1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piped_ynh.git synced 2024-09-03 20:05:54 +02:00

Merge pull request #4 from YunoHost-Apps/testing

Initial release
This commit is contained in:
Mateusz 2024-01-29 03:11:21 +01:00 committed by GitHub
commit 6cc306f3b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 356 additions and 36 deletions

View file

@ -1 +1,88 @@
# piped_ynh <!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Piped for YunoHost
[![Integration level](https://dash.yunohost.org/integration/piped.svg)](https://dash.yunohost.org/appci/app/piped) ![Working status](https://ci-apps.yunohost.org/ci/badges/piped.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/piped.maintain.svg)
[![Install Piped with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=piped)
*[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install Piped quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview
# The Problem
YouTube has an extremely invasive privacy policy which relies on using user data in unethical ways. You give them a lot of data - ranging from ideas, music taste, content, political opinions, and much more than you think.
By using Piped, you can freely watch and listen to content without the fear of prying eyes watching everything you are doing.
## Features:
**User Features**
- [x] No Ads
- [x] No Tracking
- [x] Lightweight on server and client
- [x] Infinite Scrolling
- [x] Light/Dark themes
- [x] Login
- [x] Feeds
- [x] Playlists
- [x] Integration with [SponsorBlock](https://github.com/ajayyy/SponsorBlock)
- [x] Integration with [LBRY](https://lbry.com/) for streaming
- [x] Integration with [Return YouTube Dislike](https://returnyoutubedislike.com/) via [RYD-Proxy](https://github.com/TeamPiped/RYD-Proxy)
- [x] 4K support
- [x] No connections to Google's servers
- [x] Playing just audio
- [x] PWA support
- [x] Locally saved Preferences
- [x] [Available in many languages](src/locales), thanks to [our translators](https://hosted.weblate.org/projects/piped/frontend/)
- [x] Embedded video support
- [x] No age restriction
- [x] Bypasses Geo restrictions if possible through a federated network
**Technical Features**
- [x] Multi-region load-balancing
- [x] Performant by design, designed to handle 1000s of users concurrently
- [x] Does not use official YouTube APIs
- [x] Uses [NewPipeExtractor](https://github.com/TeamNewPipe/NewPipeExtractor) to extract information
- [x] Public [JSON API](https://docs.piped.video/docs/api-documentation/)
- [x] Federated protocol on Matrix to let instances collaborate with each other
**Shipped version:** 2024.01.21~ynh1
**Demo:** https://piped.video/
## Screenshots
![Screenshot of Piped](./doc/screenshots/channel.png)
![Screenshot of Piped](./doc/screenshots/player.png)
## Documentation and resources
* Official app website: <https://docs.piped.video/>
* Official admin documentation: <https://docs.piped.video/docs/>
* Upstream app code repository: <https://github.com/TeamPiped/Piped>
* YunoHost Store: <https://apps.yunohost.org/app/piped>
* Report a bug: <https://github.com/YunoHost-Apps/piped_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/piped_ynh/tree/testing).
To try the testing branch, please proceed like that.
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/piped_ynh/tree/testing --debug
or
sudo yunohost app upgrade piped -u https://github.com/YunoHost-Apps/piped_ynh/tree/testing --debug
```
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

88
README_fr.md Normal file
View file

@ -0,0 +1,88 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Piped pour YunoHost
[![Niveau dintégration](https://dash.yunohost.org/integration/piped.svg)](https://dash.yunohost.org/appci/app/piped) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/piped.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/piped.maintain.svg)
[![Installer Piped avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=piped)
*[Read this readme in english.](./README.md)*
> *Ce package vous permet dinstaller Piped rapidement et simplement sur un serveur YunoHost.
Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
## Vue densemble
# The Problem
YouTube has an extremely invasive privacy policy which relies on using user data in unethical ways. You give them a lot of data - ranging from ideas, music taste, content, political opinions, and much more than you think.
By using Piped, you can freely watch and listen to content without the fear of prying eyes watching everything you are doing.
## Features:
**User Features**
- [x] No Ads
- [x] No Tracking
- [x] Lightweight on server and client
- [x] Infinite Scrolling
- [x] Light/Dark themes
- [x] Login
- [x] Feeds
- [x] Playlists
- [x] Integration with [SponsorBlock](https://github.com/ajayyy/SponsorBlock)
- [x] Integration with [LBRY](https://lbry.com/) for streaming
- [x] Integration with [Return YouTube Dislike](https://returnyoutubedislike.com/) via [RYD-Proxy](https://github.com/TeamPiped/RYD-Proxy)
- [x] 4K support
- [x] No connections to Google's servers
- [x] Playing just audio
- [x] PWA support
- [x] Locally saved Preferences
- [x] [Available in many languages](src/locales), thanks to [our translators](https://hosted.weblate.org/projects/piped/frontend/)
- [x] Embedded video support
- [x] No age restriction
- [x] Bypasses Geo restrictions if possible through a federated network
**Technical Features**
- [x] Multi-region load-balancing
- [x] Performant by design, designed to handle 1000s of users concurrently
- [x] Does not use official YouTube APIs
- [x] Uses [NewPipeExtractor](https://github.com/TeamNewPipe/NewPipeExtractor) to extract information
- [x] Public [JSON API](https://docs.piped.video/docs/api-documentation/)
- [x] Federated protocol on Matrix to let instances collaborate with each other
**Version incluse :** 2024.01.21~ynh1
**Démo :** https://piped.video/
## Captures décran
![Capture décran de Piped](./doc/screenshots/channel.png)
![Capture décran de Piped](./doc/screenshots/player.png)
## Documentations et ressources
* Site officiel de lapp : <https://docs.piped.video/>
* Documentation officielle de ladmin : <https://docs.piped.video/docs/>
* Dépôt de code officiel de lapp : <https://github.com/TeamPiped/Piped>
* YunoHost Store: <https://apps.yunohost.org/app/piped>
* Signaler un bug : <https://github.com/YunoHost-Apps/piped_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/piped_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/piped_ynh/tree/testing --debug
ou
sudo yunohost app upgrade piped -u https://github.com/YunoHost-Apps/piped_ynh/tree/testing --debug
```
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View file

@ -29,7 +29,7 @@ location ~ (__PATH__/proxy/videoplayback|__PATH__/proxy/api/v4/|__PATH__/proxy/a
proxy_max_temp_file_size 32m; proxy_max_temp_file_size 32m;
access_log off; access_log off;
proxy_pass http://127.0.0.1:__PORT_PROXY__; proxy_pass http://127.0.0.1:__PORT_PROXY__;
add_header Cache-Control private always; more_set_headers "Cache-Control: private always";
} }
location __PATH__/proxy/ { location __PATH__/proxy/ {
@ -51,7 +51,7 @@ location __PATH__/proxy/ {
proxy_max_temp_file_size 32m; proxy_max_temp_file_size 32m;
access_log off; access_log off;
proxy_pass http://127.0.0.1:__PORT_PROXY__/; proxy_pass http://127.0.0.1:__PORT_PROXY__/;
add_header Cache-Control "public, max-age=604800"; more_set_headers "Cache-Control: 'public, max-age=604800'";
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 209 KiB

View file

@ -10,7 +10,7 @@ version = "2024.01.21~ynh1"
maintainers = ["orhtej2"] maintainers = ["orhtej2"]
[upstream] [upstream]
license = "GNU AFFERO GPL" license = "AGPL-3.0-or-later"
website = "https://docs.piped.video/" website = "https://docs.piped.video/"
demo = "https://piped.video/" demo = "https://piped.video/"
admindoc = "https://docs.piped.video/docs/" admindoc = "https://docs.piped.video/docs/"
@ -19,7 +19,7 @@ code = "https://github.com/TeamPiped/Piped"
[integration] [integration]
yunohost = '>= 11.2' yunohost = '>= 11.2'
architectures = "all" architectures = ["amd64", "arm64"]
multi_instance = true multi_instance = true
ldap = false ldap = false
sso = false sso = false
@ -54,8 +54,10 @@ ram.runtime = "50M"
autoupdate.strategy = "latest_github_commit" autoupdate.strategy = "latest_github_commit"
[resources.sources.jdk] [resources.sources.jdk]
url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B13/OpenJDK21U-jdk_x64_linux_hotspot_21.0.2_13.tar.gz" amd64.url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B13/OpenJDK21U-jdk_x64_linux_hotspot_21.0.2_13.tar.gz"
sha256 = "454bebb2c9fe48d981341461ffb6bf1017c7b7c6e15c6b0c29b959194ba3aaa5" amd64.sha256 = "454bebb2c9fe48d981341461ffb6bf1017c7b7c6e15c6b0c29b959194ba3aaa5"
arm64.url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B13/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.2_13.tar.gz"
arm64.sha256 = "3ce6a2b357e2ef45fd6b53d6587aa05bfec7771e7fb982f2c964f6b771b7526a"
[resources.system_user] [resources.system_user]
@ -64,6 +66,9 @@ ram.runtime = "50M"
[resources.permissions] [resources.permissions]
main.url = "/" main.url = "/"
[resources.apt]
packages = "postgresql"
[resources.database] [resources.database]
type = "postgresql" type = "postgresql"

View file

@ -28,6 +28,32 @@ ynh_backup --src_path="$install_dir"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP LOGROTATE CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app-api.service"
ynh_backup --src_path="/etc/systemd/system/$app-proxy.service"
#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================
ynh_print_info --message="Backing up the PostgreSQL database..."
## linter complains about this line so let's make it happy
## uncomment once hell breaks loose
# ynh_systemd_action --service_name=$app-api --action="stop" --log_path="/var/log/$app/$app-api.log" --line_match="Shutdown completed"
ynh_psql_dump_db --database="$db_name" > db.sql
# ynh_systemd_action --service_name=$app-api --action="start" --log_path="/var/log/$app/$app-api.log" --line_match="HTTP Server is listening on"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app-api --action="stop" --log_path="/var/log/$app/$app-api.log" --line_match="Shutdown completed"
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
@ -26,15 +26,20 @@ ynh_change_url_nginx_config
#================================================= #=================================================
# SPECIFIC MODIFICATIONS # SPECIFIC MODIFICATIONS
#================================================= #=================================================
# ... ynh_script_progression --message="Updating $app configuration..."
#=================================================
sed -i s/"$old_domain"/"$new_domain"/g $install_dir/dist/assets/*
ynh_add_config --template="config.properties" --destination="$install_dir/config.properties"
chown $app:$app "$install_dir/config.properties"
chmod 600 "$install_dir/config.properties"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app-api --action="start" --log_path="/var/log/$app/$app-api.log" --line_match="HTTP Server is listening on"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -42,8 +42,8 @@ chown -R $app:www-data "$install_dir"
ynh_script_progression --message="Building UI..." --weight=5 ynh_script_progression --message="Building UI..." --weight=5
pushd $install_dir/build pushd $install_dir/build
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH corepack enable corepack enable
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH corepack prepare pnpm@latest --activate corepack prepare pnpm@latest --activate
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build
ynh_exec_warn_less ynh_exec_as $app ./localizefonts.sh ynh_exec_warn_less ynh_exec_as $app ./localizefonts.sh
@ -57,9 +57,7 @@ chown -R $app:www-data "$install_dir/dist"
chmod -R 755 "$install_dir/dist" chmod -R 755 "$install_dir/dist"
ynh_secure_remove --file="$install_dir/build" ynh_secure_remove --file="$install_dir/build"
ynh_secure_remove --file="$install_dir/.npm"
ynh_secure_remove --file="$install_dir/.local" ynh_secure_remove --file="$install_dir/.local"
ynh_secure_remove --file="$install_dir/.node"
ynh_secure_remove --file="$install_dir/.cache" ynh_secure_remove --file="$install_dir/.cache"
ynh_script_progression --message="Building API..." --weight=5 ynh_script_progression --message="Building API..." --weight=5
@ -73,6 +71,8 @@ mv $install_dir/build_api/build/libs/piped-1.0-all.jar $install_dir/piped.jar
ynh_add_config --template="config.properties" --destination="$install_dir/config.properties" ynh_add_config --template="config.properties" --destination="$install_dir/config.properties"
chown $app:$app "$install_dir/config.properties" chown $app:$app "$install_dir/config.properties"
chmod 600 "$install_dir/config.properties" chmod 600 "$install_dir/config.properties"
ynh_secure_remove --file="$install_dir/.gradle"
ynh_secure_remove --file="$install_dir/build_api"
ynh_script_progression --message="Building Proxy..." --weight=5 ynh_script_progression --message="Building Proxy..." --weight=5
@ -82,6 +82,8 @@ popd
mv $install_dir/build_proxy/target/release/piped-proxy $install_dir mv $install_dir/build_proxy/target/release/piped-proxy $install_dir
ynh_secure_remove --file="$install_dir/.rustup" ynh_secure_remove --file="$install_dir/.rustup"
ynh_secure_remove --file="$install_dir/.cargo"
ynh_secure_remove --file="$install_dir/build_proxy"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION

View file

@ -18,27 +18,60 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
chown $app:$app "$install_dir/config.properties"
chmod 600 "$install_dir/config.properties"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE POSTGRESQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=3
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
# This should be a symetric version of what happens in the install script
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app-api.service"
systemctl enable $app-api.service --quiet
ynh_restore_file --origin_path="/etc/systemd/system/$app-proxy.service"
systemctl enable $app-proxy.service --quiet
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE # RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
mkdir -p /var/log/$app
chown -R $app:root /var/log/$app
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add "$app-api" --description="Piped backend API service" --log="/var/log/$app/$app-api.log"
yunohost service add "$app-proxy" --description="Piped HTTP proxy service" --log="/var/log/$app/$app-proxy.log"
#=================================================
# RELOAD NGINX THE APP SERVICE
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_systemd_action --service_name=$app-api --action="start" --log_path="/var/log/$app/$app-api.log" --line_match="HTTP Server is listening on"
ynh_systemd_action --service_name=$app-proxy --action="start" --log_path="/var/log/$app/$app-proxy.log" --line_match="Running server!"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -22,7 +22,8 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app-api --action="stop" --log_path="/var/log/$app/$app-api.log" --line_match="Shutdown completed"
ynh_systemd_action --service_name=$app-proxy --action="stop"
#================================================= #=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
@ -32,14 +33,74 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Installing dependencies..." --weight=3
# Download, check integrity, uncompress and patch the source from app.src ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_setup_source --dest_dir="$install_dir" ynh_use_nodejs
ynh_setup_source --dest_dir="$install_dir/jdk" --source_id="jdk" --full_replace=1
ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$install_dir"/.rustup CARGO_HOME="$install_dir"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y'
export PATH="$install_dir/jdk/bin:$install_dir/.cargo/bin:$PATH"
ynh_script_progression --message="Setting up source files..."
ynh_setup_source --dest_dir="$install_dir/build"
ynh_setup_source --dest_dir="$install_dir/build_api" --source_id="api"
ynh_setup_source --dest_dir="$install_dir/build_proxy" --source_id="proxy"
chown -R $app:www-data "$install_dir"
chmod -R 755 "$install_dir"
ynh_script_progression --message="Building UI..." --weight=5
pushd $install_dir/build
corepack enable
corepack prepare pnpm@latest --activate
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build
ynh_exec_warn_less ynh_exec_as $app ./localizefonts.sh
popd
ynh_secure_remove --file="$install_dir/dist"
mv $install_dir/build/dist $install_dir
pushd $install_dir/dist
sed -i s/pipedapi.kavin.rocks/"$domain\\/api"/g assets/*
popd
chown -R $app:www-data "$install_dir/dist"
chmod -R 755 "$install_dir/dist"
ynh_secure_remove --file="$install_dir/build"
ynh_secure_remove --file="$install_dir/.local"
ynh_secure_remove --file="$install_dir/.cache"
ynh_script_progression --message="Building API..." --weight=5
pushd $install_dir/build_api
ynh_exec_warn_less ynh_exec_as $app JAVA_HOME=$install_dir/jdk ./gradlew shadowJar
ynh_exec_warn_less ynh_exec_as $app JAVA_HOME=$install_dir/jdk ./gradlew --stop
popd
ynh_secure_remove --file="$install_dir/piped.jar"
mv $install_dir/build_api/build/libs/piped-1.0-all.jar $install_dir/piped.jar
ynh_secure_remove --file="$install_dir/build_api"
ynh_secure_remove --file="$install_dir/.gradle"
ynh_script_progression --message="Building Proxy..." --weight=5
pushd $install_dir/build_proxy
ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH cargo build --release
popd
ynh_secure_remove --file="$install_dir/piped-proxy"
mv $install_dir/build_proxy/target/release/piped-proxy $install_dir
ynh_secure_remove --file="$install_dir/.rustup"
ynh_secure_remove --file="$install_dir/.cargo"
ynh_secure_remove --file="$install_dir/build_proxy"
fi fi
chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
@ -47,9 +108,11 @@ ynh_script_progression --message="Upgrading system configurations related to $ap
ynh_add_nginx_config ynh_add_nginx_config
ynh_add_systemd_config ynh_add_systemd_config --template="api.service" --service="$app-api"
yunohost service add "$app-api" --description="Piped backend API service" --log="/var/log/$app/$app-api.log"
yunohost service add $app --log="/var/log/$app/$app.log" ynh_add_systemd_config --template="proxy.service" --service="$app-proxy"
yunohost service add "$app-proxy" --description="Piped HTTP proxy service" --log="/var/log/$app/$app-proxy.log"
#================================================= #=================================================
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) # RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...)
@ -58,17 +121,19 @@ yunohost service add $app --log="/var/log/$app/$app.log"
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." ynh_script_progression --message="Updating a configuration file..."
ynh_add_config --template="" --destination="$install_dir/" ynh_add_config --template="config.properties" --destination="$install_dir/config.properties"
chown $app:$app "$install_dir/config.properties"
chmod 400 "$install_dir/some_config_file" chmod 600 "$install_dir/config.properties"
chown $app:$app "$install_dir/some_config_file"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" # Start a systemd service
ynh_systemd_action --service_name=$app-api --action="start" --log_path="/var/log/$app/$app-api.log" --line_match="HTTP Server is listening on"
ynh_systemd_action --service_name=$app-proxy --action="start" --log_path="/var/log/$app/$app-proxy.log" --line_match="Running server!"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

9
tests.toml Normal file
View file

@ -0,0 +1,9 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
test_format = 1.0
[default]
# ------------
# Tests to run
# ------------