1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/teddit_ynh.git synced 2024-09-03 20:26:31 +02:00

Merge pull request #7 from YunoHost-Apps/testing

Testing
This commit is contained in:
eric_G 2023-12-23 10:37:06 +01:00 committed by GitHub
commit 8b8af9c137
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 78 deletions

View file

@ -28,7 +28,7 @@ A free and open source alternative Reddit front-end focused on privacy. Inspired
**Shipped version:** 0.4.0~ynh4
**Shipped version:** 0.4.0~ynh5
**Demo:** https://teddit.net/

View file

@ -28,7 +28,7 @@ A free and open source alternative Reddit front-end focused on privacy. Inspired
**Version incluse :** 0.4.0~ynh4
**Version incluse :** 0.4.0~ynh5
**Démo :** https://teddit.net/

View file

@ -5,7 +5,7 @@ name = "Teddit"
description.en = "Open source alternative Reddit front-end"
description.fr = "Front-end libre alternatif à Reddit"
version = "0.4.0~ynh4"
version = "0.4.0~ynh5"
maintainers = ["eric_G"]
@ -19,8 +19,11 @@ code = "https://codeberg.org/teddit/teddit"
yunohost = ">= 11.2"
architectures = "all"
multi_instance = true
ldap = false
sso = true
disk = "50M"
ram.build = "50M"
ram.runtime = "50M"
@ -28,7 +31,6 @@ ram.runtime = "50M"
[install]
[install.domain]
type = "domain"
full_domain = true
[install.init_main_permission]
help.en = "If enabled, Teddit will be accessible by people who do not have an account. This can be changed later via the webadmin."
@ -38,8 +40,8 @@ ram.runtime = "50M"
[resources]
[resources.sources.main]
url = "https://codeberg.org/teddit/teddit/archive/b0ce6c52a66987543707d3559d50e4dc2d35a3e8.tar.gz"
sha256 = "89a0d5e95692d32c9b28d1c626ec74cb5803737abd29be9f739bbb002c6c1bb1"
url = "https://codeberg.org/teddit/teddit/archive/4536a7f4608f0f17bbee4188f9875fad8bfa954f.tar.gz"
sha256 = "e2806688d171c6ec5e0e63d0e3ae3ac4c35e125a4d750c7f74187407d7565c0e"
[resources.ports]

View file

@ -22,7 +22,6 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=3
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
@ -33,15 +32,20 @@ chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
env_path="$PATH"
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Open source alternative Reddit front-end" --log="/var/log/$app/$app.log"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/config.js.template" --destination="$install_dir/config.js"
ynh_add_config --template="config.js.template" --destination="$install_dir/config.js"
chmod 400 "$install_dir/config.js"
chown $app:$app "$install_dir/config.js"
@ -56,22 +60,6 @@ pushd $install_dir
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --no-optional
popd
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1
env_path="$PATH"
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Open source alternative Reddit front-end" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================

View file

@ -22,27 +22,12 @@ then
yunohost service remove $app
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
# Remove the dedicated systemd config
ynh_remove_systemd_config
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=4
# Remove NodeJS
ynh_remove_nodejs

View file

@ -10,15 +10,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
@ -44,14 +35,11 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Open source alternative Reddit front-end" --log="/var/log/$app/$app.log"
#=================================================
@ -61,13 +49,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND PHP-FPM
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#=================================================

View file

@ -32,13 +32,20 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=3
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="config.js"
fi
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=5
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -47,6 +54,12 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config
ynh_add_nginx_config
env_path="$PATH"
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Open source alternative Reddit front-end" --log="/var/log/$app/$app.log"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
@ -67,22 +80,6 @@ pushd $install_dir
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --no-optional
popd
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
env_path="$PATH"
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Open source alternative Reddit front-end" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================