1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/chatgpt-web_ynh.git synced 2024-09-03 18:16:21 +02:00
This commit is contained in:
Éric Gaspar 2023-05-14 12:27:42 +02:00
parent 6daf859bdd
commit 4fa44be267
4 changed files with 27 additions and 6 deletions

View file

@ -9,7 +9,7 @@ Group=__APP__
WorkingDirectory=__INSTALL_DIR__/ WorkingDirectory=__INSTALL_DIR__/
Environment="PATH=__ENV_PATH__" Environment="PATH=__ENV_PATH__"
Environment="NODE_ENV=production" Environment="NODE_ENV=production"
ExecStart=__YNH_NPM__ start ExecStart=__YNH_NPM__ run build
Restart=on-failure Restart=on-failure
RestartSec=5 RestartSec=5
StartLimitInterval=60s StartLimitInterval=60s

View file

@ -36,6 +36,12 @@ ynh_script_progression --message="Adding system configurations related to $app..
# Create a dedicated NGINX config using the conf/nginx.conf template # Create a dedicated NGINX config using the conf/nginx.conf template
ynh_add_nginx_config ynh_add_nginx_config
# Create a dedicated systemd config
env_path="$PATH"
ynh_add_systemd_config
yunohost service add $app --description="ChatGPT web interface" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# APP INITIAL CONFIGURATION # APP INITIAL CONFIGURATION
#================================================= #=================================================
@ -58,9 +64,17 @@ ynh_script_progression --message="Building app... (this will take some time and
pushd "$install_dir" pushd "$install_dir"
ynh_use_nodejs ynh_use_nodejs
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm ci ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm ci
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm run build #ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm run build
popd popd
#=================================================
# START 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="/var/log/$app/$app.log"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -31,7 +31,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" yunohost service add $app --description="ChatGPT web interface" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -29,7 +29,7 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
# 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="$install_dir" ynh_setup_source --dest_dir="$install_dir" --keep = ".env"
fi fi
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
@ -41,9 +41,16 @@ ynh_script_progression --message="Upgrading system configurations related to $ap
ynh_add_nginx_config ynh_add_nginx_config
env_path="$PATH"
ynh_add_systemd_config ynh_add_systemd_config
yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" yunohost service add $app --description="ChatGPT web interface" --log="/var/log/$app/$app.log"
pushd "$install_dir"
ynh_use_nodejs
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm ci
#ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH npm run build
popd
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE