diff --git a/conf/advancedsettings.xml b/conf/advancedsettings.xml new file mode 100644 index 0000000..5b0f2b1 --- /dev/null +++ b/conf/advancedsettings.xml @@ -0,0 +1,7 @@ + + + true + true + true + + \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..03a27f0 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,10 @@ +location __PATH__/ { + proxy_pass http://127.0.0.1:8080/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 7f412c9..fb70d6a 100644 --- a/scripts/install +++ b/scripts/install @@ -45,7 +45,6 @@ ynh_app_setting_set $app launch_on_boot $launch_on_boot #================================================= sudo mkdir /home/$app ynh_system_user_create "$app" "/home/$app" -sudo chown -R $app:$app /home/$app sudo usermod -a -G cdrom,audio,video,plugdev,users,dialout,dip,input $app #================================================= @@ -64,7 +63,7 @@ if [[ $arch != arm* ]]; then sudo cp ../conf/kodi.list /etc/apt/sources.list.d/${app}.list fi ynh_package_update -ynh_package_install xorg dbus-x11 kodi +ynh_package_install xserver-xorg-legacy xorg dbus-x11 kodi #================================================= # X11 SETTINGS @@ -72,3 +71,10 @@ ynh_package_install xorg dbus-x11 kodi sudo sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config +#================================================= +# CONTROL WEB INTERFACE +#================================================= +sudo mkdir -p /home/$app/.kodi/userdata/ +sudo cp ../conf/advancedsettings.xml /home/$app/.kodi/userdata/advancedsettings.xml +sudo chown -R $app:$app /home/$app +ynh_add_nginx_config diff --git a/scripts/remove b/scripts/remove index 40f1916..1ae428e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,7 +25,7 @@ launch_on_boot=$(ynh_app_setting_get $app launch_on_boot) #================================================= # Remove metapackage and its dependencies sudo sed -i 's/allowed_users=anybody/allowed_users=console/' /etc/X11/Xwrapper.config -ynh_package_autoremove kodi xorg dbus-x11 +ynh_package_autoremove kodi xorg dbus-x11 xserver-xorg-legacy arch=$(uname -m) if [[ $arch != arm* ]]; then sudo rm -f "/etc/apt/sources.list.d/${app}.list" @@ -53,4 +53,10 @@ ynh_system_user_delete "$app" sudo rm -rf "/home/$app" +#================================================= +# REMOVE NGINX CONFIGURATION +#================================================= +ynh_remove_nginx_config + +