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

Merge pull request #115 from YunoHost-Apps/upgrade

Upgrade to 5.17
This commit is contained in:
yalh76 2021-04-09 16:56:31 +02:00 committed by GitHub
commit 09ff820447
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 106 additions and 160 deletions

View file

@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview ## Overview
Wekan is an open-source kanban board (task manager and organizer) Wekan is an open-source kanban board (task manager and organizer)
**Shipped version:** 5.00 **Shipped version:** 5.17
## Screenshots ## Screenshots

View file

@ -13,19 +13,21 @@
setup_public=1 setup_public=1
upgrade=1 upgrade=1
# 3.79~ynh2 # 3.79~ynh2
upgrade=1 from_commit=2843d504bcdb0402939f87ebeeda3417de02a9e4 #upgrade=1 from_commit=2843d504bcdb0402939f87ebeeda3417de02a9e4
# 3.95~ynh1 # 3.95~ynh1
upgrade=1 from_commit=46f4b540cb99090a3fe1d35828094dbbfb34b692 #upgrade=1 from_commit=46f4b540cb99090a3fe1d35828094dbbfb34b692
# 3.95~ynh1 # 3.95~ynh1
upgrade=1 from_commit=3cd252289f4fd138879872658762f4c6ae415cc4 #upgrade=1 from_commit=3cd252289f4fd138879872658762f4c6ae415cc4
# 4.09~ynh1 # 4.09~ynh1
upgrade=1 from_commit=c2b4715e8591031f3054cedb1220e7619607bb36 #upgrade=1 from_commit=c2b4715e8591031f3054cedb1220e7619607bb36
# 4.43~ynh1 # 4.43~ynh1
upgrade=1 from_commit=2cf63bd4d660eae4526221c1a68efede499e3ee6 #upgrade=1 from_commit=2cf63bd4d660eae4526221c1a68efede499e3ee6
# 4.64~ynh1 # 4.64~ynh1
upgrade=1 from_commit=32fe3a7c342e5f29d7a7534125151723f916de46 upgrade=1 from_commit=32fe3a7c342e5f29d7a7534125151723f916de46
# 4.64~ynh2 # 4.64~ynh2
upgrade=1 from_commit=9e698d094c29fc6ab12ac60cd1d0e68b56bfc953 upgrade=1 from_commit=9e698d094c29fc6ab12ac60cd1d0e68b56bfc953
# 5.00~ynh1
upgrade=1 from_commit=8655e8062d1bc6e90b01b98ca9a0dea15d60119e
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0 port_already_use=0
@ -48,3 +50,5 @@ Notification=down
name=4.64~ynh1 name=4.64~ynh1
; commit=9e698d094c29fc6ab12ac60cd1d0e68b56bfc953 ; commit=9e698d094c29fc6ab12ac60cd1d0e68b56bfc953
name=4.64~ynh2 name=4.64~ynh2
; commit=8655e8062d1bc6e90b01b98ca9a0dea15d60119e
name=5.00~ynh1

View file

@ -1,9 +1,9 @@
# This is on YunoHost server just to avoid the file from disappearing # This is on YunoHost server just to avoid the file from disappearing
# Original source is https://releases.wekan.team/raspi3/wekan-5.00-arm64.zip # Original source is https://releases.wekan.team/raspi3/wekan-5.17-arm64.zip
# YunoHost source is https://build.yunohost.org/apps/wekan-5.00-arm64.zip # YunoHost source is https://build.yunohost.org/apps/wekan-5.17-arm64.zip
SOURCE_URL=https://build.yunohost.org/apps/wekan-5.00-arm64.zip SOURCE_URL=https://build.yunohost.org/apps/wekan-5.17-arm64.zip
SOURCE_SUM=156b9578766d4f133c8078bec1433fe5147e7fc594f0fbb8bdb000df2a269c89 SOURCE_SUM=3137fa9fb079e42f33405d77738bec7ceae00c3e332394b4a79524552eb4fb3e
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=wekan-5.00-arm64.zip SOURCE_FILENAME=wekan-5.17-arm64.zip

View file

@ -5,31 +5,16 @@ location __PATH__/ {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
} }
client_max_body_size 100M;
proxy_pass http://127.0.0.1:__PORT__; proxy_pass http://127.0.0.1:__PORT__;
proxy_http_version 1.1; proxy_http_version 1.1;
client_max_body_size 100M;
proxy_set_header Accept-Encoding "";
# allow websockets
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
# preserve client IP # preserve client IP
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
#proxy_buffering off;
# this setting allows the browser to cache the application in
# a way compatible with Meteor.
# on every applicaiton update the name of CSS and JS file is different,
# so they can be cache infinitely (here: 30 days)
# the root path MUST NOT be cached
if ($uri != '__PATH__')
{
expires 30d;
}
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }

