Compare commits

...

34 Commits
1.5.0 ... 1.5.1

Author SHA1 Message Date
Milo Schwartz
6b4e52a725 Merge pull request #877 from fosrl/dev
1.5.1
2025-06-09 17:40:35 -04:00
miloschwartz
e41eafd497 enhance link styling and bump traefik version 2025-06-09 17:38:18 -04:00
Owen Schwartz
d70396a664 Merge pull request #876 from thijsvanloef/fix/define-files-in-eslint
Add Typescript specific linting & define files in eslint
2025-06-09 17:15:23 -04:00
Thijs van Loef
3d59556bcd readd accidentally removed line 2025-06-09 22:38:38 +02:00
Thijs van Loef
c7018e92b0 Merge branch 'dev' into fix/define-files-in-eslint 2025-06-09 22:36:56 +02:00
Thijs van Loef
a575bace39 add typescript eslint 2025-06-09 22:32:38 +02:00
Thijs van Loef
2047aa30e1 add typescript specific linting 2025-06-09 22:25:27 +02:00
Thijs van Loef
3b10453af3 define files in eslint 2025-06-09 22:18:38 +02:00
Owen
3257edc2a0 Add link to docs for newt 2025-06-09 14:23:53 -04:00
miloschwartz
cd54e7dd38 pick first port on select container 2025-06-09 13:01:53 -04:00
Owen
9177eaba22 Merge branch 'main' into dev 2025-06-09 11:22:35 -04:00
Owen Schwartz
33ae2e08cc Merge pull request #872 from Lokowitz/fix-dependabot
Some checks failed
Mark and Close Stale Issues / stale (push) Has been cancelled
fix - dependabot
2025-06-09 11:17:45 -04:00
Owen Schwartz
4fc61386d3 Merge pull request #867 from thijsvanloef/fix-767/unit-aware-sorting
Fix - Sort Data In/Out correctly in Sites Management page in the Pangolin Dashboard
2025-06-09 11:17:15 -04:00
Owen
c409266954 Fix #860 2025-06-09 11:13:58 -04:00
Owen
57315a36ee Merge branch 'main' into dev 2025-06-09 11:07:42 -04:00
Owen Schwartz
63637b91a8 Merge pull request #874 from fosrl/dependabot/npm_and_yarn/dev-patch-updates-637b1bbe0a
Bump the dev-patch-updates group across 1 directory with 4 updates
2025-06-09 11:06:32 -04:00
Owen Schwartz
09238cd98a Merge pull request #873 from fosrl/dependabot/npm_and_yarn/prod-patch-updates-1931de1053
Bump zod from 3.25.46 to 3.25.56 in the prod-patch-updates group across 1 directory
2025-06-09 11:06:08 -04:00
Owen Schwartz
67b149ce4b Merge pull request #834 from fosrl/dependabot/npm_and_yarn/tar-fs-2.1.3
Bump tar-fs from 2.1.2 to 2.1.3
2025-06-09 11:05:24 -04:00
Thijs van Loef
96151de814 improve readability 2025-06-09 13:18:22 +02:00
Thijs van Loef
f2e461a1ee improve readability 2025-06-09 13:06:08 +02:00
dependabot[bot]
8125622c98 Bump the dev-patch-updates group across 1 directory with 4 updates
Bumps the dev-patch-updates group with 4 updates in the / directory: [@types/cookie-parser](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/cookie-parser), [@types/cors](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/cors), [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) and [react-email](https://github.com/resend/react-email/tree/HEAD/packages/react-email).


Updates `@types/cookie-parser` from 1.4.8 to 1.4.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/cookie-parser)

Updates `@types/cors` from 2.8.18 to 2.8.19
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/cors)

Updates `@types/react-dom` from 19.1.5 to 19.1.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

