mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
Implement new nodejs helper
This commit is contained in:
parent
df0587009f
commit
d3df899e0a
6 changed files with 11 additions and 21 deletions
|
@ -9,7 +9,7 @@
|
||||||
Environment="RAILS_ENV=production"
|
Environment="RAILS_ENV=production"
|
||||||
Environment="DB_POOL=25"
|
Environment="DB_POOL=25"
|
||||||
Environment="MALLOC_ARENA_MAX=2"
|
Environment="MALLOC_ARENA_MAX=2"
|
||||||
ExecStart=__RBENVROOT__/shims/bundle exec sidekiq -c 25
|
ExecStart=__RBENV_ROOT__/shims/bundle exec sidekiq -c 25
|
||||||
TimeoutSec=15
|
TimeoutSec=15
|
||||||
Restart=always
|
Restart=always
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
Environment="NODE_ENV=production"
|
Environment="NODE_ENV=production"
|
||||||
Environment="PORT=__PORT_STREAM__"
|
Environment="PORT=__PORT_STREAM__"
|
||||||
Environment="STREAMING_CLUSTER_NUM=1"
|
Environment="STREAMING_CLUSTER_NUM=1"
|
||||||
Environment=PATH=__NODEJS_PATH__
|
Environment=__YNH_LOAD_NODE_PATH__
|
||||||
ExecStart=__NODEJS_PATH__/node ./streaming
|
ExecStart=__YNH_NODE__ ./streaming
|
||||||
TimeoutSec=15
|
TimeoutSec=15
|
||||||
Restart=always
|
Restart=always
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
WorkingDirectory=__FINALPATH__/live
|
WorkingDirectory=__FINALPATH__/live
|
||||||
Environment="RAILS_ENV=production"
|
Environment="RAILS_ENV=production"
|
||||||
Environment="PORT=__PORT_WEB__"
|
Environment="PORT=__PORT_WEB__"
|
||||||
ExecStart=__RBENVROOT__/shims/bundle exec puma -C config/puma.rb
|
ExecStart=__RBENV_ROOT__/shims/bundle exec puma -C config/puma.rb
|
||||||
ExecReload=/bin/kill -SIGUSR1 $MAINPID
|
ExecReload=/bin/kill -SIGUSR1 $MAINPID
|
||||||
TimeoutSec=15
|
TimeoutSec=15
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.8.1"
|
"yunohost": ">= 3.8.2"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -230,14 +230,9 @@ cp -f ../conf/cron /etc/cron.d/$app
|
||||||
ynh_script_progression --message="Configuring a systemd service..."
|
ynh_script_progression --message="Configuring a systemd service..."
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_replace_string --match_string="__PORT_WEB__" --replace_string="$port_web" --target_file="../conf/mastodon-web.service"
|
ynh_add_systemd_config --service="$app-web" --template="mastodon-web.service" --others_var="port_web RBENV_ROOT"
|
||||||
ynh_replace_string --match_string="__RBENVROOT__" --replace_string="$RBENV_ROOT" --target_file="../conf/mastodon-web.service"
|
ynh_add_systemd_config --service="$app-sidekiq" --template="mastodon-sidekiq.service" --others_var="RBENV_ROOT"
|
||||||
ynh_replace_string --match_string="__RBENVROOT__" --replace_string="$RBENV_ROOT" --target_file="../conf/mastodon-sidekiq.service"
|
ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service" --others_var="port_stream ynh_node_load_PATH ynh_node"
|
||||||
ynh_replace_string --match_string="__PORT_STREAM__" --replace_string="$port_stream" --target_file="../conf/mastodon-streaming.service"
|
|
||||||
ynh_replace_string --match_string="__NODEJS_PATH__" --replace_string="$nodejs_path" --target_file="../conf/mastodon-streaming.service"
|
|
||||||
ynh_add_systemd_config --service="$app-web" --template="mastodon-web.service"
|
|
||||||
ynh_add_systemd_config --service="$app-sidekiq" --template="mastodon-sidekiq.service"
|
|
||||||
ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
|
|
|
@ -313,14 +313,9 @@ cp -f ../conf/cron /etc/cron.d/$app
|
||||||
ynh_script_progression --message="Upgrading systemd configuration..."
|
ynh_script_progression --message="Upgrading systemd configuration..."
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_replace_string --match_string="__PORT_WEB__" --replace_string="$port_web" --target_file="../conf/mastodon-web.service"
|
ynh_add_systemd_config --service="$app-web" --template="mastodon-web.service" --others_var="port_web RBENV_ROOT"
|
||||||
ynh_replace_string --match_string="__RBENVROOT__" --replace_string="$RBENV_ROOT" --target_file="../conf/mastodon-web.service"
|
ynh_add_systemd_config --service="$app-sidekiq" --template="mastodon-sidekiq.service" --others_var="RBENV_ROOT"
|
||||||
ynh_replace_string --match_string="__RBENVROOT__" --replace_string="$RBENV_ROOT" --target_file="../conf/mastodon-sidekiq.service"
|
ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service" --others_var="port_stream ynh_node_load_PATH ynh_node"
|
||||||
ynh_replace_string --match_string="__PORT_STREAM__" --replace_string="$port_stream" --target_file="../conf/mastodon-streaming.service"
|
|
||||||
ynh_replace_string --match_string="__NODEJS_PATH__" --replace_string="$nodejs_path" --target_file="../conf/mastodon-streaming.service"
|
|
||||||
ynh_add_systemd_config --service="$app-web" --template="mastodon-web.service"
|
|
||||||
ynh_add_systemd_config --service="$app-sidekiq" --template="mastodon-sidekiq.service"
|
|
||||||
ynh_add_systemd_config --service="$app-streaming" --template="mastodon-streaming.service"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
|
|
Loading…
Reference in a new issue