1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cockpit_ynh.git synced 2024-09-03 18:16:26 +02:00
This commit is contained in:
liberodark 2019-02-20 12:22:52 +01:00
parent d94e7ca183
commit 871443008f

View file

@ -47,7 +47,7 @@ app=$YNH_APP_INSTANCE_NAME
### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". ### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app".
### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" ### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app"
final_path=/opt/yunohost/$app final_path=/var/www/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder" test ! -e "$final_path" || ynh_die "This path already contains a folder"
# Normalize the url path syntax # Normalize the url path syntax
@ -66,6 +66,16 @@ ynh_app_setting_set $app domain $domain
ynh_app_setting_set $app path $path_url ynh_app_setting_set $app path $path_url
ynh_app_setting_set $app is_public $is_public ynh_app_setting_set $app is_public $is_public
#==============================================
# INSTALL DEPS
#==============================================
## Install the backports repo for debian
echo 'deb http://deb.debian.org/debian stretch-backports main' > \
/etc/apt/sources.list.d/$app.list
ynh_package_update
#================================================= #=================================================
# FIND AND OPEN A PORT # FIND AND OPEN A PORT
#================================================= #=================================================
@ -76,7 +86,7 @@ ynh_app_setting_set $app is_public $is_public
### - Remove the section "CLOSE A PORT" in the remove script ### - Remove the section "CLOSE A PORT" in the remove script
# Find a free port # Find a free port
port=$(ynh_find_port 8096) port=$(ynh_find_port 9090)
# Open this port # Open this port
yunohost firewall allow --no-upnp TCP $port 2>&1 yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_app_setting_set $app port $port ynh_app_setting_set $app port $port
@ -85,15 +95,15 @@ ynh_app_setting_set $app port $port
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_app_setting_set $app final_path $final_path #ynh_app_setting_set $app final_path $final_path
# 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 "$final_path" #ynh_setup_source "$final_path"
#============================================== #==============================================
# INSTALL EMBY # INSTALL COCKPIT
#============================================== #==============================================
dpkg --install $final_path/emby-server-deb* ynh_package_install cockpit
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -107,7 +117,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# Create a system user # Create a system user
ynh_system_user_create $app #ynh_system_user_create $app
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
@ -140,7 +150,7 @@ ynh_system_user_create $app
# Set permissions to app files # Set permissions to app files
#chown -R root: /etc/loolwsd #chown -R root: /etc/loolwsd
rm /etc/apt/sources.list.d/$app.list
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
@ -153,4 +163,5 @@ if [ $is_public -eq 1 ]; then
fi fi
# Reload services # Reload services
systemctl reload nginx #systemctl enable --now cockpit
systemctl reload nginx