1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cockpit_ynh.git synced 2024-09-03 18:16:26 +02:00

Fixup permissions on cockpit.conf

This commit is contained in:
orhtej2 2023-08-15 22:42:56 +02:00
parent 67a74a90dc
commit bcb7e4ab67
4 changed files with 23 additions and 3 deletions

View file

@ -30,12 +30,17 @@ ynh_change_url_nginx_config
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Fixing up permissions..." --weight=1
usermod -a -G cockpit cockpit-ws
usermod -a -G cockpit cockpit-wsinstance
ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_script_progression --message="Updating a configuration file..." --weight=1
ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf" ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf"
chmod 650 "/etc/cockpit/cockpit.conf" chmod 650 "/etc/cockpit/cockpit.conf"
chown root:$app-ws "/etc/cockpit/cockpit.conf" chown root:$app "/etc/cockpit/cockpit.conf"
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION

View file

@ -22,6 +22,11 @@ ynh_add_nginx_config
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Fixing up permissions..." --weight=1
usermod -a -G cockpit cockpit-ws
usermod -a -G cockpit cockpit-wsinstance
ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket" ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket"
@ -31,7 +36,7 @@ systemctl restart $app.socket
ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf" ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf"
chmod 650 "/etc/cockpit/cockpit.conf" chmod 650 "/etc/cockpit/cockpit.conf"
chown root:$app-ws "/etc/cockpit/cockpit.conf" chown root:$app "/etc/cockpit/cockpit.conf"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -13,6 +13,11 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# RESTORE VARIOUS FILES # RESTORE VARIOUS FILES
#================================================= #=================================================
ynh_script_progression --message="Fixing up permissions..." --weight=1
usermod -a -G cockpit cockpit-ws
usermod -a -G cockpit cockpit-wsinstance
ynh_script_progression --message="Restoring various files..." --weight=1 ynh_script_progression --message="Restoring various files..." --weight=1
ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket" ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket"

View file

@ -37,6 +37,11 @@ yunohost service add $app --description="Sysadmin login session in a web browser
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Fixing up permissions..." --weight=1
usermod -a -G cockpit cockpit-ws
usermod -a -G cockpit cockpit-wsinstance
ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_script_progression --message="Updating a configuration file..." --weight=1
ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket" ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket"
@ -46,7 +51,7 @@ systemctl restart $app.socket
ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf" ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf"
chmod 650 "/etc/cockpit/cockpit.conf" chmod 650 "/etc/cockpit/cockpit.conf"
chown root:$app-ws "/etc/cockpit/cockpit.conf" chown root:$app "/etc/cockpit/cockpit.conf"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE