diff --git a/ALL_README.md b/ALL_README.md index a01b345..152f2e7 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,6 +1,7 @@ # All available README files by language - [Read the README in English](README.md) +- [Lea el README en español](README_es.md) - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) diff --git a/README.md b/README.md index b9fa73c..bfbb577 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ A data size quota is also set on the directory. **Shipped version:** 1.3~ynh3 +## :red_circle: Antifeatures + +- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc. + ## Documentation and resources - Upstream app code repository: diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..4b27f2b --- /dev/null +++ b/README_es.md @@ -0,0 +1,50 @@ + + +# ssh chroot directory para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/ssh_chroot_dir.svg)](https://dash.yunohost.org/appci/app/ssh_chroot_dir) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/ssh_chroot_dir.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/ssh_chroot_dir.maintain.svg) + +[![Instalar ssh chroot directory con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ssh_chroot_dir) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarssh chroot directory rapidamente y simplement en un servidor YunoHost.* +> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.* + +## Descripción general + +This app provides a directory, accessible via ssh of sftp, to a new user. + +A "chroot jail" limits the commands the user can use, so you can rest assured that +they can't access your server's contents outside of the provided directory. + +A data size quota is also set on the directory. + + +**Versión actual:** 1.3~ynh3 +## :red_circle: Características no deseables + +- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc. + +## Documentaciones y recursos + +- Repositorio del código fuente oficial de la aplicación : +- Catálogo YunoHost: +- Reportar un error: + +## Información para desarrolladores + +Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/ssh_chroot_dir_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/ssh_chroot_dir_ynh/tree/testing --debug +o +sudo yunohost app upgrade ssh_chroot_dir -u https://github.com/YunoHost-Apps/ssh_chroot_dir_ynh/tree/testing --debug +``` + +**Mas informaciones sobre el empaquetado de aplicaciones:** diff --git a/README_eu.md b/README_eu.md index 78d7c2f..51ef156 100644 --- a/README_eu.md +++ b/README_eu.md @@ -25,6 +25,10 @@ A data size quota is also set on the directory. **Paketatutako bertsioa:** 1.3~ynh3 +## :red_circle: Ezaugarri zalantzagarriak + +- **Jatorrizko garapena utzita**: Software honek ez du arduradunik. Denborak aurrera egin ahala funtzionatzeari utziko dio, konpondu gabeko segurtasun arazoak izango ditu, etab. + ## Dokumentazioa eta baliabideak - Jatorrizko aplikazioaren kode-gordailua: diff --git a/README_fr.md b/README_fr.md index 2c82b4e..8cba4b9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,6 +25,10 @@ A data size quota is also set on the directory. **Version incluse :** 1.3~ynh3 +## :red_circle: Anti-fonctionnalités + +- **Application non maintenue **: Ce logiciel n'est plus maintenu. Attendez-vous à ce qu'il ne fonctionne plus avec le temps, et que l'on découvre des failles de sécurité qui ne seront pas corrigées, etc. + ## Documentations et ressources - Dépôt de code officiel de l’app : diff --git a/README_gl.md b/README_gl.md index a973427..f7db271 100644 --- a/README_gl.md +++ b/README_gl.md @@ -25,6 +25,10 @@ A data size quota is also set on the directory. **Versión proporcionada:** 1.3~ynh3 +## :red_circle: Debes considerar + +- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc. + ## Documentación e recursos - Repositorio de orixe do código: diff --git a/README_zh_Hans.md b/README_zh_Hans.md index ec57f79..736db56 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -3,7 +3,7 @@ 请勿手动编辑。 --> -# YunoHost 的 ssh chroot directory +# YunoHost 上的 ssh chroot directory [![集成程度](https://dash.yunohost.org/integration/ssh_chroot_dir.svg)](https://dash.yunohost.org/appci/app/ssh_chroot_dir) ![工作状态](https://ci-apps.yunohost.org/ci/badges/ssh_chroot_dir.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/ssh_chroot_dir.maintain.svg) @@ -25,6 +25,10 @@ A data size quota is also set on the directory. **分发版本:** 1.3~ynh3 +## :red_circle: 负面特征 + +- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc. + ## 文档与资源 - 上游应用代码库: diff --git a/manifest.toml b/manifest.toml index 46c4e0d..08f4596 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,8 @@ license = "GPL-3.0" code = "https://github.com/maniackcrudelis/ssh_chroot" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = true ldap = "not_relevant" diff --git a/scripts/_common.sh b/scripts/_common.sh index 04d89ce..2d71ee3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ user_dir="$data_dir/$ssh_user" #================================================= IS_PACKAGE_CHECK () { - if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 1 ]; then + if ynh_in_ci_tests; then return 0 else return 1 @@ -17,7 +17,3 @@ IS_PACKAGE_CHECK () { #================================================= # FUTUR OFFICIAL HELPERS #================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= diff --git a/scripts/backup b/scripts/backup index e6f51da..6be5c3d 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,34 +1,25 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # 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 -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$data_dir/$ssh_user" --is_big +ynh_backup "$data_dir/$ssh_user" #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/install b/scripts/install index e30d4b5..33137e0 100755 --- a/scripts/install +++ b/scripts/install @@ -1,24 +1,18 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=2 +ynh_script_progression "Validating installation parameters..." # Correct user name # An unix user name can contains only :alnum: and . - _ # Replace all other characters by _ ssh_user=${ssh_user//[^[:alnum:].\-_]/_} -ynh_app_setting_set --app="$app" --key=ssh_user --value="$ssh_user" +ynh_app_setting_set --key=ssh_user --value="$ssh_user" if ynh_system_user_exists "$ssh_user"; then ynh_die "This user already exist!" @@ -28,12 +22,10 @@ if test -z "$password" && test -z "$pub_key"; then ynh_die "You can't left empty both password and public key. Please fill at least one of them." fi -#================================================= -# STANDARD MODIFICATIONS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=1 +ynh_script_progression "Setting up source files..." ynh_setup_source --dest_dir="$install_dir" @@ -44,7 +36,7 @@ mkdir -p "$data_dir/$ssh_user" #================================================= # INSTALL QUOTAS SYSTEM #================================================= -ynh_script_progression --message="Install quotas system" --weight=3 +ynh_script_progression "Install quotas system" # https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh if ! IS_PACKAGE_CHECK; then @@ -57,7 +49,7 @@ fi #================================================= # CONFIGURE FSTAB TO SUPPORT QUOTAS #================================================= -ynh_script_progression --message="Configure fstab to support quotas" --weight=3 +ynh_script_progression "Configure fstab to support quotas" # https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh # Set fstab @@ -76,7 +68,7 @@ fi #================================================= # CREATE THE USER WITH CHROOT_MANAGER #================================================= -ynh_script_progression --message="Create the user with Chroot_manager" --weight=5 +ynh_script_progression "Create the user with Chroot_manager" chroot_manager_args=() @@ -99,15 +91,12 @@ fi ln -sf "$install_dir/chroot_manager.sh" "$data_dir/chroot_manager" -#================================================= -# GENERIC FINALIZATION #================================================= # SECURE FILES AND DIRECTORIES #================================================= # Set permissions to app files -chown -R root: "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R root: "$install_dir" #================================================= # DISCLAIMER #================================================= @@ -122,7 +111,7 @@ fi #================================================= # Not really settings, but required for POST_INSTALL.md -ynh_app_setting_set --app="$app" --key="domain" --value="$(yunohost domain list --json | jq -r '.["main"]')" -ynh_app_setting_set --app="$app" --key="ssh_port" --value="$(grep "^Port " /etc/ssh/sshd_config | awk '{print $2}')" +ynh_app_setting_set --key="domain" --value="$(yunohost domain list --json | jq -r '.["main"]')" +ynh_app_setting_set --key="ssh_port" --value="$(grep "^Port " /etc/ssh/sshd_config | awk '{print $2}')" -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 625822a..7ac4f91 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -14,7 +8,7 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE QUOTAS OPTIONS IN FSTAB #================================================= -ynh_script_progression --message="Remove quotas options in fstab" --weight=3 +ynh_script_progression "Remove quotas options in fstab" # https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh if ! IS_PACKAGE_CHECK; then @@ -32,22 +26,20 @@ fi #================================================= # REMOVE THE USER WITH CHROOT_MANAGER #================================================= -ynh_script_progression --message="Remove the user with Chroot_manager" --weight=3 +ynh_script_progression "Remove the user with Chroot_manager" if ! IS_PACKAGE_CHECK; then "$install_dir/chroot_manager.sh" deluser --name "$ssh_user" fi -#================================================= -# GENERIC FINALIZATION #================================================= # DISCLAIMER #================================================= -ynh_print_info --message="The directory $data_dir hasn't been removed." +ynh_print_info "The directory $data_dir hasn't been removed." #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index c780b06..ae49daa 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # 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 @@ -15,23 +9,23 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=1 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" +ynh_restore "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring the data directory..." --weight=1 +ynh_script_progression "Restoring the data directory..." -ynh_restore_file --origin_path="$data_dir/$ssh_user" --not_mandatory +ynh_restore "$data_dir/$ssh_user" || true #================================================= # SPECIFIC RESTORATION #================================================= # INSTALL QUOTAS SYSTEM #================================================= -ynh_script_progression --message="Install quotas system" --weight=3 +ynh_script_progression "Install quotas system" # https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh if ! IS_PACKAGE_CHECK; then @@ -45,7 +39,7 @@ fi #================================================= # CONFIGURE FSTAB TO SUPPORT QUOTAS #================================================= -ynh_script_progression --message="Configure fstab to support quotas" --weight=3 +ynh_script_progression "Configure fstab to support quotas" # https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh # Set fstab @@ -64,7 +58,7 @@ fi #================================================= # UPDATE THE CHROOT DIRECTORY #================================================= -ynh_script_progression --message="Update the chroot directory" --weight=3 +ynh_script_progression "Update the chroot directory" # https://github.com/maniackcrudelis/ssh_chroot/blob/master/ssh_chroot/ssh_chroot.sh # Build the chroot @@ -97,17 +91,13 @@ ln -sf "$install_dir/chroot_manager.sh" "$data_dir/chroot_manager" #================================================= # Set permissions to app files -chown -R root: $install_dir - - -#================================================= -# GENERIC FINALIZATION +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R root: $install_dir #================================================= # END OF SCRIPT #================================================= # Not really settings, but required for POST_INSTALL.md -ynh_app_setting_set --app="$app" --key="domain" --value="$(yunohost domain list --json | jq -r '.["main"]')" -ynh_app_setting_set --app="$app" --key="ssh_port" --value="$(grep "^Port " /etc/ssh/sshd_config | awk '{print $2}')" +ynh_app_setting_set --key="domain" --value="$(yunohost domain list --json | jq -r '.["main"]')" +ynh_app_setting_set --key="ssh_port" --value="$(grep "^Port " /etc/ssh/sshd_config | awk '{print $2}')" -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 5e48805..886e303 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,37 +1,23 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= -ynh_script_progression --message="Checking version..." --weight=1 +ynh_script_progression "Checking version..." -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] +# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed +if ynh_app_upstream_version_changed then - ynh_script_progression --message="Upgrading source files..." --weight=1 + ynh_script_progression "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" fi -#================================================= -# SPECIFIC UPGRADE #================================================= # SOURCE LIBRARIES #================================================= @@ -42,7 +28,7 @@ source "$install_dir/ssh_chroot/ssh_chroot.sh" #================================================= # UPDATE THE CHROOT DIRECTORY #================================================= -ynh_script_progression --message="Update the chroot directory" --weight=3 +ynh_script_progression "Update the chroot directory" # https://github.com/maniackcrudelis/ssh_chroot/blob/master/ssh_chroot/ssh_chroot.sh # Build the chroot @@ -68,19 +54,15 @@ fi ln -sf $install_dir/chroot_manager.sh "$data_dir/chroot_manager" # Set permissions to app files -chown -R root: $install_dir - -#================================================= -# GENERIC FINALIZATION +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R root: $install_dir #================================================= # SECURE FILES AND DIRECTORIES #================================================= # Set permissions to app files -chown -R root: $install_dir - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R root: $install_dir #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed"