Skip to content

Ensure initial admin password is set and visible during non-interactive installs#605

Merged
Bladestar2105 merged 1 commit into
mainfrom
codex/fix-issue-604-in-iptv-manager
May 26, 2026
Merged

Ensure initial admin password is set and visible during non-interactive installs#605
Bladestar2105 merged 1 commit into
mainfrom
codex/fix-issue-604-in-iptv-manager

Conversation

@Bladestar2105
Copy link
Copy Markdown
Owner

Motivation

  • The randomly generated default admin password was printed by the app at first startup and could be missed in non-interactive environments (e.g., Proxmox LXC), so installs lacked a visible admin password.
  • The installer should reliably provide credentials and persist them so users can log in after a fresh automated install.

Description

  • Updated scripts/install.sh to create .env if missing and ensure INITIAL_ADMIN_PASSWORD is populated during fresh installs.
  • When INITIAL_ADMIN_PASSWORD is empty the script generates a value with openssl rand -hex 8, saves it into .env, and exposes it via INITIAL_ADMIN_PASSWORD_GENERATED.
  • The installer now prints the initial WebUI credentials at the end of the install and documents that the password is stored in /opt/iptv-manager/.env as INITIAL_ADMIN_PASSWORD.
  • Updated README.md First Time Setup text to reflect that scripts/install.sh sets and prints the initial admin password.

Testing

  • Ran npm run lint, which completed successfully with the repository's existing warnings and no new errors.
  • Verified the modified scripts/install.sh prints the credentials block at the end of the script during a dry inspection of the changes.

Codex Task

@Bladestar2105 Bladestar2105 linked an issue May 26, 2026 that may be closed by this pull request
@Bladestar2105 Bladestar2105 merged commit 13f1343 into main May 26, 2026
2 checks passed
@Bladestar2105 Bladestar2105 deleted the codex/fix-issue-604-in-iptv-manager branch May 26, 2026 16:10
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 822940ab1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/install.sh

if ! grep -q '^INITIAL_ADMIN_PASSWORD=' .env || [ -z "$(grep '^INITIAL_ADMIN_PASSWORD=' .env | cut -d'=' -f2-)" ]; then
INITIAL_ADMIN_PASSWORD_GENERATED=$(openssl rand -hex 8)
sed -i "s|^INITIAL_ADMIN_PASSWORD=.*|INITIAL_ADMIN_PASSWORD=${INITIAL_ADMIN_PASSWORD_GENERATED}|" .env
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict .env permissions before persisting admin password

Writing INITIAL_ADMIN_PASSWORD into .env here creates a plaintext credential file that is later made world-readable by the existing chmod -R 755 "$INSTALL_DIR" step in the same script (scripts/install.sh lines 80-81). On multi-user hosts, any local unprivileged user can read /opt/iptv-manager/.env and log in as admin until the password is changed, so this introduces a concrete credential exposure during fresh installs.

Useful? React with 👍 / 👎.

Comment thread scripts/install.sh
fi

if ! grep -q '^INITIAL_ADMIN_PASSWORD=' .env || [ -z "$(grep '^INITIAL_ADMIN_PASSWORD=' .env | cut -d'=' -f2-)" ]; then
INITIAL_ADMIN_PASSWORD_GENERATED=$(openssl rand -hex 8)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Install or validate openssl before generating password

The new password generation path now hard-depends on openssl rand -hex 8, but this installer does not ensure the openssl binary is present before calling it. Because the script runs with set -e, systems where openssl is missing will abort the installation at this step, leaving users with a partial install instead of a recoverable fallback.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install.sh on proxmox LXC no password in console

1 participant