Optional Weblate modules

Several optional modules are available for your setup.

Git exporter

バージョン 2.10 で追加.

Provides you read-only access to the underlying Git repository using HTTP(S).

導入

  1. Add weblate.gitexport to installed apps in settings.py:

INSTALLED_APPS += ("weblate.gitexport",)
  1. Export existing repositories by migrating your database after installation:

weblate migrate

Usage

The module automatically hooks into Weblate and sets the exported repository URL in the Component configuration. The repositories are accessible under the /git/ part of the Weblate URL, for example https://example.org/git/weblate/main/.

Repositories for publicly available projects can be cloned without authentication:

git clone 'https://example.org/git/weblate/main/'

Access to browse the repositories with restricted access (with Private access control or when REQUIRE_LOGIN is enabled) requires an API token which can be obtained in your user profile:

git clone 'https://user:KEY@example.org/git/weblate/main/'

ヒント

By default members or Users group and anonymous user have access to the repositories for public projects via Access repository and Power user roles.

請求

バージョン 2.4 で追加.

This is used on Hosted Weblate to define billing plans, track invoices and usage limits.

導入

1. Add weblate.billing to installed apps in settings.py:

INSTALLED_APPS += ("weblate.billing",)
  1. Run the database migration to optionally install additional database structures for the module:

weblate migrate

Usage

After installation you can control billing in the admin interface. Users with billing enabled will get new Billing tab in their ユーザー情報.

The billing module additionally allows project admins to create new projects and components without being superusers (see Adding translation projects and components). This is possible when following conditions are met:

  • The billing is in its configured limits (any overusage results in blocking of project/component creation) and paid (if its price is non zero)

  • The user is admin of existing project with billing or user is owner of billing (the latter is necessary when creating new billing for users to be able to import new projects).

Upon project creation user is able to choose which billing should be charged for the project in case he has access to more of them.

Avatars

Avatars are downloaded and cached server-side to reduce information leaks to the sites serving them by default. The built-in support for fetching avatars from e-mails addresses configured for it can be turned off using ENABLE_AVATARS.

Weblate currently supports:

Spam protection

You can protect against spamming by users by using the Akismet service.

  1. Install the akismet Python module (this is already included in the official Docker image).

  2. Obtain the Akismet API key.

  3. Store it as AKISMET_API_KEY or WEBLATE_AKISMET_API_KEY in Docker.

Following content is sent to Akismet for checking:

  • 認証されていないユーザーからの提案

  • プロジェクトとコンポーネントの説明とリンク

注釈

This (among other things) relies on IP address of the client, please see リバース プロキシの背後で実行 for properly configuring that.

Signing Git commits with GnuPG

バージョン 3.1 で追加.

All commits can be signed by the GnuPG key of the Weblate instance.

1. Turn on WEBLATE_GPG_IDENTITY. (Weblate will generate a GnuPG key when needed and will use it to sign all translation commits.)

This feature needs GnuPG 2.1 or newer installed.

You can find the key in the DATA_DIR and the public key is shown on the "About" page:

../_images/about-gpg.png

2. Alternatively you can also import existing keys into Weblate, just set HOME=$DATA_DIR/home when invoking gpg.

接続制限

バージョン 3.2 で変更: 接続制限は、さらに詳細な設定が可能になりました。

Weblate の一部の操作は接続回数が制限されています。 RATELIMIT_WINDOW 秒以内で最大 RATELIMIT_ATTEMPTS 回の試行が許可されています。その後、ユーザーは RATELIMIT_LOCKOUT 秒間遮断されます。RATELIMIT_CONTACT_ATTEMPTSRATELIMIT_TRANSLATE_ATTEMPTS などの、アクセス範囲を限定した設定もあります。次の表は、すべての使用可能なアクセス範囲の一覧です。

接続制限が対象の操作:

名前

アクセス範囲

試行回数限度

試行可能秒数

接続遮断秒数

登録

REGISTRATION

5

300

600

管理者へメッセージの送信

MESSAGE

5

300

600

サイン イン時のパスワード認証

LOGIN

5

300

600

サイト全体の検索

SEARCH

6

60

60

翻訳

TRANSLATE

30

60

600

用語集に用語を追加

GLOSSARY

30

60

600

新しい言語での翻訳の開始

LANGUAGE

2

300

600

ユーザーがログインに AUTH_LOCK_ATTEMPTS 回失敗した場合、パスワードのリセット処理を完了するまで、アカウントのパスワード認証を無効にします。

API には、個別の接続制限があります。参照: API 接続制限

Fedora Messaging の統合

Fedora Messaging is AMQP-based publisher for all changes happening in Weblate. You can hook additional services on changes happening in Weblate using this.

The Fedora Messaging integration is available as a separate Python module weblate-fedora-messaging. Please see <https://github.com/WeblateOrg/fedora_messaging/> for setup instructions.