From 1f69303951f266b0800d36657cf02e734d0c7422 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 2 Aug 2022 04:04:50 +0200 Subject: [PATCH] Upgrade to 2022.08.02~ynh1 --- check_process | 7 ++----- conf/app.src | 5 +++-- conf/nginx.conf | 2 +- conf/systemd.service | 2 +- doc/DESCRIPTION.md | 1 + doc/DESCRIPTION_fr.md | 1 + manifest.json | 2 +- scripts/install | 16 ++++++++-------- scripts/restore | 16 ++++++++-------- scripts/upgrade | 21 ++++++++++----------- sources/extra_files/app/.gitignore | 2 -- sources/patches/.gitignore | 2 -- 12 files changed, 36 insertions(+), 41 deletions(-) create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md delete mode 100644 sources/extra_files/app/.gitignore delete mode 100644 sources/patches/.gitignore diff --git a/check_process b/check_process index fc9c03d..4766f13 100644 --- a/check_process +++ b/check_process @@ -11,7 +11,8 @@ setup_private=0 setup_public=1 upgrade=1 - # upgrade=1 from_commit=CommitHash + # 20.01.2022~ynh1 + upgrade=1 from_commit=52c1e2d4fbf5221e32025bc28939b93a64622031 backup_restore=1 multi_instance=1 port_already_use=1 @@ -19,7 +20,3 @@ ;;; Options Email= Notification=none -;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& diff --git a/conf/app.src b/conf/app.src index 763ab76..f11a202 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,7 @@ -SOURCE_URL=https://gitlab.com/bashrc2/epicyon/-/archive/18088169e682c05cba03349e01e759981396222f/epicyon-18088169e682c05cba03349e01e759981396222f.tar.gz -SOURCE_SUM=a560c52d49a22efd75a9c5006d695765f1a29ad70718fc50a0b26fcbcf640e0c +SOURCE_URL=https://gitlab.com/bashrc2/epicyon/-/archive/9d7856f9c0434b1587ae90ce19739ece6db6c206/epicyon-9d7856f9c0434b1587ae90ce19739ece6db6c206.tar.gz +SOURCE_SUM=6171f537792b67fff24eaf495ea791dd7d153739990764d8be8d09722b03291c SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index fde4204..1633f86 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { +location __PATH__/ { proxy_pass http://localhost:__PORT__; proxy_http_version 1.1; diff --git a/conf/systemd.service b/conf/systemd.service index c21d97c..f33a0ea 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=/usr/bin/python3 __FINALPATH__/epicyon.py --port 443 --proxy __PORT__ --domain __DOMAIN__ --registration close --debug +ExecStart=/usr/bin/python3 __FINALPATH__/epicyon.py --port 443 --proxy __PORT__ --domain __DOMAIN__ --registration open --log_login_failures Environment=USER=__APP__ Environment=PYTHONUNBUFFERED=true Restart=always diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..5b3aaf6 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +ActivityPub server implementing S2S and C2S protocols, suitable for single board computers. Includes features such as moderation tools, post expiry, content warnings, and image descriptions diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..d7edb26 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +Serveur ActivityPub mettant en œuvre les protocoles S2S et C2S, adapté aux ordinateurs monocartes. Comprend des fonctionnalités telles que des outils de modération, l'expiration des messages, des avertissements sur le contenu et des descriptions d'images. diff --git a/manifest.json b/manifest.json index d334fbc..354475f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Federated social network server", "fr": "Serveur de réseau social fédéré" }, - "version": "20.01.2022~ynh1", + "version": "2022.08.02~ynh1", "url": "https://epicyon.net/", "upstream": { "license": "AGPL-1.0-or-later", diff --git a/scripts/install b/scripts/install index 2fcec15..ff278d0 100755 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -26,11 +26,12 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" admin=$YNH_APP_ARG_ADMIN -email=$(ynh_user_get_info $admin 'mail') password=$YNH_APP_ARG_PASSWORD app=$YNH_APP_INSTANCE_NAME +email=$(ynh_user_get_info --username=$admin --key="mail") + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -61,7 +62,7 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port=$(ynh_find_port --port=7156) +port=$(ynh_find_port --port=8095) ynh_app_setting_set --app=$app --key=port --value=$port #================================================= @@ -86,9 +87,8 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=public_path --value=$public_path - -# Clone repo, create public path and link accounts -git clone https://gitlab.com/bashrc2/epicyon $final_path --quiet +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$final_path" mkdir $public_path mkdir -p $final_path/accounts/newsmirror @@ -113,9 +113,9 @@ ynh_add_nginx_config #================================================= # SPECIFIC SETUP #================================================= -# ... +# CREATE ADMIN USER #================================================= -ynh_script_progression --message="Create admin user" --weight=1 +ynh_script_progression --message="Creating admin user" --weight=1 # Create admin python3 $final_path/epicyon.py --addaccount=$admin --password=$password --domain=$domain diff --git a/scripts/restore b/scripts/restore index 6720c80..0922b0e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -42,13 +42,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE 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" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -86,6 +79,13 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE 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" + #================================================= # RESTORE SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9caeea5..bfe4c0a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -37,6 +37,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # Restore it if the upgrade fails ynh_restore_upgradebackup } @@ -68,10 +69,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - # Pull the latest sorce - pushd "$final_path" - git pull --quiet - popd + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" fi chmod 750 "$final_path" @@ -79,6 +78,13 @@ chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" chown -R $app: $public_path +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # NGINX CONFIGURATION #================================================= @@ -87,13 +93,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # SETUP SYSTEMD #================================================= diff --git a/sources/extra_files/app/.gitignore b/sources/extra_files/app/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/extra_files/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/patches/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op]