Browse Source

We don't need sudoers stuff anymore

Alexandre Aubin 3 years ago
parent
commit
76929bacdb
6 changed files with 5 additions and 22 deletions
  1. 0 13
      conf/sudoers.conf
  2. 0 4
      scripts/_common.sh
  3. 0 2
      scripts/backup
  4. 0 1
      scripts/remove
  5. 0 2
      scripts/restore
  6. 5 0
      scripts/upgrade

+ 0 - 13
conf/sudoers.conf

@@ -1,13 +0,0 @@
-Cmnd_Alias VPNCLIENTTASKS = /bin/systemctl stop ynh-vpnclient, \
-                            /bin/systemctl start ynh-vpnclient, \
-                            /usr/local/bin/ynh-vpnclient *
-
-Cmnd_Alias YUNOHOST = /usr/bin/yunohost app setting vpnclient *,\
-                      /usr/bin/yunohost app info hotspot *
-
-Cmnd_Alias HOTSPOT = /bin/systemctl stop ynh-hotspot,\
-                     /bin/systemctl start ynh-hotspot,\
-                     /usr/bin/yunohost app setting hotspot *
-
-__VPNCLIENT_SYSUSER__ ALL = NOPASSWD: /bin/grep, VPNCLIENTTASKS, YUNOHOST, HOTSPOT
-

+ 0 - 4
scripts/_common.sh

@@ -18,10 +18,6 @@ function vpnclient_deploy_files_and_services()
     ynh_system_user_create ${app}
   fi
 
-  # 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 "__VPNCLIENT_SYSUSER__" "${app}" /etc/sudoers.d/${app}_ynh
-
   # Install command-line cube file loader
   install -o root -g root -m 0755 ../conf/$service_name-loadcubefile.sh /usr/local/bin/
 

+ 0 - 2
scripts/backup

@@ -34,8 +34,6 @@ ynh_print_info "Backing up the main app directory..."
 
 ynh_backup "$final_path"
 
-ynh_backup "/etc/sudoers.d/${app}_ynh"
-
 ynh_backup "/usr/local/bin/$service_name-loadcubefile.sh"
 
 ynh_backup "/etc/yunohost/hooks.d/90-vpnclient.tpl"

+ 0 - 1
scripts/remove

@@ -105,7 +105,6 @@ ynh_print_info "Removing the dedicated system user"
 
 # Delete a system user
 ynh_system_user_delete ${app}
-ynh_secure_remove "/etc/sudoers.d/${app}_ynh"
 
 #=================================================
 # END OF SCRIPT

+ 0 - 2
scripts/restore

@@ -44,8 +44,6 @@ ynh_print_info "Restoring the app main directory..."
 
 ynh_restore_file "$final_path"
 
-ynh_restore_file "/etc/sudoers.d/${app}_ynh"
-
 ynh_restore_file "/usr/local/bin/$service_name-loadcubefile.sh"
 
 ynh_restore_file "/etc/yunohost/hooks.d/90-vpnclient.tpl"

+ 5 - 0
scripts/upgrade

@@ -39,6 +39,11 @@ if [ -d /var/www/vpnadmin ]; then
   ynh_secure_remove /var/www/vpnadmin
 fi
 
+# Removing sudoer file from before 2.x / Yunohost 4.3
+if [ -e "/etc/sudoers.d/${app}_ynh" ]; then
+  ynh_secure_remove "/etc/sudoers.d/${app}_ynh"
+fi
+
 #=================================================
 # SPECIAL UPGRADE FOR VERSIONS < 2.0
 #=================================================