diff --git a/README.md b/README.md index 50a91f3..7c12ac0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview [Webmin](http://www.webmin.com/index.html) is a **web-based** interface for system **administration** for Unix. Using any modern web browser, you can setup user **accounts**, **DNS**, **file sharing** and much more. Webmin removes the need to manually **edit Unix configuration** files like **/etc/passwd**, and lets you manage a system from the **console or remotely**. -**Shipped version:** 1.973 +**Shipped version:** 1.979 ## Screenshots diff --git a/check_process b/check_process index e7b5faa..8002a78 100644 --- a/check_process +++ b/check_process @@ -1,8 +1,3 @@ -# See here for more information -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest domain="domain.tld" (DOMAIN) diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..7510d4d --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,5 @@ +* Other infos that people should be aware of, such as: + * This app has **root** access which can change core things in the system, thus **breaking the YunoHost**. Use it carefully and read the [documents](https://doxfer.webmin.com/Webmin/Main_Page) two times before changing values. + * Only **root** (system user) can connect + * Webmin will **update itself** when system updates are run. So no need to **run upgrade script** once installed. + * Only **user** given permission at time of the installation can **access** the Webmin diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/screenshot1.gif b/doc/screenshots/screenshot1.gif new file mode 100644 index 0000000..009ac0e Binary files /dev/null and b/doc/screenshots/screenshot1.gif differ diff --git a/manifest.json b/manifest.json index 3f9b410..c0d0d89 100644 --- a/manifest.json +++ b/manifest.json @@ -6,8 +6,13 @@ "en": "Web-based interface for system administration for Unix.", "fr": "Interface Web d'administration système pour Unix." }, - "version": "1.973~ynh1", + "version": "1.979~ynh1", "url": "http://www.webmin.com", + "upstream": { + "license": "BSD-3-Clause", + "website": "http://www.webmin.com", + "code": "https://github.com/webmin/webmin" + }, "license": "BSD-3-Clause", "maintainer": { "name": "Anmol Sharma", @@ -25,7 +30,7 @@ { "name": "domain", "type": "domain", - "example": "domain.org" + "example": "example.com" }, { "name": "admin", diff --git a/scripts/backup b/scripts/backup index 14274c6..fefcba1 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -26,6 +26,7 @@ ynh_abort_if_errors ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME + domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= @@ -42,6 +43,8 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # SPECIFIC BACKUP #================================================= +# BACKUP VARIOUS FILES +#================================================= ynh_backup --src_path="/etc/webmin/miniserv.conf" @@ -49,4 +52,4 @@ ynh_backup --src_path="/etc/webmin/miniserv.conf" # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for Webmin. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index a86e34f..37b9a9c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -22,9 +22,10 @@ new_path="/" app=$YNH_APP_INSTANCE_NAME #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up Webmin before changing its URL (may take a while)..." +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." + # Backup the current version of the app ynh_backup_before_upgrade @@ -32,7 +33,7 @@ ynh_clean_setup () { # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -59,14 +60,14 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped LSB" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -103,7 +104,7 @@ ynh_systemd_action --service_name=$app --action="start" --line_match="Started LS #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -111,4 +112,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for Webmin" --last +ynh_script_progression --message="Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 670807b..ae85a17 100644 --- a/scripts/install +++ b/scripts/install @@ -32,7 +32,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +ynh_script_progression --message="Validating installation parameters..." final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -43,7 +43,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url @@ -54,7 +54,7 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +ynh_script_progression --message="Finding an available port..." # Find an available port port=$(ynh_find_port --port=10000) @@ -63,7 +63,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=12 +ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies @@ -73,7 +73,7 @@ ynh_install_extra_app_dependencies --repo="deb https://download.webmin.com/downl #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=11 +ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config @@ -81,29 +81,33 @@ ynh_add_nginx_config #================================================= # SPECIFIC SETUP #================================================= -# MODIFY A CONFIG FILE +# ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Modifying a config file..." --weight=1 +ynh_script_progression --message="Adding a configuration file..." ynh_replace_string --match_string="port=10000" --replace_string="port=$port" --target_file="/etc/webmin/miniserv.conf" ynh_replace_string --match_string="listen=10000" --replace_string="listen=$port" --target_file="/etc/webmin/miniserv.conf" -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= -ynh_script_progression --message="Storing the config file checksum..." --weight=1 - # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="/etc/webmin/miniserv.conf" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." + +# Create a dedicated systemd config +systemctl daemon-reload +systemctl enable $app --quiet + #================================================= # GENERIC FINALIZATION #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Webmin Daemon" +yunohost service add $app --description="Webmin Daemon" #================================================= # START SYSTEMD SERVICE @@ -116,7 +120,7 @@ ynh_systemd_action --service_name=$app --action="start" --line_match="Started LS #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +ynh_script_progression --message="Configuring permissions..." # Restrict access to admin only # yunohost app addaccess --users=$admin $app @@ -125,17 +129,10 @@ if ! ynh_permission_exists --permission "admin"; then ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin fi -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=2 - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" - #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -143,4 +140,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of Webmin completed" --last +ynh_script_progression --message="Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index ba9427b..ed3fe33 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -25,17 +25,17 @@ port=$(ynh_app_setting_get --app=$app --key=port) # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) +# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing Webmin service integration..." --weight=1 + ynh_script_progression --message="Removing $app service integration..." yunohost service remove $app fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2 +ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config @@ -45,14 +45,13 @@ ynh_remove_systemd_config #================================================= ynh_script_progression --message="Removing dependencies..." - # Remove metapackage and its dependencies ynh_remove_app_dependencies #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated NGINX config ynh_remove_nginx_config @@ -63,4 +62,4 @@ ynh_remove_nginx_config # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of Webmin completed" --last +ynh_script_progression --message="Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 1f10ab5..68dc858 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -23,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -35,22 +35,24 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +ynh_script_progression --message="Validating restoration parameters..." ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" +#================================================= +# STANDARD RESTORATION STEPS #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." +ynh_script_progression --message="Restoring the NGINX web server configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=10 +ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -61,7 +63,7 @@ ynh_install_extra_app_dependencies --repo="deb https://download.webmin.com/downl #================================================= # RESTORE VARIOUS FILES #================================================= -ynh_script_progression --message="Restoring the various files..." +ynh_script_progression --message="Restoring various files..." ynh_restore_file --origin_path="/etc/webmin/miniserv.conf" @@ -92,4 +94,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for Webmin" --last +ynh_script_progression --message="Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index e329146..5826b67 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -24,28 +24,19 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -if ! ynh_permission_exists --permission="admin"; then - # Create the required permissions - ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up Webmin before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -58,7 +49,17 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped LSB" +ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped LSB" + +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + +if ! ynh_permission_exists --permission="admin"; then + # Create the required permissions + ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin +fi #================================================= # NGINX CONFIGURATION @@ -71,7 +72,7 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 +ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies @@ -82,9 +83,9 @@ ynh_install_extra_app_dependencies --repo="deb https://download.webmin.com/downl #================================================= # INSTALL WEBMIN #================================================= -# MODIFY A CONFIG FILE +# UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Modifying a config file..." +ynh_script_progression --message="Updating a configuration file..." ynh_replace_string --match_string="port=10000" --replace_string="port=$port" --target_file="/etc/webmin/miniserv.conf" ynh_replace_string --match_string="listen=10000" --replace_string="listen=$port" --target_file="/etc/webmin/miniserv.conf" @@ -99,7 +100,7 @@ ynh_store_file_checksum --file="/etc/webmin/miniserv.conf" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "Webmin Daemon" +yunohost service add $app --description="Webmin Daemon" #================================================= # START SYSTEMD SERVICE @@ -108,17 +109,10 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --line_match="Started LSB" -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=3 - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" - #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -126,4 +120,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of Webmin completed" --last +ynh_script_progression --message="Upgrade of $app completed"