View file

@ -8,7 +8,7 @@ Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
EnvironmentFile=__FINALPATH__/.env EnvironmentFile=__FINALPATH__/.env
WorkingDirectory=__FINALPATH__ WorkingDirectory=__FINALPATH__/
ExecStart=__YNH_NODE__ __FINALPATH__/main.js ExecStart=__YNH_NODE__ __FINALPATH__/main.js
Restart=on-failure Restart=on-failure
#StartLimitInterval=86400 #StartLimitInterval=86400

View file

@ -1,9 +1,9 @@
# This is on YunoHost server just to avoid the file from disappearing # This is on YunoHost server just to avoid the file from disappearing
# Original source is https://releases.wekan.team/wekan-5.00.zip # Original source is https://releases.wekan.team/wekan-5.17.zip
# YunoHost source is https://build.yunohost.org/apps/wekan-5.00.zip # YunoHost source is https://build.yunohost.org/apps/wekan-5.17.zip
SOURCE_URL=https://build.yunohost.org/apps/wekan-5.00.zip SOURCE_URL=https://build.yunohost.org/apps/wekan-5.17.zip
SOURCE_SUM=815a6893185c4f063582afe13a63b78f3bfd5bd8bfe290ba002117657426b5cf SOURCE_SUM=42b41c5c774cbc58ef64718040a5c0306ea8e42980c1e25636d16dab831f32c3
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=wekan-5.00.zip SOURCE_FILENAME=wekan-5.17.zip

View file

@ -6,7 +6,7 @@
"en": "Trello-like kanban", "en": "Trello-like kanban",
"fr": "Un kanban similaire à Trello" "fr": "Un kanban similaire à Trello"
}, },
"version": "5.00~ynh1", "version": "5.17~ynh1",
"url": "https://wekan.io", "url": "https://wekan.io",
"license": "MIT", "license": "MIT",
"maintainer": [ "maintainer": [
@ -17,7 +17,11 @@
}, },
{ {
"name": "ljf" "name": "ljf"
}], },
{
"name": "yalh76"
}
],
"requirements": { "requirements": {
"yunohost": ">= 4.1.3" "yunohost": ">= 4.1.3"
}, },
@ -30,38 +34,22 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain name for Wekan",
"fr": "Choisissez un nom de domaine pour Wekan"
},
"example": "example.com" "example": "example.com"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for Wekan",
"fr": "Choisissez un chemin pour Wekan"
},
"example": "/wekan", "example": "/wekan",
"default": "/wekan" "default": "/wekan"
}, },
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user",
"ask": {
"en": "Choose an admin user",
"fr": "Choisissez l'administrateur"
},
"example": "johndoe" "example": "johndoe"
}, },
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"default": false "default": false
} }
] ]

View file

@ -7,7 +7,7 @@
# dependencies used by the app # dependencies used by the app
pkg_dependencies="" pkg_dependencies=""
nodejsversion=12.16.3 NODEJS_VERSION=12.16.3
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -38,7 +38,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)..." ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..."
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -46,7 +46,7 @@ ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# restore it if the upgrade fails # Restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
@ -80,23 +80,23 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating nginx web server configuration..." ynh_script_progression --message="Updating NGINX web server configuration..."
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
# Change the domain for nginx # Change the domain for NGINX
if [ $change_domain -eq 1 ] if [ $change_domain -eq 1 ]
then then
# Delete file checksum for the old conf file location # Delete file checksum for the old conf file location
@ -134,7 +134,7 @@ fi
#================================================= #=================================================
# 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

@ -75,16 +75,23 @@ ynh_app_setting_set --app=$app --key=port --value=$port
ynh_script_progression --message="Installing dependencies..." ynh_script_progression --message="Installing dependencies..."
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
ynh_install_nodejs --nodejs_version=$nodejsversion ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_use_nodejs ynh_use_nodejs
ynh_install_mongo ynh_install_mongo
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# CREATE A MONGODB DATABASE # CREATE A MONGODB DATABASE
#================================================= #=================================================
ynh_script_progression --message="Creating a MongoDB database..." ynh_script_progression --message="Creating a MongoDB database..."
# Registering db name
db_name=$(ynh_sanitize_dbid --db_name=$app) db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name
@ -99,22 +106,18 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R root:$app "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx web server..." ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
@ -126,25 +129,17 @@ ynh_script_progression --message="Configuring a systemd service..."
ynh_add_systemd_config --others_var="mongodb_servicename ynh_node" ynh_add_systemd_config --others_var="mongodb_servicename ynh_node"
#================================================= #=================================================
# MODIFY A CONFIG FILE # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." ynh_script_progression --message="Adding a config file..."
# Create a dedicated .env config
ynh_add_config --template=".env" --destination="$final_path/.env" ynh_add_config --template=".env" --destination="$final_path/.env"
chmod 400 "$final_path/.env"
chown $app:$app "$final_path/.env"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Securing files and directories..."
# Set strong right permissions to app files
chown -R $app: "$final_path"
chmod -R 640 "$final_path"
find "$final_path" -type d -print0 | xargs -0 chmod 750
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
@ -169,8 +164,6 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Configuring permissions..." ynh_script_progression --message="Configuring permissions..."
ynh_permission_create --permission="admin" --allowed "$admin"
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
@ -179,10 +172,12 @@ then
ynh_permission_update --permission="main" --add="visitors" ynh_permission_update --permission="main" --add="visitors"
fi fi
ynh_permission_create --permission="admin" --allowed=$admin
#================================================= #=================================================
# 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

