From d2eb2794dcfa4bde25d81cd2f31f1b81c6acf004 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 23 Feb 2023 23:38:39 +0100 Subject: [PATCH 1/6] [autopatch] Upgrade auto-updater --- .github/workflows/updater.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index fb72ba0..a56d7cb 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Fetch the source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Run the updater script @@ -33,7 +33,7 @@ jobs: - name: Create Pull Request id: cpr if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: Update to version ${{ env.VERSION }} From 2388f3990ea08739ac3405367c477c5ce2b1aff0 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 23 Feb 2023 22:38:41 +0000 Subject: [PATCH 2/6] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 5784959..1e31a9b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,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) + [![Install Weblate with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index 62bc191..3d34e12 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # 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) + [![Installer Weblate avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=weblate) *[Read this readme in english.](./README.md)* From c37d01d5961697507a7db7cf1cdf88f98f17f59e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 17 Mar 2023 06:13:24 +0000 Subject: [PATCH 3/6] Upgrade to v4.16.4 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 5c85975..7270582 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Translation platform using Git and Python", "fr": "Plateforme de traduction utilisant Git et Python" }, - "version": "4.15.2~ynh1", + "version": "4.16.4~ynh1", "url": "https://weblate.org", "upstream": { "license": "AGPL-3.0", From 13e38878e4f15f22015335148a1a5082d9144d0b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 17 Mar 2023 06:13:35 +0000 Subject: [PATCH 4/6] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1e31a9b..4fa5a86 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in 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:** 4.15.2~ynh1 +**Shipped version:** 4.16.4~ynh1 **Demo:** https://hosted.weblate.org/ diff --git a/README_fr.md b/README_fr.md index 3d34e12..bd407e2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po 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 :** 4.15.2~ynh1 +**Version incluse :** 4.16.4~ynh1 **Démo :** https://hosted.weblate.org/ From 180db151211027d15156842f7269bb48e70379d7 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 22 Mar 2023 17:58:46 +0100 Subject: [PATCH 5/6] Update settings --- conf/settings.py | 51 ++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/conf/settings.py b/conf/settings.py index 4c5f7b4..22b5c98 100644 --- a/conf/settings.py +++ b/conf/settings.py @@ -11,25 +11,9 @@ ################################################################################ ################################################################################ +# Copyright © Michal Čihař # -# Copyright © 2012–2022 Michal Čihař -# -# This file is part of Weblate -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - +# SPDX-License-Identifier: GPL-3.0-or-later import os import platform @@ -48,7 +32,7 @@ ENABLE_HTTPS = True # Django settings for Weblate project. # -DEBUG = False +DEBUG = True ADMINS = ( ('__ADMIN__', '__ADMIN_MAIL__'), @@ -95,6 +79,7 @@ DATABASES = { # Data directory, you can use following for the development purposes: # os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "data") DATA_DIR = os.path.join("__FINALPATH__", "data") +CACHE_DIR = f"{DATA_DIR}/cache" # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name @@ -183,7 +168,7 @@ MEDIA_URL = f"{URL_PREFIX}/media/" # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. -STATIC_ROOT = os.path.join(DATA_DIR, "static") +STATIC_ROOT = os.path.join(CACHE_DIR, "static") # URL prefix for static files. STATIC_URL = f"{URL_PREFIX}/static/" @@ -244,6 +229,10 @@ GITLAB_CREDENTIALS = { } } +# Bitbucket username and token for sending merge requests. +# Please see the documentation for more details. +BITBUCKETSERVER_CREDENTIALS = {} + # Authentication configuration AUTHENTICATION_BACKENDS = ( "social_core.backends.email.EmailAuth", @@ -378,6 +367,7 @@ REQUIRE_LOGIN = False MIDDLEWARE = [ "weblate.middleware.RedirectMiddleware", "weblate.middleware.ProxyMiddleware", + "corsheaders.middleware.CorsMiddleware", "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.csrf.CsrfViewMiddleware", @@ -430,10 +420,13 @@ INSTALLED_APPS = [ # Third party Django modules "social_django", "crispy_forms", + "crispy_bootstrap3", "compressor", "rest_framework", "rest_framework.authtoken", "django_filters", + "django_celery_beat", + "corsheaders", ] # Custom exception reporter to include some details @@ -455,10 +448,7 @@ if platform.system() != "Windows": except OSError: HAVE_SYSLOG = False -if DEBUG or not HAVE_SYSLOG: - DEFAULT_LOG = "console" -else: - DEFAULT_LOG = "syslog" +DEFAULT_LOG = "console" if DEBUG or not HAVE_SYSLOG else "syslog" DEFAULT_LOGLEVEL = "DEBUG" if DEBUG else "INFO" # A sample logging configuration. The only tangible logging @@ -713,6 +703,7 @@ LIMIT_TRANSLATION_LENGTH_BY_SOURCE_LENGTH = True SIMPLIFY_LANGUAGES = True # Render forms using bootstrap +CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap3" CRISPY_TEMPLATE_PACK = "bootstrap3" # List of quality checks @@ -850,7 +841,7 @@ CACHES = { }, "avatar": { "BACKEND": "django.core.cache.backends.filebased.FileBasedCache", - "LOCATION": os.path.join(DATA_DIR, "avatar-cache"), + "LOCATION": os.path.join(CACHE_DIR, "avatar"), "TIMEOUT": 86400, "OPTIONS": {"MAX_ENTRIES": 1000}, }, @@ -881,8 +872,8 @@ REST_FRAMEWORK = { "weblate.api.throttling.AnonRateThrottle", ), "DEFAULT_THROTTLE_RATES": {"anon": "100/day", "user": "5000/hour"}, - "DEFAULT_PAGINATION_CLASS": ("rest_framework.pagination.PageNumberPagination"), - "PAGE_SIZE": 20, + "DEFAULT_PAGINATION_CLASS": "weblate.api.pagination.StandardPagination", + "PAGE_SIZE": 50, "VIEW_DESCRIPTION_FUNCTION": "weblate.api.views.get_view_description", "UNAUTHENTICATED_USER": "weblate.auth.models.get_anonymous", } @@ -935,7 +926,7 @@ CELERY_RESULT_BACKEND = CELERY_BROKER_URL # Celery settings, it is not recommended to change these CELERY_WORKER_MAX_MEMORY_PER_CHILD = 200000 -CELERY_BEAT_SCHEDULE_FILENAME = os.path.join(DATA_DIR, "celery", "beat-schedule") +CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler" CELERY_TASK_ROUTES = { "weblate.trans.tasks.auto_translate*": {"queue": "translate"}, "weblate.accounts.tasks.notify_*": {"queue": "notify"}, @@ -947,6 +938,10 @@ CELERY_TASK_ROUTES = { "weblate.memory.tasks.*": {"queue": "memory"}, } +# CORS allowed origins +CORS_ALLOWED_ORIGINS = [] +CORS_URLS_REGEX = r"^/api/.*$" + # Enable plain database backups DATABASE_BACKUP = "plain" From be7a42ad013f34b5ee6f1f2c89f854ba32dcafab Mon Sep 17 00:00:00 2001 From: Kay0u Date: Wed, 22 Mar 2023 18:00:54 +0100 Subject: [PATCH 6/6] set debug to false --- conf/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/settings.py b/conf/settings.py index 22b5c98..343688e 100644 --- a/conf/settings.py +++ b/conf/settings.py @@ -32,7 +32,7 @@ ENABLE_HTTPS = True # Django settings for Weblate project. # -DEBUG = True +DEBUG = False ADMINS = ( ('__ADMIN__', '__ADMIN_MAIL__'),