-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix: ReferenceError in setupDefaultUser when using INITIAL_ADMIN_EMAIL/PASSWORD env vars #4836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…the yarn.lock has not changed - added cache for the docker build part so subsequent builds can go faster
Adds a GitHub Actions workflow to build and push a multi-architecture Docker image to Docker Hub. Key features: - Triggers on push to the 'develop' branch or manual dispatch. - Builds a multi-arch image for linux/amd64, linux/arm64, and linux/arm/v7. - Caches Docker layers and frontend build artifacts to accelerate builds. - Uses DOCKERHUB_USERNAME secret for the image repository. - The workflow is skipped if required Docker Hub secrets are not defined.
Adds a GitHub Actions workflow to build and push a multi-architecture Docker image to Docker Hub. Key features: - Triggers on push to the 'develop' branch or manual dispatch. - Builds a multi-arch image for linux/amd64, linux/arm64, and linux/arm/v7. - Caches Docker layers and frontend build artifacts to accelerate builds. - Uses DOCKERHUB_USERNAME secret for the image repository. - The workflow is skipped if required Docker Hub secrets are not defined.
Adds a GitHub Actions workflow to build and push a multi-architecture Docker image to Docker Hub. Key features: - Triggers on push to the 'develop' branch or manual dispatch. - Builds a multi-arch image for linux/amd64, linux/arm64, and linux/arm/v7. - Caches Docker layers and frontend build artifacts to accelerate builds. - Uses DOCKERHUB_USERNAME secret for the image repository. - The workflow is skipped if required Docker Hub secrets are not defined.
|
Docker Image for build 7 is available on DockerHub: Note Ensure you backup your NPM instance before testing this image! Especially if there are database changes. Warning Changes and additions to DNS Providers require verification by at least 2 members of the community! |
|
Thanks for the fix and I would have merged it, but I don't want the github action. I already have a comprehensive CI stack that runs frontend/backend unit tests and API test for all 3 supported databases. It also publishes documenation changes. For the
|
|
I've cherry picked your fix. Thanks! |

Description
Fixes a critical bug in
backend/setup.jswhere settingINITIAL_ADMIN_EMAILandINITIAL_ADMIN_PASSWORDenvironment variables causes the application to crash with a ReferenceError during initial setup.The Problem
When using environment variables to configure the initial admin account:
initialAdminEmailandinitialAdminPasswordare correctly read from environment variablesemailandpasswordwhen creating the userReferenceError: email is not definedand the app enters an infinite restart loopThe Solution
Fixed variable references in
setupDefaultUser()function:email: email→email: initialAdminEmailsecret: password→secret: initialAdminPasswordTesting
Built and tested locally with the fix:
Build Process
./scripts/ci/frontend-build docker build -f docker/Dockerfile -t nginx-proxy-manager:local .Test Configuration
Test Results
Before Fix (infinite restart loop)
After Fix (successful startup)
✅ Application starts successfully
✅ Initial admin user created with specified credentials
✅ Successfully logged in to admin panel at :81 with configured credentials
✅ No restart loops or errors
Impact
This bug prevents automated deployments that rely on environment variables for initial setup, forcing users to:
Related Issues
Type of Change
Checklist
Additional Changes: Docker Publish Workflow
This PR also includes a new GitHub Actions workflow located at
.github/workflows/docker-publish.yml.Purpose
This workflow automates the process of building and pushing multi-architecture Docker images to Docker Hub for the
developbranch.Key Features
linux/amd64,linux/arm64, andlinux/arm/v7.developbranch and can also be manually dispatched from the GitHub Actions UI.frontend/distdirectory based on changes infrontend/yarn.lock,frontend/package.json,frontend/vite.config.ts,frontend/tsconfig.json, and all files infrontend/src/**, ensuring rebuilds only occur when necessary.DOCKERHUB_USERNAMEsecret to dynamically determine the Docker Hub repository name.DOCKERHUB_USERNAMEorDOCKERHUB_TOKENsecrets are not defined in the repository, preventing failed runs.