| 65 | } |
| 66 | |
| 67 | function parsePort(value: string | undefined): number { |
| 68 | if (value === undefined || value === "") { |
| 69 | return DEFAULT_PORT; |
| 70 | } |
| 71 | |
| 72 | const port = Number(value); |
| 73 | if (!Number.isInteger(port) || port < 0 || port > 65_535) { |
| 74 | throw new Error(`PORT must be an integer between 0 and 65535, got ${JSON.stringify(value)}`); |
| 75 | } |
| 76 | |
| 77 | return port; |
| 78 | } |
| 79 | |
| 80 | function parseMountPoint(value: string | undefined): string { |
| 81 | const mountPoint = value === undefined || value === "" ? DEFAULT_MOUNT_POINT : value; |