mirror of
https://github.com/YunoHost-Apps/peertube_ynh.git
synced 2024-09-03 19:56:29 +02:00
Fix systemd and redundancy (#46)
* fixed env in systemd * changed path while creating password * changed path while creating password * changed path while creating password * changed path while creating password * Path in systemd * Fixed yarn in upgrade
This commit is contained in:
parent
33755ac53e
commit
c3221e6128
4 changed files with 13 additions and 7 deletions
|
@ -80,9 +80,11 @@ redundancy:
|
||||||
# size: '10GB'
|
# size: '10GB'
|
||||||
# strategy: 'trending' # Cache trending videos
|
# strategy: 'trending' # Cache trending videos
|
||||||
# -
|
# -
|
||||||
# size: '10GB'
|
size: '1GB'
|
||||||
# strategy: 'recently-added' # Cache recently added videos
|
# Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
|
||||||
# minViews: 10 # Having at least x views
|
min_lifetime: '48 hours'
|
||||||
|
strategy: 'recently-added' # Cache recently added videos
|
||||||
|
minViews: 10 # Having at least x views
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ Environment=NODE_ENV=production
|
||||||
Environment=NODE_CONFIG_DIR=__FINALPATH__/config
|
Environment=NODE_CONFIG_DIR=__FINALPATH__/config
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
ExecStart=/bin/sh -c 'PATH=/opt/node_n/bin:$PATH exec npm start'
|
Environment="PATH=__ENV_PATH__"
|
||||||
|
ExecStart=/bin/sh -c ' npm start'
|
||||||
WorkingDirectory=__FINALPATH__/
|
WorkingDirectory=__FINALPATH__/
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
|
|
|
@ -214,10 +214,13 @@ chown -R "$app":"$app" "$final_path" "$datadir"
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service"
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
systemctl enable "$app"
|
systemctl enable "$app"
|
||||||
|
@ -231,7 +234,7 @@ systemctl start "$app"
|
||||||
(
|
(
|
||||||
cd "$final_path"
|
cd "$final_path"
|
||||||
sleep 30
|
sleep 30
|
||||||
echo $admin_pass | NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production PATH="/opt/node_n/bin:$PATH" npm run reset-password -- -u root
|
echo $admin_pass | NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production npm run reset-password -- -u root
|
||||||
)
|
)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -130,7 +130,7 @@ ynh_secure_remove "$tmpdir"
|
||||||
|
|
||||||
(
|
(
|
||||||
cd "$final_path"
|
cd "$final_path"
|
||||||
yarn install --production --pure-lockfile --silent --cache-folder /var/cache/yarn/
|
yarn install --production --pure-lockfile
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ ynh_use_logrotate --non-append
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service"
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue