mirror of
https://github.com/YunoHost-Apps/thelounge_ynh.git
synced 2024-09-03 20:35:54 +02:00
commit
0138e25f02
14 changed files with 117 additions and 97 deletions
8
.github/workflows/updater.sh
vendored
8
.github/workflows/updater.sh
vendored
|
@ -23,9 +23,9 @@ repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]
|
|||
version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
|
||||
assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'"))
|
||||
|
||||
# if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then
|
||||
# version=${version:1}
|
||||
# fi
|
||||
if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then
|
||||
version=${version:1}
|
||||
fi
|
||||
|
||||
# Setting up the environment variables
|
||||
echo "Current version: $current_version"
|
||||
|
@ -63,7 +63,7 @@ echo "Handling asset at $asset_url"
|
|||
# Here we base the source file name upon a unique keyword in the assets url (admin vs. update)
|
||||
# Leave $src empty to ignore the asset
|
||||
case $asset_url in
|
||||
*".zip"*)
|
||||
*".tar.gz"*)
|
||||
src="app"
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -23,7 +23,7 @@ Modern web IRC client designed for self-hosting
|
|||
- Responsive interface
|
||||
- Multi-user support
|
||||
|
||||
**Shipped version:** 4.2.0~ynh5
|
||||
**Shipped version:** 4.3.0~ynh1
|
||||
|
||||
**Demo:** https://demo.thelounge.chat/
|
||||
|
||||
|
|
12
README_fr.md
12
README_fr.md
|
@ -11,15 +11,15 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
|||
|
||||
## Vue d'ensemble
|
||||
|
||||
Modern web IRC client designed for self-hosting
|
||||
Client Web IRC moderne conçu pour l'auto-hébergement
|
||||
|
||||
### Features:
|
||||
### Caractéristiques:
|
||||
|
||||
- Always connected
|
||||
- Responsive interface
|
||||
- Multi-user support
|
||||
- Toujours connecté
|
||||
- Interface réactive
|
||||
- Support multi-utilisateurs
|
||||
|
||||
**Version incluse :** 4.2.0~ynh5
|
||||
**Version incluse :** 4.3.0~ynh1
|
||||
|
||||
**Démo :** https://demo.thelounge.chat/
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
#upgrade=1 from_commit=bd00c8e3ce43563f33fde073cf36b997c348d05c
|
||||
#upgrade=1 from_commit=3e641515e539d8c76c00ae3dc4d411e055510770
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
change_url=1
|
||||
|
@ -20,6 +20,6 @@
|
|||
Email=
|
||||
Notification=none
|
||||
;;; Upgrade options
|
||||
; commit=bd00c8e3ce43563f33fde073cf36b997c348d05c
|
||||
name=Merge pull request #25
|
||||
; commit=3e641515e539d8c76c00ae3dc4d411e055510770
|
||||
name=Merge pull request #42
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/thelounge/thelounge/archive/v4.2.0.tar.gz
|
||||
SOURCE_SUM=6119c0692f03678940848ec19a8095ba67f8fdba42bb12481205314eabc0672d
|
||||
SOURCE_URL=https://github.com/thelounge/thelounge/archive/v4.3.0.tar.gz
|
||||
SOURCE_SUM=fa3ced790927e64bfb0917dadd7702b811bcba92207b33f23bb1f7444ad0dfc9
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
ARCH_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=true
|
||||
|
|
|
@ -152,8 +152,9 @@ module.exports = {
|
|||
|
||||
// ### prefetchMaxSearchSize
|
||||
//
|
||||
// This value sets the maximum request size made to find the Open Graph tags
|
||||
// for link previews. For some sites like YouTube this can easily exceed 300
|
||||
// This value sets the maximum response size allowed when finding the Open
|
||||
// Graph tags for link previews. The entire response is temporarily stored
|
||||
// in memory and for some sites like YouTube this can easily exceed 300
|
||||
// kilobytes.
|
||||
//
|
||||
// This value is set to `50` kilobytes by default.
|
||||
|
@ -227,10 +228,11 @@ module.exports = {
|
|||
// numbers from 0 to 9. For example, `Guest%%%` may become `Guest123`.
|
||||
// - `username`: User name.
|
||||
// - `realname`: Real name.
|
||||
// - `leaveMessage`: Network specific leave message (overrides global leaveMessage)
|
||||
// - `join`: Comma-separated list of channels to auto-join once connected.
|
||||
//
|
||||
// This value is set to connect to the official channel of The Lounge on
|
||||
// irc.libera.chat by default:
|
||||
// Libera.Chat by default:
|
||||
//
|
||||
// ```js
|
||||
// defaults: {
|
||||
|
@ -257,6 +259,7 @@ module.exports = {
|
|||
username: "thelounge",
|
||||
realname: "The Lounge User",
|
||||
join: "#yunohost",
|
||||
leaveMessage: "",
|
||||
},
|
||||
|
||||
// ### `lockNetwork`
|
||||
|
@ -406,13 +409,25 @@ module.exports = {
|
|||
// For plain connections, use the `ldap` scheme.
|
||||
url: "ldap://127.0.0.1:389",
|
||||
|
||||
// - `tlsOptions`: LDAP connection TLS options (only used if scheme is
|
||||
// `ldaps://`). It is an object whose values are Node.js' `tls.connect()`
|
||||
// options. It is set to `{}` by default.
|
||||
// For example, this option can be used in order to force the use of IPv6:
|
||||
// ```js
|
||||
// {
|
||||
// host: 'my::ip::v6',
|
||||
// servername: 'example.com'
|
||||
// }
|
||||
// ```
|
||||
tlsOptions: {},
|
||||
|
||||
// - `primaryKey`: LDAP primary key. It is set to `"uid"` by default.
|
||||
primaryKey: "uid",
|
||||
|
||||
// - `baseDN`: LDAP base DN, alternative to `searchDN`. For example, set it
|
||||
// to `"ou=accounts,dc=example,dc=com"`.
|
||||
// When unset, the LDAP auth logic with use `searchDN` instead to locate users.
|
||||
baseDN: "ou=users,dc=yunohost,dc=org",
|
||||
baseDN: "ou=users,dc=yunohost,dc=org",
|
||||
},
|
||||
|
||||
// ## Debugging settings
|
||||
|
|
7
doc/DESCRIPTION_fr.md
Normal file
7
doc/DESCRIPTION_fr.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
Client Web IRC moderne conçu pour l'auto-hébergement
|
||||
|
||||
### Caractéristiques:
|
||||
|
||||
- Toujours connecté
|
||||
- Interface réactive
|
||||
- Support multi-utilisateurs
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Web IRC client",
|
||||
"fr": "Client Web IRC"
|
||||
},
|
||||
"version": "4.2.0~ynh5",
|
||||
"version": "4.3.0~ynh1",
|
||||
"url": "https://thelounge.chat/",
|
||||
"upstream": {
|
||||
"license": "MIT",
|
||||
|
@ -26,7 +26,7 @@
|
|||
"email": "beudbeud@beudibox.fr"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.2.4"
|
||||
"yunohost": ">= 4.3.0"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#=================================================
|
||||
|
||||
# nodejs version
|
||||
nodejs_version=14
|
||||
nodejs_version=16
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
|
|
|
@ -37,6 +37,12 @@ ynh_print_info --message="Declaring files to be backed up..."
|
|||
|
||||
ynh_backup --src_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# BACKUP DATADIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$datadir" --is_big
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -49,12 +55,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
|
||||
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||
|
||||
#=================================================
|
||||
# BACKUP CONFIG
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$datadir"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -29,7 +29,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
#=================================================
|
||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating installation parameters..."
|
||||
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
||||
|
||||
final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||
|
@ -40,7 +40,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
|||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Storing installation settings..."
|
||||
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
|
||||
|
@ -50,7 +50,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
|
|||
#=================================================
|
||||
# FIND AND OPEN A PORT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Finding an available port..."
|
||||
ynh_script_progression --message="Finding an available port..." --weight=1
|
||||
|
||||
# Find an available port
|
||||
port=$(ynh_find_port 9000)
|
||||
|
@ -59,7 +59,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
|||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..."
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=7
|
||||
|
||||
# Install Nodejs
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
@ -70,7 +70,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
|
|||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..."
|
||||
ynh_script_progression --message="Configuring system user..." --weight=1
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
@ -78,7 +78,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..."
|
||||
ynh_script_progression --message="Setting up source files..." --weight=4
|
||||
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
|
@ -91,7 +91,7 @@ chown -R $app:www-data "$final_path"
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring NGINX web server..."
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
@ -99,7 +99,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
# CREATE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a data directory..."
|
||||
ynh_script_progression --message="Creating a data directory..." --weight=1
|
||||
|
||||
datadir=/home/yunohost.app/$app
|
||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||
|
@ -115,26 +115,25 @@ chown -R $app:www-data "$datadir"
|
|||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Modifying a config file..."
|
||||
ynh_script_progression --message="Modifying a config file..." --weight=1
|
||||
|
||||
ynh_add_config --template="../conf/config.js" --destination="$datadir/config.js"
|
||||
|
||||
#=================================================
|
||||
# INSTALL THE LOUNGE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing The Lounge..."
|
||||
ynh_script_progression --message="Installing The Lounge..." --weight=10
|
||||
|
||||
pushd $final_path
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less NODE_ENV=production yarn install
|
||||
yarn add webpack webpack-dev-server --dev
|
||||
ynh_exec_warn_less NODE_ENV=production yarn build
|
||||
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install
|
||||
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production yarn build
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..."
|
||||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||
|
||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
ynh_add_systemd_config
|
||||
|
@ -142,14 +141,14 @@ ynh_add_systemd_config
|
|||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="Client Web IRC" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..."
|
||||
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
|
||||
|
@ -157,7 +156,7 @@ ynh_systemd_action --service_name=$app --action=start --log_path=systemd
|
|||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring permissions..."
|
||||
ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||
|
||||
# Make app public if necessary
|
||||
if [ $is_public -eq 1 ]
|
||||
|
@ -168,7 +167,7 @@ fi
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
@ -176,4 +175,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Installation of $app completed"
|
||||
ynh_script_progression --message="Installation of $app completed" --last
|
||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..."
|
||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -30,14 +30,14 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
|||
# 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
|
||||
then
|
||||
ynh_script_progression --message="Removing $app service..."
|
||||
ynh_script_progression --message="Removing $app service..." --weight=2
|
||||
yunohost service remove $app
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STOP AND REMOVE SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping and removing the systemd service..."
|
||||
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
ynh_remove_systemd_config
|
||||
|
@ -45,7 +45,7 @@ ynh_remove_systemd_config
|
|||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies..."
|
||||
ynh_script_progression --message="Removing dependencies..." --weight=1
|
||||
|
||||
# Remove NodeJS
|
||||
ynh_remove_nodejs
|
||||
|
@ -53,34 +53,36 @@ ynh_remove_nodejs
|
|||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing $app main directory..."
|
||||
ynh_script_progression --message="Removing $app main directory..." --weight=3
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
||||
#=================================================
|
||||
# REMOVE DATA DIR
|
||||
#=================================================
|
||||
|
||||
# Remove the data directory if --purge option is used
|
||||
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
|
||||
then
|
||||
ynh_script_progression --message="Removing app data directory..." --weight=2
|
||||
ynh_secure_remove --file="$datadir"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..."
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
||||
|
||||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC REMOVE
|
||||
#=================================================
|
||||
# REMOVE THE CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the config file..."
|
||||
|
||||
ynh_secure_remove --file="$datadir"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# REMOVE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the dedicated system user..."
|
||||
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
|
||||
|
||||
# Delete a system user
|
||||
ynh_system_user_delete --username=$app
|
||||
|
@ -89,4 +91,4 @@ ynh_system_user_delete --username=$app
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Removal of $app completed"
|
||||
ynh_script_progression --message="Removal of $app completed" --last
|
||||
|
|
|
@ -22,7 +22,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading settings..."
|
||||
ynh_script_progression --message="Loading settings..." --weight=1
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -34,24 +34,23 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir)
|
|||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..."
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the NGINX configuration..."
|
||||
ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..."
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
@ -59,7 +58,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring $app main directory..."
|
||||
ynh_script_progression --message="Restoring $app main directory..." --weight=5
|
||||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
|
@ -70,7 +69,7 @@ chown -R $app:www-data "$final_path"
|
|||
#=================================================
|
||||
# RESTORE THE CONFIG
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the config path..."
|
||||
ynh_script_progression --message="Restoring the config path..." --weight=2
|
||||
|
||||
ynh_restore_file --origin_path="$datadir" --not_mandatory
|
||||
|
||||
|
@ -85,7 +84,7 @@ chown -R $app:www-data "$datadir"
|
|||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..."
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=7
|
||||
|
||||
# Install Nodejs
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
@ -96,7 +95,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
|
|||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the systemd configuration..."
|
||||
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service --quiet
|
||||
|
@ -104,14 +103,14 @@ systemctl enable $app.service --quiet
|
|||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="Client Web IRC" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..."
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action=start --log_path=systemd
|
||||
|
||||
|
@ -120,7 +119,7 @@ ynh_systemd_action --service_name=$app --action=start --log_path=systemd
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
@ -128,4 +127,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Restoration completed for $app"
|
||||
ynh_script_progression --message="Restoration completed for $app" --last
|
||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..."
|
||||
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -25,14 +25,13 @@ port=$(ynh_app_setting_get --app=$app --key=port)
|
|||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Checking version..."
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
|
||||
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
|
||||
|
@ -47,7 +46,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
# If final_path doesn't exist, create it
|
||||
if [ -z "$final_path" ]; then
|
||||
|
@ -74,14 +73,14 @@ fi
|
|||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping a systemd service..."
|
||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action=stop --log_path=systemd
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Making sure dedicated system user exists..."
|
||||
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"
|
||||
|
@ -92,7 +91,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=2
|
||||
|
||||
ynh_secure_remove --file="$final_path"
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
|
@ -107,7 +106,7 @@ chown -R $app:www-data $datadir
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
@ -115,7 +114,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..."
|
||||
ynh_script_progression --message="Upgrading dependencies..." --weight=5
|
||||
|
||||
# Install Nodejs
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
|
@ -132,17 +131,16 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
|
|||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
pushd $final_path
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less NODE_ENV=production yarn install
|
||||
yarn add webpack webpack-dev-server --dev
|
||||
ynh_exec_warn_less NODE_ENV=production yarn build
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install
|
||||
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production yarn build
|
||||
popd
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading systemd configuration..."
|
||||
ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
|
||||
|
||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
|
||||
ynh_add_systemd_config
|
||||
|
@ -152,21 +150,21 @@ ynh_add_systemd_config
|
|||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add $app --description="Client Web IRC" --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..."
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action=start --log_path=systemd
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
@ -174,4 +172,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrade of $app completed"
|
||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||
|
|
Loading…
Reference in a new issue