mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
portal-api: fix cookie secret initialization
This commit is contained in:
parent
a0dbf6a5b0
commit
b61a16421b
1 changed files with 8 additions and 0 deletions
|
@ -57,6 +57,12 @@ do_init_regen() {
|
||||||
chmod 700 /var/cache/yunohost
|
chmod 700 /var/cache/yunohost
|
||||||
|
|
||||||
getent passwd ynh-portal &>/dev/null || useradd --no-create-home --shell /usr/sbin/nologin --system --user-group ynh-portal
|
getent passwd ynh-portal &>/dev/null || useradd --no-create-home --shell /usr/sbin/nologin --system --user-group ynh-portal
|
||||||
|
if [ ! -e /etc/yunohost/.ssowat_cookie_secret ]; then
|
||||||
|
# NB: we need this to be exactly 32 char long, because it is later used as a key for AES256
|
||||||
|
dd if=/dev/urandom bs=1 count=1000 2>/dev/null | tr --complement --delete 'A-Za-z0-9' | head -c 32 > /etc/yunohost/.ssowat_cookie_secret
|
||||||
|
fi
|
||||||
|
chown ynh-portal:root /etc/yunohost/.ssowat_cookie_secret
|
||||||
|
chmod 400 /etc/yunohost/.ssowat_cookie_secret
|
||||||
|
|
||||||
cp yunohost-api.service /etc/systemd/system/yunohost-api.service
|
cp yunohost-api.service /etc/systemd/system/yunohost-api.service
|
||||||
cp yunohost-portal-api.service /etc/systemd/system/yunohost-portal-api.service
|
cp yunohost-portal-api.service /etc/systemd/system/yunohost-portal-api.service
|
||||||
|
@ -68,6 +74,8 @@ do_init_regen() {
|
||||||
systemctl enable yunohost-api.service --quiet
|
systemctl enable yunohost-api.service --quiet
|
||||||
systemctl start yunohost-api.service
|
systemctl start yunohost-api.service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
systemctl enable yunohost-portal-api.service
|
systemctl enable yunohost-portal-api.service
|
||||||
systemctl start yunohost-portal-api.service
|
systemctl start yunohost-portal-api.service
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue