1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lutim_ynh.git synced 2024-09-03 19:36:24 +02:00
* Upgrade to v.0.12.1

Co-authored-by: Maniack Crudelis <maniackcrudelis@users.noreply.github.com>
Co-authored-by: Augustin Trancart <augustin.trancart@oslandia.com>
This commit is contained in:
Éric Gaspar 2020-11-13 12:45:25 +01:00 committed by GitHub
parent 2e1395cccf
commit aa21d2d428
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 90 additions and 255 deletions

View file

@ -1,8 +1,11 @@
Changelog Changelog
========= =========
## Unreleased ## [0.12.1~ynh1](https://github.com/YunoHost-Apps/lutim_ynh/pull/46) - 2020-10-18
- Nothing for now...
#### Changed
* [Update to Lutim 0.12.1](https://github.com/YunoHost-Apps/lutim_ynh/pull/52)
## [0.11.6~ynh4](https://github.com/YunoHost-Apps/lutim_ynh/pull/46) - 2020-04-25 ## [0.11.6~ynh4](https://github.com/YunoHost-Apps/lutim_ynh/pull/46) - 2020-04-25

View file

@ -13,7 +13,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
Lutim stores images and allows you to see them, download them or share them on social networks. Lutim stores images and allows you to see them, download them or share them on social networks.
Images are indefinitely stored unless you request that they will be deleted at first view or after 24 hours / one week / one month / one year. Images are indefinitely stored unless you request that they will be deleted at first view or after 24 hours / one week / one month / one year.
**Shipped version:** 0.11.6 **Shipped version:** 0.12.1
## Screenshots ## Screenshots
@ -23,13 +23,13 @@ Images are indefinitely stored unless you request that they will be deleted at f
## Configuration ## Configuration
Edit the file `/var/www/lutim/lutim.conf` to edit the configuration of Lutim. Edit the file `/var/www/lutim/lutim.conf` to configure Lutim.
Then reload the lutim service. Then reload the lutim service.
## Documentation ## Documentation
* Official documentation: https://framagit.org/luc/lutim/wikis/home * Official documentation: https://framagit.org/luc/lutim/wikis/home
* YunoHost documentation: There no other documentations, feel free to contribute. * YunoHost documentation: https://yunohost.org/#/app_lutim
## YunoHost specific features ## YunoHost specific features
@ -39,9 +39,8 @@ Not relevant.
#### Supported architectures #### Supported architectures
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lutim/) * x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lutim/)
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lutim/) * ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lutim/)
* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/lutim%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/lutim/)
## Limitations ## Limitations
@ -56,8 +55,7 @@ Not relevant.
--- ---
Developers infos ## Developers infos
----------------
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/lutim_ynh/tree/testing). Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/lutim_ynh/tree/testing).

View file

@ -8,12 +8,12 @@
> *Ce package vous permet d'installer Lutim rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet d'installer Lutim rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/install_fr) pour savoir comment l'installer et en profiter.* Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/install_fr) pour savoir comment l'installer et en profiter.*
## Résumé ## Vue d'ensemble
Lutim stocke les images et vous permet de les voir, de les télécharger ou de les partager sur les réseaux sociaux. Lutim stocke les images et vous permet de les voir, de les télécharger ou de les partager sur les réseaux sociaux.
Les images sont stockées indéfiniment à moins que vous ne demandiez qu'elles soient effacées à la première vue ou après 24 heures / une semaine / un mois / un an. Les images sont stockées indéfiniment à moins que vous ne demandiez qu'elles soient effacées à la première vue ou après 24 heures / une semaine / un mois / un an.
**Version embarquée:** 0.11.6 **Version embarquée :** 0.12.1
## Captures d'écran ## Captures d'écran
@ -23,13 +23,13 @@ Les images sont stockées indéfiniment à moins que vous ne demandiez qu'elles
## Configuration ## Configuration
Editez le fichier `/var/www/lutim/lutim.conf` pour éditer la configuration de Lutim. Éditez le fichier `/var/www/lutim/lutim.conf` pour configurer Lutim.
Rechargez ensuite le service lutim. Rechargez ensuite le service Lutim.
## Documentation ## Documentation
* Documentation officielle: https://framagit.org/luc/lutim/wikis/home * Documentation officielle : https://framagit.org/luc/lutim/wikis/home
* Documentation YunoHost: Il n'y a pas d'autre documentation, n'hésitez pas à contribuer. * Documentation YunoHost : https://yunohost.org/#/app_lutim_fr
## Fonctionnalités spécifiques à YunoHost ## Fonctionnalités spécifiques à YunoHost
@ -39,9 +39,8 @@ Non applicable.
#### Architectures supportées. #### Architectures supportées.
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lutim/) * x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lutim/)
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lutim/) * ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/lutim%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lutim/)
* Buster x86-64b - [![](https://ci-buster.nohost.me/ci/logs/lutim%20%28Apps%29.svg)](https://ci-buster.nohost.me/ci/apps/lutim/)
## Limitations ## Limitations
@ -49,15 +48,14 @@ Non applicable.
## Liens ## Liens
* Reporter un bug: https://github.com/YunoHost-Apps/lutim_ynh/issues * Reporter un bug : https://github.com/YunoHost-Apps/lutim_ynh/issues
* Site de Lutim: https://lut.im/ * Site de Lutim : https://lut.im/
* Dépôt de Lutim: https://framagit.org/fiat-tux/hat-softwares/lutim * Dépôt de Lutim : https://framagit.org/fiat-tux/hat-softwares/lutim
* Site de YunoHost: https://yunohost.org/ * Site de YunoHost : https://yunohost.org/
--- ---
Informations à l'intention des développeurs ## Informations à l'intention des développeurs
----------------
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/lutim_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/lutim_ynh/tree/testing).

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://framagit.org/fiat-tux/hat-softwares/lutim/-/archive/0.11.6/lutim-0.11.6.tar.gz SOURCE_URL=https://framagit.org/fiat-tux/hat-softwares/lutim/-/archive/0.12.1/lutim-0.12.1.tar.gz
SOURCE_SUM=092fc5b914fc8a2dd46f7101fe94c493 SOURCE_SUM=141f142d47e3a8367e0c292304ddbecfc34b49ae7e561e2c3526000040318973
SOURCE_SUM_PRG=md5sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME= SOURCE_FILENAME=

View file

@ -3,10 +3,9 @@ Description=Image hosting and sharing service
After=network.target After=network.target
[Service] [Service]
Type=simple Type=forking
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
RemainAfterExit=yes
WorkingDirectory=__FINALPATH__/ WorkingDirectory=__FINALPATH__/
PIDFile=__FINALPATH__/script/hypnotoad.pid PIDFile=__FINALPATH__/script/hypnotoad.pid
ExecStart=/usr/bin/carton exec hypnotoad script/lutim >> /var/log/lutim/production.log 2>&1 ExecStart=/usr/bin/carton exec hypnotoad script/lutim >> /var/log/lutim/production.log 2>&1

View file

@ -8,7 +8,7 @@ name = "Lutim configuration"
name = "Lutim configuration" name = "Lutim configuration"
[main.configuration.always_encrypt] [main.configuration.always_encrypt]
ask = "Force the encryption of images ?" ask = "Force the encryption of images?"
type = "boolean" type = "boolean"
default = true default = true
@ -28,19 +28,19 @@ name = "Lutim configuration"
name = "Overwriting config files" name = "Overwriting config files"
[main.overwrite_files.overwrite_settings] [main.overwrite_files.overwrite_settings]
ask = "Overwrite the config file lutim.conf ?" ask = "Overwrite the config file lutim.conf?"
type = "boolean" type = "boolean"
default = true default = true
help = "If the file is overwritten, a backup will be created." help = "If the file is overwritten, a backup will be created."
[main.overwrite_files.overwrite_nginx] [main.overwrite_files.overwrite_nginx]
ask = "Overwrite the nginx config file ?" ask = "Overwrite the nginx config file?"
type = "boolean" type = "boolean"
default = true default = true
help = "If the file is overwritten, a backup will be created." help = "If the file is overwritten, a backup will be created."
[main.overwrite_files.overwrite_systemd] [main.overwrite_files.overwrite_systemd]
ask = "Overwrite the systemd config file ?" ask = "Overwrite the systemd config file?"
type = "boolean" type = "boolean"
default = true default = true
help = "If the file is overwritten, a backup will be created." help = "If the file is overwritten, a backup will be created."
@ -49,7 +49,7 @@ name = "Lutim configuration"
name = "Global configuration" name = "Global configuration"
[main.global_config.email_type] [main.global_config.email_type]
ask = "Send HTML email to admin ?" ask = "Send HTML email to admin?"
type = "boolean" type = "boolean"
default = true default = true
help = "Allow app scripts to send HTML mails instead of plain text." help = "Allow app scripts to send HTML mails instead of plain text."

View file

@ -6,7 +6,7 @@
"en": "Self hosting images and sharing anonymous application", "en": "Self hosting images and sharing anonymous application",
"fr": "Application d'hébergement et de partage d'images anonyme" "fr": "Application d'hébergement et de partage d'images anonyme"
}, },
"version": "0.11.6~ynh4", "version": "0.12.1~ynh1",
"url": "https://lut.im", "url": "https://lut.im",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"maintainer": { "maintainer": {
@ -18,7 +18,7 @@
"email": "maniackc_dev@crudelis.fr" "email": "maniackc_dev@crudelis.fr"
}], }],
"requirements": { "requirements": {
"yunohost": ">= 3.7" "yunohost": ">= 3.8.1"
}, },
"multi_instance": false, "multi_instance": false,
"services": [ "services": [
@ -54,7 +54,8 @@
}, },
"default": false, "default": false,
"help": { "help": {
"en": "If you set Lutim as public, everyone will be able to upload images and share them.<br>But even if not public, everyone can see an image from a link shared with your Lutim." "en": "If you set Lutim as public, everyone will be able to upload images and share them.<br>But even if not public, everyone can see an image from a link shared with your Lutim.",
"fr": "Si vous définissez Lutim comme public, tout le monde pourra télécharger des images et les partager.<br>Mais même si ce n'est pas public, tout le monde peut voir une image à partir d'un lien partagé avec votre Lutim."
} }
}, },
{ {

View file

@ -1,9 +1,11 @@
#!/bin/bash #!/bin/bash
#================================================= #=================================================
# PERSONAL HELPERS # COMMON VARIABLES
#================================================= #=================================================
pkg_depencencies="carton perlmagick libpq-dev shared-mime-info"
#================================================= #=================================================
# BACKUP # BACKUP
#================================================= #=================================================
@ -265,27 +267,27 @@ __PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/service
#================================================= #=================================================
ynh_debian_release () { # ynh_debian_release () {
lsb_release --codename --short # lsb_release --codename --short
} # }
is_stretch () { # is_stretch () {
if [ "$(ynh_debian_release)" == "stretch" ] # if [ "$(ynh_debian_release)" == "stretch" ]
then # then
return 0 # return 0
else # else
return 1 # return 1
fi # fi
} # }
is_jessie () { # is_jessie () {
if [ "$(ynh_debian_release)" == "jessie" ] # if [ "$(ynh_debian_release)" == "jessie" ]
then # then
return 0 # return 0
else # else
return 1 # return 1
fi # fi
} # }
#================================================= #=================================================
@ -579,160 +581,6 @@ ynh_check_ram () {
fi fi
} }
#=================================================
# Define the values to configure php-fpm
#
# usage: ynh_get_scalable_phpfpm --usage=usage --footprint=footprint [--print]
# | arg: -f, --footprint - Memory footprint of the service (low/medium/high).
# low - Less than 20Mb of ram by pool.
# medium - Between 20Mb and 40Mb of ram by pool.
# high - More than 40Mb of ram by pool.
# Or specify exactly the footprint, the load of the service as Mb by pool instead of having a standard value.
# To have this value, use the following command and stress the service.
# watch -n0.5 ps -o user,cmd,%cpu,rss -u APP
#
# | arg: -u, --usage - Expected usage of the service (low/medium/high).
# low - Personal usage, behind the sso.
# medium - Low usage, few people or/and publicly accessible.
# high - High usage, frequently visited website.
#
# | arg: -p, --print - Print the result
#
#
#
# The footprint of the service will be used to defined the maximum footprint we can allow, which is half the maximum RAM.
# So it will be used to defined 'pm.max_children'
# A lower value for the footprint will allow more children for 'pm.max_children'. And so for
# 'pm.start_servers', 'pm.min_spare_servers' and 'pm.max_spare_servers' which are defined from the
# value of 'pm.max_children'
# NOTE: 'pm.max_children' can't exceed 4 times the number of processor's cores.
#
# The usage value will defined the way php will handle the children for the pool.
# A value set as 'low' will set the process manager to 'ondemand'. Children will start only if the
# service is used, otherwise no child will stay alive. This config gives the lower footprint when the
# service is idle. But will use more proc since it has to start a child as soon it's used.
# Set as 'medium', the process manager will be at dynamic. If the service is idle, a number of children
# equal to pm.min_spare_servers will stay alive. So the service can be quick to answer to any request.
# The number of children can grow if needed. The footprint can stay low if the service is idle, but
# not null. The impact on the proc is a little bit less than 'ondemand' as there's always a few
# children already available.
# Set as 'high', the process manager will be set at 'static'. There will be always as many children as
# 'pm.max_children', the footprint is important (but will be set as maximum a quarter of the maximum
# RAM) but the impact on the proc is lower. The service will be quick to answer as there's always many
# children ready to answer.
ynh_get_scalable_phpfpm () {
local legacy_args=ufp
# Declare an array to define the options of this helper.
declare -Ar args_array=( [u]=usage= [f]=footprint= [p]=print )
local usage
local footprint
local print
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
# Set all characters as lowercase
footprint=${footprint,,}
usage=${usage,,}
print=${print:-0}
if [ "$footprint" = "low" ]
then
footprint=20
elif [ "$footprint" = "medium" ]
then
footprint=35
elif [ "$footprint" = "high" ]
then
footprint=50
fi
# Define the way the process manager handle child processes.
if [ "$usage" = "low" ]
then
php_pm=ondemand
elif [ "$usage" = "medium" ]
then
php_pm=dynamic
elif [ "$usage" = "high" ]
then
php_pm=static
else
ynh_die --message="Does not recognize '$usage' as an usage value."
fi
# Get the total of RAM available, except swap.
local max_ram=$(ynh_check_ram --no_swap)
less0() {
# Do not allow value below 1
if [ $1 -le 0 ]
then
echo 1
else
echo $1
fi
}
# Define pm.max_children
# The value of pm.max_children is the total amount of ram divide by 2 and divide again by the footprint of a pool for this app.
# So if php-fpm start the maximum of children, it won't exceed half of the ram.
php_max_children=$(( $max_ram / 2 / $footprint ))
# If process manager is set as static, use half less children.
# Used as static, there's always as many children as the value of pm.max_children
if [ "$php_pm" = "static" ]
then
php_max_children=$(( $php_max_children / 2 ))
fi
php_max_children=$(less0 $php_max_children)
# To not overload the proc, limit the number of children to 4 times the number of cores.
local core_number=$(nproc)
local max_proc=$(( $core_number * 4 ))
if [ $php_max_children -gt $max_proc ]
then
php_max_children=$max_proc
fi
if [ "$php_pm" = "dynamic" ]
then
# Define pm.start_servers, pm.min_spare_servers and pm.max_spare_servers for a dynamic process manager
php_min_spare_servers=$(( $php_max_children / 8 ))
php_min_spare_servers=$(less0 $php_min_spare_servers)
php_max_spare_servers=$(( $php_max_children / 2 ))
php_max_spare_servers=$(less0 $php_max_spare_servers)
php_start_servers=$(( $php_min_spare_servers + ( $php_max_spare_servers - $php_min_spare_servers ) /2 ))
php_start_servers=$(less0 $php_start_servers)
else
php_min_spare_servers=0
php_max_spare_servers=0
php_start_servers=0
fi
if [ $print -eq 1 ]
then
ynh_debug --message="Footprint=${footprint}Mb by pool."
ynh_debug --message="Process manager=$php_pm"
ynh_debug --message="Max RAM=${max_ram}Mb"
if [ "$php_pm" != "static" ]; then
ynh_debug --message="\nMax estimated footprint=$(( $php_max_children * $footprint ))"
ynh_debug --message="Min estimated footprint=$(( $php_min_spare_servers * $footprint ))"
fi
if [ "$php_pm" = "dynamic" ]; then
ynh_debug --message="Estimated average footprint=$(( $php_max_spare_servers * $footprint ))"
elif [ "$php_pm" = "static" ]; then
ynh_debug --message="Estimated footprint=$(( $php_max_children * $footprint ))"
fi
ynh_debug --message="\nRaw php-fpm values:"
ynh_debug --message="pm.max_children = $php_max_children"
if [ "$php_pm" = "dynamic" ]; then
ynh_debug --message="pm.start_servers = $php_start_servers"
ynh_debug --message="pm.min_spare_servers = $php_min_spare_servers"
ynh_debug --message="pm.max_spare_servers = $php_max_spare_servers"
fi
fi
}
#================================================= #=================================================

View file

@ -1,4 +0,0 @@
#!/bin/bash
# Dependencies
app_depencencies="carton perlmagick libpq-dev shared-mime-info"

View file

@ -19,7 +19,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=2 ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -27,11 +27,13 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
#================================================= #=================================================
# STANDARD BACKUP STEPS # DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Backing up the main app directory..."
CHECK_SIZE "$final_path" CHECK_SIZE "$final_path"
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
@ -39,7 +41,6 @@ ynh_backup --src_path="$final_path"
#================================================= #=================================================
# BACKUP NGINX CONFIGURATION # BACKUP NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Backing up nginx web server configuration..."
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -48,21 +49,18 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# BACKUP LOGROTATE # BACKUP LOGROTATE
#================================================= #=================================================
ynh_script_progression --message="Backing up logrotate configuration"
ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# BACKUP SYSTEMD # BACKUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Backing up systemd configuration"
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#================================================= #=================================================
# BACKUP A CRON FILE # BACKUP A CRON FILE
#================================================= #=================================================
ynh_script_progression --message="Backing up cron file"
ynh_backup --src_path="/etc/cron.d/$app" ynh_backup --src_path="/etc/cron.d/$app"
@ -70,4 +68,4 @@ ynh_backup --src_path="/etc/cron.d/$app"
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -33,7 +33,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --weight=20 ynh_script_progression --message="Backing up $app before changing its URL (may take a while)..." --weight=20
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -79,21 +79,21 @@ fi
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating nginx web server configuration..." --weight=2 ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
# Change the path in the nginx config file # Change the path in the NGINX config file
if [ $change_path -eq 1 ] if [ $change_path -eq 1 ]
then then
# Make a backup of the original nginx config file if modified # Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$nginx_conf_path" ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
# Set global variables for nginx helper # Set global variables for NGINX helper
domain="$old_domain" domain="$old_domain"
path_url="$new_path" path_url="$new_path"
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
fi fi
@ -138,7 +138,7 @@ ynh_replace_string --match_string="\(^ *prefix.*=> '\).*" --replace_string="\1$n
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -7,8 +7,6 @@
#================================================= #=================================================
# Load common variables for all scripts. # Load common variables for all scripts.
source _variables
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -83,14 +81,14 @@ ynh_setup_source --dest_dir="$final_path"
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=60 ynh_script_progression --message="Installing dependencies..." --weight=60
ynh_install_app_dependencies $app_depencencies ynh_install_app_dependencies $pkg_depencencies
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx web server..." --weight=2 ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#================================================= #=================================================
@ -106,7 +104,7 @@ ynh_system_user_create $app
#================================================= #=================================================
# SETUP LUTIM # SETUP LUTIM
#================================================= #=================================================
ynh_script_progression --message="Configure Lutim" --weight=2 ynh_script_progression --message="Configure $app" --weight=2
# Configure Lutim # Configure Lutim
cp ../conf/lutim.conf.template "$final_path/lutim.conf" cp ../conf/lutim.conf.template "$final_path/lutim.conf"
@ -149,7 +147,7 @@ chmod +x $final_path/script/lutim
#================================================= #=================================================
# INSTALL LUTIM WITH CARTON # INSTALL LUTIM WITH CARTON
#================================================= #=================================================
ynh_script_progression --message="Installing Lutim with Carton..." --weight=60 ynh_script_progression --message="Installing $app with Carton..." --weight=60
mkdir -p /var/log/$app/ mkdir -p /var/log/$app/
(cd $final_path (cd $final_path
@ -225,14 +223,14 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --weight=2 ynh_script_progression --message="Reloading NGINX web server..." --weight=2
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# CHECK LUTIM BOOTING # CHECK LUTIM BOOTING
#================================================= #=================================================
ynh_script_progression --message="Restarting Lutim..." --weight=6 ynh_script_progression --message="Restarting $app..." --weight=6
# Wait for lutim to be fully started # Wait for lutim to be fully started
ynh_systemd_action --action=restart --line_match="Manager.*started" --log_path="/var/log/$app/production.log" --timeout="120" ynh_systemd_action --action=restart --line_match="Manager.*started" --log_path="/var/log/$app/production.log" --timeout="120"
@ -248,7 +246,7 @@ ynh_systemd_action --action=restart --line_match="Manager.*started" --log_path="
# SEND A README FOR THE ADMIN # SEND A README FOR THE ADMIN
#================================================= #=================================================
# Get main domain and buid the url of the admin panel of the app. # Get main domain and buid the URL of the admin panel of the app.
admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app" admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
echo "You can find a config file at $final_path/lutim.conf echo "You can find a config file at $final_path/lutim.conf

View file

@ -51,7 +51,7 @@ ynh_remove_app_dependencies
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Removing app main directory..." --weight=2 ynh_script_progression --message="Removing $app main directory..." --weight=2
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
@ -59,9 +59,9 @@ ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing nginx web server configuration..." ynh_script_progression --message="Removing NGINX web server configuration..."
# Remove the dedicated nginx config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#================================================= #=================================================

View file

@ -7,8 +7,6 @@
#================================================= #=================================================
# Load common variables for all scripts. # Load common variables for all scripts.
source ../settings/scripts/_variables
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -62,7 +60,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." ynh_script_progression --message="Restoring $app main directory..."
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
@ -88,7 +86,7 @@ chown -R $app: $final_path
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=60 ynh_script_progression --message="Reinstalling dependencies..." --weight=60
ynh_install_app_dependencies $app_depencencies ynh_install_app_dependencies $pkg_depencencies
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # ADVERTISE SERVICE IN ADMIN PANEL
@ -130,14 +128,14 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --weight=2 ynh_script_progression --message="Reloading NGINX web server..." --weight=2
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# START AND CHECK LUTIM BOOTING # START AND CHECK LUTIM BOOTING
#================================================= #=================================================
ynh_script_progression --message="Restarting Lutim..." --weight=3 ynh_script_progression --message="Restarting $app..." --weight=3
# Wait for lutim to be fully started # Wait for lutim to be fully started
ynh_systemd_action --action=restart --line_match="Manager.*started" --log_path="/var/log/$app/production.log" --timeout="120" ynh_systemd_action --action=restart --line_match="Manager.*started" --log_path="/var/log/$app/production.log" --timeout="120"

View file

@ -7,8 +7,6 @@
#================================================= #=================================================
# Load common variables for all scripts. # Load common variables for all scripts.
source _variables
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -184,7 +182,7 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=9 ynh_script_progression --message="Upgrading dependencies..." --weight=9
ynh_install_app_dependencies $app_depencencies ynh_install_app_dependencies $pkg_depencencies
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -193,7 +191,7 @@ ynh_install_app_dependencies $app_depencencies
# Overwrite the nginx configuration only if it's allowed # Overwrite the nginx configuration only if it's allowed
if [ $overwrite_nginx -eq 1 ] if [ $overwrite_nginx -eq 1 ]
then then
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2 ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
ynh_add_nginx_config ynh_add_nginx_config
fi fi
@ -210,7 +208,7 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# SETUP LUTIM # SETUP LUTIM
#================================================= #=================================================
ynh_script_progression --message="Reconfiguring Lutim..." ynh_script_progression --message="Reconfiguring $app..."
# Overwrite the settings config file only if it's allowed # Overwrite the settings config file only if it's allowed
if [ $overwrite_settings -eq 1 ] if [ $overwrite_settings -eq 1 ]
@ -274,7 +272,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading Lutim with carton..." --weight=4 ynh_script_progression --message="Upgrading $app with Carton..." --weight=4
(cd $final_path (cd $final_path
carton install 2>&1 | tee -a "/var/log/$app/setup_carton.log") carton install 2>&1 | tee -a "/var/log/$app/setup_carton.log")
fi fi
@ -299,7 +297,7 @@ chown $app -R /var/log/$app
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload