mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
Use $app instead of $YNH_APP_ID
This commit is contained in:
parent
b8e3f085bd
commit
236bfd27e8
5 changed files with 16 additions and 16 deletions
|
@ -18,7 +18,7 @@ install_sources() {
|
|||
fi
|
||||
|
||||
mkdir -p $code_dir
|
||||
chown $YNH_APP_ID:root -R $code_dir
|
||||
chown $app:root -R $code_dir
|
||||
|
||||
if [ -n "$(uname -m | grep arm)" ]
|
||||
then
|
||||
|
@ -146,24 +146,24 @@ configure_nginx() {
|
|||
}
|
||||
|
||||
set_permissions() {
|
||||
chown $YNH_APP_ID:$YNH_APP_ID -R $code_dir
|
||||
chown $app:$app -R $code_dir
|
||||
chmod o= -R $code_dir
|
||||
|
||||
chmod 770 $code_dir/Coturn_config_rotate.sh
|
||||
chmod 700 $code_dir/update_synapse_for_appservice.sh
|
||||
|
||||
find $data_dir \( \! -perm -o= \
|
||||
-o \! -user $YNH_APP_ID \
|
||||
-o \! -group $YNH_APP_ID \) \
|
||||
-exec chown $YNH_APP_ID:$YNH_APP_ID {} \; \
|
||||
-o \! -user $app \
|
||||
-o \! -group $app \) \
|
||||
-exec chown $app:$app {} \; \
|
||||
-exec chmod o= {} \;
|
||||
|
||||
chown $YNH_APP_ID:$YNH_APP_ID -R /etc/matrix-$app
|
||||
chown $app:$app -R /etc/matrix-$app
|
||||
chmod u=rwX,g=rX,o= -R /etc/matrix-$app
|
||||
setfacl -R -m user:turnserver:rX /etc/matrix-$app
|
||||
|
||||
chmod 600 /etc/matrix-$app/$server_name.signing.key
|
||||
|
||||
chown $YNH_APP_ID:root -R /var/log/matrix-$app
|
||||
chown $app:root -R /var/log/matrix-$app
|
||||
setfacl -R -m user:turnserver:rwX /var/log/matrix-$app
|
||||
}
|
||||
|
|
|
@ -124,9 +124,9 @@ ynh_script_progression --message="Creating $app user..." --weight=1
|
|||
|
||||
synapse_user_app_pwd="$(ynh_string_random --length=30)"
|
||||
ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_app_pwd
|
||||
# yunohost user create $YNH_APP_ID -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
|
||||
# yunohost user create $app -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
|
||||
|
||||
adduser $YNH_APP_ID ssl-cert
|
||||
adduser $app ssl-cert
|
||||
adduser turnserver ssl-cert
|
||||
|
||||
#=================================================
|
||||
|
@ -162,7 +162,7 @@ install_sources
|
|||
|
||||
cp ../sources/cas_server.php $install_dir/
|
||||
chmod u=rwX,g=rX,o= -R $install_dir
|
||||
chown $YNH_APP_ID:$YNH_APP_ID -R $install_dir
|
||||
chown $app:$app -R $install_dir
|
||||
|
||||
#=================================================
|
||||
# CREATE SYNAPSE CONFIG
|
||||
|
|
|
@ -82,7 +82,7 @@ ynh_remove_fail2ban_config
|
|||
ynh_script_progression --message="Removing the dedicated system user" --weight=1
|
||||
|
||||
# Delete a system user
|
||||
yunohost user delete $YNH_APP_ID
|
||||
yunohost user delete $app
|
||||
|
||||
ynh_script_progression --message="Removal of $app completed" --last
|
||||
sleep 1
|
||||
|
|
|
@ -22,8 +22,8 @@ ynh_script_progression --message="Loading settings..."
|
|||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=3
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
yunohost user create $YNH_APP_ID -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
|
||||
adduser $YNH_APP_ID ssl-cert
|
||||
yunohost user create $app -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
|
||||
adduser $app ssl-cert
|
||||
adduser turnserver ssl-cert
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -217,7 +217,7 @@ if [ -z $synapse_user_app_pwd ]; then
|
|||
synapse_user_app_pwd="$(ynh_string_random --length=30)"
|
||||
ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_app_pwd
|
||||
# The format to create an user account varies depending on the version of YunoHost currently installed.
|
||||
yunohost user create $YNH_APP_ID -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
|
||||
yunohost user create $app -F "Synapse Application" -d $domain -p "$synapse_user_app_pwd"
|
||||
fi
|
||||
|
||||
# We stop the service
|
||||
|
@ -250,7 +250,7 @@ if [ ! $(grep "ssl-cert:x:[0-9]*:.*matrix-$app" /etc/group) ]
|
|||
then
|
||||
ynh_script_progression --message="Use standard access for certificate..." --weight=1
|
||||
|
||||
adduser $YNH_APP_ID ssl-cert
|
||||
adduser $app ssl-cert
|
||||
adduser turnserver ssl-cert
|
||||
fi
|
||||
|
||||
|
@ -361,7 +361,7 @@ configure_synapse
|
|||
mkdir -p $install_dir
|
||||
cp ../sources/cas_server.php $install_dir/
|
||||
chmod u=rwX,g=rX,o= -R $install_dir
|
||||
chown $YNH_APP_ID:root -R $install_dir
|
||||
chown $app:root -R $install_dir
|
||||
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue