diff --git a/server/bin/admin-cli.sh b/server/bin/admin-cli.sh deleted file mode 100755 index 90db9957ed..0000000000 --- a/server/bin/admin-cli.sh +++ /dev/null @@ -1 +0,0 @@ -node ./dist/main cli "$@" diff --git a/server/package-lock.json b/server/package-lock.json index 91e79b132b..74f8bd2a2f 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -54,7 +54,7 @@ }, "bin": { "immich": "bin/cli.sh", - "immich-admin": "bin/admin-cli.sh" + "immich-admin": "start.sh admin-cli" }, "devDependencies": { "@nestjs/cli": "^9.1.8", diff --git a/server/package.json b/server/package.json index 735280f9cc..2343f9befd 100644 --- a/server/package.json +++ b/server/package.json @@ -7,7 +7,7 @@ "license": "UNLICENSED", "bin": { "immich": "./bin/cli.sh", - "immich-admin": "./bin/admin-cli.sh" + "immich-admin": "./start.sh admin-cli" }, "scripts": { "build": "nest build", diff --git a/server/src/cli/app.module.ts b/server/src/admin-cli/app.module.ts similarity index 100% rename from server/src/cli/app.module.ts rename to server/src/admin-cli/app.module.ts diff --git a/server/src/cli/commands/list-users.command.ts b/server/src/admin-cli/commands/list-users.command.ts similarity index 100% rename from server/src/cli/commands/list-users.command.ts rename to server/src/admin-cli/commands/list-users.command.ts diff --git a/server/src/cli/commands/password-login.ts b/server/src/admin-cli/commands/password-login.ts similarity index 100% rename from server/src/cli/commands/password-login.ts rename to server/src/admin-cli/commands/password-login.ts diff --git a/server/src/cli/commands/reset-admin-password.command.ts b/server/src/admin-cli/commands/reset-admin-password.command.ts similarity index 100% rename from server/src/cli/commands/reset-admin-password.command.ts rename to server/src/admin-cli/commands/reset-admin-password.command.ts diff --git a/server/src/cli/constants.ts b/server/src/admin-cli/constants.ts similarity index 100% rename from server/src/cli/constants.ts rename to server/src/admin-cli/constants.ts diff --git a/server/src/cli/immich.ts b/server/src/admin-cli/main.ts similarity index 100% rename from server/src/cli/immich.ts rename to server/src/admin-cli/main.ts diff --git a/server/src/main.ts b/server/src/main.ts index 3ab308fd51..1f2221a8de 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -1,4 +1,4 @@ -import { bootstrap as cli } from './cli/immich'; +import { bootstrap as adminCli } from './admin-cli/main'; import { bootstrap as immich } from './immich/main'; import { bootstrap as microservices } from './microservices/main'; @@ -14,8 +14,8 @@ function bootstrap() { return immich(); case 'microservices': return microservices(); - case 'cli': - return cli(); + case 'admin-cli': + return adminCli(); default: console.log(`Invalid app name: ${immichApp}. Expected one of immich|microservices|cli`); process.exit(1); diff --git a/server/start.sh b/server/start.sh index 4d1bc9a78b..617837da70 100755 --- a/server/start.sh +++ b/server/start.sh @@ -1,5 +1,10 @@ #!/bin/sh +if [ "$DB_URL_FILE" ]; then + export DB_URL=$(cat $DB_URL_FILE) + unset DB_URL_FILE +fi + if [ "$DB_HOSTNAME_FILE" ]; then export DB_HOSTNAME=$(cat $DB_HOSTNAME_FILE) unset DB_HOSTNAME_FILE