diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml
index 4363d38..4a866ff 100644
--- a/.github/workflows/updater.yml
+++ b/.github/workflows/updater.yml
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch the source code
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run the updater script
@@ -33,7 +33,7 @@ jobs:
- name: Create Pull Request
id: cpr
if: ${{ env.PROCEED == 'true' }}
- uses: peter-evans/create-pull-request@v3
+ uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update to version ${{ env.VERSION }}
diff --git a/README.md b/README.md
index 6916fcf..36d225c 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,7 @@ It shall NOT be edited by hand.
# Calckey for YunoHost
[](https://dash.yunohost.org/appci/app/calckey)  
+
[](https://install-app.yunohost.org/?app=calckey)
*[Lire ce readme en français.](./README_fr.md)*
@@ -32,30 +33,6 @@ A greatly enhanced fork of Misskey with better UI/UX, security, features, and mo

-## Disclaimers / important information
-
-### Important points to read before installing
-
-- *Calckey* requires a dedicated root domain, e.g. `Calckey.domain.tld`
-- Due to Cypress dependency, *Calckey* only works on 64-bit CPU machines.
-- *Calckey* can take quite some time to install (more then 30 minutes). So take out some time and grab yourself a coffee.
-- If installing from command line, using `screen` is recommended to avoid disconnection. See below.
-- After installation, first page can take time to load and may show timeout error. Give it time to make itself ready for you. Refresh the page after 2 or 3 minutes.
-- The first account created will be an admin user and will have all the admin rights.
-
-Using screen in case of disconnects
-
-```
-sudo apt-get install screen
-screen
-sudo yunohost app install https://github.com/YunoHost-Apps/Calckey_ynh.git
-```
-Recover after disconnect:
-```
-screen -d
-screen -r
-```
-
## Documentation and resources
* Official app website:
diff --git a/README_fr.md b/README_fr.md
index e491ddc..3561cae 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -6,6 +6,7 @@ It shall NOT be edited by hand.
# Calckey pour YunoHost
[](https://dash.yunohost.org/appci/app/calckey)  
+
[](https://install-app.yunohost.org/?app=calckey)
*[Read this readme in english.](./README.md)*
@@ -30,30 +31,6 @@ Un fork grandement amélioré de Misskey avec une meilleure UI/UX, sécurité, f

-## Avertissements / informations importantes
-
-### Points importants à lire avant l'installation
-
-- *Calckey* nécessite un domaine racine dédié, par ex. `Calckey.domain.tld`
-- En raison de la dépendance de Cypress, *Calckey* ne fonctionne que sur les machines à processeur 64 bits.
-- *Calckey* peut prendre un certain temps à installer (plus de 30 minutes). Alors prenez un peu de temps et prenez un café.
-- Si l'installation à partir de la ligne de commande, l'utilisation de l'écran est réenregistrée pour éviter la déconnexion. Voir ci-dessous.
-- Après l'installation, la première page peut prendre du temps à charger et peut afficher une erreur de délai d'attente. Donnez-lui le temps de se préparer pour vous. Actualiser la page après 2-3 minutes.
-- Le premier compte créé sera un utilisateur administrateur et disposera de tous les droits d'administrateur.
-
-Utiliser *screen* en cas de déconnexion
-
-```
-sudo apt-get install screen
-screen
-sudo yunohost app install https://github.com/YunoHost-Apps/Calckey_ynh.git
-```
-Récupérer après déconnexion :
-```
-screen -d
-screen -r
-```
-
## Documentations et ressources
* Site officiel de l’app :
diff --git a/check_process b/check_process
deleted file mode 100644
index 43ab1de..0000000
--- a/check_process
+++ /dev/null
@@ -1,25 +0,0 @@
-;; Test complet
- ; Manifest
- domain="domain.tld"
- is_public=1
-
- ; Checks
- pkg_linter=1
- setup_sub_dir=0
- setup_root=1
- setup_nourl=0
- setup_private=1
- setup_public=1
- upgrade=1
- # v13.0.5
- upgrade=1 from_commit=89f4f52e3cb3c9daf8eff43aab67bcda475da410
- backup_restore=1
- multi_instance=0
- change_url=0
-;;; Options
-Email=
-Notification=none
-;;; Upgrade options
- ; commit=CommitHash
- name=Name and date of the commit.
- manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666&
diff --git a/conf/nginx.conf b/conf/nginx.conf
index 32ad407..b62c14a 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -1,6 +1,7 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
+
proxy_pass http://127.0.0.1:__PORT__;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
diff --git a/conf/systemd.service b/conf/systemd.service
index 2b708ad..9d771d3 100644
--- a/conf/systemd.service
+++ b/conf/systemd.service
@@ -6,7 +6,7 @@ After=network.target
Type=simple
User=__APP__
Group=__APP__
-WorkingDirectory=__FINALPATH__/
+WorkingDirectory=__INSTALL_DIR__/
Environment="__YNH_NODE_LOAD_PATH__"
Environment="NODE_ENV=production"
ExecStart=__YNH_NPM__ start
diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md
deleted file mode 100644
index 30a50d5..0000000
--- a/doc/DISCLAIMER.md
+++ /dev/null
@@ -1,21 +0,0 @@
-### Important points to read before installing
-
-- *Calckey* requires a dedicated root domain, e.g. `Calckey.domain.tld`
-- Due to Cypress dependency, *Calckey* only works on 64-bit CPU machines.
-- *Calckey* can take quite some time to install (more then 30 minutes). So take out some time and grab yourself a coffee.
-- If installing from command line, using `screen` is recommended to avoid disconnection. See below.
-- After installation, first page can take time to load and may show timeout error. Give it time to make itself ready for you. Refresh the page after 2 or 3 minutes.
-- The first account created will be an admin user and will have all the admin rights.
-
-Using screen in case of disconnects
-
-```
-sudo apt-get install screen
-screen
-sudo yunohost app install https://github.com/YunoHost-Apps/Calckey_ynh.git
-```
-Recover after disconnect:
-```
-screen -d
-screen -r
-```
diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md
deleted file mode 100644
index a63adab..0000000
--- a/doc/DISCLAIMER_fr.md
+++ /dev/null
@@ -1,21 +0,0 @@
-### Points importants à lire avant l'installation
-
-- *Calckey* nécessite un domaine racine dédié, par ex. `Calckey.domain.tld`
-- En raison de la dépendance de Cypress, *Calckey* ne fonctionne que sur les machines à processeur 64 bits.
-- *Calckey* peut prendre un certain temps à installer (plus de 30 minutes). Alors prenez un peu de temps et prenez un café.
-- Si l'installation à partir de la ligne de commande, l'utilisation de l'écran est réenregistrée pour éviter la déconnexion. Voir ci-dessous.
-- Après l'installation, la première page peut prendre du temps à charger et peut afficher une erreur de délai d'attente. Donnez-lui le temps de se préparer pour vous. Actualiser la page après 2-3 minutes.
-- Le premier compte créé sera un utilisateur administrateur et disposera de tous les droits d'administrateur.
-
-Utiliser *screen* en cas de déconnexion
-
-```
-sudo apt-get install screen
-screen
-sudo yunohost app install https://github.com/YunoHost-Apps/Calckey_ynh.git
-```
-Récupérer après déconnexion :
-```
-screen -d
-screen -r
-```
diff --git a/manifest.json b/manifest.json
deleted file mode 100644
index bbfeb05..0000000
--- a/manifest.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "name": "Calckey",
- "id": "calckey",
- "packaging_format": 1,
- "description": {
- "en": "Fork of Misskey with better UI/UX, security, features",
- "fr": "Un fork de Misskey avec une meilleure interface utilisateur, la sécurité, les fonctionnalités"
- },
- "version": "13.1.2~ynh1",
- "url": "https://i.calckey.cloud/",
- "upstream": {
- "license": "AGPL-3.0",
- "website": "https://i.calckey.cloud/",
- "demo": "https://i.calckey.cloud/",
- "code": "https://codeberg.org/calckey/calckey"
- },
- "license": "AGPL-3.0",
- "maintainer": {
- "name": "oufmilo"
- },
- "requirements": {
- "yunohost": ">= 11.0.0"
- },
- "multi_instance": false,
- "services": [
- "nginx"
- ],
- "arguments": {
- "install": [
- {
- "name": "domain",
- "type": "domain"
- },
-
- {
- "name": "is_public",
- "type": "boolean",
- "help": {
- "en": "If enabled, Calckey will be accessible by people who do not have an account. This can be changed later via the webadmin.",
- "fr": "Si cette case est cochée, Calckey sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
- },
- "default": true
- }
- ]
- }
-}
diff --git a/manifest.toml b/manifest.toml
new file mode 100644
index 0000000..d3bc8e1
--- /dev/null
+++ b/manifest.toml
@@ -0,0 +1,55 @@
+packaging_format = 2
+
+id = "calckey"
+name = "Calckey"
+description.en = "Fork of Misskey with better UI/UX, security, features"
+description.fr = "Un fork de Misskey avec une meilleure interface utilisateur, la sécurité, les fonctionnalités"
+
+version = "13.1.2~ynh1"
+
+maintainers = ["oufmilo"]
+
+[upstream]
+license = "AGPL-3.0"
+website = "https://i.calckey.cloud/"
+demo = "https://i.calckey.cloud/"
+code = "https://codeberg.org/calckey/calckey"
+
+[integration]
+yunohost = ">= 11.0.0"
+architectures = "all"
+multi_instance = false
+ldap = "not_relevant"
+sso = "not_relevant"
+disk = "50M"
+ram.build = "50M"
+ram.runtime = "50M"
+
+[install]
+ [install.domain]
+ # this is a generic question - ask strings are automatically handled by Yunohost's core
+ type = "domain"
+ full_domain = true
+
+ [install.init_main_permission]
+ help.en = "If enabled, Calckey will be accessible by people who do not have an account. This can be changed later via the webadmin."
+ help.fr = "Si cette case est cochée, Calckey sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
+ type = "group"
+ default = "visitors"
+
+[resources]
+ [resources.system_user]
+
+ [resources.install_dir]
+
+ [resources.permissions]
+ main.url = "/"
+
+ [resources.ports]
+ main.default = 3020
+
+ [resources.apt]
+ packages = "ffmpeg, postgresql, build-essential"
+
+ [resources.database]
+ type = "postgresql"
\ No newline at end of file
diff --git a/scripts/backup b/scripts/backup
index 37a5e95..b88b274 100755
--- a/scripts/backup
+++ b/scripts/backup
@@ -10,26 +10,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-ynh_clean_setup () {
- true
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_print_info --message="Loading installation settings..."
-
-app=$YNH_APP_INSTANCE_NAME
-
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
@@ -40,7 +20,7 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================
-ynh_backup --src_path="$final_path"
+ynh_backup --src_path="$install_dir"
#=================================================
# BACKUP THE NGINX CONFIGURATION
diff --git a/scripts/install b/scripts/install
index b2b6dea..6be975a 100644
--- a/scripts/install
+++ b/scripts/install
@@ -9,61 +9,15 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-ynh_clean_setup () {
- ynh_clean_check_starting
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
-domain=$YNH_APP_ARG_DOMAIN
-path_url="/"
-is_public=$YNH_APP_ARG_IS_PUBLIC
-app=$YNH_APP_INSTANCE_NAME
-
-#=================================================
-# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
-#=================================================
-ynh_script_progression --message="Validating installation parameters..." --weight=1
-
-# Check machine architecture (in particular, we don't support ARM and 32bit machines)
-if [ $YNH_ARCH != "amd64" ] && [ $YNH_ARCH != "aarch64" ] && [ $YNH_ARCH != "arm64" ]
-then
- ynh_die --message="Sorry, but this app can only be installed on a 64 bits machine :("
-fi
-
-final_path=/var/www/$app
-test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
-
-# Register (book) web path
-ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
-
-#=================================================
-# STORE SETTINGS FROM MANIFEST
-#=================================================
-ynh_script_progression --message="Storing installation settings..." --weight=1
-
-ynh_app_setting_set --app=$app --key=domain --value=$domain
-ynh_app_setting_set --app=$app --key=path --value=$path_url
#=================================================
# STANDARD MODIFICATIONS
#=================================================
-# FIND AND OPEN A PORT
-#=================================================
-ynh_script_progression --message="Finding an available port..." --weight=1
-
-# Find an available port
-port=$(ynh_find_port --port=3020)
-ynh_app_setting_set --app=$app --key=port --value=$port
#=================================================
# INSTALL DEPENDENCIES
@@ -72,39 +26,15 @@ ynh_script_progression --message="Installing dependencies... This might take som
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
-ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
-
-#=================================================
-# CREATE DEDICATED USER
-#=================================================
-ynh_script_progression --message="Configuring system user..." --weight=2
-
-# Create a system user
-ynh_system_user_create --username=$app --home_dir="$final_path"
-
-#=================================================
-# CREATE A POSTGRESQL DATABASE
-#=================================================
-ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
-
-db_name=$(ynh_sanitize_dbid --db_name=$app)
-db_user=$db_name
-ynh_app_setting_set --app=$app --key=db_name --value=$db_name
-ynh_psql_test_if_first_run
-ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
-
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=3
-ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
-ynh_setup_source --dest_dir="$final_path"
+ynh_setup_source --dest_dir="$install_dir"
-chmod 750 "$final_path"
-chmod -R o-rwx "$final_path"
-chown -R $app:www-data "$final_path"
+chown -R $app:www-data "$install_dir"
#=================================================
# NGINX CONFIGURATION
@@ -123,14 +53,20 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1
redis_db=$(ynh_redis_get_free_db)
ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
-ynh_add_config --template="../conf/default.yml" --destination="$final_path/.config/default.yml"
+ynh_add_config --template="../conf/default.yml" --destination="$install_dir/.config/default.yml"
+
+chmod 750 "$install_dir"
+chmod -R o-rwx "$install_dir"
+chown -R $app:www-data "$install_dir"
+chmod 400 "$install_dir/.config/default.yml"
+chown $app:$app "$install_dir/.config/default.yml"
#=================================================
# BUILD APP
#=================================================
ynh_script_progression --message="Building app... This will take some time." --weight=15
-pushd "$final_path"
+pushd "$install_dir"
ynh_use_nodejs
corepack enable
corepack prepare pnpm@latest --activate
@@ -171,23 +107,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="All workers started"
-#=================================================
-# SETUP SSOWAT
-#=================================================
-ynh_script_progression --message="Configuring permissions..." --weight=1
-
-# Make app public if necessary
-if [ $is_public -eq 1 ]
-then
- ynh_permission_update --permission="main" --add="visitors"
-fi
-
-#=================================================
-# RELOAD NGINX
-#=================================================
-ynh_script_progression --message="Reloading NGINX web server..."
-
-ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
diff --git a/scripts/remove b/scripts/remove
index b4d4187..1164548 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -9,19 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..."
-
-app=$YNH_APP_INSTANCE_NAME
-
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-port=$(ynh_app_setting_get --app=$app --key=port)
-db_name=$(ynh_app_setting_get --app=$app --key=db_name)
-db_user=$db_name
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
#=================================================
# STANDARD REMOVE
@@ -52,14 +39,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
# Remove the app-specific logrotate config
ynh_remove_logrotate
-#=================================================
-# REMOVE THE POSTGRESQL DATABASE
-#=================================================
-ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1
-
-# Remove a database if it exists, along with the associated user
-ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
-
#=================================================
# REMOVE THE REDIS DATABASE
#=================================================
@@ -67,14 +46,6 @@ ynh_script_progression --message="Removing the redis database..." --weight=1
ynh_redis_remove_db "$redis_db"
-#=================================================
-# REMOVE APP MAIN DIR
-#=================================================
-ynh_script_progression --message="Removing app main directory..." --weight=1
-
-# Remove the app directory securely
-ynh_secure_remove --file="$final_path"
-
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
@@ -90,7 +61,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies
ynh_remove_nodejs
-ynh_remove_app_dependencies
#=================================================
# SPECIFIC REMOVE
@@ -104,12 +74,6 @@ ynh_secure_remove --file="/var/log/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
-# REMOVE DEDICATED USER
-#=================================================
-ynh_script_progression --message="Removing the dedicated system user..." --weight=1
-
-# Delete a system user
-ynh_system_user_delete --username=$app
#=================================================
# END OF SCRIPT
diff --git a/scripts/restore b/scripts/restore
index 2e6e9c9..0fea344 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -10,58 +10,16 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-ynh_clean_setup () {
- ynh_clean_check_starting
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..."
-
-app=$YNH_APP_INSTANCE_NAME
-
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-path_url=$(ynh_app_setting_get --app=$app --key=path)
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-db_name=$(ynh_app_setting_get --app=$app --key=db_name)
-db_user=$db_name
-db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
-
-#=================================================
-# CHECK IF THE APP CAN BE RESTORED
-#=================================================
-ynh_script_progression --message="Validating restoration parameters..." --weight=1
-
-test ! -d $final_path \
- || ynh_die --message="There is already a directory: $final_path "
-
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
-# RECREATE THE DEDICATED USER
-#=================================================
-ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
-
-# Create the dedicated user (if not existing)
-ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=1
-ynh_restore_file --origin_path="$final_path"
-
-chmod 750 "$final_path"
-chmod -R o-rwx "$final_path"
-chown -R $app:www-data "$final_path"
+ynh_restore_file --origin_path="$install_dir"
#=================================================
# SPECIFIC RESTORATION
@@ -72,7 +30,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=5
# Define and install dependencies
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
-ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
#=================================================
# REINSTALL PNPM
@@ -80,7 +37,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Reinstalling pnpm..." --weight=1
# Define and install pnpm
-pushd "$final_path"
+pushd "$install_dir"
ynh_use_nodejs
corepack enable
corepack prepare pnpm@latest --activate
@@ -100,10 +57,16 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
-ynh_psql_test_if_first_run
-ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
+#=================================================
+# SECURE FILES AND DIRECTORIES
+#=================================================
+
+# Set permissions to app files
+chmod -R o-rwx "$install_dir"
+chown -R $app:www-data "$install_dir"
+
#=================================================
# RESTORE SYSTEMD
#=================================================
diff --git a/scripts/upgrade b/scripts/upgrade
index ed1c22f..aca8f7e 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -9,19 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-app=$YNH_APP_INSTANCE_NAME
-
-domain=$(ynh_app_setting_get --app=$app --key=domain)
-path_url=$(ynh_app_setting_get --app=$app --key=path)
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-db_name=$(ynh_app_setting_get --app=$app --key=db_name)
-db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
-port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# CHECK VERSION
@@ -52,16 +39,6 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
-# 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
-}
-# Exit if an error occurs during the execution of the script
-ynh_abort_if_errors
-
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
@@ -75,28 +52,12 @@ if [ -z "$db_name" ]; then
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
fi
-# If final_path doesn't exist, create it
-if [ -z "$final_path" ]; then
- final_path=/var/www/$app
- ynh_app_setting_set --app=$app --key=final_path --value=$final_path
+# If install_dir doesn't exist, create it
+if [ -z "$install_dir" ]; then
+ install_dir=/var/www/$app
+ ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir
fi
-# Cleaning legacy permissions
-if ynh_legacy_permissions_exists; then
- ynh_legacy_permissions_delete_all
-
- ynh_app_setting_delete --app=$app --key=is_public
-fi
-
-
-#=================================================
-# CREATE DEDICATED USER
-#=================================================
-ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
-
-# Create a dedicated user (if not existing)
-ynh_system_user_create --username=$app --home_dir="$final_path"
-
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@@ -106,12 +67,12 @@ then
ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
- ynh_setup_source --dest_dir="$final_path" --keep=".config/default.yml"
+ ynh_setup_source --dest_dir="$install_dir" --keep=".config/default.yml"
fi
-chmod 750 "$final_path"
-chmod -R o-rwx "$final_path"
-chown -R $app:www-data "$final_path"
+chmod 750 "$install_dir"
+chmod -R o-rwx "$install_dir"
+chown -R $app:www-data "$install_dir"
#=================================================
# UPGRADE DEPENDENCIES
@@ -119,11 +80,10 @@ chown -R $app:www-data "$final_path"
ynh_script_progression --message="Upgrading dependencies..." --weight=5
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
-ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
# REMOVE YARN (upgrade from 13.0.x to 13.1.x)
ynh_script_progression --message="Removing old version dependency..."
-ynh_secure_remove --file="$final_path/.yarn"
+ynh_secure_remove --file="$install_dir/.yarn"
#=================================================
# NGINX CONFIGURATION
@@ -138,7 +98,7 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Building app..."
-pushd "$final_path"
+pushd "$install_dir"
corepack enable
corepack prepare pnpm@latest --activate
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm clean-all
@@ -179,12 +139,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="All workers started"
-#=================================================
-# RELOAD NGINX
-#=================================================
-ynh_script_progression --message="Reloading NGINX web server..." --weight=1
-
-ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
diff --git a/tests.toml b/tests.toml
new file mode 100644
index 0000000..71e7a74
--- /dev/null
+++ b/tests.toml
@@ -0,0 +1,17 @@
+test_format = 1.0
+
+[default]
+
+ # ------------
+ # Tests to run
+ # ------------
+
+ # -------------------------------
+ # Default args to use for install
+ # -------------------------------
+ exclude = ["change_url"]
+ # -------------------------------
+ # Commits to test upgrade from
+ # -------------------------------
+
+ test_upgrade_from.89f4f52.name = "Upgrade from 13.0.5"