mirror of
https://github.com/YunoHost-Apps/hedgedoc_ynh.git
synced 2024-09-03 19:25:52 +02:00
fix
This commit is contained in:
parent
4a83da3d50
commit
c412fb04cd
5 changed files with 6 additions and 28 deletions
|
@ -7,12 +7,12 @@ After=network.target postgresql.service __APP___backend.service
|
||||||
Type=simple
|
Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__FINALPATH__/frontend
|
WorkingDirectory=__INSTALL_DIR__/frontend
|
||||||
Environment="PATH=__ENV_PATH__"
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
Environment="NODE_ENV=production"
|
Environment="NODE_ENV=production"
|
||||||
Environment="PORT=__PORT_FRONTEND__"
|
Environment="PORT=__PORT_FRONTEND__"
|
||||||
Environment="REACT_APP_BACKEND_BASE_URL=http://localhost:__PORT_BACKEND__/"
|
Environment="REACT_APP_BACKEND_BASE_URL=http://localhost:__PORT_BACKEND__/"
|
||||||
ExecStart=__FINALPATH__/frontend/node_modules/.bin/cross-env PORT=__PORT_FRONTEND__ REACT_APP_BACKEND_BASE_URL=http://localhost:__PORT_BACKEND__/ __FINAL_PATH__/frontend/node_modules/.bin/craco start
|
ExecStart=__INSTALL_DIR__/frontend/node_modules/.bin/cross-env PORT=__PORT_FRONTEND__ REACT_APP_BACKEND_BASE_URL=http://localhost:__PORT_BACKEND__/ __INSTALL_DIR__/frontend/node_modules/.bin/craco start
|
||||||
Restart=always
|
Restart=always
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=true
|
PrivateDevices=true
|
||||||
|
|
|
@ -53,6 +53,8 @@ ram.runtime = "50M"
|
||||||
autoupdate.strategy = "latest_github_tag"
|
autoupdate.strategy = "latest_github_tag"
|
||||||
|
|
||||||
[resources.ports]
|
[resources.ports]
|
||||||
|
frontend.default = 3001
|
||||||
|
backend.default = 3000
|
||||||
|
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ ynh_backup_if_checksum_is_different --file="$install_dir/config.json"
|
||||||
domain=$new_domain
|
domain=$new_domain
|
||||||
url_path=${new_path#/}
|
url_path=${new_path#/}
|
||||||
|
|
||||||
ynh_add_config --template="../conf/config.json.example" --destination="$install_dir/config.json"
|
ynh_add_config --template="config.json.example" --destination="$install_dir/config.json"
|
||||||
|
|
||||||
chmod 400 "$install_dir/config.json"
|
chmod 400 "$install_dir/config.json"
|
||||||
chown $app:$app "$install_dir/config.json"
|
chown $app:$app "$install_dir/config.json"
|
||||||
|
|
|
@ -26,21 +26,6 @@ require_free_url_authentication=false
|
||||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
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=path --value=$path_url
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD MODIFICATIONS
|
|
||||||
#=================================================
|
|
||||||
# FIND AND OPEN A PORT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Finding available ports..." --weight=2
|
|
||||||
|
|
||||||
# Find an available port for the backend
|
|
||||||
port_backend=$(ynh_find_port --port=3000)
|
|
||||||
ynh_app_setting_set --app=$app --key=port_backend --value=$port_backend
|
|
||||||
|
|
||||||
# Find an available port for the frontend
|
|
||||||
port_frontend=$(ynh_find_port --port=$(($port_backend+1)))
|
|
||||||
ynh_app_setting_set --app=$app --key=port_frontend --value=$port_frontend
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -78,7 +63,6 @@ yunohost service add $app --description="Collaborative Markdown editor" --log="/
|
||||||
#==============================================
|
#==============================================
|
||||||
# INSTALL HEDGEDOC
|
# INSTALL HEDGEDOC
|
||||||
#==============================================
|
#==============================================
|
||||||
|
|
||||||
ynh_script_progression --message="Building HedgeDoc backend... (this will take some time and resources!)" --weight=20
|
ynh_script_progression --message="Building HedgeDoc backend... (this will take some time and resources!)" --weight=20
|
||||||
|
|
||||||
pushd "$install_dir/backend"
|
pushd "$install_dir/backend"
|
||||||
|
@ -100,9 +84,6 @@ popd
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/backend.service"
|
|
||||||
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/frontend.service"
|
|
||||||
|
|
||||||
ynh_add_systemd_config --service="${app}_backend" --template="../conf/backend.service"
|
ynh_add_systemd_config --service="${app}_backend" --template="../conf/backend.service"
|
||||||
ynh_add_systemd_config --service="${app}_frontend" --template="../conf/frontend.service"
|
ynh_add_systemd_config --service="${app}_frontend" --template="../conf/frontend.service"
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,6 @@ then
|
||||||
yunohost service remove ${app}_frontend
|
yunohost service remove ${app}_frontend
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STOP AND REMOVE SERVICE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Stopping and removing the systemd services..." --weight=1
|
|
||||||
|
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_remove_systemd_config --service=${app}_backend
|
ynh_remove_systemd_config --service=${app}_backend
|
||||||
ynh_remove_systemd_config --service=${app}_frontend
|
ynh_remove_systemd_config --service=${app}_frontend
|
||||||
|
|
Loading…
Add table
Reference in a new issue