@ -29,7 +29,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# REMOVE SERVICE INTEGRATION IN YUNOHOST # REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null if ynh_exec_warn_less yunohost service status $app >/dev/null
then then
ynh_script_progression --message="Removing $app service integration..." ynh_script_progression --message="Removing $app service integration..."
@ -73,9 +73,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

@ -24,7 +24,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading settings..." ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -49,17 +49,10 @@ test ! -d $final_path \
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the nginx configuration..." ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
@ -69,14 +62,15 @@ ynh_script_progression --message="Recreating the dedicated system user..."
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring user rights..." ynh_script_progression --message="Restoring the app main directory..."
# Restore permissions on app files ynh_restore_file --origin_path="$final_path"
chown -R $app: "$final_path"
chmod -R 640 "$final_path" chmod 750 "$final_path"
find "$final_path" -type d -print0 | xargs -0 chmod 750 chmod -R o-rwx "$final_path"
chown -R root:$app "$final_path"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -87,7 +81,7 @@ ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies # Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
ynh_install_nodejs --nodejs_version=$nodejsversion ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_use_nodejs ynh_use_nodejs
ynh_install_mongo ynh_install_mongo
@ -131,7 +125,7 @@ fi
#================================================= #=================================================
# 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

@ -46,7 +46,7 @@ fi
if ! ynh_permission_exists --permission="admin"; then if ! ynh_permission_exists --permission="admin"; then
# Create the required permissions # Create the required permissions
ynh_permission_create --permission="admin" --allowed "$admin" ynh_permission_create --permission="admin" --allowed=$admin
fi fi
#================================================= #=================================================
@ -68,7 +68,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {
# restore it if the upgrade fails # Restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
@ -114,23 +114,13 @@ if ynh_version_gt "2.56~ynh1" "${previous_version}" ; then
touch $config_file touch $config_file
fi fi
# Create the permission "admin" only if it doesn't exist. #=================================================
if ! ynh_permission_exists --permission="admin" # CREATE DEDICATED USER
then #=================================================
ynh_script_progression --message="Upgrading Permission configuration..." ynh_script_progression --message="Making sure dedicated system user exists..."
ynh_app_setting_delete --app=$app --key=unprotected_uris # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
if [ $is_public -eq 1 ]; then
ynh_permission_update --permission "main" --add "visitors"
fi
ynh_app_setting_delete --app=$app --key=is_public
ynh_permission_create --permission="admin"
fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -160,12 +150,16 @@ then
ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"
fi fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R root:$app "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#================================================= #=================================================
@ -175,26 +169,12 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
ynh_remove_nodejs ynh_remove_nodejs
ynh_install_nodejs --nodejs_version=$nodejsversion ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_use_nodejs ynh_use_nodejs
ynh_install_mongo ynh_install_mongo
#================================================= #=================================================
# CREATE DEDICATED USER # SPECIFIC UPGRADE
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying a config file..."
# Create a dedicated .env config
ynh_add_config --template=".env" --destination="$final_path/.env"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
@ -203,18 +183,18 @@ ynh_script_progression --message="Upgrading systemd configuration..."
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config --others_var="mongodb_servicename ynh_node" ynh_add_systemd_config --others_var="mongodb_servicename ynh_node"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a config file..."
ynh_add_config --template=".env" --destination="$final_path/.env"
chmod 400 "$final_path/.env"
chown $app:$app "$final_path/.env"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Securing files and directories..."
# Set permissions on app files
chown -R $app: "$final_path"
chmod -R 640 "$final_path"
find "$final_path" -type d -print0 | xargs -0 chmod 750
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
@ -236,7 +216,7 @@ fi
#================================================= #=================================================
# 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