Skip to content

[autopatch] Automatic patch attempt for helpers 2.1 #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: oldtesting
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ALL_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ It shall NOT be edited by hand.

# Lemmy for YunoHost

[![Integration level](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![Working status](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)
[![Integration level](https://dash.yunohost.org/integration/lemmy.svg)](https://ci-apps.yunohost.org/ci/apps/lemmy/) ![Working status](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)

[![Install Lemmy with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lemmy)

Expand All @@ -19,7 +19,7 @@ It shall NOT be edited by hand.
Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse.


**Shipped version:** 0.18.2~ynh3
**Shipped version:** 0.19.5~ynh2

**Demo:** <https://lemmy.ml/>

Expand Down
4 changes: 2 additions & 2 deletions README_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ No se debe editar a mano.

# Lemmy para Yunohost

[![Nivel de integración](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)
[![Nivel de integración](https://dash.yunohost.org/integration/lemmy.svg)](https://ci-apps.yunohost.org/ci/apps/lemmy/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)

[![Instalar Lemmy con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lemmy)

Expand All @@ -19,7 +19,7 @@ No se debe editar a mano.
Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse.


**Versión actual:** 0.18.2~ynh3
**Versión actual:** 0.19.5~ynh2

**Demo:** <https://lemmy.ml/>

Expand Down
4 changes: 2 additions & 2 deletions README_eu.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EZ editatu eskuz.

# Lemmy YunoHost-erako

[![Integrazio maila](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)
[![Integrazio maila](https://dash.yunohost.org/integration/lemmy.svg)](https://ci-apps.yunohost.org/ci/apps/lemmy/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)

[![Instalatu Lemmy YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lemmy)

Expand All @@ -19,7 +19,7 @@ EZ editatu eskuz.
Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse.


**Paketatutako bertsioa:** 0.18.2~ynh3
**Paketatutako bertsioa:** 0.19.5~ynh2

**Demoa:** <https://lemmy.ml/>

Expand Down
4 changes: 2 additions & 2 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main.

# Lemmy pour YunoHost

[![Niveau d’intégration](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)
[![Niveau d’intégration](https://dash.yunohost.org/integration/lemmy.svg)](https://ci-apps.yunohost.org/ci/apps/lemmy/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)

[![Installer Lemmy avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lemmy)

Expand All @@ -18,7 +18,7 @@ Il NE doit PAS être modifié à la main.

Lemmy est similaire à des sites comme Reddit, Lobste.rs ou Hacker News : vous vous abonnez aux forums qui vous intéressent, publiez des liens et des discussions, puis votez et commentez-les. Dans les coulisses, c'est très différent ; n'importe qui peut facilement exécuter un serveur, et tous ces serveurs sont fédérés (pensez au courrier électronique) et connectés au même univers, appelé Fediverse.

**Version incluse :** 0.18.2~ynh3
**Version incluse :** 0.19.5~ynh2

**Démo :** <https://lemmy.ml/>

Expand Down
4 changes: 2 additions & 2 deletions README_gl.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NON debe editarse manualmente.

# Lemmy para YunoHost

[![Nivel de integración](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)
[![Nivel de integración](https://dash.yunohost.org/integration/lemmy.svg)](https://ci-apps.yunohost.org/ci/apps/lemmy/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)

[![Instalar Lemmy con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lemmy)

Expand All @@ -19,7 +19,7 @@ NON debe editarse manualmente.
Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse.


**Versión proporcionada:** 0.18.2~ynh3
**Versión proporcionada:** 0.19.5~ynh2

**Demo:** <https://lemmy.ml/>

Expand Down
50 changes: 50 additions & 0 deletions README_id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!--
N.B.: README ini dibuat secara otomatis oleh <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Ini TIDAK boleh diedit dengan tangan.
-->

# Lemmy untuk YunoHost

[![Tingkat integrasi](https://dash.yunohost.org/integration/lemmy.svg)](https://ci-apps.yunohost.org/ci/apps/lemmy/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)

[![Pasang Lemmy dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lemmy)

*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)*

> *Paket ini memperbolehkan Anda untuk memasang Lemmy 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

Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse.


**Versi terkirim:** 0.19.5~ynh2

**Demo:** <https://lemmy.ml/>

## Tangkapan Layar

![Tangkapan Layar pada Lemmy](./doc/screenshots/screenshot1.webp)

## Dokumentasi dan sumber daya

- Website aplikasi resmi: <https://join-lemmy.org/>
- Dokumentasi admin resmi: <https://join-lemmy.org/docs/en/>
- Depot kode aplikasi hulu: <https://github.com/LemmyNet/lemmy>
- Gudang YunoHost: <https://apps.yunohost.org/app/lemmy>
- Laporkan bug: <https://github.com/YunoHost-Apps/lemmy_ynh/issues>

## Info developer

Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/lemmy_ynh/tree/testing).

Untuk mencoba branch `testing`, silakan dilanjutkan seperti:

```bash
sudo yunohost app install https://github.com/YunoHost-Apps/lemmy_ynh/tree/testing --debug
atau
sudo yunohost app upgrade lemmy -u https://github.com/YunoHost-Apps/lemmy_ynh/tree/testing --debug
```

**Info lebih lanjut mengenai pemaketan aplikasi:** <https://yunohost.org/packaging_apps>
4 changes: 2 additions & 2 deletions README_zh_Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# YunoHost 上的 Lemmy

[![集成程度](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![工作状态](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)
[![集成程度](https://dash.yunohost.org/integration/lemmy.svg)](https://ci-apps.yunohost.org/ci/apps/lemmy/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg)

[![使用 YunoHost 安装 Lemmy](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lemmy)

Expand All @@ -19,7 +19,7 @@
Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse.


**分发版本:** 0.18.2~ynh3
**分发版本:** 0.19.5~ynh2

**演示:** <https://lemmy.ml/>

Expand Down
2 changes: 1 addition & 1 deletion conf/lemmy-ui.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Environment="LEMMY_EXTERNAL_HOST=__DOMAIN__"
Environment="LEMMY_HTTPS=true"
Environment="LEMMY_UI_HOST=0.0.0.0:__PORT_UI__"
WorkingDirectory=__INSTALL_DIR__/lemmy-ui/
ExecStart=__YNH_NODE__ dist/js/server.js
ExecStart=__NODEJS_DIR__/node dist/js/server.js
StandardOutput=append:/var/log/__APP__/__APP__-ui.log
StandardError=inherit
Restart=always
Expand Down
9 changes: 5 additions & 4 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "Lemmy"
description.en = "Link aggregator/Reddit clone for the fediverse"
description.fr = "Agrégateur de liens/clone Reddit pour le fedivers"

version = "0.19.5~ynh1"
version = "0.19.5~ynh2"

maintainers = []

Expand All @@ -19,7 +19,8 @@ admindoc = "https://join-lemmy.org/docs/en/"
code = "https://github.com/LemmyNet/lemmy"

[integration]
yunohost = ">= 11.2"
yunohost = ">= 11.2.29"
helpers_version = "2.1"
architectures = ["amd64"]
multi_instance = false

Expand Down Expand Up @@ -56,8 +57,8 @@ ram.runtime = "50M"
autoupdate.strategy = "latest_github_commit"

[resources.sources.lemmy-translations]
url = "https://github.com/LemmyNet/lemmy-translations/archive/73f8fcaae7d76a596cad281d70fe6917912e0a8e.tar.gz"
sha256 = "6eadc85c58128fb991645a6b575e6959bc4c756f2e95770e8789934c476dc45c"
url = "https://github.com/LemmyNet/lemmy-translations/archive/088a27703ffa65e069dfbf341ee9bd44ec4c45c5.tar.gz"
sha256 = "b504c50878a7914bdc49ea578a8c4855152de6f50a94c3cf053954ef903cd93e"

autoupdate.upstream = "https://github.com/LemmyNet/lemmy-translations/"
autoupdate.strategy = "latest_github_commit"
Expand Down
26 changes: 7 additions & 19 deletions scripts/_common.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
#!/bin/bash

#=================================================
# COMMON VARIABLES
# COMMON VARIABLES AND CUSTOM HELPERS
#=================================================

PICTRS_VERSION=0.4.1-rc.0

NODEJS_VERSION=20
nodejs_version=20

main_domain=$(cat /etc/yunohost/current_host)

#=================================================
# PERSONAL HELPERS
#=================================================

#=================================================
# EXPERIMENTAL HELPERS
#=================================================

# Downloads an AppImage from an url, unpacks and extracts it in a destination directory, and creates a symlink to its executable
download_and_install_appimage() {

# Declare an array to define the options of this helper.
local legacy_args=nud
#REMOVEME? local legacy_args=nud
local -A args_array=([n]=name= [u]=url= [d]=directory= [s]=symlink=)
local url
local directory
Expand All @@ -31,13 +23,13 @@ download_and_install_appimage() {
ynh_handle_getopts_args "$@"

# Cleanup
ynh_secure_remove --file="$install_dir/pict-rs/$name"
ynh_secure_remove --file="$install_dir/pict-rs/$name.appimage"
ynh_secure_remove --file="$install_dir/pict-rs/$name.appimageextract"
ynh_safe_rm "$install_dir/pict-rs/$name"
ynh_safe_rm "$install_dir/pict-rs/$name.appimage"
ynh_safe_rm "$install_dir/pict-rs/$name.appimageextract"

# Download and make executable
curl -f "$url" -o "$directory/$name.appimage" -s
[ ! -f "$directory/$name.appimage" ] && ynh_print_err --message="AppImage could not be downloaded"
[ ! -f "$directory/$name.appimage" ] && ynh_print_warn "AppImage could not be downloaded"
chmod +x "$directory/$name.appimage"

# Extract and create link
Expand All @@ -47,7 +39,3 @@ download_and_install_appimage() {
ln -s "$directory/$name.appimageextract/AppRun" "$directory/$name"
popd
}

#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
30 changes: 11 additions & 19 deletions scripts/backup
Original file line number Diff line number Diff line change
@@ -1,51 +1,43 @@
#!/bin/bash

#=================================================
# 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

#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
ynh_print_info "Declaring files to be backed up..."

#=================================================
# BACKUP THE APP MAIN DIR
#=================================================

ynh_backup --src_path="$install_dir"
ynh_backup "$install_dir"

#=================================================
# BACKUP THE DATA DIR
#=================================================

ynh_backup --src_path="$data_dir" --is_big
ynh_backup "$data_dir"

#=================================================
# SYSTEM CONFIGURATION
#=================================================

ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"

ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup "/etc/logrotate.d/$app"

ynh_backup --src_path="/etc/systemd/system/$app.service"
ynh_backup --src_path="/etc/systemd/system/$app-ui.service"
ynh_backup --src_path="/etc/systemd/system/$app-pict-rs.service"
ynh_backup "/etc/systemd/system/$app.service"
ynh_backup "/etc/systemd/system/$app-ui.service"
ynh_backup "/etc/systemd/system/$app-pict-rs.service"

#=================================================
# BACKUP THE POSTGRESQL DATABASE
#=================================================
ynh_print_info --message="Backing up the PostgreSQL database..."
ynh_print_info "Backing up the PostgreSQL database..."

ynh_psql_dump_db --database="$db_name" > db.sql
ynh_psql_dump_db > db.sql

#=================================================
# END OF SCRIPT
#=================================================

ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
33 changes: 13 additions & 20 deletions scripts/change_url
Original file line number Diff line number Diff line change
@@ -1,50 +1,43 @@
#!/bin/bash

#=================================================
# IMPORT GENERIC HELPERS
#=================================================

source _common.sh
source /usr/share/yunohost/helpers

#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping $app's systemd services..." --weight=1
ynh_script_progression "Stopping $app's systemd service..."

ynh_systemd_action --service_name="$app" --action="stop" --line_match="Stopped" "/var/log/$app/$app.log"
ynh_systemd_action --service_name="$app-ui" --action="stop" --line_match="Stopped" --log_path="/var/log/$app/$app-ui.log"
ynh_systemd_action --service_name="$app-pict-rs" --action="stop" --line_match="Stopped" --log_path="/var/log/$app/$app-pict-rs.log"
ynh_systemctl --service=$app --action="stop" --wait_until="Stopped" "/var/log/$app/$app.log"
ynh_systemctl --service=$app-ui --action="stop" --wait_until="Stopped" --log_path="/var/log/$app/$app-ui.log"
ynh_systemctl --service=$app-pict-rs --action="stop" --wait_until="Stopped" --log_path="/var/log/$app/$app-pict-rs.log"

#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_script_progression "Updating NGINX web server configuration..."

ynh_change_url_nginx_config
ynh_config_change_url_nginx

#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Updating $app's configuration file..." --weight=1
ynh_script_progression "Adding $app's configuration..."

mkdir -p "$install_dir/config/"
ynh_add_config --template="lemmy.hjson" --destination="$install_dir/config/config.hjson"

chmod 400 "$install_dir/config/config.hjson"
chown "$app:$app" "$install_dir/config/config.hjson"
ynh_config_add --template="lemmy.hjson" --destination="$install_dir/config/config.hjson"

#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting $app's systemd services..." --weight=1
ynh_script_progression "Starting $app's systemd service..."

ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" --line_match="Starting http server at"
ynh_systemd_action --service_name="$app-ui" --action="start" --log_path="/var/log/$app/$app-ui.log" --line_match="http://0.0.0.0"
ynh_systemd_action --service_name="$app-pict-rs" --action="start" --log_path="/var/log/$app/$app-pict-rs.log" --line_match="starting in Actix runtime"
ynh_systemctl --service=$app --action="start" --wait_until="Starting http server at"
ynh_systemctl --service=$app-ui --action="start" --log_path="/var/log/$app/$app-ui.log" --wait_until="http://0.0.0.0"
ynh_systemctl --service=$app-pict-rs --action="start" --log_path="/var/log/$app/$app-pict-rs.log" --wait_until="starting in Actix runtime"

#=================================================
# END OF SCRIPT
#=================================================

ynh_script_progression --message="Change of URL completed for $app" --last
ynh_script_progression "Change of URL completed for $app"
Loading