Updates `react-email` from 4.0.15 to 4.0.16
- [Release notes](https://github.com/resend/react-email/releases)
- [Changelog](https://github.com/resend/react-email/blob/canary/packages/react-email/CHANGELOG.md)
- [Commits](https://github.com/resend/react-email/commits/react-email@4.0.16/packages/react-email)

---
updated-dependencies:
- dependency-name: "@types/cookie-parser"
  dependency-version: 1.4.9
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-patch-updates
- dependency-name: "@types/cors"
  dependency-version: 2.8.19
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-patch-updates
- dependency-name: "@types/react-dom"
  dependency-version: 19.1.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-patch-updates
- dependency-name: react-email
  dependency-version: 4.0.16
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 02:06:40 +00:00
dependabot[bot]
1a6942ccc9 Bump zod in the prod-patch-updates group across 1 directory
Bumps the prod-patch-updates group with 1 update in the / directory: [zod](https://github.com/colinhacks/zod).


Updates `zod` from 3.25.46 to 3.25.56
- [Release notes](https://github.com/colinhacks/zod/releases)
- [Commits](https://github.com/colinhacks/zod/compare/v3.25.46...v3.25.56)

---
updated-dependencies:
- dependency-name: zod
  dependency-version: 3.25.56
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 02:05:59 +00:00
Marvin
7b0e1df778 Update dependabot.yml 2025-06-08 17:29:14 +02:00
Owen Schwartz
7d6b114d67 Merge pull request #869 from Lokowitz/fix-package
Some checks failed
Mark and Close Stale Issues / stale (push) Has been cancelled
Fix - package-lock
2025-06-08 08:47:40 -04:00
Lokowitz
a169256770 update package-lock 2025-06-08 12:30:32 +00:00
Lokowitz
2e54afd72f rebuild package-lock 2025-06-08 12:26:52 +00:00
Thijs van Loef
26207bd951 add datasize helper and add correct sorting to sitestable 2025-06-08 00:07:49 +02:00
Owen
3ed681e277 Bump temp version 2025-06-06 12:16:58 -04:00
Owen
c135b5e3cf Dont request unless its a newt 2025-06-06 12:15:15 -04:00
Owen
e648307f0b Merge branch 'main' into dev 2025-06-06 12:04:24 -04:00
Owen Schwartz
0e4f35e87a Merge pull request #855 from Lokowitz/main
Some checks failed
Mark and Close Stale Issues / stale (push) Has been cancelled
fix - removed package-lock.json from .gitignore
2025-06-06 12:00:49 -04:00
Marvin
553dffd4ee removed package-lock.json from .gitignore
update package-lock.json
2025-06-06 07:00:07 +00:00
miloschwartz
c1fd38ac39 fix typo 2025-06-05 15:48:37 -04:00
dependabot[bot]
9f979c5019 Bump tar-fs from 2.1.2 to 2.1.3
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 2.1.2 to 2.1.3.
- [Commits](https://github.com/mafintosh/tar-fs/commits)

---
updated-dependencies:
- dependency-name: tar-fs
  dependency-version: 2.1.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-03 09:32:28 +00:00
13 changed files with 16496 additions and 13837 deletions

View File

@@ -13,10 +13,6 @@ updates:
dependency-type: "development"
update-types:
- "minor"
dev-major-updates:
dependency-type: "development"
update-types:
- "major"
prod-patch-updates:
dependency-type: "production"
update-types:
@@ -25,10 +21,6 @@ updates:
dependency-type: "production"
update-types:
- "minor"
prod-major-updates:
dependency-type: "production"
update-types:
- "major"
- package-ecosystem: "docker"
directory: "/"
@@ -41,6 +33,3 @@ updates:
minor-updates:
update-types:
- "minor"
major-updates:
update-types:
- "major"

3
.gitignore vendored
View File

@@ -32,5 +32,4 @@ installer
bin
.secrets
test_event.json
.idea/
package-lock.json
.idea/

View File

@@ -1,9 +1,12 @@
// eslint.config.js
export default [
import tseslint from 'typescript-eslint';
export default tseslint.config(
tseslint.configs.recommended,
{
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
rules: {
semi: "error",
"prefer-const": "error"
}
}
];
);

View File

@@ -35,7 +35,7 @@ services:
- 80:80 # Port for traefik because of the network_mode
{{end}}
traefik:
image: traefik:v3.4.0
image: traefik:v3.4.1
container_name: traefik
restart: unless-stopped
{{if .InstallGerbil}}
@@ -58,4 +58,4 @@ services:
networks:
default:
driver: bridge
name: pangolin
name: pangolin

30199
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -104,7 +104,7 @@
"winston": "3.17.0",
"winston-daily-rotate-file": "5.0.0",
"ws": "8.18.2",
"zod": "3.25.46",
"zod": "3.25.56",
"zod-validation-error": "3.4.1"
},
"devDependencies": {
@@ -112,8 +112,8 @@
"@esbuild-plugins/tsconfig-paths": "0.1.2",
"@tailwindcss/postcss": "^4.1.8",
"@types/better-sqlite3": "7.6.12",
"@types/cookie-parser": "1.4.8",
"@types/cors": "2.8.18",
"@types/cookie-parser": "1.4.9",
"@types/cors": "2.8.19",
"@types/crypto-js": "^4.2.2",
"@types/express": "5.0.0",
"@types/jmespath": "^0.15.2",
@@ -122,7 +122,7 @@
"@types/node": "^22",
"@types/nodemailer": "6.4.17",
"@types/react": "19.1.6",
"@types/react-dom": "19.1.5",
"@types/react-dom": "19.1.6",
"@types/semver": "7.7.0",
"@types/swagger-ui-express": "^4.1.8",
"@types/ws": "8.18.1",
@@ -131,11 +131,12 @@
"esbuild": "0.25.5",
"esbuild-node-externals": "1.18.0",
"postcss": "^8",
"react-email": "4.0.15",
"react-email": "4.0.16",
"tailwindcss": "^4.1.4",
"tsc-alias": "1.8.16",
"tsx": "4.19.4",
"typescript": "^5",
"typescript-eslint": "^8.34.0",
"yargs": "18.0.0"
},
"overrides": {

View File

@@ -2,7 +2,7 @@ import path from "path";
import { fileURLToPath } from "url";
// This is a placeholder value replaced by the build process
export const APP_VERSION = "1.5.0";
export const APP_VERSION = "1.5.1";
export const __FILENAME = fileURLToPath(import.meta.url);
export const __DIRNAME = path.dirname(__FILENAME);

View File

@@ -27,6 +27,7 @@ import { formatAxiosError } from "@app/lib/api";
import { createApiClient } from "@app/lib/api";
import { useEnvContext } from "@app/hooks/useEnvContext";
import CreateSiteFormModal from "./CreateSiteModal";
import { parseDataSize } from '@app/lib/dataSize';
export type SiteRow = {
id: number;
@@ -197,7 +198,9 @@ export default function SitesTable({ sites, orgId }: SitesTableProps) {
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
);
}
},
sortingFn: (rowA, rowB) =>
parseDataSize(rowA.original.mbIn) - parseDataSize(rowB.original.mbIn)
},
{
accessorKey: "mbOut",
@@ -213,7 +216,9 @@ export default function SitesTable({ sites, orgId }: SitesTableProps) {
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
);
}
},
sortingFn: (rowA, rowB) =>
parseDataSize(rowA.original.mbOut) - parseDataSize(rowB.original.mbOut),
},
{
accessorKey: "type",

View File

@@ -32,6 +32,8 @@ import { createApiClient } from "@app/lib/api";
import { useEnvContext } from "@app/hooks/useEnvContext";
import { useState } from "react";
import { SwitchInput } from "@app/components/SwitchInput";
import Link from "next/link";
import { ArrowRight, ExternalLink } from "lucide-react";
const GeneralFormSchema = z.object({
name: z.string().nonempty("Name is required"),
@@ -151,8 +153,18 @@ export default function GeneralPage() {
<FormDescription>
Enable Docker Socket
discovery for populating
container information,
useful in resource targets.
container information.
Socket path must be provided
to Newt.{" "}
<a
href="https://docs.fossorial.io/Newt/overview#docker-socket-integration"
target="_blank"
rel="noopener noreferrer"
className="text-primary hover:underline inline-flex items-center"
>
Learn more
<ExternalLink className="ml-1 h-4 w-4" />
</a>
</FormDescription>
</FormItem>
)}

View File

@@ -82,7 +82,14 @@ export default function StepperForm() {
);
const generateId = (name: string) => {
return name.toLowerCase().replace(/\s+/g, "-");
// Replace any character that is not a letter, number, space, or hyphen with a hyphen
// Also collapse multiple hyphens and trim
return name
.toLowerCase()
.replace(/[^a-z0-9\s-]/g, "-")
.replace(/\s+/g, "-")
.replace(/-+/g, "-")
.replace(/^-+|-+$/g, "");
};
async function orgSubmit(values: z.infer<typeof orgSchema>) {
@@ -207,23 +214,22 @@ export default function StepperForm() {
type="text"
{...field}
onChange={(e) => {
const orgId =
generateId(
e.target
.value
);
// Prevent "/" in orgName input
const sanitizedValue = e.target.value.replace(/\//g, "-");
const orgId = generateId(sanitizedValue);
orgForm.setValue(
"orgId",
orgId
);
orgForm.setValue(
"orgName",
e.target.value
sanitizedValue
);
debouncedCheckOrgIdAvailability(
orgId
);
}}
value={field.value.replace(/\//g, "-")}
/>
</FormControl>
<FormMessage />

View File

@@ -95,7 +95,7 @@ export const ContainersSelector: FC<ContainerSelectorProps> = ({
<CredenzaTitle>Containers in {site.name}</CredenzaTitle>
<CredenzaDescription>
Select any container to use as a hostname for this
target. Click a port to use select a port.
target. Click a port to use a port.
</CredenzaDescription>
</CredenzaHeader>
<CredenzaBody>
@@ -346,16 +346,19 @@ const DockerContainersTable: FC<{
{
id: "actions",
header: "Actions",
cell: ({ row }) => (
<Button
variant="default"
size="sm"
onClick={() => onContainerSelect(row.original)}
disabled={row.original.state !== "running"}
>
Select
</Button>
)
cell: ({ row }) => {
const ports = getExposedPorts(row.original);
return (
<Button
variant="default"
size="sm"
onClick={() => onContainerSelect(row.original, ports[0])}
disabled={row.original.state !== "running"}
>
Select
</Button>
);
}
}
];

View File

@@ -21,7 +21,8 @@ export function useDockerSocket(site: Site) {
const api = createApiClient(useEnvContext());
const { dockerSocketEnabled: isEnabled = true } = site || {};
const { dockerSocketEnabled: rawIsEnabled = true, type: siteType } = site || {};
const isEnabled = rawIsEnabled && siteType === "newt";
const { isAvailable = false, socketPath } = dockerSocket || {};
const checkDockerSocket = useCallback(async () => {

21
src/lib/dataSize.ts Normal file
View File

@@ -0,0 +1,21 @@
export function parseDataSize(sizeStr: string): number {
if (typeof sizeStr !== 'string') return 0;
const match = /^\s*([\d.]+)\s*([KMGT]?B)\s*$/i.exec(sizeStr);
if (!match) return 0;
const [ , numStr, unitRaw ] = match;
const num = parseFloat(numStr);
if (isNaN(num)) return 0;
const unit = unitRaw.toUpperCase();
const multipliers = {
B: 1,
KB: 1024,
MB: 1024 ** 2,
GB: 1024 ** 3,
TB: 1024 ** 4,
} as const;
return num * (multipliers[unit as keyof typeof multipliers] ?? 1);
}