added the password generation for admin

This commit is contained in:
GoldenSpring 2026-01-30 11:27:18 +03:00
parent 6b0b8d07e3
commit ff2cd48038
No known key found for this signature in database
GPG Key ID: 75701174BCB6A808
2 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,7 @@
}, },
"notes": [ "notes": [
{ {
"text": "Change the default admin credentials", "text": "Default generated admin password is in the env file (sonobarr_superadmin_password)",
"type": "info" "type": "info"
} }
] ]

View File

@ -22,6 +22,7 @@ $STD uv pip install --no-cache-dir -r /opt/sonobarr/requirements.txt
mkdir -p /etc/sonobarr mkdir -p /etc/sonobarr
mv /opt/sonobarr/.sample-env /etc/sonobarr/.env mv /opt/sonobarr/.sample-env /etc/sonobarr/.env
sed -i "s/^secret_key=.*/secret_key=$(openssl rand -hex 16)/" /etc/sonobarr/.env sed -i "s/^secret_key=.*/secret_key=$(openssl rand -hex 16)/" /etc/sonobarr/.env
sed -i "s/^sonobarr_superadmin_password=.*/secret_key=$(openssl rand -hex 16)/" /etc/sonobarr/.env
echo "release_version=$(cat ~/.sonobarr)" >>/etc/sonobarr/.env echo "release_version=$(cat ~/.sonobarr)" >>/etc/sonobarr/.env
echo "sonobarr_config_dir=/etc/sonobarr" >>/etc/sonobarr.env echo "sonobarr_config_dir=/etc/sonobarr" >>/etc/sonobarr.env
msg_ok "Set up sonobarr" msg_ok "Set up sonobarr"