From 22d591c804ca5e61f1b6c4799181fd9f7dafb891 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Jul 2021 13:17:44 +0200 Subject: [PATCH 1/8] Improving service --- conf/systemd.service | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/systemd.service b/conf/systemd.service index 02198e6..33c9d25 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,6 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ +ExecStartPre=-/bin/bash -c 'chown __APP__:__APP__ /etc/__APP__/' ExecStartPre=-/bin/bash -c 'cat /etc/__APP__/config.d/*.toml > /etc/__APP__/config.toml' ExecStart=__FINALPATH__/live/__APP__ /etc/__APP__/config.toml StandardOutput=append:/var/log/__APP__/__APP__.log From 44d17daa22776538e0b942185ee8b0d4a01a22c5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Jul 2021 13:19:59 +0200 Subject: [PATCH 2/8] Upgrade to 0.4.4~ynh2 --- check_process | 6 ++++-- manifest.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 8c819a8..f4efec3 100644 --- a/check_process +++ b/check_process @@ -14,6 +14,8 @@ setup_private=0 setup_public=0 upgrade=1 + # 0.4.4~ynh1 + upgrade=1 from_commit=3fcde5a7829938763b393ac1e878929bdc35297f backup_restore=1 multi_instance=0 port_already_use=0 @@ -22,5 +24,5 @@ Email=yalh@yahoo.com Notification=all ;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. + ; commit=3fcde5a7829938763b393ac1e878929bdc35297f + name=0.4.4~ynh1. diff --git a/manifest.json b/manifest.json index 17fca68..25b4d09 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "A gemini server written in rust." }, - "version": "0.4.4~ynh1", + "version": "0.4.4~ynh2", "url": "https://codeberg.org/Valenoern/gemserv", "upstream": { "license": "MIT", From d7590f9b19a9a98023c760872e809d3d74ab5a9a Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Wed, 14 Jul 2021 11:20:08 +0000 Subject: [PATCH 3/8] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bce60ee..6c9ecc3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in A gemini server written in rust. -**Shipped version:** 0.4.4~ynh1 +**Shipped version:** 0.4.4~ynh2 diff --git a/README_fr.md b/README_fr.md index 57e9890..1c116ac 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour -**Version incluse :** 0.4.4~ynh1 +**Version incluse :** 0.4.4~ynh2 From 1c65136d2ed1a3d2ef6546a3615a60b8361f8910 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Jul 2021 13:37:16 +0200 Subject: [PATCH 4/8] ynh_exec_warn_less --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 1fc4136..9a93b10 100755 --- a/scripts/install +++ b/scripts/install @@ -89,7 +89,7 @@ ynh_script_progression --message="Making install..." # Install rustup with the toolchain needed by vaultwarden pushd "$final_path" - sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' + ynh_exec_warn_less sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" diff --git a/scripts/upgrade b/scripts/upgrade index 780b2d2..77429af 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,7 +97,7 @@ ynh_script_progression --message="Making install..." # Install rustup with the toolchain needed by vaultwarden pushd "$final_path" - sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' + ynh_exec_warn_less sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" From 880047e5d33c2c092cd2afe16a35321abcb19fa3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Jul 2021 15:10:42 +0200 Subject: [PATCH 5/8] Upgrade to 0.4.5~ynh1 --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- conf/server.toml | 1 - manifest.json | 6 +++--- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6c9ecc3..b7655fe 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in A gemini server written in rust. -**Shipped version:** 0.4.4~ynh2 +**Shipped version:** 0.4.5~ynh1 diff --git a/README_fr.md b/README_fr.md index 1c116ac..758d459 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour -**Version incluse :** 0.4.4~ynh2 +**Version incluse :** 0.4.5~ynh1 diff --git a/conf/app.src b/conf/app.src index 152099d..ca65e49 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://codeberg.org/Valenoern/gemserv/archive/v0.4.4.tar.gz -SOURCE_SUM=810f56dfcbd1d8761afac4a5f3fbf64ec352aa78628ade1eb5e41285c58acf2a +SOURCE_URL=https://git.sr.ht/~int80h/gemserv/archive/v0.4.5.tar.gz +SOURCE_SUM=7aeb5edc8af6ebefc2331aebc0c360798711c2fb16ee9cbde8c5c4f9502c491f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/server.toml b/conf/server.toml index 7628ccc..8c895a0 100644 --- a/conf/server.toml +++ b/conf/server.toml @@ -5,4 +5,3 @@ host = "::" # are error, warn, and info. If error is set it will only show error. If warn # is set it will show error and warn. Info shows all three. log = "info" - diff --git a/manifest.json b/manifest.json index 25b4d09..db210cb 100644 --- a/manifest.json +++ b/manifest.json @@ -5,11 +5,11 @@ "description": { "en": "A gemini server written in rust." }, - "version": "0.4.4~ynh2", - "url": "https://codeberg.org/Valenoern/gemserv", + "version": "0.4.5~ynh1", + "url": "https://git.sr.ht/~int80h/gemserv/", "upstream": { "license": "MIT", - "code": "https://codeberg.org/Valenoern/gemserv" + "code": "https://git.sr.ht/~int80h/gemserv" }, "license": "MIT", "maintainer": { From a1bc4732eee27b38a9932938bd11c9fc42471722 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Wed, 14 Jul 2021 13:10:48 +0000 Subject: [PATCH 6/8] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b7655fe..cc9750c 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ redirect = { "/redirect" = "/", "/newdomain" = "gemini://example.net" } ``` ## Documentation and resources -* Upstream app code repository: https://codeberg.org/Valenoern/gemserv +* Upstream app code repository: https://git.sr.ht/~int80h/gemserv * YunoHost documentation for this app: https://yunohost.org/app_gemserv * Report a bug: https://github.com/YunoHost-Apps/gemserv_ynh/issues diff --git a/README_fr.md b/README_fr.md index 758d459..065dc46 100644 --- a/README_fr.md +++ b/README_fr.md @@ -56,7 +56,7 @@ redirect = { "/redirect" = "/", "/newdomain" = "gemini://example.net" } ``` ## Documentations et ressources -* Dépôt de code officiel de l'app : https://codeberg.org/Valenoern/gemserv +* Dépôt de code officiel de l'app : https://git.sr.ht/~int80h/gemserv * Documentation YunoHost pour cette app : https://yunohost.org/app_gemserv * Signaler un bug : https://github.com/YunoHost-Apps/gemserv_ynh/issues From 333a91748f50dc635475327526a6a97dce227977 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Jul 2021 15:13:56 +0200 Subject: [PATCH 7/8] Fix Upgrade --- scripts/install | 4 ++-- scripts/upgrade | 33 ++++++++++++++++++--------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/scripts/install b/scripts/install index 9a93b10..0f46d1c 100755 --- a/scripts/install +++ b/scripts/install @@ -87,7 +87,7 @@ chown -R $app:$app "$final_path" #================================================= ynh_script_progression --message="Making install..." -# Install rustup with the toolchain needed by vaultwarden +# Install rustup with the toolchain needed by Gemserv pushd "$final_path" ynh_exec_warn_less sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' popd @@ -99,7 +99,7 @@ pushd "$final_path"/build ynh_exec_warn_less sudo -u "$app" env PATH="$PATH" cargo build --release popd -# Install vaultwarden +# Install Gemserv cp -af "$final_path/build/target/release/gemserv" "$final_path/live/gemserv" # Remove build files and rustup diff --git a/scripts/upgrade b/scripts/upgrade index 77429af..1976006 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,25 +95,28 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_script_progression --message="Making install..." -# Install rustup with the toolchain needed by vaultwarden -pushd "$final_path" - ynh_exec_warn_less sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' -popd +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + # Install rustup with the toolchain needed by Gemserv + pushd "$final_path" + ynh_exec_warn_less sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' + popd -export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" + export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" -# Compile Gemserv -pushd "$final_path"/build - ynh_exec_warn_less sudo -u "$app" env PATH="$PATH" cargo build --release -popd + # Compile Gemserv + pushd "$final_path"/build + ynh_exec_warn_less sudo -u "$app" env PATH="$PATH" cargo build --release + popd -# Install vaultwarden -cp -af "$final_path/build/target/release/gemserv" "$final_path/live/gemserv" + # Install Gemserv + cp -af "$final_path/build/target/release/gemserv" "$final_path/live/gemserv" -# Remove build files and rustup -ynh_secure_remove --file="$final_path/build" -ynh_secure_remove --file="$final_path/.cargo" -ynh_secure_remove --file="$final_path/.rustup" + # Remove build files and rustup + ynh_secure_remove --file="$final_path/build" + ynh_secure_remove --file="$final_path/.cargo" + ynh_secure_remove --file="$final_path/.rustup" +fi #================================================= # UPDATE A CONFIG FILE From 205938403947f779df6d34dff08bc86173070f2e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Jul 2021 16:06:24 +0200 Subject: [PATCH 8/8] Fix rustup --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 0f46d1c..91e0c93 100755 --- a/scripts/install +++ b/scripts/install @@ -89,7 +89,7 @@ ynh_script_progression --message="Making install..." # Install rustup with the toolchain needed by Gemserv pushd "$final_path" - ynh_exec_warn_less sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' + sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" diff --git a/scripts/upgrade b/scripts/upgrade index 1976006..ac745a0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,7 +99,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then # Install rustup with the toolchain needed by Gemserv pushd "$final_path" - ynh_exec_warn_less sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' + sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"