mirror of
https://github.com/YunoHost-Apps/gemserv_ynh.git
synced 2024-09-03 18:36:27 +02:00
commit
7dd95b1d74
10 changed files with 71 additions and 75 deletions
18
README.md
18
README.md
|
@ -5,7 +5,7 @@ It shall NOT be edited by hand.
|
||||||
|
|
||||||
# Gemserv for YunoHost
|
# Gemserv for YunoHost
|
||||||
|
|
||||||
[![Integration level](https://dash.yunohost.org/integration/gemserv.svg)](https://dash.yunohost.org/appci/app/gemserv) ![](https://ci-apps.yunohost.org/ci/badges/gemserv.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gemserv.maintain.svg)
|
[![Integration level](https://dash.yunohost.org/integration/gemserv.svg)](https://dash.yunohost.org/appci/app/gemserv) ![Working status](https://ci-apps.yunohost.org/ci/badges/gemserv.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/gemserv.maintain.svg)
|
||||||
[![Install Gemserv with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gemserv)
|
[![Install Gemserv with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gemserv)
|
||||||
|
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
|
@ -28,10 +28,7 @@ A gemini server written in rust.
|
||||||
- Reload config on SIGHUP
|
- Reload config on SIGHUP
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 0.6.6~ynh2
|
**Shipped version:** 0.6.6~ynh3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Disclaimers / important information
|
## Disclaimers / important information
|
||||||
|
|
||||||
Please note that Gemserv uses the TCP port 1965, so you can't use it for anything else.
|
Please note that Gemserv uses the TCP port 1965, so you can't use it for anything else.
|
||||||
|
@ -72,19 +69,20 @@ redirect = { "/redirect" = "/", "/newdomain" = "gemini://example.net" }
|
||||||
|
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
* Upstream app code repository: https://git.sr.ht/~int80h/gemserv
|
* Upstream app code repository: <https://git.sr.ht/~int80h/gemserv>
|
||||||
* YunoHost documentation for this app: https://yunohost.org/app_gemserv
|
* YunoHost documentation for this app: <https://yunohost.org/app_gemserv>
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/gemserv_ynh/issues
|
* Report a bug: <https://github.com/YunoHost-Apps/gemserv_ynh/issues>
|
||||||
|
|
||||||
## Developer info
|
## Developer info
|
||||||
|
|
||||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing).
|
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing).
|
||||||
|
|
||||||
To try the testing branch, please proceed like that.
|
To try the testing branch, please proceed like that.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing --debug
|
||||||
or
|
or
|
||||||
sudo yunohost app upgrade gemserv -u https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing --debug
|
sudo yunohost app upgrade gemserv -u https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||||
|
|
24
README_fr.md
24
README_fr.md
|
@ -1,10 +1,14 @@
|
||||||
|
<!--
|
||||||
|
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||||
|
It shall NOT be edited by hand.
|
||||||
|
-->
|
||||||
|
|
||||||
# Gemserv pour YunoHost
|
# Gemserv pour YunoHost
|
||||||
|
|
||||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/gemserv.svg)](https://dash.yunohost.org/appci/app/gemserv) ![](https://ci-apps.yunohost.org/ci/badges/gemserv.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gemserv.maintain.svg)
|
[![Niveau d'intégration](https://dash.yunohost.org/integration/gemserv.svg)](https://dash.yunohost.org/appci/app/gemserv) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/gemserv.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/gemserv.maintain.svg)
|
||||||
[![Installer Gemserv avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gemserv)
|
[![Installer Gemserv avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gemserv)
|
||||||
|
|
||||||
*[Read this readme in english.](./README.md)*
|
*[Read this readme in english.](./README.md)*
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
|
||||||
|
|
||||||
> *Ce package vous permet d'installer Gemserv rapidement et simplement sur un serveur YunoHost.
|
> *Ce package vous permet d'installer Gemserv rapidement et simplement sur un serveur YunoHost.
|
||||||
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
||||||
|
@ -24,10 +28,7 @@ A gemini server written in rust.
|
||||||
- Reload config on SIGHUP
|
- Reload config on SIGHUP
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 0.6.6~ynh2
|
**Version incluse :** 0.6.6~ynh3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Avertissements / informations importantes
|
## Avertissements / informations importantes
|
||||||
|
|
||||||
Please note that Gemserv uses the TCP port 1965, so you can't use it for anything else.
|
Please note that Gemserv uses the TCP port 1965, so you can't use it for anything else.
|
||||||
|
@ -68,19 +69,20 @@ redirect = { "/redirect" = "/", "/newdomain" = "gemini://example.net" }
|
||||||
|
|
||||||
## Documentations et ressources
|
## Documentations et ressources
|
||||||
|
|
||||||
* Dépôt de code officiel de l'app : https://git.sr.ht/~int80h/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
|
* Documentation YunoHost pour cette app : <https://yunohost.org/app_gemserv>
|
||||||
* Signaler un bug : https://github.com/YunoHost-Apps/gemserv_ynh/issues
|
* Signaler un bug : <https://github.com/YunoHost-Apps/gemserv_ynh/issues>
|
||||||
|
|
||||||
## Informations pour les développeurs
|
## Informations pour les développeurs
|
||||||
|
|
||||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing).
|
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing).
|
||||||
|
|
||||||
Pour essayer la branche testing, procédez comme suit.
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing --debug
|
||||||
ou
|
ou
|
||||||
sudo yunohost app upgrade gemserv -u https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing --debug
|
sudo yunohost app upgrade gemserv -u https://github.com/YunoHost-Apps/gemserv_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
upgrade=1 from_commit=d1e78f8cb47fc61dc3ede3e9cbb8445e364f0ab0
|
upgrade=1 from_commit=d1e78f8cb47fc61dc3ede3e9cbb8445e364f0ab0
|
||||||
# 0.6.3~ynh1
|
# 0.6.3~ynh1
|
||||||
upgrade=1 from_commit=884e8c80936563ee20896a1e2ea4ace85fc4c3a7
|
upgrade=1 from_commit=884e8c80936563ee20896a1e2ea4ace85fc4c3a7
|
||||||
|
# 0.6.6~ynh2
|
||||||
|
upgrade=1 from_commit=f9e059a5ea4851aa51349319e8ed77f1e0676e46
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=0
|
multi_instance=0
|
||||||
port_already_use=0
|
port_already_use=0
|
||||||
|
@ -22,10 +24,3 @@
|
||||||
;;; Options
|
;;; Options
|
||||||
Email=yalh@yahoo.com
|
Email=yalh@yahoo.com
|
||||||
Notification=all
|
Notification=all
|
||||||
;;; Upgrade options
|
|
||||||
; commit=3fcde5a7829938763b393ac1e878929bdc35297f
|
|
||||||
name=0.4.4~ynh1
|
|
||||||
; commit=d1e78f8cb47fc61dc3ede3e9cbb8445e364f0ab0
|
|
||||||
name=0.4.5~ynh1
|
|
||||||
; commit=884e8c80936563ee20896a1e2ea4ace85fc4c3a7
|
|
||||||
name=0.6.3~ynh1
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=gemserv
|
Description=Gemserv daemon
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
@ -17,7 +17,7 @@ Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
# Sandboxing options to harden security
|
# Sandboxing options to harden security
|
||||||
# Depending on specificities of your service/app, you may need to tweak these
|
# Depending on specificities of your service/app, you may need to tweak these
|
||||||
# .. but this should be a good baseline
|
# .. but this should be a good baseline
|
||||||
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
|
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
|
@ -44,7 +44,7 @@ CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM
|
||||||
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
|
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
|
||||||
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
|
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
|
||||||
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
|
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
|
||||||
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
|
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"description": {
|
"description": {
|
||||||
"en": "A gemini server written in rust."
|
"en": "A gemini server written in rust."
|
||||||
},
|
},
|
||||||
"version": "0.6.6~ynh2",
|
"version": "0.6.6~ynh3",
|
||||||
"url": "https://git.sr.ht/~int80h/gemserv/",
|
"url": "https://git.sr.ht/~int80h/gemserv/",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -25,4 +25,4 @@
|
||||||
"arguments": {
|
"arguments": {
|
||||||
"install": []
|
"install": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ ynh_print_info --message="Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
|
|
@ -30,7 +30,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating installation parameters..."
|
ynh_script_progression --message="Validating installation parameters..."
|
||||||
|
|
||||||
final_path="/opt/yunohost/$app"
|
final_path=/opt/yunohost/$app
|
||||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -42,18 +42,18 @@ ynh_script_progression --message="Finding an available port..."
|
||||||
|
|
||||||
# Find an available port
|
# Find an available port
|
||||||
port=1965
|
port=1965
|
||||||
ynh_app_setting_set --app="$app" --key=port --value="$port"
|
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
|
|
||||||
# Open the port
|
# Open the port
|
||||||
ynh_script_progression --message="Configuring firewall..."
|
ynh_script_progression --message="Configuring firewall..."
|
||||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP "$port"
|
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing dependencies..."
|
ynh_script_progression --message="Installing dependencies..."
|
||||||
|
|
||||||
ynh_install_app_dependencies "$pkg_dependencies"
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
|
@ -61,16 +61,16 @@ ynh_install_app_dependencies "$pkg_dependencies"
|
||||||
ynh_script_progression --message="Configuring system user..."
|
ynh_script_progression --message="Configuring system user..."
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create --username="$app" --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
usermod -a -G ssl-cert "$app"
|
usermod -a -G ssl-cert $app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..."
|
ynh_script_progression --message="Setting up source files..."
|
||||||
|
|
||||||
ynh_app_setting_set --app="$app" --key=final_path --value="$final_path"
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path/build"
|
ynh_setup_source --dest_dir="$final_path/build"
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ mkdir -p "$final_path/live"
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R "$app":"$app" "$final_path"
|
chown -R $app:$app "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
@ -89,14 +89,14 @@ ynh_script_progression --message="Making install..."
|
||||||
|
|
||||||
# Install rustup with the toolchain needed by Gemserv
|
# Install rustup with the toolchain needed by Gemserv
|
||||||
pushd "$final_path"
|
pushd "$final_path"
|
||||||
ynh_exec_as "$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 ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y'
|
||||||
popd
|
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
|
# Compile Gemserv
|
||||||
pushd "$final_path"/build
|
pushd "$final_path"/build
|
||||||
ynh_exec_warn_less ynh_exec_as "$app" env PATH="$PATH" cargo build --release
|
ynh_exec_warn_less ynh_exec_as $app env PATH="$PATH" cargo build --release
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Install Gemserv
|
# Install Gemserv
|
||||||
|
@ -116,12 +116,12 @@ mkdir -p "/etc/$app/config.d/"
|
||||||
|
|
||||||
chmod 750 "/etc/$app"
|
chmod 750 "/etc/$app"
|
||||||
chmod -R o-rwx "/etc/$app"
|
chmod -R o-rwx "/etc/$app"
|
||||||
chown -R "$app":"$app" "/etc/$app"
|
chown -R $app:$app "/etc/$app"
|
||||||
|
|
||||||
ynh_add_config --template="server.toml" --destination="/etc/$app/config.d/server.toml.head"
|
ynh_add_config --template="server.toml" --destination="/etc/$app/config.d/server.toml.head"
|
||||||
|
|
||||||
chmod 400 "/etc/$app/config.d/server.toml.head"
|
chmod 400 "/etc/$app/config.d/server.toml.head"
|
||||||
chown "$app":"$app" "/etc/$app/config.d/server.toml.head"
|
chown $app:$app "/etc/$app/config.d/server.toml.head"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
@ -146,7 +146,7 @@ ynh_use_logrotate
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||||
|
|
||||||
yunohost service add "$app" --description="$app daemon" --log="/var/log/$app/$app.log" --needs_exposed_ports="1965"
|
yunohost service add $app --description="$app daemon" --log="/var/log/$app/$app.log" --needs_exposed_ports="1965"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
@ -154,7 +154,7 @@ yunohost service add "$app" --description="$app daemon" --log="/var/log/$app/$ap
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name="$app" --action="start" --line_match="Started" --log_path="systemd"
|
ynh_systemd_action --service_name=$app --action="start" --line_match="Started" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -16,8 +16,8 @@ ynh_script_progression --message="Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
port=$(ynh_app_setting_get --app="$app" --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -26,10 +26,10 @@ final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
||||||
if ynh_exec_warn_less yunohost service status "$app" >/dev/null
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Removing $app service integration..."
|
ynh_script_progression --message="Removing $app service integration..."
|
||||||
yunohost service remove "$app"
|
yunohost service remove $app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -71,7 +71,7 @@ ynh_remove_app_dependencies
|
||||||
if yunohost firewall list | grep -q "\- $port$"
|
if yunohost firewall list | grep -q "\- $port$"
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Closing port $port..."
|
ynh_script_progression --message="Closing port $port..."
|
||||||
ynh_exec_warn_less yunohost firewall disallow TCP "$port"
|
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -95,7 +95,7 @@ ynh_secure_remove --file="/var/log/$app"
|
||||||
ynh_script_progression --message="Removing the dedicated system user..."
|
ynh_script_progression --message="Removing the dedicated system user..."
|
||||||
|
|
||||||
# Delete a system user
|
# Delete a system user
|
||||||
ynh_system_user_delete --username="$app"
|
ynh_system_user_delete --username=$app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
true
|
ynh_clean_check_starting
|
||||||
}
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
@ -27,14 +27,14 @@ ynh_script_progression --message="Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..."
|
ynh_script_progression --message="Validating restoration parameters..."
|
||||||
|
|
||||||
test ! -d "$final_path" \
|
test ! -d $final_path \
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|| ynh_die --message="There is already a directory: $final_path "
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -45,7 +45,7 @@ test ! -d "$final_path" \
|
||||||
ynh_script_progression --message="Recreating the dedicated system user..."
|
ynh_script_progression --message="Recreating the dedicated system user..."
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create --username="$app" --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
|
@ -56,7 +56,7 @@ ynh_restore_file --origin_path="$final_path"
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R "$app":"$app" "$final_path"
|
chown -R $app:$app "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
|
@ -66,7 +66,7 @@ chown -R "$app":"$app" "$final_path"
|
||||||
ynh_script_progression --message="Reinstalling dependencies..."
|
ynh_script_progression --message="Reinstalling dependencies..."
|
||||||
|
|
||||||
# Define and install dependencies
|
# Define and install dependencies
|
||||||
ynh_install_app_dependencies "$pkg_dependencies"
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE VARIOUS FILES
|
# RESTORE VARIOUS FILES
|
||||||
|
@ -81,7 +81,7 @@ ynh_restore_file --origin_path="/etc/$app/"
|
||||||
ynh_script_progression --message="Restoring the systemd configuration..."
|
ynh_script_progression --message="Restoring the systemd configuration..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||||
systemctl enable "$app".service --quiet
|
systemctl enable $app.service --quiet
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE LOGROTATE CONFIGURATION
|
# RESTORE THE LOGROTATE CONFIGURATION
|
||||||
|
@ -95,14 +95,14 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||||
|
|
||||||
yunohost service add "$app" --description="$app daemon" --log="/var/log/$app/$app.log" --needs_exposed_ports="1965"
|
yunohost service add $app --description="$app daemon" --log="/var/log/$app/$app.log" --needs_exposed_ports="1965"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action="start" --line_match="Started" --log_path="systemd"
|
ynh_systemd_action --service_name=$app --action="start" --line_match="Started" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -16,7 +16,7 @@ ynh_script_progression --message="Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -33,6 +33,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
|
||||||
# Backup the current version of the app
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
ynh_backup_before_upgrade
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
|
ynh_clean_check_starting
|
||||||
# Restore it if the upgrade fails
|
# Restore it if the upgrade fails
|
||||||
ynh_restore_upgradebackup
|
ynh_restore_upgradebackup
|
||||||
}
|
}
|
||||||
|
@ -46,7 +47,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..."
|
ynh_script_progression --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action="stop" --line_match="Stopped" --log_path="systemd"
|
ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
@ -67,9 +68,9 @@ fi
|
||||||
ynh_script_progression --message="Making sure dedicated system user exists..."
|
ynh_script_progression --message="Making sure dedicated system user exists..."
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
# Create a dedicated user (if not existing)
|
||||||
ynh_system_user_create --username="$app" --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
usermod -a -G ssl-cert "$app"
|
usermod -a -G ssl-cert $app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -87,14 +88,14 @@ fi
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R "$app":"$app" "$final_path"
|
chown -R $app:$app "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# UPGRADE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading dependencies..."
|
ynh_script_progression --message="Upgrading dependencies..."
|
||||||
|
|
||||||
ynh_install_app_dependencies "$pkg_dependencies"
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
|
@ -107,14 +108,14 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
# Install rustup with the toolchain needed by Gemserv
|
# Install rustup with the toolchain needed by Gemserv
|
||||||
pushd "$final_path"
|
pushd "$final_path"
|
||||||
ynh_exec_as "$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 ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y'
|
||||||
popd
|
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
|
# Compile Gemserv
|
||||||
pushd "$final_path"/build
|
pushd "$final_path"/build
|
||||||
ynh_exec_warn_less ynh_exec_as "$app" env PATH="$PATH" cargo build --release
|
ynh_exec_warn_less ynh_exec_as $app env PATH="$PATH" cargo build --release
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Install Gemserv
|
# Install Gemserv
|
||||||
|
@ -135,12 +136,12 @@ mkdir -p "/etc/$app/config.d/"
|
||||||
|
|
||||||
chmod 750 "/etc/$app"
|
chmod 750 "/etc/$app"
|
||||||
chmod -R o-rwx "/etc/$app"
|
chmod -R o-rwx "/etc/$app"
|
||||||
chown -R "$app":"$app" "/etc/$app"
|
chown -R $app:$app "/etc/$app"
|
||||||
|
|
||||||
ynh_add_config --template="server.toml" --destination="/etc/$app/config.d/server.toml.head"
|
ynh_add_config --template="server.toml" --destination="/etc/$app/config.d/server.toml.head"
|
||||||
|
|
||||||
chmod 400 "/etc/$app/config.d/server.toml.head"
|
chmod 400 "/etc/$app/config.d/server.toml.head"
|
||||||
chown "$app":"$app" "/etc/$app/config.d/server.toml.head"
|
chown $app:$app "/etc/$app/config.d/server.toml.head"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
@ -165,14 +166,14 @@ ynh_use_logrotate --non-append
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||||
|
|
||||||
yunohost service add "$app" --description="$app daemon" --log="/var/log/$app/$app.log" --needs_exposed_ports="1965"
|
yunohost service add $app --description="$app daemon" --log="/var/log/$app/$app.log" --needs_exposed_ports="1965"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action="start" --line_match="Started" --log_path="systemd"
|
ynh_systemd_action --service_name=$app --action="start" --line_match="Started" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Reference in a new issue