Fix: ReferenceError in setupDefaultUser when using INITIAL_ADMIN_EMAIL/PASSWORD env vars#4836
Closed
zuptalo wants to merge 8 commits intoNginxProxyManager:developfrom
Closed
Fix: ReferenceError in setupDefaultUser when using INITIAL_ADMIN_EMAIL/PASSWORD env vars#4836zuptalo wants to merge 8 commits intoNginxProxyManager:developfrom
zuptalo wants to merge 8 commits intoNginxProxyManager:developfrom
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! |
Member
|
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
|
jc21
added a commit
that referenced
this pull request
Nov 11, 2025
Member
|
I've cherry picked your fix. Thanks! |
Zoey2936
pushed a commit
to ZoeyVid/NPMplus
that referenced
this pull request
Nov 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.