Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
92397046f8 |
8
conf/30-peertube-tcp.conf
Normal file
8
conf/30-peertube-tcp.conf
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# In a video server, we are often sending files to a client
|
||||||
|
# which can't accept it as fast as our local network connection
|
||||||
|
# could produce packets. To prevent packet loss and buffer bloat,
|
||||||
|
# it's especially important to use a modern CoDel scheduler which
|
||||||
|
# knows how to delay outgoing packets to match slower client links.
|
||||||
|
|
||||||
|
net.core.default_qdisc = fq_codel
|
||||||
|
net.ipv4.tcp_congestion_control = bbr
|
|
@ -26,6 +26,7 @@ path_url="/"
|
||||||
admin_email=$YNH_APP_ARG_EMAIL
|
admin_email=$YNH_APP_ARG_EMAIL
|
||||||
admin_pass=$(ynh_string_random 24)
|
admin_pass=$(ynh_string_random 24)
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
tuning="1"
|
||||||
|
|
||||||
|
|
||||||
# This is a multi-instance app, meaning it can be installed several times independently
|
# This is a multi-instance app, meaning it can be installed several times independently
|
||||||
|
@ -60,7 +61,7 @@ ynh_app_setting_set "$app" domain "$domain"
|
||||||
ynh_app_setting_set "$app" admin_email "$admin_email"
|
ynh_app_setting_set "$app" admin_email "$admin_email"
|
||||||
ynh_app_setting_set "$app" admin_pass "$admin_pass"
|
ynh_app_setting_set "$app" admin_pass "$admin_pass"
|
||||||
ynh_app_setting_set "$app" is_public "$is_public"
|
ynh_app_setting_set "$app" is_public "$is_public"
|
||||||
|
ynh_app_setting_set "$app" tuning "$tuning"
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -190,6 +191,20 @@ ynh_store_file_checksum "$final_path/config/production.yaml"
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate "/home/yunohost.app/${app}/storage/logs/peertube.log"
|
ynh_use_logrotate "/home/yunohost.app/${app}/storage/logs/peertube.log"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
### `yunohost service add` is a CLI yunohost command to add a service in the admin panel.
|
||||||
|
### You'll find the service in the 'services' section of YunoHost admin panel.
|
||||||
|
### This CLI command would be useless if the app does not have any services (systemd or sysvinit)
|
||||||
|
### If you're not using these lines:
|
||||||
|
### - You can remove these files in conf/.
|
||||||
|
### - Remove the section "REMOVE SERVICE FROM ADMIN PANEL" in the remove script
|
||||||
|
### - As well as the section ADVERTISE SERVICE IN ADMIN PANEL" in the restore script
|
||||||
|
|
||||||
|
yunohost service add NAME_INIT.D --log "/home/yunohost.app/${app}/storage/logs/peertube.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -214,8 +229,6 @@ chown -R "$app":"$app" "$final_path" "$datadir"
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -237,6 +250,17 @@ systemctl start "$app"
|
||||||
echo $admin_pass | NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production npm run reset-password -- -u root
|
echo $admin_pass | NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production npm run reset-password -- -u root
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# TUNING CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
if [ $tuning -eq 1 ]
|
||||||
|
then
|
||||||
|
|
||||||
|
# Copy 30-peertube-tcp to /etc/sysctl.d/
|
||||||
|
cp -f ../30-peertube-tcp.conf /etc/sysctl.d/
|
||||||
|
sysctl -p /etc/sysctl.d/30-peertube-tcp.conf
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SEND A README FOR THE ADMIN
|
# SEND A README FOR THE ADMIN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -101,6 +101,14 @@ fi
|
||||||
# Delete a system user
|
# Delete a system user
|
||||||
ynh_system_user_delete "$app"
|
ynh_system_user_delete "$app"
|
||||||
|
|
||||||
|
# Remove 30-peertube-tcp.conf
|
||||||
|
if [ -f /etc/sysctl.d/30-peertube-tcp.conf ]; then
|
||||||
|
|
||||||
|
# Remove 30-peertube-tcp from /etc/sysctl.d/
|
||||||
|
rm -f /etc/sysctl.d/30-peertube-tcp.conf
|
||||||
|
sysctl -p
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SEND A README FOR THE ADMIN
|
# SEND A README FOR THE ADMIN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -136,6 +136,11 @@ ynh_restore_file "/etc/logrotate.d/$app"
|
||||||
# Set right permissions
|
# Set right permissions
|
||||||
chown -R "$app":"$app" "$final_path"
|
chown -R "$app":"$app" "$final_path"
|
||||||
|
|
||||||
|
# TUNING CONFIGURATION
|
||||||
|
# Copy 30-peertube-tcp to /etc/sysctl.d/
|
||||||
|
cp -f ../30-peertube-tcp.conf /etc/sysctl.d/
|
||||||
|
sysctl -p /etc/sysctl.d/30-peertube-tcp.conf
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -196,6 +196,12 @@ then
|
||||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# TUNING CONFIGURATION
|
||||||
|
# Copy 30-peertube-tcp to /etc/sysctl.d/
|
||||||
|
cp -f ../30-peertube-tcp.conf /etc/sysctl.d/
|
||||||
|
sysctl -p /etc/sysctl.d/30-peertube-tcp.conf
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue