From bc9c9cb48062bd8f68483b0450cf9887362fe16f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 5 May 2024 06:54:19 +0000 Subject: [PATCH 01/17] Auto-update READMEs --- ALL_README.md | 1 + README_zh_Hans.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 README_zh_Hans.md diff --git a/ALL_README.md b/ALL_README.md index 77b7509..a01b345 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -4,3 +4,4 @@ - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..bc5a274 --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,50 @@ + + +# YunoHost 的 Weblate + +[![集成程度](https://dash.yunohost.org/integration/weblate.svg)](https://dash.yunohost.org/appci/app/weblate) ![工作状态](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) + +[![使用 YunoHost 安装 Weblate](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Weblate。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +Weblate is a libre web-based translation tool with tight version control integration. It provides two user interfaces, propagation of translations across components, quality checks and automatic linking to source files. + +**分发版本:** 5.4.3~ynh1 + +**演示:** + +## 截图 + +![Weblate 的截图](./doc/screenshots/BigScreenshot.png) + +## 文档与资源 + +- 官方应用网站: +- 官方用户文档: +- 官方管理文档: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/weblate_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +或 +sudo yunohost app upgrade weblate -u https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From a37f9da1cbbb8f2601a444e9bce826a9634d5833 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 5 May 2024 09:06:21 +0200 Subject: [PATCH 02/17] upgrade to 5.5.3 --- conf/settings.py | 31 ++++++++++++++++++------------- manifest.toml | 2 +- tests.toml | 3 ++- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/conf/settings.py b/conf/settings.py index d274ee9..9b55daa 100644 --- a/conf/settings.py +++ b/conf/settings.py @@ -15,9 +15,7 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright © Michal Čihař -# -# SPDX-License-Identifier: GPL-3.0-or-later +# mypy: disable-error-code="var-annotated" import os import platform @@ -138,6 +136,7 @@ LANGUAGES = ( ("sr", "Српски"), ("sr-latn", "Srpski"), ("sv", "Svenska"), + ("ta", "தமிழ்"), ("th", "ไทย"), ("tr", "Türkçe"), ("uk", "Українська"), @@ -158,7 +157,7 @@ USE_TZ = True DEFAULT_AUTO_FIELD = "django.db.models.AutoField" # URL prefix to use, please see documentation for more details -# WARNING: this must be without trailing slash (this is why we set __PATH_NO_SLASH__ (cf. loaded settings in install and upgrade)) +# YUNOHOST_WARNING: this must be without trailing slash (this is why we set __PATH_NO_SLASH__ (cf. loaded settings in install and upgrade)) URL_PREFIX = "__PATH_NO_SLASH__" # Absolute filesystem path to the directory that will hold user-uploaded files. @@ -222,9 +221,6 @@ GITHUB_CREDENTIALS = { "token": "__GITHUB_TOKEN__", } } -# Azure DevOps username and token for sending pull requests. -# Please see the documentation for more details. -AZURE_DEVOPS_CREDENTIALS = {} # Azure DevOps username and token for sending pull requests. # Please see the documentation for more details. @@ -244,7 +240,7 @@ GITLAB_CREDENTIALS = { BITBUCKETSERVER_CREDENTIALS = {} # Authentication configuration -AUTHENTICATION_BACKENDS = ( +AUTHENTICATION_BACKENDS: tuple[str, ...] = ( "social_core.backends.email.EmailAuth", # "social_core.backends.google.GoogleOAuth2", # "social_core.backends.github.GithubOAuth2", @@ -431,7 +427,7 @@ INSTALLED_APPS = [ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", - "django.contrib.admin.apps.SimpleAdminConfig", + "django.contrib.admin", "django.contrib.admindocs", "django.contrib.sitemaps", "django.contrib.humanize", @@ -464,7 +460,7 @@ if platform.system() != "Windows": # Since Python 3.7 connect failures are silently discarded, so # the exception is almost never raised here. Instead we look whether the socket # to syslog is open after init. - HAVE_SYSLOG = handler.socket.fileno() != -1 + HAVE_SYSLOG = handler.socket.fileno() != -1 # type: ignore[attr-defined] handler.close() except OSError: HAVE_SYSLOG = False @@ -477,7 +473,7 @@ DEFAULT_LOGLEVEL = "DEBUG" if DEBUG else "INFO" # the site admins on every HTTP 500 error when DEBUG=False. # See http://docs.djangoproject.com/en/stable/topics/logging for # more details on how to customize your logging configuration. -LOGGING = { +LOGGING: dict = { "version": 1, "disable_existing_loggers": True, "filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}}, @@ -615,6 +611,10 @@ LOGOUT_URL = f"{URL_PREFIX}/accounts/logout/" # Default location for login LOGIN_REDIRECT_URL = f"{URL_PREFIX}/" +LOGOUT_REDIRECT_URL = f"{URL_PREFIX}/" + +# Opt-in for Django 6.0 default +FORMS_URLFIELD_ASSUME_HTTPS = True # Anonymous user name ANONYMOUS_USER_NAME = "anonymous" @@ -657,6 +657,7 @@ CRISPY_TEMPLATE_PACK = "bootstrap3" # "weblate.checks.chars.EndColonCheck", # "weblate.checks.chars.EndQuestionCheck", # "weblate.checks.chars.EndExclamationCheck", +# "weblate.checks.chars.EndInterrobangCheck", # "weblate.checks.chars.EndEllipsisCheck", # "weblate.checks.chars.EndSemicolonCheck", # "weblate.checks.chars.MaxLengthCheck", @@ -824,6 +825,7 @@ REST_FRAMEWORK = { "DEFAULT_PAGINATION_CLASS": "weblate.api.pagination.StandardPagination", "PAGE_SIZE": 50, "VIEW_DESCRIPTION_FUNCTION": "weblate.api.views.get_view_description", + "EXCEPTION_HANDLER": "weblate.api.views.weblate_exception_handler", "UNAUTHENTICATED_USER": "weblate.auth.models.get_anonymous", } @@ -850,6 +852,7 @@ if REQUIRE_LOGIN: # rf"{URL_PREFIX}/healthz/$", # Allowing public access to health check # rf"{URL_PREFIX}/api/(.*)$", # Allowing access to API # rf"{URL_PREFIX}/js/i18n/$", # JavaScript localization +# rf"{URL_PREFIX}/css/custom\.css$", # Custom CSS support # rf"{URL_PREFIX}/contact/$", # Optional for contact form # rf"{URL_PREFIX}/legal/(.*)$", # Optional for legal app # rf"{URL_PREFIX}/avatar/(.*)$", # Optional for avatars @@ -869,7 +872,9 @@ SILENCED_SYSTEM_CHECKS = [ # Celery worker configuration for production CELERY_TASK_ALWAYS_EAGER = False CELERY_BROKER_URL = "redis://127.0.0.1:6379/__REDIS_DB__" -CELERY_RESULT_BACKEND = CELERY_BROKER_URL +CELERY_RESULT_BACKEND: str | None = CELERY_BROKER_URL +CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True +CELERY_BROKER_CONNECTION_RETRY = True # Celery settings, it is not recommended to change these CELERY_WORKER_MAX_MEMORY_PER_CHILD = 200000 @@ -887,7 +892,7 @@ CELERY_TASK_ROUTES = { # CORS allowed origins CORS_ALLOWED_ORIGINS = [] -CORS_URLS_REGEX = r"^/api/.*$" +CORS_URLS_REGEX = rf"^{URL_PREFIX}/api/.*$" # Enable plain database backups DATABASE_BACKUP = "plain" diff --git a/manifest.toml b/manifest.toml index b9b97bf..9f74c87 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Weblate" description.en = "Translation platform using Git and Python" description.fr = "Plateforme de traduction utilisant Git et Python" -version = "5.4.3~ynh1" +version = "5.5.3~ynh1" maintainers = ["Thovi98"] diff --git a/tests.toml b/tests.toml index b38404d..c6f8b1c 100644 --- a/tests.toml +++ b/tests.toml @@ -27,4 +27,5 @@ test_format = 1.0 test_upgrade_from.52db1ab.name = "5.3.1-ynh2" test_upgrade_from.e075efc.name = "5.4.1" - test_upgrade_from.40ff28f.name = "5.4.2" \ No newline at end of file + test_upgrade_from.40ff28f.name = "5.4.2" + test_upgrade_from.def94c9.name = "5.4.3" \ No newline at end of file From 9f0b4fc7d73701f2f6a8cdcab5557e2cad6791c6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 5 May 2024 07:06:25 +0000 Subject: [PATCH 03/17] Auto-update READMEs --- README.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 845d78c..4ca74ce 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ It shall NOT be edited by hand. Weblate is a libre web-based translation tool with tight version control integration. It provides two user interfaces, propagation of translations across components, quality checks and automatic linking to source files. -**Shipped version:** 5.4.3~ynh1 +**Shipped version:** 5.5.3~ynh1 **Demo:** diff --git a/README_eu.md b/README_eu.md index 765e537..7dcf5bb 100644 --- a/README_eu.md +++ b/README_eu.md @@ -18,7 +18,7 @@ EZ editatu eskuz. Weblate is a libre web-based translation tool with tight version control integration. It provides two user interfaces, propagation of translations across components, quality checks and automatic linking to source files. -**Paketatutako bertsioa:** 5.4.3~ynh1 +**Paketatutako bertsioa:** 5.5.3~ynh1 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 09c13a9..7e62527 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Il NE doit PAS être modifié à la main. Weblate est un outil de traduction libre avec une intégration étroite du contrôle de version. Il fournit deux interfaces utilisateur, la propagation des traductions entre les composants, les contrôles de qualité et la liaison automatique aux fichiers source. -**Version incluse :** 5.4.3~ynh1 +**Version incluse :** 5.5.3~ynh1 **Démo :** diff --git a/README_gl.md b/README_gl.md index 0e531eb..effb08c 100644 --- a/README_gl.md +++ b/README_gl.md @@ -18,7 +18,7 @@ NON debe editarse manualmente. Weblate is a libre web-based translation tool with tight version control integration. It provides two user interfaces, propagation of translations across components, quality checks and automatic linking to source files. -**Versión proporcionada:** 5.4.3~ynh1 +**Versión proporcionada:** 5.5.3~ynh1 **Demo:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index bc5a274..349fd52 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -18,7 +18,7 @@ Weblate is a libre web-based translation tool with tight version control integration. It provides two user interfaces, propagation of translations across components, quality checks and automatic linking to source files. -**分发版本:** 5.4.3~ynh1 +**分发版本:** 5.5.3~ynh1 **演示:** From 14aba53306510257a87598e4f77c0b932e1c7d0e Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 5 May 2024 09:23:24 +0200 Subject: [PATCH 04/17] code styling + add dependencie --- manifest.toml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/manifest.toml b/manifest.toml index 9f74c87..0ae69e4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -94,11 +94,29 @@ ram.runtime = "3G" main.default = 8080 [resources.apt] - # §1 = weblate dependecies, §2 = borgbackup dependencies - packages = ["libxml2-dev", "libxslt-dev", "libfreetype6-dev", "libjpeg-dev", "libz-dev", "libyaml-dev", "libffi-dev", "libcairo-dev", "gir1.2-pango-1.0", "libgirepository1.0-dev", "libacl1-dev", "libssl-dev", "libpq-dev", "libjpeg62-turbo-dev", "build-essential", "python3-gdbm", "python3-dev", "python3-pip", "python3-venv", "python3-virtualenv", "virtualenv", "git", "uwsgi", "uwsgi-plugin-python3", "redis-server", "postgresql", "postgresql-contrib", "hub", - - - "libacl1-dev", "libacl1", "libssl-dev", "liblz4-dev", "libzstd-dev", "libxxhash-dev", "build-essential", "pkg-config", "python3-pkgconfig"] + packages = [ + # Weblate dependencies + "build-essential", "git", + "gir1.2-pango-1.0", "libacl1-dev", "libcairo-dev", "libffi-dev", "libfreetype6-dev", + "libgirepository1.0-dev", "libjpeg-dev", "libjpeg62-turbo-dev", "libpq-dev", + "libssl-dev", "libxml2-dev", "libxslt-dev", "libyaml-dev", "libz-dev", + "python3-gdbm", + "python3-dev", + "python3-gst-1.0" + "python3-pip", + "python3-venv", + "python3-virtualenv", + "virtualenv", + "uwsgi", + "uwsgi-plugin-python3", + "redis-server", + "postgresql", + "postgresql-contrib", + "hub", + # Borg backup dependencies + "pkg-config", "python3-pkgconfig", + "libacl1-dev", "libacl1", "libssl-dev", "liblz4-dev", "libzstd-dev", "libxxhash-dev", + ] [resources.database] type = "postgresql" From 8ac3a068eef7e4028b516680f4634d8568719c0b Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 5 May 2024 09:25:00 +0200 Subject: [PATCH 05/17] fix formatting --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 0ae69e4..b8575c0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,7 +102,7 @@ ram.runtime = "3G" "libssl-dev", "libxml2-dev", "libxslt-dev", "libyaml-dev", "libz-dev", "python3-gdbm", "python3-dev", - "python3-gst-1.0" + "python3-gst-1.0", "python3-pip", "python3-venv", "python3-virtualenv", From eac7eb1177570223b4d80ad61c251837c796ce77 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sun, 5 May 2024 21:14:11 +0200 Subject: [PATCH 06/17] fix --- manifest.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index b8575c0..2315111 100644 --- a/manifest.toml +++ b/manifest.toml @@ -99,10 +99,9 @@ ram.runtime = "3G" "build-essential", "git", "gir1.2-pango-1.0", "libacl1-dev", "libcairo-dev", "libffi-dev", "libfreetype6-dev", "libgirepository1.0-dev", "libjpeg-dev", "libjpeg62-turbo-dev", "libpq-dev", - "libssl-dev", "libxml2-dev", "libxslt-dev", "libyaml-dev", "libz-dev", + "libssl-dev", "libxml2-dev", "libxslt-dev", "libyaml-dev", "libz-dev", "librsvg2-dev", "python3-gdbm", "python3-dev", - "python3-gst-1.0", "python3-pip", "python3-venv", "python3-virtualenv", From e4b026793b69d6b9894e6072bb8417b9212aae19 Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 26 Aug 2024 14:18:43 +0200 Subject: [PATCH 07/17] needs bookworm --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 2315111..53c8cc7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -22,7 +22,7 @@ cpe = "cpe:2.3:a:weblate:weblate" fund = "https://weblate.org/fr/donate/" [integration] -yunohost = ">= 11.2.0" +yunohost = ">= 12.0.0" architectures = "all" multi_instance = true ldap = false From 4b2c739efe3fbbd4b76d24c7d8a891a3a94326a5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 26 Aug 2024 12:18:47 +0000 Subject: [PATCH 08/17] Auto-update READMEs --- ALL_README.md | 3 +++ README.md | 2 +- README_es.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++ README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_id.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++ README_ru.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 4 ++-- 9 files changed, 159 insertions(+), 6 deletions(-) create mode 100644 README_es.md create mode 100644 README_id.md create mode 100644 README_ru.md diff --git a/ALL_README.md b/ALL_README.md index a01b345..e3c80d2 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,7 +1,10 @@ # All available README files by language - [Read the README in English](README.md) +- [Lea el README en español](README_es.md) - [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_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index 4ca74ce..8d06df1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Weblate for YunoHost -[![Integration level](https://dash.yunohost.org/integration/weblate.svg)](https://dash.yunohost.org/appci/app/weblate) ![Working status](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![Working status](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) [![Install Weblate with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..12c1ce6 --- /dev/null +++ b/README_es.md @@ -0,0 +1,50 @@ + + +# Weblate para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) + +[![Instalar Weblate con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarWeblate rapidamente y simplement en un servidor YunoHost.* +> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.* + +## Descripción general + +Weblate is a libre web-based translation tool with tight version control integration. It provides two user interfaces, propagation of translations across components, quality checks and automatic linking to source files. + +**Versión actual:** 5.5.3~ynh1 + +**Demo:** + +## Capturas + +![Captura de Weblate](./doc/screenshots/BigScreenshot.png) + +## Documentaciones y recursos + +- Sitio web oficial: +- Documentación usuario oficial: +- Documentación administrador oficial: +- Repositorio del código fuente oficial de la aplicación : +- Catálogo YunoHost: +- Reportar un error: + +## Información para desarrolladores + +Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/weblate_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +o +sudo yunohost app upgrade weblate -u https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +``` + +**Mas informaciones sobre el empaquetado de aplicaciones:** diff --git a/README_eu.md b/README_eu.md index 7dcf5bb..4fdb601 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Weblate YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/weblate.svg)](https://dash.yunohost.org/appci/app/weblate) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) [![Instalatu Weblate YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) diff --git a/README_fr.md b/README_fr.md index 7e62527..5294406 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Weblate pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/weblate.svg)](https://dash.yunohost.org/appci/app/weblate) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) [![Installer Weblate avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) diff --git a/README_gl.md b/README_gl.md index effb08c..561bace 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Weblate para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/weblate.svg)](https://dash.yunohost.org/appci/app/weblate) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) [![Instalar Weblate con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..43c5274 --- /dev/null +++ b/README_id.md @@ -0,0 +1,50 @@ + + +# Weblate untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) + +[![Pasang Weblate dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang Weblate 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 + +Weblate is a libre web-based translation tool with tight version control integration. It provides two user interfaces, propagation of translations across components, quality checks and automatic linking to source files. + +**Versi terkirim:** 5.5.3~ynh1 + +**Demo:** + +## Tangkapan Layar + +![Tangkapan Layar pada Weblate](./doc/screenshots/BigScreenshot.png) + +## Dokumentasi dan sumber daya + +- Website aplikasi resmi: +- Dokumentasi pengguna resmi: +- Dokumentasi admin resmi: +- Depot kode aplikasi hulu: +- Gudang YunoHost: +- Laporkan bug: + +## Info developer + +Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/weblate_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +atau +sudo yunohost app upgrade weblate -u https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +``` + +**Info lebih lanjut mengenai pemaketan aplikasi:** diff --git a/README_ru.md b/README_ru.md new file mode 100644 index 0000000..0f3af64 --- /dev/null +++ b/README_ru.md @@ -0,0 +1,50 @@ + + +# Weblate для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) + +[![Установите Weblate с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Weblate быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +Weblate is a libre web-based translation tool with tight version control integration. It provides two user interfaces, propagation of translations across components, quality checks and automatic linking to source files. + +**Поставляемая версия:** 5.5.3~ynh1 + +**Демо-версия:** + +## Снимки экрана + +![Снимок экрана Weblate](./doc/screenshots/BigScreenshot.png) + +## Документация и ресурсы + +- Официальный веб-сайт приложения: +- Официальная документация пользователя: +- Официальная документация администратора: +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/weblate_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +или +sudo yunohost app upgrade weblate -u https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 349fd52..14cd73c 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -3,9 +3,9 @@ 请勿手动编辑。 --> -# YunoHost 的 Weblate +# YunoHost 上的 Weblate -[![集成程度](https://dash.yunohost.org/integration/weblate.svg)](https://dash.yunohost.org/appci/app/weblate) ![工作状态](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) [![使用 YunoHost 安装 Weblate](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) From bc5a1d718e196bf0a97adb237fab18ad7fcb837f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 26 Aug 2024 12:20:56 +0000 Subject: [PATCH 09/17] Auto-update READMEs --- ALL_README.md | 2 ++ README_es.md | 2 +- README_zh_Hans.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ALL_README.md b/ALL_README.md index 152f2e7..e3c80d2 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -5,4 +5,6 @@ - [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_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README_es.md b/README_es.md index c3e4227..12c1ce6 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Weblate para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/weblate.svg)](https://dash.yunohost.org/appci/app/weblate) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) [![Instalar Weblate con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) diff --git a/README_zh_Hans.md b/README_zh_Hans.md index d318bab..14cd73c 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Weblate -[![集成程度](https://dash.yunohost.org/integration/weblate.svg)](https://dash.yunohost.org/appci/app/weblate) ![工作状态](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) [![使用 YunoHost 安装 Weblate](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) From 5b0205bc95aabd98e53de497f9a9ab5493d35baa Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 31 Aug 2024 03:55:10 +0200 Subject: [PATCH 10/17] [autopatch] Automatic patch attempt for helpers 2.1 --- .gitignore | 3 ++ manifest.toml | 4 +- scripts/_common.sh | 14 +----- scripts/backup | 29 +++++------- scripts/change_url | 48 ++++++++------------ scripts/install | 100 +++++++++++++++++++---------------------- scripts/remove | 41 ++++++++--------- scripts/restore | 60 +++++++++++-------------- scripts/upgrade | 110 +++++++++++++++++++-------------------------- 9 files changed, 170 insertions(+), 239 deletions(-) diff --git a/.gitignore b/.gitignore index 7bbc71c..ac45474 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,6 @@ ENV/ # mypy .mypy_cache/ +*~ +*.sw[op] +.DS_Store diff --git a/manifest.toml b/manifest.toml index 33a3fe4..8d95556 100644 --- a/manifest.toml +++ b/manifest.toml @@ -22,7 +22,8 @@ cpe = "cpe:2.3:a:weblate:weblate" fund = "https://weblate.org/fr/donate/" [integration] -yunohost = ">= 11.2.12" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = true ldap = false @@ -86,6 +87,7 @@ ram.runtime = "3G" [resources.system_user] [resources.install_dir] + group = "www-data:r-x" [resources.permissions] main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index c5f9ef0..5e9b55a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,7 +1,7 @@ #!/bin/bash #================================================= -# COMMON VARIABLES +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= debian_maj_version=$(sed 's/\..*//' /etc/debian_version) @@ -16,10 +16,6 @@ elif [ "$debian_maj_version" -eq 12 ] ; then weblate_pypath="python3.11" fi -#================================================= -# PERSONAL HELPERS -#================================================= - set_forge_variables() { if [ $used_forge = "GitHub" ] ; then github_username="$forge_username" @@ -33,11 +29,3 @@ set_forge_variables() { gitlab_token="$forge_token" fi } - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= diff --git a/scripts/backup b/scripts/backup index dbbe2a8..fd85c98 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,31 +1,22 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# 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 NGINX CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # SPECIFIC BACKUP @@ -33,30 +24,30 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP LOGROTATE #================================================= -ynh_backup --src_path="/etc/logrotate.d/$app" +ynh_backup "/etc/logrotate.d/$app" #================================================= # BACKUP SYSTEMD #================================================= -ynh_backup --src_path="/etc/systemd/system/$app.service" -ynh_backup --src_path="/etc/systemd/system/$app-celery.service" +ynh_backup "/etc/systemd/system/$app.service" +ynh_backup "/etc/systemd/system/$app-celery.service" #================================================= # BACKUP VARIOUS FILES #================================================= -ynh_backup --src_path="/etc/uwsgi/apps-available/$app.ini" +ynh_backup "/etc/uwsgi/apps-available/$app.ini" #================================================= # 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)." diff --git a/scripts/change_url b/scripts/change_url index 5a4d779..041c63f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,87 +1,77 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping systemd services..." --weight=1 +ynh_script_progression "Stopping systemd services..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/weblate.log" --line_match="goodbye to uWSGI" -ynh_systemd_action --service_name="$app-celery" --action="stop" --log_path="systemd" +ynh_systemctl --service=$app --action="stop" --log_path="/var/log/$app/weblate.log" --wait_until="goodbye to uWSGI" +ynh_systemctl --service="$app-celery" --action="stop" --log_path="systemd" #================================================= # 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 #================================================= # SPECIFIC MODIFICATIONS #================================================= # MODIFY SETTINGS #================================================= -ynh_script_progression --message="Modify weblate's config file..." --weight=1 +ynh_script_progression "Modify weblate's config file..." settings="$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/settings.py" -ynh_backup_if_checksum_is_different --file="$settings" +ynh_backup_if_checksum_is_different "$settings" # Change the path in the nginx config file if [ $change_path -eq 1 ] then - ynh_replace_string --match_string="URL_PREFIX = \"${old_path%/}\"" --replace_string="URL_PREFIX = \"${new_path%/}\"" --target_file="$settings" + ynh_replace --match="URL_PREFIX = \"${old_path%/}\"" --replace="URL_PREFIX = \"${new_path%/}\"" --file="$settings" fi # Change the domain for nginx if [ $change_domain -eq 1 ] then # replace SERVER_EMAIL - ynh_replace_string --match_string="noreply@$old_domain" --replace_string="noreply@$new_domain" --target_file="$settings" + ynh_replace --match="noreply@$old_domain" --replace="noreply@$new_domain" --file="$settings" # replace SITE_DOMAIN - ynh_replace_string --match_string="SITE_DOMAIN = \"$old_domain\"" --replace_string="SITE_DOMAIN = \"$new_domain\"" --target_file="$settings" + ynh_replace --match="SITE_DOMAIN = \"$old_domain\"" --replace="SITE_DOMAIN = \"$new_domain\"" --file="$settings" # replace ALLOWED_HOSTS - ynh_replace_string --match_string="ALLOWED_HOSTS = \[\"$old_domain\"\]" --replace_string="ALLOWED_HOSTS = \[\"$new_domain\"\]" --target_file="$settings" + ynh_replace --match="ALLOWED_HOSTS = \[\"$old_domain\"\]" --replace="ALLOWED_HOSTS = \[\"$new_domain\"\]" --file="$settings" fi -ynh_store_file_checksum --file="$settings" +ynh_store_file_checksum "$settings" #================================================= # MODIFY UWSGI #================================================= finaluwsgiini="/etc/uwsgi/apps-available/$app.ini" -ynh_backup_if_checksum_is_different --file="$finaluwsgiini" +ynh_backup_if_checksum_is_different "$finaluwsgiini" # Change the path in the nginx config file if [ $change_path -eq 1 ] then - ynh_replace_string --match_string="mount = $old_path=" --replace_string="mount = $new_path=" --target_file="$finaluwsgiini" + ynh_replace --match="mount = $old_path=" --replace="mount = $new_path=" --file="$finaluwsgiini" fi -ynh_store_file_checksum --file="$finaluwsgiini" +ynh_store_file_checksum "$finaluwsgiini" -#================================================= -# GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=5 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/weblate.log" --line_match="spawned uWSGI" -ynh_systemd_action --service_name="$app-celery" --action="start" --log_path="/var/log/$app/weblate-celery-celery.log" --line_match="mingle: all alone" +ynh_systemctl --service=$app --action="start" --log_path="/var/log/$app/weblate.log" --wait_until="spawned uWSGI" +ynh_systemctl --service="$app-celery" --action="start" --log_path="/var/log/$app/weblate-celery-celery.log" --wait_until="mingle: all alone" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 4e13e85..cdd1f08 100755 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -19,11 +13,11 @@ key=$(ynh_string_random --length=50) #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +ynh_script_progression "Storing installation settings..." -ynh_app_setting_set --app=$app --key=used_forge --value=$used_forge -ynh_app_setting_set --app=$app --key=forge_username --value=$forge_username -ynh_app_setting_set --app=$app --key=forge_token --value=$forge_token +ynh_app_setting_set --key=used_forge --value=$used_forge +ynh_app_setting_set --key=forge_username --value=$forge_username +ynh_app_setting_set --key=forge_token --value=$forge_token # Remove trailing "/" from the path path_no_slash=${path%/} @@ -31,36 +25,35 @@ path_no_slash=${path%/} #================================================= # CREATE A POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2 +ynh_script_progression "Creating a PostgreSQL database..." -ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name +ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS pg_trgm;" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +ynh_script_progression "Setting up source files..." mkdir -p "$install_dir/avatar-cache" mkdir -p "$install_dir/data" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 +ynh_script_progression "Configuring NGINX web server..." # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # SPECIFIC SETUP #================================================= # INSTALL XXHASH #================================================= -ynh_script_progression --message="Installing xxHash..." +ynh_script_progression "Installing xxHash..." tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id="libxxhash" @@ -68,17 +61,17 @@ pushd $tempdir make make install popd -ynh_secure_remove --file="$tempdir" +ynh_safe_rm "$tempdir" #================================================= # CONFIGURE HUB #================================================= if [ $used_forge = "GitHub" ] ; then - ynh_script_progression --message="Configure hub..." --weight=1 - + ynh_script_progression "Configure hub..." + mkdir "$install_dir/.config/" - ynh_add_config --template="../conf/hub_config" --destination="$install_dir/.config/hub" + ynh_config_add --template="hub_config" --destination="$install_dir/.config/hub" cat < "$install_dir/.bashrc" eval "$(hub alias -s /bin/bash)" @@ -88,11 +81,10 @@ fi #================================================= # PIP INSTALLATION #================================================= -ynh_script_progression --message="Install weblate using PIP..." --weight=80 +ynh_script_progression "Install weblate using PIP..." virtualenv --python=python3 "${install_dir}/venv" -chown -R $app: "$install_dir" - +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" #run source in a 'sub shell' ( set +o nounset @@ -116,33 +108,33 @@ chown -R $app: "$install_dir" #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." redis_db=$(ynh_redis_get_free_db) -ynh_app_setting_set --app=$app --key=redis_db --value="$redis_db" +ynh_app_setting_set --key=redis_db --value="$redis_db" settings="$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/settings.py" set_forge_variables -ynh_add_config --template="../conf/settings.py" --destination="$settings" -ynh_add_config --template="../conf/celery-weblate" --destination="$install_dir/celery-weblate" -ynh_add_config --template="../conf/uwsgi.ini" --destination="/etc/uwsgi/apps-available/$app.ini" +ynh_config_add --template="settings.py" --destination="$settings" +ynh_config_add --template="celery-weblate" --destination="$install_dir/celery-weblate" +ynh_config_add --template="uwsgi.ini" --destination="/etc/uwsgi/apps-available/$app.ini" touch "$install_dir/local_settings.py" ln -sf "$install_dir/local_settings.py" "$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/local_settings.py" # Set permissions to app files -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app: "$install_dir" -chown "$app:www-data" "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir/data" #================================================= # SPECIFIC SETUP Filling up the database # https://docs.weblate.org/en/latest/admin/install.html#filling-up-the-database #========================================== -ynh_script_progression --message="Filling up the database..." --weight=10 +ynh_script_progression "Filling up the database..." ( set +o nounset @@ -152,46 +144,44 @@ ynh_script_progression --message="Filling up the database..." --weight=10 cd "${install_dir}" # the user needs to be weblate for postgresql - ynh_exec_warn_less sudo --user=$app $install_dir/venv/bin/weblate migrate --noinput - - ynh_exec_warn_less sudo --user=$app $install_dir/venv/bin/weblate createadmin --no-color \ + ynh_hide_warnings sudo --user=$app $install_dir/venv/bin/weblate migrate --noinput + + ynh_hide_warnings sudo --user=$app $install_dir/venv/bin/weblate createadmin --no-color \ --password "$password" \ --username "$admin" \ --email "$admin_mail" # generate static files - ynh_exec_warn_less sudo --user=$app $install_dir/venv/bin/weblate collectstatic --noinput + ynh_hide_warnings sudo --user=$app $install_dir/venv/bin/weblate collectstatic --noinput # https://docs.weblate.org/en/latest/admin/install/venv-debian.html - ynh_exec_warn_less sudo --user=$app $install_dir/venv/bin/weblate compress + ynh_hide_warnings sudo --user=$app $install_dir/venv/bin/weblate compress # Check the configuration # This may fail in some cases with errors, etc., but the app works and the user can fix issues later. - ynh_exec_warn_less sudo --user=$app $install_dir/venv/bin/weblate check --deploy || true + ynh_hide_warnings sudo --user=$app $install_dir/venv/bin/weblate check --deploy || true ) #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=3 +ynh_script_progression "Configuring $app's systemd service..." -ynh_add_systemd_config --service=$app --template="weblate.service" -ynh_add_systemd_config --service="$app-celery" --template="celery-weblate.service" +ynh_config_add_systemd --template="weblate.service" +ynh_config_add_systemd --service="$app-celery" --template="celery-weblate.service" -#================================================= -# GENERIC FINALIZATION #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 +ynh_script_progression "Configuring log rotation..." # Use logrotate to manage application logfile(s) -ynh_use_logrotate --non-append +ynh_config_add_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=3 +ynh_script_progression "Integrating service in YunoHost..." yunohost service add $app --log="/var/log/$app/weblate.log" yunohost service add "$app-celery" --log="/var/log/$app/weblate-celery-w1.log" @@ -199,13 +189,13 @@ yunohost service add "$app-celery" --log="/var/log/$app/weblate-celery-w1.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=5 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/weblate.log" --line_match="spawned uWSGI" -ynh_systemd_action --service_name="$app-celery" --action="start" --log_path="/var/log/$app/weblate-celery-celery.log" --line_match="mingle: all alone" +ynh_systemctl --service=$app --action="start" --log_path="/var/log/$app/weblate.log" --wait_until="spawned uWSGI" +ynh_systemctl --service="$app-celery" --action="start" --log_path="/var/log/$app/weblate-celery-celery.log" --wait_until="mingle: all alone" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index f6d4bd6..b4e2e43 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -16,48 +10,49 @@ source /usr/share/yunohost/helpers #================================================= # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null +if ynh_hide_warnings yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service integration..." --weight=1 + ynh_script_progression "Removing $app service integration..." yunohost service remove $app fi # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status "$app-celery" >/dev/null +if ynh_hide_warnings yunohost service status "$app-celery" >/dev/null then - ynh_script_progression --message="Removing $app-celery service integration..." --weight=1 + ynh_script_progression "Removing $app-celery service integration..." yunohost service remove "$app-celery" fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=5 +ynh_script_progression "Stopping and removing the systemd service..." # Remove the dedicated systemd config -ynh_remove_systemd_config --service=$app -ynh_remove_systemd_config --service="$app-celery" +ynh_config_remove_systemd + +ynh_config_remove_systemd"$app-celery" #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 +ynh_script_progression "Removing logrotate configuration..." # Remove the app-specific logrotate config -ynh_remove_logrotate +ynh_config_remove_logrotate #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression "Removing NGINX web server configuration..." # Remove the dedicated NGINX config -ynh_remove_nginx_config +ynh_config_remove_nginx #================================================= # REMOVE XXHASH #================================================= -ynh_script_progression --message="Removing xxHash..." +ynh_script_progression "Removing xxHash..." tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id="libxxhash" @@ -65,18 +60,18 @@ pushd $tempdir make make uninstall popd -ynh_secure_remove --file="$tempdir" +ynh_safe_rm "$tempdir" #================================================= # SPECIFIC REMOVE #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." +ynh_script_progression "Removing various files..." -ynh_secure_remove --file="/etc/uwsgi/apps-available/$app.ini" +ynh_safe_rm "/etc/uwsgi/apps-available/$app.ini" -ynh_secure_remove --file="/var/run/$app-celery" +ynh_safe_rm "/var/run/$app-celery" ynh_redis_remove_db @@ -84,4 +79,4 @@ ynh_redis_remove_db # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 0263875..541db01 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# 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 @@ -13,37 +7,37 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=4 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" +ynh_restore "$install_dir" touch "$install_dir/local_settings.py" ln -sf "$install_dir/local_settings.py" "$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/local_settings.py" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app: "$install_dir" -chown $app:www-data "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:www-data "$install_dir" chown -R $app:www-data "$install_dir/data" #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." +ynh_script_progression "Restoring the NGINX web server configuration..." -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=5 +ynh_script_progression "Restoring the PostgreSQL database..." -ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +ynh_psql_db_shell < ./db.sql #================================================= # INSTALL XXHASH #================================================= -ynh_script_progression --message="Installing xxHash..." +ynh_script_progression "Installing xxHash..." tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id="libxxhash" @@ -51,37 +45,37 @@ pushd $tempdir make make install popd -ynh_secure_remove --file="$tempdir" +ynh_safe_rm "$tempdir" #================================================= # RESTORE VARIOUS FILES #================================================= -ynh_script_progression --message="Restoring various files..." --weight=1 +ynh_script_progression "Restoring various files..." -ynh_restore_file --origin_path="/etc/uwsgi/apps-available/$app.ini" +ynh_restore "/etc/uwsgi/apps-available/$app.ini" #================================================= # RESTORE SYSTEMD #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=4 +ynh_script_progression "Restoring $app's systemd service..." -ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +ynh_restore "/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -ynh_restore_file --origin_path="/etc/systemd/system/$app-celery.service" +ynh_restore "/etc/systemd/system/$app-celery.service" systemctl enable "$app-celery" --quiet #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." +ynh_script_progression "Restoring the logrotate configuration..." mkdir -p "/var/log/$app" -ynh_restore_file --origin_path="/etc/logrotate.d/$app" +ynh_restore "/etc/logrotate.d/$app" #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=3 +ynh_script_progression "Integrating service in YunoHost..." yunohost service add $app --log="/var/log/$app/weblate.log" yunohost service add "$app-celery" --log="/var/log/$app/weblate-celery-w1.log" @@ -89,22 +83,20 @@ yunohost service add "$app-celery" --log="/var/log/$app/weblate-celery-w1.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=5 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/weblate.log" --line_match="spawned uWSGI" -ynh_systemd_action --service_name="$app-celery" --action="start" --log_path="/var/log/$app/weblate-celery-w1.log" --line_match="mingle: all alone" +ynh_systemctl --service=$app --action="start" --log_path="/var/log/$app/weblate.log" --wait_until="spawned uWSGI" +ynh_systemctl --service="$app-celery" --action="start" --log_path="/var/log/$app/weblate-celery-w1.log" --wait_until="mingle: all alone" -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression "Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 6d65747..b5659ce 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,18 +1,12 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression "Loading installation settings..." admin_mail=$(ynh_user_get_info --username="$admin" --key=mail) key=$(ynh_string_random --length=50) @@ -20,51 +14,41 @@ key=$(ynh_string_random --length=50) # Remove trailing "/" from the path path_no_slash=${path%/} -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping systemd services..." --weight=5 +ynh_script_progression "Stopping systemd services..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/weblate.log" --line_match="goodbye to uWSGI" -ynh_systemd_action --service_name="$app-celery" --action="stop" --log_path="systemd" +ynh_systemctl --service=$app --action="stop" --log_path="/var/log/$app/weblate.log" --wait_until="goodbye to uWSGI" +ynh_systemctl --service="$app-celery" --action="stop" --log_path="systemd" #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +ynh_script_progression "Ensuring downward compatibility..." # If used_forge, forge_username, forge_token don't exist, create them if [ -z "$used_forge" ]; then used_forge="GitHub" - forge_username=$(ynh_app_setting_get --app=$app --key=github_account) - forge_token=$(ynh_app_setting_get --app=$app --key=github_token) - ynh_app_setting_set --app=$app --key=used_forge --value=$used_forge - ynh_app_setting_set --app=$app --key=forge_username --value=$forge_username - ynh_app_setting_set --app=$app --key=forge_token --value=$forge_token + forge_username=$(ynh_app_setting_get --key=github_account) + forge_token=$(ynh_app_setting_get --key=github_token) + ynh_app_setting_set --key=used_forge --value=$used_forge + ynh_app_setting_set --key=forge_username --value=$forge_username + ynh_app_setting_set --key=forge_token --value=$forge_token fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=3 +ynh_script_progression "Upgrading NGINX web server configuration..." # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx -#================================================= -# SPECIFIC UPGRADE #================================================= # INSTALL XXHASH #================================================= -ynh_script_progression --message="Installing xxHash..." +ynh_script_progression "Installing xxHash..." tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id="libxxhash" @@ -72,17 +56,17 @@ pushd $tempdir make make install popd -ynh_secure_remove --file="$tempdir" +ynh_safe_rm "$tempdir" #================================================= # CONFIGURE HUB #================================================= if [ $used_forge = "GitHub" ] ; then - ynh_script_progression --message="Configure hub..." --weight=1 - + ynh_script_progression "Configure hub..." + #mkdir "$install_dir/.config/" - ynh_add_config --template="../conf/hub_config" --destination="$install_dir/.config/hub" + ynh_config_add --template="hub_config" --destination="$install_dir/.config/hub" cat < "$install_dir/.bashrc" eval "$(hub alias -s /bin/bash)" @@ -92,19 +76,19 @@ fi #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=2 +ynh_script_progression "Updating configuration..." -ynh_add_config --template="../conf/uwsgi.ini" --destination="/etc/uwsgi/apps-available/$app.ini" +ynh_config_add --template="uwsgi.ini" --destination="/etc/uwsgi/apps-available/$app.ini" -ynh_add_config --template="../conf/celery-weblate" --destination="$install_dir/celery-weblate" +ynh_config_add --template="celery-weblate" --destination="$install_dir/celery-weblate" #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=3 +ynh_script_progression "Configuring $app's systemd service..." -ynh_add_systemd_config --service=$app --template="weblate.service" -ynh_add_systemd_config --service="$app-celery" --template="celery-weblate.service" +ynh_config_add_systemd --template="weblate.service" +ynh_config_add_systemd --service="$app-celery" --template="celery-weblate.service" #================================================= # UPGRADE WEBLATE @@ -116,12 +100,11 @@ upgrade() { #================================================= # PIP INSTALLATION #================================================= - ynh_script_progression --message="Install weblate using PIP..." --weight=15 + ynh_script_progression "Install weblate using PIP..." - ynh_secure_remove --file="${install_dir}/venv" + ynh_safe_rm "${install_dir}/venv" virtualenv --python=python3 "${install_dir}/venv" - chown -R $app: "$install_dir" - + #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" #run source in a 'sub shell' ( set +o nounset @@ -144,19 +127,19 @@ upgrade() { #================================================= # MODIFY A CONFIG FILE #================================================= - ynh_script_progression --message="Create weblate configuration file..." --weight=2 + ynh_script_progression "Create weblate configuration file..." # save old settings file settings="$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/settings.py" path="${path%/}" set_forge_variables - ynh_add_config --template="../conf/settings.py" --destination="$settings" + ynh_config_add --template="settings.py" --destination="$settings" - ynh_app_setting_set --app=$app --key=redis_db --value="$redis_db" + ynh_app_setting_set --key=redis_db --value="$redis_db" # Recalculate and store the config file checksum into the app settings - ynh_store_file_checksum --file="$settings" + ynh_store_file_checksum "$settings" touch "$install_dir/local_settings.py" ln -sf "$install_dir/local_settings.py" "$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/local_settings.py" @@ -164,9 +147,9 @@ upgrade() { #================================================= # MIGRATE WEBLATE #================================================= - ynh_script_progression --message="Run migration scripts..." --weight=10 + ynh_script_progression "Run migration scripts..." - ynh_systemd_action --service_name="$app-celery" --action="start" + ynh_systemctl --service="$app-celery" --action="start" ( set +o nounset @@ -189,7 +172,7 @@ upgrade() { fi ) - ynh_systemd_action --service_name="$app-celery" --action="stop" + ynh_systemctl --service="$app-celery" --action="stop" } file_version="${install_dir}/venv/lib/$weblate_pypath/site-packages/weblate/__init__.py" @@ -205,7 +188,7 @@ else current_version=3 fi -ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name +ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS pg_trgm;" if [ "$current_version" -lt "5" ] then @@ -216,27 +199,24 @@ upgrade $(ynh_app_upstream_version) "../conf/settings.py" # Set right permissions for curl installation mkdir -p "$install_dir/avatar-cache" -chown -R $app: "$install_dir" -chown "$app:www-data" "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir/data" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" - -#================================================= -# GENERIC FINALIZATION +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 +ynh_script_progression "Upgrading logrotate configuration..." # Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append +ynh_config_add_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 +ynh_script_progression "Integrating service in YunoHost..." yunohost service add $app --log="/var/log/$app/weblate.log" yunohost service add "$app-celery" --log="/var/log/$app/weblate-celery-w1.log" @@ -244,13 +224,13 @@ yunohost service add "$app-celery" --log="/var/log/$app/weblate-celery-w1.log" #================================================= # START SYSTEMD SERVICES #================================================= -ynh_script_progression --message="Starting systemd services..." --weight=5 +ynh_script_progression "Starting systemd services..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/weblate.log" --line_match="spawned uWSGI" -ynh_systemd_action --service_name="$app-celery" --action="start" --log_path="/var/log/$app/weblate-celery-celery.log" --line_match="mingle: all alone" +ynh_systemctl --service=$app --action="start" --log_path="/var/log/$app/weblate.log" --wait_until="spawned uWSGI" +ynh_systemctl --service="$app-celery" --action="start" --log_path="/var/log/$app/weblate-celery-celery.log" --wait_until="mingle: all alone" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed" From cd60686646843e0044a40916b9e93735bae95780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:34:28 +0200 Subject: [PATCH 11/17] cleaning --- scripts/backup | 17 +---------------- scripts/change_url | 2 -- scripts/install | 20 +++++++++----------- scripts/remove | 35 ++++------------------------------- scripts/restore | 9 ++++----- scripts/upgrade | 12 +++++++----- 6 files changed, 25 insertions(+), 70 deletions(-) diff --git a/scripts/backup b/scripts/backup index fd85c98..7899510 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,6 +1,5 @@ #!/bin/bash -# 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 @@ -13,30 +12,16 @@ ynh_print_info "Declaring files to be backed up..." ynh_backup "$install_dir" #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - ynh_backup "/etc/logrotate.d/$app" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup "/etc/systemd/system/$app.service" ynh_backup "/etc/systemd/system/$app-celery.service" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - ynh_backup "/etc/uwsgi/apps-available/$app.ini" #================================================= diff --git a/scripts/change_url b/scripts/change_url index 041c63f..edda15b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -18,8 +18,6 @@ ynh_script_progression "Updating NGINX web server configuration..." ynh_config_change_url_nginx -#================================================= -# SPECIFIC MODIFICATIONS #================================================= # MODIFY SETTINGS #================================================= diff --git a/scripts/install b/scripts/install index cdd1f08..3c5014b 100755 --- a/scripts/install +++ b/scripts/install @@ -37,19 +37,17 @@ ynh_script_progression "Setting up source files..." mkdir -p "$install_dir/avatar-cache" mkdir -p "$install_dir/data" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" + #================================================= # NGINX CONFIGURATION #================================================= ynh_script_progression "Configuring NGINX web server..." -# Create a dedicated NGINX config ynh_config_add_nginx -#================================================= -# SPECIFIC SETUP #================================================= # INSTALL XXHASH #================================================= @@ -84,7 +82,7 @@ fi ynh_script_progression "Install weblate using PIP..." virtualenv --python=python3 "${install_dir}/venv" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" +chown -R $app: "$install_dir" #run source in a 'sub shell' ( set +o nounset @@ -124,10 +122,10 @@ touch "$install_dir/local_settings.py" ln -sf "$install_dir/local_settings.py" "$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/local_settings.py" # Set permissions to app files -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:www-data" "$install_dir" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app: "$install_dir" +chown "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir/data" #================================================= diff --git a/scripts/remove b/scripts/remove index b4e2e43..fed424e 100755 --- a/scripts/remove +++ b/scripts/remove @@ -4,49 +4,24 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEM CONFIGURATIONS #================================================= +ynh_script_progression "Removing system configurations related to $app..." -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_hide_warnings yunohost service status $app >/dev/null -then - ynh_script_progression "Removing $app service integration..." +if ynh_hide_warnings yunohost service status $app >/dev/null; then yunohost service remove $app fi -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_hide_warnings yunohost service status "$app-celery" >/dev/null -then - ynh_script_progression "Removing $app-celery service integration..." +if ynh_hide_warnings yunohost service status "$app-celery" >/dev/null; then yunohost service remove "$app-celery" fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression "Stopping and removing the systemd service..." - -# Remove the dedicated systemd config ynh_config_remove_systemd ynh_config_remove_systemd"$app-celery" -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression "Removing logrotate configuration..." - -# Remove the app-specific logrotate config ynh_config_remove_logrotate -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression "Removing NGINX web server configuration..." - -# Remove the dedicated NGINX config ynh_config_remove_nginx #================================================= @@ -62,8 +37,6 @@ pushd $tempdir popd ynh_safe_rm "$tempdir" -#================================================= -# SPECIFIC REMOVE #================================================= # REMOVE VARIOUS FILES #================================================= diff --git a/scripts/restore b/scripts/restore index 541db01..2817485 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,6 +1,5 @@ #!/bin/bash -# 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 @@ -14,10 +13,10 @@ ynh_restore "$install_dir" touch "$install_dir/local_settings.py" ln -sf "$install_dir/local_settings.py" "$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/local_settings.py" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:www-data "$install_dir" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app: "$install_dir" +chown $app:www-data "$install_dir" chown -R $app:www-data "$install_dir/data" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b5659ce..18afb8a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -104,7 +104,7 @@ upgrade() { ynh_safe_rm "${install_dir}/venv" virtualenv --python=python3 "${install_dir}/venv" - #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" + chown -R $app: "$install_dir" #run source in a 'sub shell' ( set +o nounset @@ -128,6 +128,7 @@ upgrade() { # MODIFY A CONFIG FILE #================================================= ynh_script_progression "Create weblate configuration file..." + # save old settings file settings="$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/settings.py" path="${path%/}" @@ -199,12 +200,13 @@ upgrade $(ynh_app_upstream_version) "../conf/settings.py" # Set right permissions for curl installation mkdir -p "$install_dir/avatar-cache" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app: "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:www-data" "$install_dir" +chown -R $app: "$install_dir" +chown "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir/data" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" + #================================================= # SETUP LOGROTATE #================================================= From ef3ecb512e1320d579ec6cb3b74efcaa13b81735 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 30 Sep 2024 18:14:07 +0200 Subject: [PATCH 12/17] Auto-update READMEs --- ALL_README.md | 1 + README_es.md | 2 +- README_nl.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 README_nl.md diff --git a/ALL_README.md b/ALL_README.md index e3c80d2..df3708b 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -6,5 +6,6 @@ - [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) +- [Lees de README in het Nederlands](README_nl.md) - [Прочитать README на русский](README_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README_es.md b/README_es.md index 12c1ce6..4953a92 100644 --- a/README_es.md +++ b/README_es.md @@ -37,7 +37,7 @@ Weblate is a libre web-based translation tool with tight version control integra ## Información para desarrolladores -Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/weblate_ynh/tree/testing +Por favor enviar sus correcciones a la [rama `testing`](https://github.com/YunoHost-Apps/weblate_ynh/tree/testing). Para probar la rama `testing`, sigue asÍ: diff --git a/README_nl.md b/README_nl.md new file mode 100644 index 0000000..3f9e274 --- /dev/null +++ b/README_nl.md @@ -0,0 +1,50 @@ + + +# Weblate voor Yunohost + +[![Integratieniveau](https://dash.yunohost.org/integration/weblate.svg)](https://ci-apps.yunohost.org/ci/apps/weblate/) ![Mate van functioneren](https://ci-apps.yunohost.org/ci/badges/weblate.status.svg) ![Onderhoudsstatus](https://ci-apps.yunohost.org/ci/badges/weblate.maintain.svg) + +[![Weblate met Yunohost installeren](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) + +*[Deze README in een andere taal lezen.](./ALL_README.md)* + +> *Met dit pakket kun je Weblate snel en eenvoudig op een YunoHost-server installeren.* +> *Als je nog geen YunoHost hebt, lees dan [de installatiehandleiding](https://yunohost.org/install), om te zien hoe je 'm installeert.* + +## Overzicht + +Weblate is a libre web-based translation tool with tight version control integration. It provides two user interfaces, propagation of translations across components, quality checks and automatic linking to source files. + +**Geleverde versie:** 5.5.3~ynh1 + +**Demo:** + +## Schermafdrukken + +![Schermafdrukken van Weblate](./doc/screenshots/BigScreenshot.png) + +## Documentatie en bronnen + +- Officiele website van de app: +- Officiele gebruikersdocumentatie: +- Officiele beheerdersdocumentatie: +- Upstream app codedepot: +- YunoHost-store: +- Meld een bug: + +## Ontwikkelaarsinformatie + +Stuur je pull request alsjeblieft naar de [`testing`-branch](https://github.com/YunoHost-Apps/weblate_ynh/tree/testing). + +Om de `testing`-branch uit te proberen, ga als volgt te werk: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +of +sudo yunohost app upgrade weblate -u https://github.com/YunoHost-Apps/weblate_ynh/tree/testing --debug +``` + +**Verdere informatie over app-packaging:** From de34e2026a3a5a373e95a49d000f724f11bec155 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 30 Sep 2024 18:33:33 +0200 Subject: [PATCH 13/17] cleaning --- manifest.toml | 1 + scripts/install | 1 + 2 files changed, 2 insertions(+) diff --git a/manifest.toml b/manifest.toml index fff5e89..024f73e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -114,6 +114,7 @@ ram.runtime = "3G" "postgresql", "postgresql-contrib", "hub", + "gettext", # Borg backup dependencies "pkg-config", "python3-pkgconfig", "libacl1-dev", "libacl1", "libssl-dev", "liblz4-dev", "libzstd-dev", "libxxhash-dev", diff --git a/scripts/install b/scripts/install index 3c5014b..1bf70d0 100755 --- a/scripts/install +++ b/scripts/install @@ -83,6 +83,7 @@ ynh_script_progression "Install weblate using PIP..." virtualenv --python=python3 "${install_dir}/venv" chown -R $app: "$install_dir" + #run source in a 'sub shell' ( set +o nounset From 702b976f4f767b566acba372eec9d212746e3187 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:30:18 +0200 Subject: [PATCH 14/17] fix uwsgi --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 1bf70d0..55d02c4 100755 --- a/scripts/install +++ b/scripts/install @@ -118,6 +118,7 @@ set_forge_variables ynh_config_add --template="settings.py" --destination="$settings" ynh_config_add --template="celery-weblate" --destination="$install_dir/celery-weblate" ynh_config_add --template="uwsgi.ini" --destination="/etc/uwsgi/apps-available/$app.ini" +chmod 600 "/etc/uwsgi/apps-available/$app.ini" touch "$install_dir/local_settings.py" ln -sf "$install_dir/local_settings.py" "$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/local_settings.py" diff --git a/scripts/upgrade b/scripts/upgrade index 18afb8a..b777037 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,6 +79,7 @@ fi ynh_script_progression "Updating configuration..." ynh_config_add --template="uwsgi.ini" --destination="/etc/uwsgi/apps-available/$app.ini" +chmod 600 "/etc/uwsgi/apps-available/$app.ini" ynh_config_add --template="celery-weblate" --destination="$install_dir/celery-weblate" From ffd660962269dfe947354af4e523b39fdde9b83c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:04:08 +0200 Subject: [PATCH 15/17] fix permission --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 55d02c4..64487f4 100755 --- a/scripts/install +++ b/scripts/install @@ -118,7 +118,7 @@ set_forge_variables ynh_config_add --template="settings.py" --destination="$settings" ynh_config_add --template="celery-weblate" --destination="$install_dir/celery-weblate" ynh_config_add --template="uwsgi.ini" --destination="/etc/uwsgi/apps-available/$app.ini" -chmod 600 "/etc/uwsgi/apps-available/$app.ini" +chmod 640 "/etc/uwsgi/apps-available/$app.ini" touch "$install_dir/local_settings.py" ln -sf "$install_dir/local_settings.py" "$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/local_settings.py" From 593e93bbb7152549a605e803b30cab27a199e64a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:12:32 +0200 Subject: [PATCH 16/17] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 64487f4..c4aad21 100755 --- a/scripts/install +++ b/scripts/install @@ -118,7 +118,9 @@ set_forge_variables ynh_config_add --template="settings.py" --destination="$settings" ynh_config_add --template="celery-weblate" --destination="$install_dir/celery-weblate" ynh_config_add --template="uwsgi.ini" --destination="/etc/uwsgi/apps-available/$app.ini" + chmod 640 "/etc/uwsgi/apps-available/$app.ini" +chown $app:$app "/etc/uwsgi/apps-available/$app.ini" touch "$install_dir/local_settings.py" ln -sf "$install_dir/local_settings.py" "$install_dir/venv/lib/$weblate_pypath/site-packages/weblate/local_settings.py" From 796ae3481711511c0f9a06f4eb9cc49eadb89d97 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 1 Oct 2024 07:39:42 +0200 Subject: [PATCH 17/17] Update remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index fed424e..c31f8fe 100755 --- a/scripts/remove +++ b/scripts/remove @@ -18,7 +18,7 @@ fi ynh_config_remove_systemd -ynh_config_remove_systemd"$app-celery" +ynh_config_remove_systemd "$app-celery" ynh_config_remove_logrotate