1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wireguard_ynh.git synced 2024-09-03 20:35:58 +02:00

Drop sudoers

This commit is contained in:
tituspijean 2021-12-21 17:48:41 +01:00
parent 88f5edb095
commit 29f4015f46
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
4 changed files with 4 additions and 12 deletions

View file

@ -1,2 +0,0 @@
Cmnd_Alias WIREGUARDSERVICE = /usr/bin/systemctl restart wg-quick@wg0.service
%__USER__ ALL = NOPASSWD: WIREGUARDSERVICE

View file

@ -4,6 +4,5 @@ After=network.target
[Service] [Service]
Type=oneshot Type=oneshot
User=__APP__ User=root
Group=__APP__ ExecStart=/usr/bin/systemctl restart wg-quick@wg0.service
ExecStart=sudo /usr/bin/systemctl restart wg-quick@wg0.service

View file

@ -117,10 +117,6 @@ ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user # Create a system user
ynh_system_user_create --username=$app ynh_system_user_create --username=$app
# Ensure the system user has enough permissions
install -b -o root -g root -m 0440 ../conf/sudoers.conf /etc/sudoers.d/${app}_ynh
ynh_replace_string "__USER__" "${app}" /etc/sudoers.d/${app}_ynh
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================

View file

@ -92,10 +92,9 @@ Now wireguard_ynh use a DKMS module allowing itself to be used with the stable k
fi fi
fi fi
# Add sudoers file if missing # Drop sudoers file if present
if [ -f "/etc/sudoers.d/${app}_ynh" ]; then if [ -f "/etc/sudoers.d/${app}_ynh" ]; then
install -b -o root -g root -m 0440 ../conf/sudoers.conf /etc/sudoers.d/${app}_ynh ynh_secure_remove /etc/sudoers.d/${app}_ynh
ynh_replace_string "__USER__" "${app}" /etc/sudoers.d/${app}_ynh
fi fi
# Remove deprecated services # Remove deprecated services