diff --git a/check_process b/check_process index d0c50d7..aacfa4f 100644 --- a/check_process +++ b/check_process @@ -4,6 +4,7 @@ domain="domain.tld" (DOMAIN) welcometext="Welcome to my mumble server" registername="Root" + mumbleweb=1 ; Checks pkg_linter=1 setup_sub_dir=0 @@ -11,10 +12,10 @@ setup_nourl=1 setup_private=0 setup_public=0 - upgrade=1 + upgrade=0 # latest published in community.json - backup_restore=1 - multi_instance=1 + backup_restore=0 + multi_instance=0 wrong_user=0 wrong_path=0 incorrect_path=0 @@ -33,4 +34,4 @@ Level 10=0 ;;; Options Email=jean-baptiste@holcroft.fr -Notification=all \ No newline at end of file +Notification=all diff --git a/conf/mumble-web.service b/conf/mumble-web.service new file mode 100644 index 0000000..5e8797f --- /dev/null +++ b/conf/mumble-web.service @@ -0,0 +1,15 @@ +[Unit] +Description=Mumble web interface +Documentation=https://github.com/johni0702/mumble-web +Requires=network.target mumble-server.service +After=network.target mumble-server.service + +[Service] +Type=simple +User=www-data +Environment="PATH=__ENV_PATH__" +Environment=NODE_ENV=production +ExecStart=/usr/bin/websockify --web=/usr/lib/node_modules/mumble-web/dist --ssl-target localhost:64737 localhost:64738 + +[Install] +WantedBy=multi-user.target diff --git a/manifest.json b/manifest.json index 4b587f6..bab7187 100644 --- a/manifest.json +++ b/manifest.json @@ -46,6 +46,14 @@ }, "example": "Root", "default": "Root" + }, + { + "name": "mumbleweb", + "type": "boolean", + "ask": { + "en": "Install the web application? (mumble-web)" + }, + "default": false } ] } diff --git a/scripts/install b/scripts/install index 187085b..42e9e4d 100644 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ app=$YNH_APP_INSTANCE_NAME welcometext=$YNH_APP_ARG_WELCOMETEXT registerName=$YNH_APP_ARG_REGISTERNAME instance_id=$YNH_APP_INSTANCE_NUMBER +mumbleweb=$YNH_APP_ARG_MUMBLEWEB server_password=$(ynh_string_random) su_passwd=$(ynh_string_random) @@ -51,6 +52,7 @@ ynh_app_setting_set "$app" su_passwd "$su_passwd" ynh_app_setting_set "$app" welcometext "$welcometext" ynh_app_setting_set "$app" registerName "$registerName" ynh_app_setting_set "$app" instance_id "$instance_id" +ynh_app_setting_set "$app" mumbleweb "$mumbleweb" #================================================= # STANDARD MODIFICATIONS @@ -69,7 +71,20 @@ yunohost firewall allow Both "$port" #================================================= # Install Mumble Debian package via apt -ynh_install_app_dependencies mumble-server mailutils +ynh_install_app_dependencies mumble-server mailutils websockify + +ynh_install_nodejs --nodejs_version="10" + +#================================================= +# INSTALL Mumble-web +#================================================= + +if [ "$mumbleweb" -eq 1 ] ; then + ynh_use_nodejs + ( + npm install mumble-web@0.5.1 + ) +fi #================================================= # SPECIFIC SETUP @@ -101,6 +116,7 @@ ynh_store_file_checksum "$mumble_conf" # Create a dedicated systemd config ynh_add_systemd_config +ynh_add_systemd_config mumble-web #================================================= # GENERIC FINALIZATION @@ -158,4 +174,4 @@ If you changed it manually and upgrade mumble, you'll find a backup in $final_pa Are you facing an issue, want to improve this app or say thank you? Please open a new issue in this project: https://github.com/YunoHost-Apps/mumbleserver_ynh " -ynh_send_readme_to_admin "$message" \ No newline at end of file +ynh_send_readme_to_admin "$message" diff --git a/scripts/remove b/scripts/remove index 30e8f7c..362ef6d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -37,6 +37,7 @@ fi # Remove the dedicated systemd config ynh_remove_systemd_config +ynh_remove_systemd_config mumble-web #================================================= # REMOVE DEPENDENCIES @@ -45,6 +46,12 @@ ynh_remove_systemd_config # Remove metapackage and its dependencies ynh_remove_app_dependencies +#================================================= +# REMOVE NODEJS +#================================================= + +ynh_remove_nodejs + #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 97c1088..5256c6a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,7 @@ registerName=$(ynh_app_setting_get "$app" registerName) port=$(ynh_app_setting_get "$app" port) final_path=$(ynh_app_setting_get "$app" final_path) instance_id=$(ynh_app_setting_get "$app" instance_id) +mumbleweb=$(ynh_app_setting_get "$app" mumbleweb) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -116,7 +117,7 @@ ynh_abort_if_errors #================================================= # Install Mumble Debian package via apt -ynh_install_app_dependencies mumble-server mailutils +ynh_install_app_dependencies mumble-server mailutils websockify #================================================= # SPECIFIC UPGRADE @@ -208,4 +209,4 @@ If you changed it manually and upgrade mumble, you'll find a backup in $final_pa Are you facing an issue, want to improve this app or say thank you? Please open a new issue in this project: https://github.com/YunoHost-Apps/mumbleserver_ynh " -ynh_send_readme_to_admin "$message" \ No newline at end of file +ynh_send_readme_to_admin "$message"