1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/luckysheet_ynh.git synced 2024-09-03 19:36:21 +02:00
This commit is contained in:
Éric Gaspar 2022-06-14 22:24:20 +02:00
parent d48461cbf1
commit 7f843f2891
No known key found for this signature in database
GPG key ID: 574F281483054D44
8 changed files with 35 additions and 56 deletions

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/mengshukeji/Luckysheet/archive/v2.0.0.tar.gz
SOURCE_SUM=697e79a4d033506074f8e0261ff94cee6e4360b7f0634cb9de53ae59edcec1fe
SOURCE_URL=https://github.com/mengshukeji/Luckysheet/archive/v2.1.13.tar.gz
SOURCE_SUM=9c996e1e2a47ca0bb37b17840f7ded82ed999899daf3bd620b07c154b71647f9
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

View file

@ -1,4 +1,5 @@
location ^~ __PATH__/ {
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
proxy_pass http://127.0.0.1:__PORT__/;
proxy_redirect off;
@ -12,13 +13,6 @@ location ^~ __PATH__/ {
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
# setup for image upload
#client_max_body_size 256M;
#proxy_max_temp_file_size 1024M;
#proxy_read_timeout 300;
#proxy_connect_timeout 300;
# Include SSOWAT user panel.
#include conf.d/yunohost_panel.conf.inc;
#more_clear_input_headers 'Accept-Encoding';

View file

@ -7,8 +7,8 @@ After=network.target
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__
Environment="PATH=__ENV_PATH__"
WorkingDirectory=__FINALPATH__/
Environment="__YNH_NODE_LOAD_PATH__"
Environment="NODE_ENV=production"
ExecStart=__YNH_NPM__ run build
Restart=always

View file

@ -6,7 +6,7 @@
"en": "Online spreadsheet that is powerful, simple to configure",
"fr": "Feuille de calcul en ligne, puissante, simple à configurer"
},
"version": "2.0.0~ynh4",
"version": "2.1.13~ynh1",
"url": "https://github.com/mengshukeji/Luckysheet",
"license": "MIT",
"maintainer": {

View file

@ -14,7 +14,8 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
### Remove this function if there's nothing to clean before calling the remove script.
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -45,8 +46,8 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#=================================================
ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
#=================================================
# STANDARD MODIFICATIONS
@ -84,6 +85,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$final_path
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -99,38 +104,29 @@ ynh_add_nginx_config
#==============================================
ynh_script_progression --message="Building Luckysheet... (this will take some time and resources!)" --weight=20
pushd "$final_path"
pushd $final_path
ynh_use_nodejs
ynh_exec_warn_less $ynh_npm install
ynh_exec_warn_less $ynh_npm install gulp -g
npm install
npm install gulp --location=global
popd
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
cp ../conf/config.example.js $final_path/src/config.js
ynh_add_config --template="../conf/config.example.js" --destination="$final_path/src/config.js"
chmod 400 "$final_path/src/config.js"
chown $app:$app "$final_path/src/config.js"
#=================================================
# SETUP SYSTEMD
#=================================================
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_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
ynh_add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Securing files and directories..." --weight=1
# Set permissions to app files
chown -R $app: $final_path
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================

View file

@ -29,7 +29,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# 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 Luckysheet service..." --weight=1
ynh_script_progression --message="Removing $app service..." --weight=1
yunohost service remove $app
fi
@ -51,7 +51,7 @@ ynh_remove_nodejs
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing Luckysheet main directory..." --weight=6
ynh_script_progression --message="Removing $app main directory..." --weight=6
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
@ -78,4 +78,4 @@ ynh_system_user_delete --username=$app
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of Luckysheet completed" --last
ynh_script_progression --message="Removal of $app completed" --last

View file

@ -49,7 +49,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring Luckysheet main directory..." --weight=50
ynh_script_progression --message="Restoring $app main directory..." --weight=50
ynh_restore_file --origin_path="$final_path"
@ -114,4 +114,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for Luckysheet" --last
ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -79,13 +79,14 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=20
# Remove the app directory securely
ynh_secure_remove --file=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$final_path
ynh_setup_source --dest_dir=$final_path --keep="$final_path/src/config.js"
fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -109,7 +110,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#==============================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Building Luckysheet... (this will take some time and resources!)" --weight=20
ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=20
pushd "$final_path"
ynh_use_nodejs
@ -123,21 +124,9 @@ fi
#=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=2
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Securing files and directories..." --weight=1
# Set permissions on app files
chown -R $app: $final_path
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
@ -163,4 +152,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of Luckysheet completed" --last
ynh_script_progression --message="Upgrade of $app completed" --last