From 8e9c387d70704580734908d434cc48569748db85 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 7 Jan 2022 21:06:28 +0100 Subject: [PATCH] Apply last example_ynh --- check_process | 10 +++++----- conf/nginx.conf | 6 ------ doc/DESCRIPTION.md | 5 +++++ manifest.json | 8 +++----- scripts/backup | 2 +- scripts/install | 9 ++++----- scripts/remove | 16 ++++++++-------- scripts/restore | 2 +- scripts/upgrade | 3 +-- scripts/ynh_detect_arch__2 | 25 ------------------------- 10 files changed, 28 insertions(+), 58 deletions(-) create mode 100644 doc/DESCRIPTION.md delete mode 100644 scripts/ynh_detect_arch__2 diff --git a/check_process b/check_process index e997daa..657a9e1 100644 --- a/check_process +++ b/check_process @@ -17,15 +17,15 @@ setup_public=1 upgrade=1 # 2.2.0~ynh1 - upgrade=1 from_commit=059ddc457aabe6962f5960612ed2dc1db53daeeb + # upgrade=1 from_commit=059ddc457aabe6962f5960612ed2dc1db53daeeb # 2.2.2~ynh1 - upgrade=1 from_commit=63723f18af5b035a41e967078cc3128423b1f9ae + # upgrade=1 from_commit=63723f18af5b035a41e967078cc3128423b1f9ae # 2.3.0~ynh1 - upgrade=1 from_commit=9f5c0970d2bf8bb6111785184b1d3762228b04ec + # upgrade=1 from_commit=9f5c0970d2bf8bb6111785184b1d3762228b04ec # 2.3.0~ynh2 - upgrade=1 from_commit=4757df265b0c3e8d1fc5280190ccfe5705dcb691 + # upgrade=1 from_commit=4757df265b0c3e8d1fc5280190ccfe5705dcb691 # 2.3.0~ynh3 - upgrade=1 from_commit=28ed2fd7ab7b5e55154991c990d8e780560a56db + # upgrade=1 from_commit=28ed2fd7ab7b5e55154991c990d8e780560a56db # 2.4.0~ynh1 upgrade=1 from_commit=2c4a57afdc92a6428ccfea3ccb74c7e33dc9b9ff backup_restore=1 diff --git a/conf/nginx.conf b/conf/nginx.conf index c0bdf8f..fa8dfb4 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,5 @@ location / { - # if you do not want remote frontends to be able to access your Pleroma backend - # server, remove these lines. - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - # Standard nginx configuration proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..943c97b --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,5 @@ +Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support ActivityPub. What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed. + +For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post/what-is-pleroma/) + +**Mastodon web front-end for Pleroma:** Add **/web** in front of your Pleroma domain, eg. pleroma.domain.tld/web diff --git a/manifest.json b/manifest.json index 368ab21..8179c4c 100644 --- a/manifest.json +++ b/manifest.json @@ -25,7 +25,7 @@ "name": "yalh76" }], "requirements": { - "yunohost": ">= 4.1.7.3" + "yunohost": ">= 4.3.1.8" }, "multi_instance": false, "services": [ @@ -35,13 +35,11 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" }, { "name": "is_public", diff --git a/scripts/backup b/scripts/backup index b833944..7496400 100755 --- a/scripts/backup +++ b/scripts/backup @@ -73,7 +73,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" # BACKUP VARIOUS FILES #================================================= -ynh_backup --src_path="/etc/$app/config.exs" +ynh_backup --src_path="/etc/$app/" #================================================= # BACKUP THE POSTGRESQL DATABASE diff --git a/scripts/install b/scripts/install index bea78bc..576bc11 100755 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_detect_arch__2 source /usr/share/yunohost/helpers #================================================= @@ -121,7 +120,7 @@ ynh_script_progression --message="Setting up source files..." ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -architecture=$(ynh_detect_arch) +architecture=$YNH_ARCH ynh_setup_source --dest_dir="$final_path/$app" --source_id=$architecture chmod 750 "$final_path" @@ -170,11 +169,11 @@ chown -R $app:$app "$datadir" #================================================= ynh_script_progression --message="Adding a configuration file..." -mkdir -p /etc/$app -chown -R $app /etc/$app - config="/etc/$app/config.exs" +mkdir -p /etc/$app +chown $app:$app /etc/$app + #================================================= # SETUP SYSTEMD #================================================= diff --git a/scripts/remove b/scripts/remove index d337e43..f1ec2a2 100755 --- a/scripts/remove +++ b/scripts/remove @@ -55,14 +55,6 @@ ynh_script_progression --message="Removing the PostgreSQL database..." # Remove a database if it exists, along with the associated user ynh_psql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= @@ -80,6 +72,14 @@ ynh_script_progression --message="Removing NGINX web server configuration..." ynh_remove_nginx_config ynh_secure_remove --file="/etc/nginx/conf.d/$app-cache.conf" +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # CLOSE A PORT #================================================= diff --git a/scripts/restore b/scripts/restore index f310611..82a9cc8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -125,7 +125,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" #================================================= ynh_script_progression --message="Restoring various files..." -ynh_restore_file --origin_path="/etc/$app/config.exs" +ynh_restore_file --origin_path="/etc/$app/" chmod 400 "/etc/$app/config.exs" chown $app:$app "/etc/$app/config.exs" diff --git a/scripts/upgrade b/scripts/upgrade index c31144e..a92578f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,7 +8,6 @@ source _common.sh source ynh_package_version -source ynh_detect_arch__2 source /usr/share/yunohost/helpers #================================================= @@ -184,7 +183,7 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - architecture=$(ynh_detect_arch) + architecture=$YNH_ARCH ynh_setup_source --dest_dir="$final_path/$app" --source_id=$architecture fi diff --git a/scripts/ynh_detect_arch__2 b/scripts/ynh_detect_arch__2 deleted file mode 100644 index b1c7375..0000000 --- a/scripts/ynh_detect_arch__2 +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# Check the architecture -# -# example: architecture=$(ynh_detect_arch) -# -# usage: ynh_detect_arch -# -# Requires YunoHost version 2.2.4 or higher. - -ynh_detect_arch(){ - local architecture - if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then - architecture="arm64" - elif [ -n "$(uname -m | grep 64)" ]; then - architecture="x86-64" - elif [ -n "$(uname -m | grep 86)" ]; then - architecture="i386" - elif [ -n "$(uname -m | grep arm)" ]; then - architecture="arm" - else - architecture="unknown" - fi - echo $architecture -}