diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 1baafb8..0000000 --- a/manifest.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "Samba", - "id": "samba", - "packaging_format": 1, - "description": { - "en": "Share directories on your private network thanks to SMB protocol", - "fr": "Partager des dossiers sur un réseau privé via le protocole SMB" - }, - "version": "4.13.13~ynh1", - "url": "https://www.samba.org/", - "upstream": { - "license": "AGPL-3.0-only", - "website": "https://www.samba.org/", - "admindoc": "https://www.samba.org/samba/docs/", - "code": "https://git.samba.org/?p=samba.git;a=summary" - }, - "license": "AGPL-3.0-only", - "maintainer": { - "name": "Galette" - }, - "requirements": { - "yunohost": ">= 11.2" - }, - "multi_instance": false, - "services": [], - "arguments": { - "install": [ - { - "name": "warning", - "type": "display_text", - "ask": { - "en": "I understand this app is only for private network purpose and i should not install it on a server with a public IP or open the 445 port on my home router.", - "fr": "Je comprends que cette application est uniquement à des fins de réseau privé et que je ne dois pas l'installer sur un serveur avec une adresse IP publique ou ouvrir le port 445 sur mon routeur." - } - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 5347000..ed95980 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,18 +14,16 @@ license = "AGPL-3.0-only" website = "https://www.samba.org/" admindoc = "https://www.samba.org/samba/docs/" code = "https://git.samba.org/?p=samba.git;a=summary" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] yunohost = ">= 11.2" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +architectures = "all" multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = "not_relevant" +sso = "not_relevant" +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install.warning] ask.en = "I understand this app is only for private network purpose and i should not install it on a server with a public IP or open the 445 port on my home router." @@ -36,7 +34,16 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.system_user] [resources.install_dir] + dir = ["/etc/samba"] + + [resources.ports] + main.default = 445 + main.exposed = "Both" [resources.data_dir] + subdirs = ["share"] [resources.permissions] + + [resources.apt] + packages = ["samba"] \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index 813375d..d2db266 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,24 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index f57addd..b6c6b9a 100755 --- a/scripts/install +++ b/scripts/install @@ -9,52 +9,15 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." - -#REMOVEME? install_dir="/etc/samba" - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 +ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=directories --value=shared ynh_app_setting_set --app=$app --key=advanced --value=0 ynh_app_setting_set --app=$app --key=readonly_dir --value='' ynh_app_setting_set --app=$app --key=unbrowseable --value='' -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -ynh_script_progression --message="Configuring firewall..." - -ynh_exec_warn_less yunohost firewall allow Both 445 --no-upnp - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=10 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # SPECIFIC SETUP @@ -66,16 +29,12 @@ ynh_exec_warn_less yunohost firewall allow Both 445 --no-upnp # We define the permission in advance to be able to use the group # in unix permission #REMOVEME? ynh_permission_create --permission="share" --allowed=all_users + #================================================= # CREATE DATA DIRECTORY #================================================= ynh_script_progression --message="Creating a data directory..." --weight=1 -#REMOVEME? data_dir=/home/yunohost.app/samba -#REMOVEME? ynh_app_setting_set --app=samba --key=data_dir --value=$data_dir - -mkdir -p $data_dir/share - chmod 750 "$data_dir/share" chmod -R o-rwx "$data_dir/share" chown -R root:root "$data_dir/share" @@ -106,7 +65,7 @@ cat $install_dir/smb.conf.d/*.conf >> $install_dir/smb.conf #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports 445 +yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports $port #================================================= # START SYSTEMD SERVICE diff --git a/scripts/remove b/scripts/remove index 7b61f36..8c02fa1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,16 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # STANDARD REMOVE #================================================= @@ -32,26 +22,6 @@ then yunohost service remove smbd fi -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=2 - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." --weight=10 -#REMOVEME? ynh_secure_remove --file="$data_dir" -#REMOVEME? ynh_secure_remove --file="$install_dir" -fi - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 7efff34..ba15529 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,35 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) -#REMOVEME? directories=$(ynh_app_setting_get --app=$app --key=directories) -#REMOVEME? advanced=$(ynh_app_setting_get --app=$app --key=advanced) -#REMOVEME? readonly_dir=$(ynh_app_setting_get --app=$app --key=readonly_dir) -#REMOVEME? unbrowseable=$(ynh_app_setting_get --app=$app --key=unbrowseable) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -48,8 +19,6 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" chown -R root:root "$install_dir" #================================================= @@ -59,37 +28,15 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $data_dir - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" chown -R root:root "$data_dir" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# FIND AND OPEN A PORT -#================================================= -ynh_script_progression --message="Open 445 port..." --weight=1 - -ynh_exec_warn_less yunohost firewall allow Both 445 --no-upnp - - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 # Don't add --needs_exposed_ports 445 , we don't want a remote diagnosis here -yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports 445 +yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports $port #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index e521e2b..31da8bf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,35 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -47,18 +24,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=4 ynh_systemd_action --service_name=smbd --action="stop" -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." - -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=12 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # GENERIC FINALIZATION #================================================= @@ -67,7 +32,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 # Don't add --needs_exposed_ports 445 , we don't want a remote diagnosis here -yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports 445 +yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports $port #================================================= # START SYSTEMD SERVICE