diff --git a/ct/immichframe.sh b/ct/immichframe.sh index 782152ee1..3fa5eeb66 100644 --- a/ct/immichframe.sh +++ b/ct/immichframe.sh @@ -79,6 +79,17 @@ function update_script() { restore_backup chown -R immichframe:immichframe /opt/immichframe + if ! grep -q '^Environment=IMMICHFRAME_ADMIN_PASSWORD=' /etc/systemd/system/immichframe.service; then + msg_info "Setting Admin Password" + ADMIN_PASSWORD=$(openssl rand -hex 16) + sed -i "/^Environment=DOTNET_CONTENTROOT=/a Environment=IMMICHFRAME_ADMIN_PASSWORD=${ADMIN_PASSWORD}" /etc/systemd/system/immichframe.service + cat <>~/immichframe.creds +ImmichFrame Admin User: admin +ImmichFrame Admin Password: $ADMIN_PASSWORD +EOF + systemctl daemon-reload + msg_ok "Set Admin Password (see ~/immichframe.creds)" + fi msg_info "Starting Service" systemctl start immichframe diff --git a/install/immichframe-install.sh b/install/immichframe-install.sh index 4a1b384f2..cba170169 100644 --- a/install/immichframe-install.sh +++ b/install/immichframe-install.sh @@ -60,6 +60,11 @@ chown -R immichframe:immichframe /opt/immichframe msg_ok "Setup ImmichFrame" msg_info "Creating Service" +ADMIN_PASSWORD=$(openssl rand -hex 16) +cat <~/immichframe.creds +ImmichFrame Admin User: admin +ImmichFrame Admin Password: $ADMIN_PASSWORD +EOF cat </etc/systemd/system/immichframe.service [Unit] Description=ImmichFrame Digital Photo Frame @@ -74,6 +79,7 @@ ExecStart=/usr/bin/dotnet /opt/immichframe/ImmichFrame.WebApi.dll Environment=ASPNETCORE_URLS=http://0.0.0.0:8080 Environment=ASPNETCORE_ENVIRONMENT=Production Environment=DOTNET_CONTENTROOT=/opt/immichframe +Environment=IMMICHFRAME_ADMIN_PASSWORD=$ADMIN_PASSWORD Restart=always RestartSec=5 StandardOutput=journal