1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ampache_ynh.git synced 2024-09-03 18:15:55 +02:00

Truely random secret string

This commit is contained in:
Steven Roose 2015-08-07 21:39:48 +02:00
parent aee7289358
commit 66a872ce9c
2 changed files with 3 additions and 2 deletions

View file

@ -62,7 +62,7 @@ database_password = "yunopass"
; Cryptographic secret
; This MUST BE changed with your own secret key. Ampache-specific, just pick any random string you want.
secret_key = "abcdefghijklmnoprqstuvwyz0123456"
secret_key = "RANDOMKEYTOCHANGE"
; Length that a session will last expressed in seconds. Default is
; one hour.
@ -984,4 +984,3 @@ force_ssl = "true"
; so that the ordering is sane.
; DEFAULT: auto
;mb_detect_order = "ASCII,UTF-8,EUC-JP,ISO-2022-JP,SJIS,JIS"

View file

@ -46,6 +46,8 @@ sudo sed -i "s/yunobase/$db_user/g" $final_path/config/ampache.cfg.php
sudo sed -i "s/yunoadmin/$admin_ampache/g" /tmp/admin.sql
sed -i "s@PATHTOCHANGE@$path@g" $final_path/config/ampache.cfg.php
sed -i "s@DOMAINTOCHANGE@$domain@g" $final_path/config/ampache.cfg.php
random_key=db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p')
sed -i "s@RANDOMKEYTOCHANGE@$random_key@g" $final_path/config/ampache.cfg.php
# Set permissions to roundcube directory
sudo chown -R www-data: $final_path