From d930d39947e26d1a8cb649e7dc449048c8e675d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:09:13 +0100 Subject: [PATCH 1/7] Update nginx.conf --- conf/nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 63b9113..7ad64ad 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,5 @@ -location / { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $host; From dc3e5ae409063fd715a761f70351ce5204496769 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 24 Feb 2023 00:32:44 +0100 Subject: [PATCH 2/7] [autopatch] Upgrade auto-updater --- .github/workflows/updater.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index fd6ed60..609c284 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Fetch the source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Run the updater script @@ -33,7 +33,7 @@ jobs: - name: Create Pull Request id: cpr if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: Update to version ${{ env.VERSION }} From 9d46aaeb5c0a2f2064235ffc16fa70b426e936e8 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 23 Feb 2023 23:32:46 +0000 Subject: [PATCH 3/7] Auto-update README --- README.md | 3 ++- README_fr.md | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 57dc4ba..2532a9b 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Owncast for YunoHost -[![Integration level](https://dash.yunohost.org/integration/owncast.svg)](https://dash.yunohost.org/appci/app/owncast) ![Working status](https://ci-apps.yunohost.org/ci/badges/owncast.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/owncast.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/owncast.svg)](https://dash.yunohost.org/appci/app/owncast) ![Working status](https://ci-apps.yunohost.org/ci/badges/owncast.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/owncast.maintain.svg) + [![Install Owncast with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=owncast) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index 902f008..e327139 100755 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,16 @@ It shall NOT be edited by hand. # Owncast pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/owncast.svg)](https://dash.yunohost.org/appci/app/owncast) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/owncast.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/owncast.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/owncast.svg)](https://dash.yunohost.org/appci/app/owncast) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/owncast.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/owncast.maintain.svg) + [![Installer Owncast avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=owncast) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Owncast rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Owncast rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble Owncast est un serveur de diffusion en direct et de chat open source, auto-hébergé, décentralisé et à utilisateur unique pour exécuter vos propres diffusions en direct dans un style similaire aux grandes options grand public. Il offre une propriété complète sur votre contenu, votre interface, votre modération et votre audience. @@ -21,9 +22,9 @@ Owncast est un serveur de diffusion en direct et de chat open source, auto-hébe **Démo :** https://watch.owncast.online/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de Owncast](./doc/screenshots/owncast-screenshot.png) +![Capture d’écran de Owncast](./doc/screenshots/owncast-screenshot.png) ## Avertissements / informations importantes @@ -44,9 +45,9 @@ OBS peut être utilisé comme application de streaming vidéo : https://obsproje ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -62,4 +63,4 @@ ou sudo yunohost app upgrade owncast -u https://github.com/YunoHost-Apps/owncast_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From 77472aca2a5338f948c90e6defe20ce7a7946abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:35:29 +0100 Subject: [PATCH 4/7] v2 --- conf/systemd.service | 4 +-- manifest.toml | 51 ++++++++++++++++++++++++++++++++++++ scripts/_common.sh | 2 +- scripts/backup | 12 ++++----- scripts/install | 62 ++++++++++++++++++++++---------------------- scripts/remove | 22 ++++++++-------- scripts/restore | 38 +++++++++++++-------------- scripts/upgrade | 44 +++++++++++++++---------------- 8 files changed, 143 insertions(+), 92 deletions(-) create mode 100644 manifest.toml diff --git a/conf/systemd.service b/conf/systemd.service index 5ef2b2e..6a614db 100755 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,8 +6,8 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/owncast --enableVerboseLogging -webserverport __PORT__ +WorkingDirectory=__INSTALL_DIR__/ +ExecStart=__INSTALL_DIR__/owncast --enableVerboseLogging -webserverport __PORT__ Restart=on-failure RestartSec=5 diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..99baecb --- /dev/null +++ b/manifest.toml @@ -0,0 +1,51 @@ +packaging_format = 2 + +id = "owncast" +name = "Owncast" +description.en = "Self-hosted live video and web chat server for use with existing broadcasting software" +description.fr = "Serveur de vidéo en direct et de chat Web auto-hébergé à utiliser avec un logiciel de diffusion" + +version = "0.0.13~ynh2" + +maintainers = ["eric_G"] + +[upstream] +license = "MIT" +website = "https://owncast.online/" +demo = "https://watch.owncast.online/" +admindoc = "https://owncast.online/docs/" +code = "https://github.com/owncast/owncast" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = false +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + help.en = "Owncast needs to be installed in a dedicated domain or sub-domain." + help.fr = "Owncast doit être installé dans un domaine ou sous-domaine dédié." + type = "domain" + full_domain = true + + [install.init_main_permission] + help.en = "If enabled, Owncast will be accessible by people who do not have an account. This can be changed later via the webadmin." + help.fr = "Si cette case est cochée, Owncast sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + type = "group" + default = "visitors" + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index a40bad9..0d59030 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="ffmpeg" +#REMOVEME? pkg_dependencies="ffmpeg" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 4103270..1d69599 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,17 +15,17 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -36,7 +36,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index 0ebd438..090e37a 100755 --- a/scripts/install +++ b/scripts/install @@ -14,51 +14,51 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url="/" -is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +path="/" +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path #================================================= # STANDARD MODIFICATIONS #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port=$(ynh_find_port --port=8095) -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? port=$(ynh_find_port --port=8095) +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port # Find an available port for stream -stream_port=$(ynh_find_port --port=1935) -ynh_app_setting_set --app=$app --key=stream_port --value=$stream_port +#REMOVEME? stream_port=$(ynh_find_port --port=1935) +#REMOVEME? ynh_app_setting_set --app=$app --key=stream_port --value=$stream_port # Open the port ynh_script_progression --message="Configuring firewall..." --weight=1 @@ -67,30 +67,30 @@ ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $stream_port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=1 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=4 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH +ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # NGINX CONFIGURATION @@ -137,20 +137,20 @@ sleep 20 #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index aaf1c2a..726305a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,13 +12,13 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -stream_port=$(ynh_app_setting_get --app=$app --key=stream_port) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? stream_port=$(ynh_app_setting_get --app=$app --key=stream_port) #================================================= # STANDARD REMOVE @@ -52,18 +52,18 @@ ynh_remove_logrotate #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=2 +#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=2 # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE NGINX CONFIGURATION @@ -96,10 +96,10 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 3674ae2..f64d241 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,28 +15,28 @@ source /usr/share/yunohost/helpers #================================================= # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -stream_port=$(ynh_app_setting_get --app=$app --key=stream_port) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? stream_port=$(ynh_app_setting_get --app=$app --key=stream_port) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS @@ -50,31 +50,31 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=2 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index f49497f..79b22cd 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,15 +12,15 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -stream_port=$(ynh_app_setting_get --app=$app --key=stream_port) -port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? stream_port=$(ynh_app_setting_get --app=$app --key=stream_port) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION @@ -31,16 +31,16 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -54,10 +54,10 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -68,12 +68,12 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH + ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # NGINX CONFIGURATION @@ -86,9 +86,9 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1 -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies #================================================= # SETUP SYSTEMD @@ -124,9 +124,9 @@ sleep 20 #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From d75fc43f23986de7ca4f76d56d1310cf920866a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:43:47 +0100 Subject: [PATCH 5/7] Fix --- check_process | 24 ------------ manifest.json | 51 -------------------------- manifest.toml | 26 +++++++------ scripts/_common.sh | 3 -- scripts/backup | 17 --------- scripts/change_url | 85 +------------------------------------------ scripts/install | 91 +--------------------------------------------- scripts/remove | 47 ------------------------ scripts/restore | 49 +------------------------ scripts/upgrade | 52 +------------------------- tests.toml | 7 ++++ 11 files changed, 26 insertions(+), 426 deletions(-) delete mode 100755 check_process delete mode 100755 manifest.json create mode 100644 tests.toml diff --git a/check_process b/check_process deleted file mode 100755 index 4691619..0000000 --- a/check_process +++ /dev/null @@ -1,24 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/path" - is_public=1 - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - #upgrade=1 from_commit=4eab5026853627bed955945968753378ea41f5ad - backup_restore=1 - multi_instance=0 - change_url=1 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=4eab5026853627bed955945968753378ea41f5ad - name= Merge pull request #1 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=1Strong-Password diff --git a/manifest.json b/manifest.json deleted file mode 100755 index 30c558b..0000000 --- a/manifest.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "Owncast", - "id": "owncast", - "packaging_format": 1, - "description": { - "en": "Self-hosted live video and web chat server for use with existing broadcasting software", - "fr": "Serveur de vidéo en direct et de chat Web auto-hébergé à utiliser avec un logiciel de diffusion" - }, - "version": "0.0.13~ynh2", - "url": "https://owncast.online/", - "upstream": { - "license": "MIT", - "website": "https://owncast.online/", - "demo": "https://watch.owncast.online/", - "admindoc": "https://owncast.online/docs/", - "code": "https://github.com/owncast/owncast" - }, - "license": "MIT", - "maintainer": { - "name": "eric_G", - "email": "" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain", - "help": { - "en": "Owncast needs to be installed in a dedicated domain or sub-domain.", - "fr": "Owncast doit être installé dans un domaine ou sous-domaine dédié." - } - }, - { - "name": "is_public", - "type": "boolean", - "help": { - "en": "If enabled, Owncast will be accessible by people who do not have an account. This can be changed later via the webadmin.", - "fr": "Si cette case est cochée, Owncast sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." - }, - "default": true - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 99baecb..b133e36 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Owncast" description.en = "Self-hosted live video and web chat server for use with existing broadcasting software" description.fr = "Serveur de vidéo en direct et de chat Web auto-hébergé à utiliser avec un logiciel de diffusion" -version = "0.0.13~ynh2" +version = "0.0.13~ynh3" maintainers = ["eric_G"] @@ -15,22 +15,19 @@ website = "https://owncast.online/" demo = "https://watch.owncast.online/" admindoc = "https://owncast.online/docs/" code = "https://github.com/owncast/owncast" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.1.12" +architectures = ["amd64", "armhf", "arm64"] multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = false +sso = false +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core help.en = "Owncast needs to be installed in a dedicated domain or sub-domain." help.fr = "Owncast doit être installé dans un domaine ou sous-domaine dédié." type = "domain" @@ -43,9 +40,16 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen default = "visitors" [resources] + [resources.ports] + stream.default = 1935 + stream.exposed = "TCP" + [resources.system_user] [resources.install_dir] [resources.permissions] main.url = "/" + + [resources.apt] + packages = "ffmpeg" diff --git a/scripts/_common.sh b/scripts/_common.sh index 0d59030..f1a0166 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="ffmpeg" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 1d69599..9167fc7 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,23 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index 8f745a8..7b9d74e 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,60 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -port=$(ynh_app_setting_get --app=$app --key=port) - -#================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=3 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. - ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -77,29 +23,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi +ynh_change_url_nginx_config #================================================= # GENERIC FINALISATION @@ -110,13 +34,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 090e37a..d3c9e3f 100755 --- a/scripts/install +++ b/scripts/install @@ -9,82 +9,11 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -path="/" -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=8095) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - -# Find an available port for stream -#REMOVEME? stream_port=$(ynh_find_port --port=1935) -#REMOVEME? ynh_app_setting_set --app=$app --key=stream_port --value=$stream_port - -# Open the port -ynh_script_progression --message="Configuring firewall..." --weight=1 -ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $stream_port - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=1 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=4 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH @@ -123,7 +52,7 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="Self-hosted live video and web chat server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$stream_port" +yunohost service add $app --description="Self-hosted live video and web chat server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port_stream" #================================================= # START SYSTEMD SERVICE @@ -134,24 +63,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" sleep 20 -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary -#REMOVEME? if [ $is_public -eq 1 ] -then -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 726305a..af75639 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,17 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? stream_port=$(ynh_app_setting_get --app=$app --key=stream_port) - #================================================= # STANDARD REMOVE #================================================= @@ -49,22 +38,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=2 - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -73,16 +46,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $stream_port$" -then - ynh_script_progression --message="Closing port $stream_port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $stream_port -fi - #================================================= # REMOVE VARIOUS FILES #================================================= @@ -91,16 +54,6 @@ ynh_script_progression --message="Removing various files..." --weight=1 # Remove the log files ynh_secure_remove --file="/var/log/$app" -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index f64d241..157745b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,34 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? stream_port=$(ynh_app_setting_get --app=$app --key=stream_port) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -47,14 +19,6 @@ ynh_script_progression --message="Restoring the NGINX configuration..." --weight ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -62,20 +26,9 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 - -# Define and install dependencies -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # RESTORE SYSTEMD #================================================= @@ -96,7 +49,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -yunohost service add $app --description="Self-hosted live video and web chat server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$stream_port" +yunohost service add $app --description="Self-hosted live video and web chat server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port_stream" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 79b22cd..ea2eb11 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,39 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? stream_port=$(ynh_app_setting_get --app=$app --key=stream_port) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) - #================================================= # CHECK VERSION #================================================= upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -51,14 +24,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -71,7 +36,6 @@ then ynh_setup_source --dest_dir="$install_dir" --source_id=$YNH_ARCH fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -83,13 +47,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - #================================================= # SETUP SYSTEMD #================================================= @@ -111,7 +68,7 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -yunohost service add $app --description="Self-hosted live video and web chat server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$stream_port" +yunohost service add $app --description="Self-hosted live video and web chat server" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port_stream" #================================================= # START SYSTEMD SERVICE @@ -121,13 +78,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" sleep 20 -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..91daf17 --- /dev/null +++ b/tests.toml @@ -0,0 +1,7 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ \ No newline at end of file From d7981b24d31eb33ecf49e21a7a23738e7f37fdf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:49:13 +0100 Subject: [PATCH 6/7] fix --- doc/{DISCLAIMER.md => ADMIN.md} | 6 +++--- doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 0 doc/POST_INSTALL.md | 1 + doc/POST_INSTALL_fr.md | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) rename doc/{DISCLAIMER.md => ADMIN.md} (76%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (100%) create mode 100755 doc/POST_INSTALL.md create mode 100755 doc/POST_INSTALL_fr.md diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 76% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md index ba5cc0d..91672e3 100755 --- a/doc/DISCLAIMER.md +++ b/doc/ADMIN.md @@ -1,6 +1,6 @@ ## Configuration -You can configure Owncast in the admin page: `domain.ltd/admin` with `admin` and `abc123` as credential. Don't forget to change the stream key. +You can configure Owncast in the admin page: `__DOMAIN__/admin` with `admin` and `abc123` as credential. Don't forget to change the stream key. ## Streaming app @@ -9,10 +9,10 @@ OBS can be used as streaming video app: https://obsproject.com/ 1. Install OBS or Streamlabs OBS and get it working with your local setup. 1. Open OBS Settings and go to **Stream**. 1. Select **Custom…** as the service. -1. Enter the URL of the server running your streaming service in the format of `rtmp://myserver.net/live`. +1. Enter the URL of the server running your streaming service in the format of `rtmp://__DOMAIN__/live`. 1. Enter your **Stream Key** that matches your key file. 1. Press **Start Streaming** (OBS) or **Go Live** (Streamlabs) on OBS. ## Standalone chat mode -`https://live.domain.ltd/index-standalone-chat-readwrite.html` \ No newline at end of file +`https://__DOMAIN__/index-standalone-chat-readwrite.html` \ No newline at end of file diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100755 index 0000000..d38fd51 --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1 @@ +You can configure Owncast in the admin page: `__DOMAIN__/admin` with `admin` and `abc123` as credential. Don't forget to change the stream key. \ No newline at end of file diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md new file mode 100755 index 0000000..079f2cc --- /dev/null +++ b/doc/POST_INSTALL_fr.md @@ -0,0 +1 @@ +Vous pouvez configurer Owncast dans la page d'administration : `__DOMAIN__/admin` avec `admin` et `abc123` comme identifiant. N'oubliez pas de changer la clé de flux (Stream Key). From 2beb182761cd11ffe1938d16543cc9e8ebbf07df Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 2 Mar 2023 18:49:19 +0000 Subject: [PATCH 7/7] Auto-update README --- README.md | 22 +--------------------- README_fr.md | 19 +------------------ 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 2532a9b..88d3573 100755 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Owncast is an open source, self-hosted, decentralized, single user live streaming and chat server for running your own live streams similar in style to the large mainstream options. It offers complete ownership over your content, interface, moderation and audience. -**Shipped version:** 0.0.13~ynh2 +**Shipped version:** 0.0.13~ynh3 **Demo:** https://watch.owncast.online/ @@ -26,26 +26,6 @@ Owncast is an open source, self-hosted, decentralized, single user live streamin ![Screenshot of Owncast](./doc/screenshots/owncast-screenshot.png) -## Disclaimers / important information - -## Configuration - -You can configure Owncast in the admin page: `domain.ltd/admin` with `admin` and `abc123` as credential. Don't forget to change the stream key. - -## Streaming app - -OBS can be used as streaming video app: https://obsproject.com/ - -1. Install OBS or Streamlabs OBS and get it working with your local setup. -1. Open OBS Settings and go to **Stream**. -1. Select **Custom…** as the service. -1. Enter the URL of the server running your streaming service in the format of `rtmp://myserver.net/live`. -1. Enter your **Stream Key** that matches your key file. -1. Press **Start Streaming** (OBS) or **Go Live** (Streamlabs) on OBS. - -## Standalone chat mode - -`https://live.domain.ltd/index-standalone-chat-readwrite.html` ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index e327139..cef8c22 100755 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Owncast est un serveur de diffusion en direct et de chat open source, auto-hébergé, décentralisé et à utilisateur unique pour exécuter vos propres diffusions en direct dans un style similaire aux grandes options grand public. Il offre une propriété complète sur votre contenu, votre interface, votre modération et votre audience. -**Version incluse :** 0.0.13~ynh2 +**Version incluse :** 0.0.13~ynh3 **Démo :** https://watch.owncast.online/ @@ -26,23 +26,6 @@ Owncast est un serveur de diffusion en direct et de chat open source, auto-hébe ![Capture d’écran de Owncast](./doc/screenshots/owncast-screenshot.png) -## Avertissements / informations importantes - -## Configuration - -Vous pouvez configurer Owncast dans la page d'administration : `domain.ltd/admin` avec `admin` et `abc123` comme identifiant. N'oubliez pas de changer la clé de flux (Stream Key). - -## Application de diffusion en continu - -OBS peut être utilisé comme application de streaming vidéo : https://obsproject.com/ - -1. Installez **OBS** ou **Streamlabs OBS** et faites-le fonctionner avec votre configuration locale. -1. Ouvrez les **paramètres** OBS et allez dans **Stream**. -1. Sélectionnez **Personnalisé…** comme service. -1. Entrez l'URL du serveur exécutant votre service de streaming au format `rtmp://myserver.net/live`. -1. Saisissez votre « Stream key » qui correspond à votre clé de streaming choisie lors de l'installation. -1. Appuyez sur **Démarrer le streaming** (OBS) ou **Go Live** (Streamlabs) sur OBS. - ## Documentations et ressources * Site officiel de l’app :