From 1c2c03009f4a4c9393e778bfe987326e12212ff7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 13 Aug 2024 21:38:30 +0200 Subject: [PATCH 01/14] fix --- manifest.toml | 8 ++++---- scripts/install | 2 +- scripts/upgrade | 12 ++++-------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/manifest.toml b/manifest.toml index 783495e..4fd4279 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Libreddit" description.en = "Libre alternative to Reddit" description.fr = "Alternative libre à Reddit" -version = "0.30.1~ynh4" +version = "0.35.1~ynh1" maintainers = [] @@ -16,7 +16,7 @@ demo = "https://libreddit.spike.codes/" code = "https://github.com/spikecodes/libreddit" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.20" architectures = ["amd64"] multi_instance = true ldap = false @@ -37,8 +37,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/spikecodes/libreddit/releases/download/v0.30.0/libreddit" - sha256 = "7148815a160acf4b19d5fec1e3c47f9fc7a850a212f3b83ed88a1a76c39882c9" + url = "https://github.com/redlib-org/redlib/releases/download/v0.35.1/redlib-x86_64-unknown-linux-musl.tar.gz" + sha256 = "fbd1abd1ccd418e397b0ec3cf449fcd2faae6fbe0873c3485636d9785efb0471" extract = false in_subdir = false rename = "libreddit" diff --git a/scripts/install b/scripts/install index aaf5609..d3cb5b9 100755 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ yunohost service add $app --description="Alternative to Reddit" --log="/var/log/ #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/libreddit.conf" --destination="$install_dir/libreddit.conf" +ynh_add_config --template="libreddit.conf" --destination="$install_dir/libreddit.conf" chmod 400 "$install_dir/libreddit.conf" chown $app:$app "$install_dir/libreddit.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 54c30d4..9ebb616 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,14 +27,10 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=5 -if [ "$upgrade_type" == "UPGRADE_APP" ] -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="$install_dir" --keep="libreddit.conf" -fi +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" --keep="libreddit.conf" chown -R $app:www-data "$install_dir" chmod +x $install_dir/libreddit @@ -57,7 +53,7 @@ yunohost service add $app --description="Alternative to Reddit" --log="/var/log/ #================================================= #ynh_script_progression --message="Updating a configuration file..." --weight=1 -# ynh_add_config --template="../conf/libreddit.conf" --destination="$install_dir/libreddit.conf" +# ynh_add_config --template="libreddit.conf" --destination="$install_dir/libreddit.conf" # chmod 400 "$install_dir/libreddit.conf" # chown $app:$app "$install_dir/libreddit.conf" From 71cb6ad478adb275788a951a2c32d6b47f120da0 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 13 Aug 2024 19:38:35 +0000 Subject: [PATCH 02/14] Auto-update READMEs --- ALL_README.md | 1 + README.md | 4 ++-- README_es.md | 4 ++-- README_eu.md | 4 ++-- README_fr.md | 4 ++-- README_gl.md | 4 ++-- README_id.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 4 ++-- 8 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 README_id.md diff --git a/ALL_README.md b/ALL_README.md index 152f2e7..4ed64dd 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -5,4 +5,5 @@ - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [Baca README dalam bahasa bahasa Indonesia](README_id.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index 2990775..0af3bb9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Libreddit for YunoHost -[![Integration level](https://dash.yunohost.org/integration/libreddit.svg)](https://dash.yunohost.org/appci/app/libreddit) ![Working status](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/libreddit.svg)](https://ci-apps.yunohost.org/ci/apps/libreddit/) ![Working status](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) [![Install Libreddit with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreddit) @@ -26,7 +26,7 @@ Libreddit is a portmanteau of "libre" (meaning freedom) and "Reddit". It is a pr - Strong Content Security Policy prevents browser requests to Reddit -**Shipped version:** 0.30.1~ynh4 +**Shipped version:** 0.35.1~ynh1 **Demo:** diff --git a/README_es.md b/README_es.md index bbdd386..05c3288 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Libreddit para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/libreddit.svg)](https://dash.yunohost.org/appci/app/libreddit) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/libreddit.svg)](https://ci-apps.yunohost.org/ci/apps/libreddit/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) [![Instalar Libreddit con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreddit) @@ -26,7 +26,7 @@ Libreddit is a portmanteau of "libre" (meaning freedom) and "Reddit". It is a pr - Strong Content Security Policy prevents browser requests to Reddit -**Versión actual:** 0.30.1~ynh4 +**Versión actual:** 0.35.1~ynh1 **Demo:** diff --git a/README_eu.md b/README_eu.md index 1a947b8..7a4868d 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Libreddit YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/libreddit.svg)](https://dash.yunohost.org/appci/app/libreddit) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/libreddit.svg)](https://ci-apps.yunohost.org/ci/apps/libreddit/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) [![Instalatu Libreddit YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreddit) @@ -26,7 +26,7 @@ Libreddit is a portmanteau of "libre" (meaning freedom) and "Reddit". It is a pr - Strong Content Security Policy prevents browser requests to Reddit -**Paketatutako bertsioa:** 0.30.1~ynh4 +**Paketatutako bertsioa:** 0.35.1~ynh1 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 7abcf0f..12f8867 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Libreddit pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/libreddit.svg)](https://dash.yunohost.org/appci/app/libreddit) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/libreddit.svg)](https://ci-apps.yunohost.org/ci/apps/libreddit/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) [![Installer Libreddit avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreddit) @@ -25,7 +25,7 @@ Libreddit est un mot-valise de "libre" (qui signifie liberté) et "Reddit". C'es - Toutes les requêtes sont transmises via le serveur, y compris les médias - Une politique de sécurité du contenu solide empêche les requêtes du navigateur à Reddit -**Version incluse :** 0.30.1~ynh4 +**Version incluse :** 0.35.1~ynh1 **Démo :** diff --git a/README_gl.md b/README_gl.md index c197458..b714e07 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Libreddit para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/libreddit.svg)](https://dash.yunohost.org/appci/app/libreddit) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/libreddit.svg)](https://ci-apps.yunohost.org/ci/apps/libreddit/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) [![Instalar Libreddit con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreddit) @@ -26,7 +26,7 @@ Libreddit is a portmanteau of "libre" (meaning freedom) and "Reddit". It is a pr - Strong Content Security Policy prevents browser requests to Reddit -**Versión proporcionada:** 0.30.1~ynh4 +**Versión proporcionada:** 0.35.1~ynh1 **Demo:** diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..9270f97 --- /dev/null +++ b/README_id.md @@ -0,0 +1,56 @@ + + +# Libreddit untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/libreddit.svg)](https://ci-apps.yunohost.org/ci/apps/libreddit/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) + +[![Pasang Libreddit dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreddit) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang Libreddit secara cepat dan mudah pada server YunoHost.* +> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.* + +## Ringkasan + +Libreddit is a portmanteau of "libre" (meaning freedom) and "Reddit". It is a private front-end like Invidious but for Reddit. Browse the coldest takes of r/unpopularopinion without being tracked. + +### Features + +- Written in Rust for blazing fast speeds and memory safety +- No JavaScript, no ads, no tracking, no bloat +- All requests are proxied through the server, including media +- Strong Content Security Policy prevents browser requests to Reddit + + +**Versi terkirim:** 0.35.1~ynh1 + +**Demo:** + +## Tangkapan Layar + +![Tangkapan Layar pada Libreddit](./doc/screenshots/screenshot.png) + +## Dokumentasi dan sumber daya + +- Website aplikasi resmi: +- Depot kode aplikasi hulu: +- Gudang YunoHost: +- Laporkan bug: + +## Info developer + +Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/libreddit_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/libreddit_ynh/tree/testing --debug +atau +sudo yunohost app upgrade libreddit -u https://github.com/YunoHost-Apps/libreddit_ynh/tree/testing --debug +``` + +**Info lebih lanjut mengenai pemaketan aplikasi:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 9472666..0122362 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Libreddit -[![集成程度](https://dash.yunohost.org/integration/libreddit.svg)](https://dash.yunohost.org/appci/app/libreddit) ![工作状态](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/libreddit.svg)](https://ci-apps.yunohost.org/ci/apps/libreddit/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) [![使用 YunoHost 安装 Libreddit](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreddit) @@ -26,7 +26,7 @@ Libreddit is a portmanteau of "libre" (meaning freedom) and "Reddit". It is a pr - Strong Content Security Policy prevents browser requests to Reddit -**分发版本:** 0.30.1~ynh4 +**分发版本:** 0.35.1~ynh1 **演示:** From 7ee90937c9d4c019b215ced64d806f39dcf7daba Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 13 Aug 2024 21:49:46 +0200 Subject: [PATCH 03/14] fix --- conf/.env | 52 ++++++++++++++++++++++++++++++++++++++++++++ conf/systemd.service | 2 +- scripts/install | 6 ++--- scripts/upgrade | 8 +++---- 4 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 conf/.env diff --git a/conf/.env b/conf/.env new file mode 100644 index 0000000..72c62d9 --- /dev/null +++ b/conf/.env @@ -0,0 +1,52 @@ +# Redlib configuration +# See the Configuration section of the README for a more detailed explanation of these settings. + +# Instance-specific settings +# Enable SFW-only mode for the instance +REDLIB_SFW_ONLY=off +# Set a banner message for the instance +REDLIB_BANNER= +# Disable search engine indexing +REDLIB_ROBOTS_DISABLE_INDEXING=off +# Set the Pushshift frontend for "removed" links +REDLIB_PUSHSHIFT_FRONTEND=undelete.pullpush.io + +# Default user settings +# Set the default theme (options: system, light, dark, black, dracula, nord, laserwave, violet, gold, rosebox, gruvboxdark, gruvboxlight) +REDLIB_DEFAULT_THEME=system +# Set the default front page (options: default, popular, all) +REDLIB_DEFAULT_FRONT_PAGE=default +# Set the default layout (options: card, clean, compact) +REDLIB_DEFAULT_LAYOUT=card +# Enable wide mode by default +REDLIB_DEFAULT_WIDE=off +# Set the default post sort method (options: hot, new, top, rising, controversial) +REDLIB_DEFAULT_POST_SORT=hot +# Set the default comment sort method (options: confidence, top, new, controversial, old) +REDLIB_DEFAULT_COMMENT_SORT=confidence +# Enable blurring Spoiler content by default +REDLIB_DEFAULT_BLUR_SPOILER=off +# Enable showing NSFW content by default +REDLIB_DEFAULT_SHOW_NSFW=off +# Enable blurring NSFW content by default +REDLIB_DEFAULT_BLUR_NSFW=off +# Enable HLS video format by default +REDLIB_DEFAULT_USE_HLS=off +# Hide HLS notification by default +REDLIB_DEFAULT_HIDE_HLS_NOTIFICATION=off +# Disable autoplay videos by default +REDLIB_DEFAULT_AUTOPLAY_VIDEOS=off +# Define a default list of subreddit subscriptions (format: sub1+sub2+sub3) +REDLIB_DEFAULT_SUBSCRIPTIONS= +# Define a default list of subreddit filters (format: sub1+sub2+sub3) +REDLIB_DEFAULT_FILTERS= +# Hide awards by default +REDLIB_DEFAULT_HIDE_AWARDS=off +# Hide sidebar and summary +REDLIB_DEFAULT_HIDE_SIDEBAR_AND_SUMMARY=off +# Disable the confirmation before visiting Reddit +REDLIB_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION=off +# Hide score by default +REDLIB_DEFAULT_HIDE_SCORE=off +# Enable fixed navbar by default +REDLIB_DEFAULT_FIXED_NAVBAR=on \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service index 7e1d6f4..8874621 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ After=network.service User=__APP__ Group=__APP__ DynamicUser=yes -EnvironmentFile=-__INSTALL_DIR__/libreddit.conf +EnvironmentFile=-__INSTALL_DIR__/.env ExecStart=__INSTALL_DIR__/libreddit -a 127.0.0.1 -p __PORT__ [Install] diff --git a/scripts/install b/scripts/install index d3cb5b9..062e90f 100755 --- a/scripts/install +++ b/scripts/install @@ -38,10 +38,10 @@ yunohost service add $app --description="Alternative to Reddit" --log="/var/log/ #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="libreddit.conf" --destination="$install_dir/libreddit.conf" +ynh_add_config --template=".env" --destination="$install_dir/.env" -chmod 400 "$install_dir/libreddit.conf" -chown $app:$app "$install_dir/libreddit.conf" +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 9ebb616..6f41245 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,7 +30,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" 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="$install_dir" --keep="libreddit.conf" +ynh_setup_source --dest_dir="$install_dir" --keep=".env" chown -R $app:www-data "$install_dir" chmod +x $install_dir/libreddit @@ -53,10 +53,10 @@ yunohost service add $app --description="Alternative to Reddit" --log="/var/log/ #================================================= #ynh_script_progression --message="Updating a configuration file..." --weight=1 -# ynh_add_config --template="libreddit.conf" --destination="$install_dir/libreddit.conf" +# ynh_add_config --template=".env" --destination="$install_dir/.env" -# chmod 400 "$install_dir/libreddit.conf" -# chown $app:$app "$install_dir/libreddit.conf" +# chmod 400 "$install_dir/.env" +# chown $app:$app "$install_dir/.env" #================================================= # START SYSTEMD SERVICE From 355408c8bf0044593a81c1c8f74ffc30191d1bed Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 12:15:49 +0200 Subject: [PATCH 04/14] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 8874621..38833dd 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ User=__APP__ Group=__APP__ DynamicUser=yes EnvironmentFile=-__INSTALL_DIR__/.env -ExecStart=__INSTALL_DIR__/libreddit -a 127.0.0.1 -p __PORT__ +ExecStart=__INSTALL_DIR__/libreddit -a 127.0.0.1 -p __PORT__ --env-file .env [Install] WantedBy=multi-user.target From f7642f38550c01975cd7af1dd9e62a5452bb55d1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 12:16:32 +0200 Subject: [PATCH 05/14] Delete libreddit.conf --- conf/libreddit.conf | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 conf/libreddit.conf diff --git a/conf/libreddit.conf b/conf/libreddit.conf deleted file mode 100644 index d112e14..0000000 --- a/conf/libreddit.conf +++ /dev/null @@ -1,12 +0,0 @@ -LIBREDDIT_DEFAULT_THEME=system -LIBREDDIT_DEFAULT_FRONT_PAGE=default -LIBREDDIT_DEFAULT_LAYOUT=card -LIBREDDIT_DEFAULT_WIDE=off -LIBREDDIT_DEFAULT_COMMENT_SORT=hot -LIBREDDIT_DEFAULT_POST_SORT=confidence -LIBREDDIT_DEFAULT_SHOW_NSFW=off -LIBREDDIT_DEFAULT_USE_HLS=on -LIBREDDIT_DEFAULT_HIDE_HLS_NOTIFICATION=off -LIBREDDIT_DEFAULT_AUTOPLAY_VIDEOS=off -LIBREDDIT_DEFAULT_SHOW_NSFW=on -LIBREDDIT_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION=on From 365468fb6fe5c3cc458c18bb53be64db529178fe Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 14 Aug 2024 10:18:21 +0000 Subject: [PATCH 06/14] Auto-update READMEs --- ALL_README.md | 1 + README_ru.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 README_ru.md diff --git a/ALL_README.md b/ALL_README.md index 4ed64dd..e3c80d2 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -6,4 +6,5 @@ - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) - [Baca README dalam bahasa bahasa Indonesia](README_id.md) +- [Прочитать README на русский](README_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README_ru.md b/README_ru.md new file mode 100644 index 0000000..2ea3a24 --- /dev/null +++ b/README_ru.md @@ -0,0 +1,56 @@ + + +# Libreddit для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/libreddit.svg)](https://ci-apps.yunohost.org/ci/apps/libreddit/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/libreddit.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/libreddit.maintain.svg) + +[![Установите Libreddit с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreddit) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Libreddit быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +Libreddit is a portmanteau of "libre" (meaning freedom) and "Reddit". It is a private front-end like Invidious but for Reddit. Browse the coldest takes of r/unpopularopinion without being tracked. + +### Features + +- Written in Rust for blazing fast speeds and memory safety +- No JavaScript, no ads, no tracking, no bloat +- All requests are proxied through the server, including media +- Strong Content Security Policy prevents browser requests to Reddit + + +**Поставляемая версия:** 0.35.1~ynh1 + +**Демо-версия:** + +## Снимки экрана + +![Снимок экрана Libreddit](./doc/screenshots/screenshot.png) + +## Документация и ресурсы + +- Официальный веб-сайт приложения: +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/libreddit_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/libreddit_ynh/tree/testing --debug +или +sudo yunohost app upgrade libreddit -u https://github.com/YunoHost-Apps/libreddit_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** From 7de48c4af2aec3d42d929a0a5df075d3f1f58df9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 13:10:52 +0200 Subject: [PATCH 07/14] Update manifest.toml --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4fd4279..d4341af 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,11 +16,11 @@ demo = "https://libreddit.spike.codes/" code = "https://github.com/spikecodes/libreddit" [integration] -yunohost = ">= 11.2.20" +yunohost = ">= 11.2.27" architectures = ["amd64"] multi_instance = true ldap = false -sso = "not_relevant" +sso = false disk = "50M" ram.build = "50M" ram.runtime = "50M" From 2c6c7f150fedc8ced938842f598bb402d061a4f0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 13:14:18 +0200 Subject: [PATCH 08/14] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 062e90f..710ff4f 100755 --- a/scripts/install +++ b/scripts/install @@ -18,7 +18,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" chown -R $app:www-data "$install_dir" -chmod +x $install_dir/libreddit +chmod +x $install_dir/libreddit && chown $app:$app redlib #================================================= # SYSTEM CONFIGURATION From 7c349e3ce0ee17089bee60e144c334a1c97a690f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 13:14:50 +0200 Subject: [PATCH 09/14] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 710ff4f..c44df72 100755 --- a/scripts/install +++ b/scripts/install @@ -18,7 +18,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" chown -R $app:www-data "$install_dir" -chmod +x $install_dir/libreddit && chown $app:$app redlib +chmod +x $install_dir/libreddit && chown $app:$app $install_dir/libreddit #================================================= # SYSTEM CONFIGURATION From 6b31d08a180e084db75619770a321bb19f2b9f2c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 13:16:25 +0200 Subject: [PATCH 10/14] fix --- conf/systemd.service | 2 +- scripts/upgrade | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 38833dd..83cca9e 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ User=__APP__ Group=__APP__ DynamicUser=yes EnvironmentFile=-__INSTALL_DIR__/.env -ExecStart=__INSTALL_DIR__/libreddit -a 127.0.0.1 -p __PORT__ --env-file .env +ExecStart=__INSTALL_DIR__/redlib -a 127.0.0.1 -p __PORT__ --env-file .env [Install] WantedBy=multi-user.target diff --git a/scripts/upgrade b/scripts/upgrade index 6f41245..fba01c0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,12 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -33,7 +27,7 @@ ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_setup_source --dest_dir="$install_dir" --keep=".env" chown -R $app:www-data "$install_dir" -chmod +x $install_dir/libreddit +chmod +x $install_dir/redlib #================================================= # REAPPLY SYSTEM CONFIGURATIONS From 31df48eabe03ecb4e413190d20cb685963dee8bd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 13:24:15 +0200 Subject: [PATCH 11/14] fix --- conf/redlib.conf | 17 +++++++++++++++++ conf/systemd.service | 27 +++++++++++++++++++++++++-- scripts/install | 8 ++++---- 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 conf/redlib.conf diff --git a/conf/redlib.conf b/conf/redlib.conf new file mode 100644 index 0000000..7f7150d --- /dev/null +++ b/conf/redlib.conf @@ -0,0 +1,17 @@ +ADDRESS=127.0.0.1 +PORT=__PORT__ +#REDLIB_DEFAULT_THEME=default +#REDLIB_DEFAULT_FRONT_PAGE=default +#REDLIB_DEFAULT_LAYOUT=card +#REDLIB_DEFAULT_WIDE=off +#REDLIB_DEFAULT_POST_SORT=hot +#REDLIB_DEFAULT_COMMENT_SORT=confidence +#REDLIB_DEFAULT_BLUR_SPOILER=off +#REDLIB_DEFAULT_SHOW_NSFW=off +#REDLIB_DEFAULT_BLUR_NSFW=off +#REDLIB_DEFAULT_USE_HLS=off +#REDLIB_DEFAULT_HIDE_HLS_NOTIFICATION=off +#REDLIB_DEFAULT_AUTOPLAY_VIDEOS=off +#REDLIB_DEFAULT_SUBSCRIPTIONS=off (sub1+sub2+sub3) +#REDLIB_DEFAULT_HIDE_AWARDS=off +#REDLIB_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION=off \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service index 83cca9e..3278367 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,8 +7,31 @@ After=network.service User=__APP__ Group=__APP__ DynamicUser=yes -EnvironmentFile=-__INSTALL_DIR__/.env -ExecStart=__INSTALL_DIR__/redlib -a 127.0.0.1 -p __PORT__ --env-file .env +EnvironmentFile=-__INSTALL_DIR__/redlib.conf +#ExecStart=__INSTALL_DIR__/redlib -a 127.0.0.1 -p __PORT__ --env-file .env +ExecStart=__INSTALL_DIR__/redlib -a 127.0.0.1 -p __PORT__ + +# Hardening +DeviceAllow= +LockPersonality=yes +MemoryDenyWriteExecute=yes +PrivateDevices=yes +ProcSubset=pid +ProtectClock=yes +ProtectControlGroups=yes +ProtectHome=yes +ProtectHostname=yes +ProtectKernelLogs=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +ProtectProc=invisible +RestrictAddressFamilies=AF_INET AF_INET6 +RestrictNamespaces=yes +RestrictRealtime=yes +RestrictSUIDSGID=yes +SystemCallArchitectures=native +SystemCallFilter=@system-service ~@privileged ~@resources +UMask=0077 [Install] WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index c44df72..6ea2141 100755 --- a/scripts/install +++ b/scripts/install @@ -18,7 +18,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" chown -R $app:www-data "$install_dir" -chmod +x $install_dir/libreddit && chown $app:$app $install_dir/libreddit +chmod +x $install_dir/redlib && chown $app:$app $install_dir/redlib #================================================= # SYSTEM CONFIGURATION @@ -38,10 +38,10 @@ yunohost service add $app --description="Alternative to Reddit" --log="/var/log/ #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template=".env" --destination="$install_dir/.env" +ynh_add_config --template="redlib.conf" --destination="$install_dir/redlib.conf" -chmod 400 "$install_dir/.env" -chown $app:$app "$install_dir/.env" +chmod 400 "$install_dir/redlib.conf" +chown $app:$app "$install_dir/redlib.conf" #================================================= # START SYSTEMD SERVICE From 9975450db2fe6e859ce179c9a6684514dac9d43b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 13:46:07 +0200 Subject: [PATCH 12/14] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index d4341af..129b744 100644 --- a/manifest.toml +++ b/manifest.toml @@ -41,7 +41,7 @@ ram.runtime = "50M" sha256 = "fbd1abd1ccd418e397b0ec3cf449fcd2faae6fbe0873c3485636d9785efb0471" extract = false in_subdir = false - rename = "libreddit" + rename = "redlib" autoupdate.strategy = "latest_github_tag" [resources.system_user] From c27d6910d9609509383854037e42267f0e86d083 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 18:40:39 +0200 Subject: [PATCH 13/14] fix --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 129b744..449ffd2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -37,8 +37,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/redlib-org/redlib/releases/download/v0.35.1/redlib-x86_64-unknown-linux-musl.tar.gz" - sha256 = "fbd1abd1ccd418e397b0ec3cf449fcd2faae6fbe0873c3485636d9785efb0471" + url = "https://github.com/redlib-org/redlib/releases/download/v0.35.1/redlib" + sha256 = "795222c0a368d893310996186527372aedf280a343cf699b3d2cc753c5991131" extract = false in_subdir = false rename = "redlib" From 0e9b90aecd4fac82d3d0e218f4f203b0d8aab1c7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 14 Aug 2024 18:46:07 +0200 Subject: [PATCH 14/14] fix --- scripts/backup | 4 ---- scripts/install | 2 +- scripts/restore | 1 - scripts/upgrade | 10 +++++----- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/scripts/backup b/scripts/backup index f8e82aa..a032119 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,10 +27,6 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= diff --git a/scripts/install b/scripts/install index 6ea2141..aa80988 100755 --- a/scripts/install +++ b/scripts/install @@ -18,7 +18,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" chown -R $app:www-data "$install_dir" -chmod +x $install_dir/redlib && chown $app:$app $install_dir/redlib +chmod +x $install_dir/redlib #================================================= # SYSTEM CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 980d5f5..8f15010 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/upgrade b/scripts/upgrade index fba01c0..df2d3b3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" 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="$install_dir" --keep=".env" +ynh_setup_source --dest_dir="$install_dir" --keep="redlib.conf" --full_replace=1 chown -R $app:www-data "$install_dir" chmod +x $install_dir/redlib @@ -45,12 +45,12 @@ yunohost service add $app --description="Alternative to Reddit" --log="/var/log/ #================================================= # UPDATE A CONFIG FILE #================================================= -#ynh_script_progression --message="Updating a configuration file..." --weight=1 +ynh_script_progression --message="Updating a configuration file..." --weight=1 -# ynh_add_config --template=".env" --destination="$install_dir/.env" +ynh_add_config --template="redlib.conf" --destination="$install_dir/redlib.conf" -# chmod 400 "$install_dir/.env" -# chown $app:$app "$install_dir/.env" +chmod 400 "$install_dir/redlib.conf" +chown $app:$app "$install_dir/redlib.conf" #================================================= # START SYSTEMD SERVICE