diff --git a/README.md b/README.md index 2a03910..65a2295 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,10 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -This is a dummy description of this app features +Remote runner to offload heavy workloads jobs (such as transcoding) from one or several (distant) Peertube server. **Shipped version:** 1.0~ynh1 - -## Screenshots - -![Screenshot of PeerTube Remote Runner](./doc/screenshots/example.jpg) - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 2c6c725..7fa1d33 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,15 +16,10 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Ceci est une fausse description des fonctionalités de l'app +Un *runner* distant pour décharger le travail intense en ressources (comme le transcodage) d'un serveur PeerTube principal distant. **Version incluse :** 1.0~ynh1 - -## Captures d’écran - -![Capture d’écran de PeerTube Remote Runner](./doc/screenshots/example.jpg) - ## Documentations et ressources * Site officiel de l’app : diff --git a/conf/nginx.conf b/conf/nginx.conf deleted file mode 100644 index 7937e6b..0000000 --- a/conf/nginx.conf +++ /dev/null @@ -1,9 +0,0 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { - - # Path to source - alias __INSTALL_DIR__/; - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; -} diff --git a/conf/systemd.service b/conf/systemd.service index 99bcd29..908560e 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,7 +9,7 @@ Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/config Environment="__YNH_NODE_LOAD_PATH__" User=__APP__ Group=__APP__ -ExecStart=__YNH_NODE__ __INSTALL_DIR__/peertube-runner server +ExecStart=__YNH_NODE__ __INSTALL_DIR__/node_modules/@peertube/peertube-runner server WorkingDirectory=__INSTALL_DIR__/ StandardOutput=syslog StandardError=syslog diff --git a/doc/ADMIN.md b/doc/ADMIN.md deleted file mode 100644 index c9b5225..0000000 --- a/doc/ADMIN.md +++ /dev/null @@ -1,3 +0,0 @@ -This is a dummy admin doc for this app - -The app install dir is `__INSTALL_DIR__` diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 3f2e57a..4247c47 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1 +1 @@ -This is a dummy description of this app features +Remote runner to offload heavy workloads jobs (such as transcoding) from one or several (distant) Peertube server. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 13f4b64..04baf65 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1 @@ -Ceci est une fausse description des fonctionalités de l'app +Un *runner* distant pour décharger le travail intense en ressources (comme le transcodage) d'un serveur PeerTube principal distant. diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index f367b62..10655bf 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,7 +1,7 @@ -This is a dummy disclaimer to display after the install +The app url is `__DOMAIN____PATH__`. You will not need this in the future, the runner will contact Peertube directly. -The app url is `__DOMAIN____PATH__` +The app install dir is `__INSTALL_DIR__`. -The app install dir is `__INSTALL_DIR__` +The app id is `__ID__`. -The app id is `__ID__` +You now need to setup your Peertube server to use that remote runner for transcoding and so on : https://docs.joinpeertube.org/admin/remote-runners#enable-remote-runners diff --git a/doc/POST_UPGRADE.md b/doc/POST_UPGRADE.md deleted file mode 100644 index a58e2ae..0000000 --- a/doc/POST_UPGRADE.md +++ /dev/null @@ -1 +0,0 @@ -This is a dummy disclaimer to display after upgrades diff --git a/doc/PRE_INSTALL.md b/doc/PRE_INSTALL.md index eb3ab3a..83ae081 100644 --- a/doc/PRE_INSTALL.md +++ b/doc/PRE_INSTALL.md @@ -1 +1,2 @@ -This is a dummy disclaimer to display prior to the install +To install this app, you will need to specify one Peertube server URL (the use of several servers is not supported yet out of the box, it requires to run a specific command). +You will also need a remote runner token : https://docs.joinpeertube.org/admin/remote-runners#manage-remote-runners diff --git a/doc/PRE_INSTALL_fr.md b/doc/PRE_INSTALL_fr.md index 4a02cd5..0914266 100644 --- a/doc/PRE_INSTALL_fr.md +++ b/doc/PRE_INSTALL_fr.md @@ -1 +1,2 @@ -Ceci est un faux disclaimer à présenter avant l'installation +Pour installer cette application, vous devrez spécifier l'URL d'un serveur Peertube (l'utilisation de plusieurs serveurs n'est pas encore supportée, il faut exécuter une commande spécifique). +Vous aurez également besoin d'un jeton (*token*) d'exécution à distance : https://docs.joinpeertube.org/admin/remote-runners#manage-remote-runners diff --git a/doc/PRE_UPGRADE.md b/doc/PRE_UPGRADE.md deleted file mode 100644 index 780fc15..0000000 --- a/doc/PRE_UPGRADE.md +++ /dev/null @@ -1 +0,0 @@ -This is a dummy disclaimer to display prior to any upgrade diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/doc/screenshots/example.jpg b/doc/screenshots/example.jpg deleted file mode 100644 index a1efa1a..0000000 Binary files a/doc/screenshots/example.jpg and /dev/null differ diff --git a/manifest.toml b/manifest.toml index b85c468..1cd5779 100644 --- a/manifest.toml +++ b/manifest.toml @@ -37,7 +37,7 @@ ram.runtime = "1000M" [install.admin] type = "user" - [install.runner_url] + [install.peertube_url] type = "string" [install.runner_token] diff --git a/scripts/change_url b/scripts/change_url index f0964a6..567110b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -18,18 +18,18 @@ 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" -#================================================= -# MODIFY URL IN NGINX CONF -#================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 - -ynh_change_url_nginx_config - #================================================= # SPECIFIC MODIFICATIONS #================================================= -# ... +# CHANGE REMOTE RUNNER URL INSIDE PEERTUBE #================================================= +ynh_script_progression --message="Removing the runner from Peertube, registering it with the new URL and name..." --weight=1 + +pushd "$install_dir" + ynh_use_nodejs + ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" unregister --url $peertube_url --registration-token $runner_token --runner-name $app\_$(hostname) + ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" register --url $peertube_url --registration-token $runner_token --runner-name $app\_$(hostname) +popd #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 1daeb89..c622825 100755 --- a/scripts/install +++ b/scripts/install @@ -33,16 +33,13 @@ popd #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 - -ynh_add_nginx_config +ynh_script_progression --message="Adding peertube runner service $app..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config yunohost service add $app --description="Peertube remote runner" --log="/var/log/$app/$app.log" - #================================================= # APP INITIAL CONFIGURATION #================================================= @@ -62,8 +59,12 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RUNNER REGISTRATION #================================================= +ynh_script_progression --message="Registering the runner on Peertube server..." --weight=1 -peertube-runner register --url runner_url --registration-token runner_token --runner-name $app$(hostname) +pushd "$install_dir" + ynh_use_nodejs + ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" register --url $peertube_url --registration-token $runner_token --runner-name $app\_$(hostname) +popd #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 40511a1..2506ef7 100755 --- a/scripts/remove +++ b/scripts/remove @@ -10,10 +10,11 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# RUNNER REGISTRATION +# RUNNER UNREGISTRATION #================================================= +ynh_script_progression --message="Unregistering the runner on Peertube server..." --weight=1 -peertube-runner unregister --url runner_url --registration-token runner_token --runner-name $app$(hostname) +ynh_exec_as $app env $ynh_node_load_PATH NODE_CONFIG_DIR="$install_dir/config" NODE_ENV=production $ynh_node "$install_dir/node_modules/@peertube/peertube-runner" unregister --url $peertube_url --registration-token $runner_token --runner-name $app\_$(hostname) #================================================= # REMOVE SYSTEM CONFIGURATIONS @@ -31,9 +32,6 @@ fi ynh_remove_systemd_config -ynh_remove_nginx_config - - #================================================= # REMOVE NPM MODULE #=================================================