admin creation
Some checks failed
Update GitHub Versions (New) / update-github-versions (push) Has been cancelled
Crawl Versions from newreleases.io / crawl-versions (push) Has been cancelled
Crawl Versions from github / crawl-versions (push) Has been cancelled

This commit is contained in:
CanbiZ (MickLesk) 2026-02-17 11:54:14 +01:00
parent b59702f31e
commit f40baa4699
2 changed files with 4 additions and 13 deletions

View File

@ -72,6 +72,5 @@ msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}" echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"
echo -e "${INFO}${YW} Default Credentials:${CL}" echo -e "${INFO}${YW} Admin Setup:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}Username: admin${CL}" echo -e "${TAB}${GATEWAY}${BGN}Create the first account in the web UI (use admin@local to match developer emails)${CL}"
echo -e "${TAB}${GATEWAY}${BGN}Password: Check /opt/discourse/.env${CL}"

View File

@ -105,16 +105,8 @@ set +a
$STD bundle exec rails assets:precompile $STD bundle exec rails assets:precompile
msg_ok "Built Discourse Assets" msg_ok "Built Discourse Assets"
msg_info "Creating Discourse Admin User" msg_info "Preparing Admin Onboarding"
cd /opt/discourse msg_ok "Automatic admin bootstrap skipped (use first signup in UI with admin@local)"
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
eval "$(rbenv init - bash)" 2>/dev/null || true
export RAILS_ENV=production
set -a
source /opt/discourse/.env
set +a
$STD bundle exec rails runner "User.create!(email: 'admin@local', username: 'admin', password: '${DISCOURSE_DB_PASS}', admin: true)" || true
msg_ok "Created Discourse Admin User"
msg_info "Creating Service" msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/discourse.service cat <<EOF >/etc/systemd/system/discourse.service