1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nocodb_ynh.git synced 2024-09-03 19:56:01 +02:00
This commit is contained in:
Éric Gaspar 2023-11-22 14:50:53 +01:00
parent f7b0100e03
commit 1c6c5fd902
7 changed files with 15 additions and 48 deletions

View file

@ -5,3 +5,11 @@ NC_AUTH_JWT_SECRET=__JWT_SECRET__
NC_DISABLE_TELE=1 NC_DISABLE_TELE=1
NC_PUBLIC_URL=https://__DOMAIN__ NC_PUBLIC_URL=https://__DOMAIN__
NC_REQUEST_BODY_SIZE=104857600 NC_REQUEST_BODY_SIZE=104857600
NC_SMTP_FROM=__APP__@__DOMAIN__
NC_SMTP_HOST=localhost
NC_SMTP_PORT=25
NC_SMTP_USERNAME=__APP__
NC_SMTP_PASSWORD=__MAIL_PWD__
NC_SMTP_SECURE=false
NC_SMTP_IGNORE_TLS

View file

@ -10,8 +10,6 @@ WorkingDirectory=__INSTALL_DIR__/
Environment="__YNH_NODE_LOAD_PATH__" Environment="__YNH_NODE_LOAD_PATH__"
EnvironmentFile=__INSTALL_DIR__/.env EnvironmentFile=__INSTALL_DIR__/.env
ExecStart=__YNH_NODE__ __INSTALL_DIR__/nocodb ExecStart=__YNH_NODE__ __INSTALL_DIR__/nocodb
StandardOutput=append:/var/log/__APP__/__APP__.log
StandardError=inherit
# Sandboxing options to harden security # Sandboxing options to harden security
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html # Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html

View file

@ -49,7 +49,8 @@ ram.runtime = "50M"
extract = false extract = false
[resources.system_user] [resources.system_user]
allow_email = true
[resources.install_dir] [resources.install_dir]
[resources.ports] [resources.ports]

View file

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
@ -33,7 +33,7 @@ ynh_change_url_nginx_config
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="application successfully started" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="application successfully started"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -57,25 +57,6 @@ ynh_use_logrotate
yunohost service add $app --description="Turns any database into a smart-spreadsheet" --log="/var/log/$app/$app.log" yunohost service add $app --description="Turns any database into a smart-spreadsheet" --log="/var/log/$app/$app.log"
#=================================================
# SPECIFIC SETUP
#=================================================
# INSTALL NOCODB
#=================================================
ynh_script_progression --message="Installing NocoDB..." --weight=5
ynh_use_nodejs
pushd $install_dir
if [ $YNH_ARCH = "arm64" ]; then
ynh_print_info --message="Retrieving and building OracleDB for ARM64..."
ynh_exec_warn_less ynh_exec_as $app git clone --recursive https://github.com/oracle/node-oracledb.git oracledb
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH NODE_ENV="production" $ynh_npm install ./oracledb
ynh_print_info --message="...Done! Installing NocoDB now..."
fi
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH NODE_ENV="production" $ynh_npm install --save nocodb@$(ynh_app_upstream_version)
popd
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================

View file

@ -60,7 +60,7 @@ yunohost service add $app --description="Turns any database into a smart-spreads
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="application successfully started" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="application successfully started"
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -63,33 +63,12 @@ ynh_use_logrotate --non-append
yunohost service add $app --description="Turns any database into a smart-spreadsheet" --log="/var/log/$app/$app.log" yunohost service add $app --description="Turns any database into a smart-spreadsheet" --log="/var/log/$app/$app.log"
#=================================================
# SPECIFIC UPGRADE
#=================================================
# PERFORMING NOCODB UPGRADE
#=================================================
ynh_script_progression --message="Upgrading NocoDB..." --weight=5
ynh_use_nodejs
pushd $install_dir
if [ $YNH_ARCH = "arm64" ]; then
ynh_print_info --message="Retrieving and building OracleDB for ARM64..."
ynh_secure_remove oracledb
ynh_exec_warn_less ynh_exec_as $app git clone --recursive https://github.com/oracle/node-oracledb.git oracledb
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH NODE_ENV="production" $ynh_npm install ./oracledb
fi
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH NODE_ENV="production" $ynh_npm uninstall nocodb
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH NODE_ENV="production" $ynh_npm install --save nocodb@$(ynh_app_upstream_version)
popd
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="application successfully started" ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="application successfully started"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT