「Postorius」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(翻訳)
(→‎インストール: 翻訳を修正)
 
(2人の利用者による、間の6版が非表示)
6行目: 6行目:
 
== インストール ==
 
== インストール ==
   
Postorius を使うためには、動作する[[ウェブサーバー]]のセットアップが必要です (例えば、[[Apache HTTP Server|Apache]] を使って [[wikipedia:Wsgi|WSGI]] に直接転送するか、[[Nginx]] を使ってリクエストを [[UWSGI]] のようなアプリケーションサーバーに転送す)
+
Postorius を使うためには、動作する [[ウェブサーバー]] のセットアップが必要です (例えば、[[Apache HTTP Server|Apache]] を使って [[wikipedia:Wsgi|WSGI]] に直接転送するか、[[Nginx]] を使ってリクエストを [[UWSGI]] のようなアプリケーションサーバーに転送しま)
   
{{Pkg|postorius}} パッケージを[[インストール]]します。
+
{{Pkg|postorius}} パッケージを [[インストール]] します。
   
{{Warning|Postorius は、パスワードやユーザーデータをネットワークに公開してしまうため、[[TLS]] 経由でのみアクセスされるべきです (テスト目的でそれを実行しているマシンから直接アクセスされる場合を除く)。}}
+
{{Warning|Postorius は、パスワードやユーザーデータをネットワークに公開してしまうため、[[TLS]] 経由でのみアクセスされるべきです (テスト目的でそれを実行しているマシンから直接アクセスされる場合を除く。)}}
   
== Configuration ==
+
== 設定 ==
   
The web application is configured in {{ic|/etc/webapps/postorius/settings_local.py}} which is included by the default configuration in {{ic|/usr/share/webapps/postorius/settings.py}}.
+
Web アプリケーションは、{{ic|/etc/webapps/postorius/settings_local.py}} で設定されます。これは、{{ic|/usr/share/webapps/postorius/settings.py}} のデフォルト設定に含まれています。
   
{{Note|Postorius should store user sensitive data (e.g. sqlite database) in {{ic|/var/lib/postorius/data/}}, as that directory is only accessible by root and the application itself.}}
+
{{Note|Postorius は、ユーザーの機密データ (sqlite データベースなど) {{ic|/var/lib/postorius/data/}} に保存する必要があります。このディレクトリには root とアプリケーション自体だけがアクセスできるためです。}}
   
  +
アプリケーションのデフォルトのシークレットを変更します。
Change the default secret for the application:
 
   
 
{{hc|/etc/webapps/postorius/settings_local.py|2=
 
{{hc|/etc/webapps/postorius/settings_local.py|2=
24行目: 24行目:
 
}}
 
}}
   
  +
運用環境で実行する場合は、必ずデバッグを無効にしてください。
Make sure to disable debugging when running in production:
 
   
 
{{hc|/etc/webapps/postorius/settings_local.py|2=
 
{{hc|/etc/webapps/postorius/settings_local.py|2=
30行目: 30行目:
 
}}
 
}}
   
  +
実行中の [[mailman]] インスタンスを設定できるようにするには、REST API の設定オプションを postorius の構成に追加する必要があります。
To be able to configure a running [[mailman]] instance configuration options for its REST API have to be added to postorius' configuration.
 
   
 
{{hc|/etc/webapps/postorius/settings_local.py|<nowiki>
 
{{hc|/etc/webapps/postorius/settings_local.py|<nowiki>
38行目: 38行目:
 
</nowiki>}}
 
</nowiki>}}
   
  +
有効な電子メール設定を追加します ([[Django]] アプリケーションが購読者を確認できるようにします)。
Add a valid email configuration (so that the [[Django]] application can verify subscribers):
 
   
 
{{hc|/etc/webapps/postorius/settings_local.py|2=
 
{{hc|/etc/webapps/postorius/settings_local.py|2=
48行目: 48行目:
 
}}
 
}}
   
{{Note|The {{ic|DEFAULT_FROM_EMAIL}} and {{ic|SERVER_EMAIL}} configuration options can be used to define the {{ic|From:}} header of mails sent for internal authentication and error reporting (respectively).}}
+
{{Note|{{ic|DEFAULT_FROM_EMAIL}} および {{ic|SERVER_EMAIL}} 設定オプションを使用して、それぞれ内部認証とエラー報告のために送信されるメールの {{ic|From:}} ヘッダーを定義できます。}}
   
  +
アプリケーションの有効なホスト名またはドメイン名を定義する必要があります。
The valid hosts or domain names for the application need to be defined:
 
   
 
{{hc|/etc/webapps/postorius/settings_local.py|2=
 
{{hc|/etc/webapps/postorius/settings_local.py|2=
59行目: 59行目:
 
}}
 
}}
   
== Hosting ==
+
== ホスティング ==
   
{{Expansion|Example for a setup using [[Apache HTTP Server]].}}
+
{{Expansion|[[Apache HTTP Server]] を使ったセットアップの例。}}
   
{{Note|Postorius needs to be run as its own user and group (i.e. {{ic|postorius}}). It is using {{ic|/etc/webapps/postorius/}}, {{ic|/var/lib/postorius/}} and {{ic|/run/postorius/}} for configurations, static caches and (potentially) sockets, respectively.}}
+
{{Note|Postorius はそれ自身のユーザーとグループ (すなわち {{ic|postorius}}) として実行する必要があります。それは設定、静的キャッシュ、および (潜在的に) ソケットのためにそれぞれ {{ic|/etc/webapps/postorius/}}, {{ic|/var/lib/postorius/}}, および {{ic|/run/postorius/}} を使用しています。}}
   
{{Note|As the static files are by default served from a top-level {{ic|static/}} directory, which will conflict with [[hyperkitty]] on the same (sub)domain, it is advisable to set the {{ic|STATIC_URL}} variable in {{ic|/etc/webapps/postorius/settings_local.py}} to something unique (e.g. {{ic|'/postorius_static/'}}).}}
+
{{Note|静的ファイルはデフォルトでトップレベルの {{ic|static/}} ディレクトリから提供され、同じ (サブ) ドメイン上の [[hyperkitty]] と競合するため、{{ic|/etc/webapps/postorius/settings_local.py}} {{ic|STATIC_URL}} 変数をユニークなもの (例: {{ic|'/postorius_static/'}}) に設定することをお勧めします。}}
   
=== Nginx and uWSGI ===
+
=== Nginx uWSGI ===
   
Postorius comes with a working [[uWSGI]] configuration file in {{ic|/etc/uwsgi/postorius.ini}}.
+
Postorius {{ic|/etc/uwsgi/postorius.ini}} にある動作する [[uWSGI]] 設定ファイルが付属しています。
   
[[Install]] {{Pkg|nginx}} and {{Pkg|uwsgi-plugin-python}}, create a per-application socket for [[uWSGI]] (see [[UWSGI#Accessibility of uWSGI socket]] for reference) and [[enable]] {{ic|uwsgi-secure@postorius.socket}}.
+
{{Pkg|nginx}} {{Pkg|uwsgi-plugin-python}} を[[インストール]]し、[[uWSGI]] のアプリケーションごとのソケットを作成し ([[UWSGI#Accessibility of uWSGI socket]] を参照){{ic|uwsgi-secure@postorius.socket}} を[[有効化]]してください。
   
For a local test setup, serving Postorius at http://127.0.0.1:80/postorius add the following [[Nginx]] configuration to your setup:
+
ローカルのテストセットアップで、http://127.0.0.1:80/postorius Postorius を提供するには、以下の [[Nginx]] 設定をセットアップに追加します:
   
 
{{hc|/etc/nginx/postorius.conf|<nowiki>
 
{{hc|/etc/nginx/postorius.conf|<nowiki>
96行目: 96行目:
 
</nowiki>}}
 
</nowiki>}}
   
== Setup ==
+
== セットアップ ==
   
{{Note| Run the following commands as the {{ic|postorius}} user (e.g. using [[sudo]] or [[su]]).}}
+
{{Note| 以下のコマンドは {{ic|postorius}} ユーザーとして実行してください (例: [[sudo]] または [[su]] を使用して)}}
   
  +
初回インストール後、データベースを生成することを確認してください:
After first installation make sure to generate a database:
 
   
 
[postorius]$ django-admin migrate --pythonpath /usr/share/webapps/postorius/ --settings settings
 
[postorius]$ django-admin migrate --pythonpath /usr/share/webapps/postorius/ --settings settings
   
  +
その後、アプリケーションの静的データを収集する必要があります:
Afterwards, the static data for the application needs to be collected:
 
   
 
[postorius]$ django-admin collectstatic --pythonpath /usr/share/webapps/postorius/ --settings settings
 
[postorius]$ django-admin collectstatic --pythonpath /usr/share/webapps/postorius/ --settings settings
   
  +
[[Django]] アプリケーションのスーパーユーザーアカウントを作成します:
Create a superuser account for the [[Django]] application:
 
   
 
[postorius]$ django-admin createsuperuser --pythonpath /usr/share/webapps/postorius/ --settings settings
 
[postorius]$ django-admin createsuperuser --pythonpath /usr/share/webapps/postorius/ --settings settings
   
  +
== ヒントとテクニック ==
== Tips and tricks ==
 
   
  +
=== エイリアスドメインを設定する ===
=== Set an Alias Domain ===
 
   
To use a domain in a [http://www.postfix.org/ADDRESS_CLASS_README.html#virtual_alias_class virtual alias domain] setup with with [[postfix]] it is necessary to set the domain's {{ic|Alias Domain}}. The domain name does not have to exist.
+
[[postfix]] と共に [http://www.postfix.org/ADDRESS_CLASS_README.html#virtual_alias_class 仮想エイリアスドメイン] のセットアップでドメインを使用するためには、ドメインの {{ic|Alias Domain}} を設定する必要があります。ドメイン名は実在しなくても構いません。
   
To set the {{ic|Alias Domain}}, log in using the admin user (i.e. {{ic|postorius}} by default) and alter the domain's settings it in the {{ic|Domains}} menu.
+
{{ic|Alias Domain}} を設定するためには、管理ユーザーでログインします (デフォルトでは {{ic|postorius}}) し、{{ic|Domains}} メニューでドメインの設定を変更します。
   
== See also ==
+
== 参照 ==
   
* [https://postorius.readthedocs.io/en/latest/ Postorius Documentation] - The upstream documentation
+
* [https://postorius.readthedocs.io/en/latest/ Postorius ドキュメンテーション] - アップストリームのドキュメンテーション
* [https://docs.mailman3.org/en/latest/ Mailman Suite Documentation] - The (high level) upstream documentation for the entire Mailman Suite (Mailman, Hyperkitty and Postorius)
+
* [https://docs.mailman3.org/en/latest/ Mailman Suite ドキュメンテーション] - Mailman Suite (Mailman, Hyperkitty および Postorius) 全体に関する (高レベルの) アップストリームドキュメンテーション

2023年10月18日 (水) 14:00時点における最新版

Postorius は、Mailman の管理インターフェースのための Django ベースのツールです。

インストール

Postorius を使うためには、動作する ウェブサーバー のセットアップが必要です (例えば、Apache を使って WSGI に直接転送するか、Nginx を使ってリクエストを UWSGI のようなアプリケーションサーバーに転送します。)

postorius パッケージを インストール します。

警告: Postorius は、パスワードやユーザーデータをネットワークに公開してしまうため、TLS 経由でのみアクセスされるべきです (テスト目的でそれを実行しているマシンから直接アクセスされる場合を除く。)

設定

Web アプリケーションは、/etc/webapps/postorius/settings_local.py で設定されます。これは、/usr/share/webapps/postorius/settings.py のデフォルト設定に含まれています。

ノート: Postorius は、ユーザーの機密データ (sqlite データベースなど) を /var/lib/postorius/data/ に保存する必要があります。このディレクトリには root とアプリケーション自体だけがアクセスできるためです。

アプリケーションのデフォルトのシークレットを変更します。

/etc/webapps/postorius/settings_local.py
SECRET_KEY = 'something-very-secret'

運用環境で実行する場合は、必ずデバッグを無効にしてください。

/etc/webapps/postorius/settings_local.py
DEBUG = False

実行中の mailman インスタンスを設定できるようにするには、REST API の設定オプションを postorius の構成に追加する必要があります。

/etc/webapps/postorius/settings_local.py
MAILMAN_REST_API_URL = 'http://localhost:8001'
MAILMAN_REST_API_USER = 'rest_admin'
MAILMAN_REST_API_PASS = 'rest_admin_password'

有効な電子メール設定を追加します (Django アプリケーションが購読者を確認できるようにします)。

/etc/webapps/postorius/settings_local.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
EMAIL_HOST_USER = username
EMAIL_HOST_PASSWORD = password
ノート: DEFAULT_FROM_EMAIL および SERVER_EMAIL 設定オプションを使用して、それぞれ内部認証とエラー報告のために送信されるメールの From: ヘッダーを定義できます。

アプリケーションの有効なホスト名またはドメイン名を定義する必要があります。

/etc/webapps/postorius/settings_local.py
ALLOWED_HOSTS = [
    'localhost',
    'lists.example.com'
]

ホスティング

この記事またはセクションは加筆を必要としています。
理由: Apache HTTP Server を使ったセットアップの例。 (議論: トーク:Postorius#)
ノート: Postorius はそれ自身のユーザーとグループ (すなわち postorius) として実行する必要があります。それは設定、静的キャッシュ、および (潜在的に) ソケットのためにそれぞれ /etc/webapps/postorius/, /var/lib/postorius/, および /run/postorius/ を使用しています。
ノート: 静的ファイルはデフォルトでトップレベルの static/ ディレクトリから提供され、同じ (サブ) ドメイン上の hyperkitty と競合するため、/etc/webapps/postorius/settings_local.pySTATIC_URL 変数をユニークなもの (例: '/postorius_static/') に設定することをお勧めします。

Nginx と uWSGI

Postorius は /etc/uwsgi/postorius.ini にある動作する uWSGI 設定ファイルが付属しています。

nginxuwsgi-plugin-pythonインストールし、uWSGI のアプリケーションごとのソケットを作成し (UWSGI#Accessibility of uWSGI socket を参照)、uwsgi-secure@postorius.socket有効化してください。

ローカルのテストセットアップで、http://127.0.0.1:80/postorius で Postorius を提供するには、以下の Nginx 設定をセットアップに追加します:

/etc/nginx/postorius.conf
server {
  listen 80;
  server_name localhost;
  charset utf-8;
  client_max_body_size 75M;
  root /usr/share/webapps/postorius;
  access_log /var/log/nginx/access.postorius.log;
  error_log /var/log/nginx/error.postorius.log;

  location /postorius_static {
    alias /var/lib/postorius/static;
  }

  location ~^/(accounts|admin|postorius)/(.*)$ {
    include /etc/nginx/uwsgi_params;
    uwsgi_pass unix:/run/postorius/postorius.sock;
  }
}

セットアップ

ノート: 以下のコマンドは postorius ユーザーとして実行してください (例: sudo または su を使用して)。

初回インストール後、データベースを生成することを確認してください:

[postorius]$ django-admin migrate --pythonpath /usr/share/webapps/postorius/ --settings settings

その後、アプリケーションの静的データを収集する必要があります:

[postorius]$ django-admin collectstatic --pythonpath /usr/share/webapps/postorius/ --settings settings

Django アプリケーションのスーパーユーザーアカウントを作成します:

[postorius]$ django-admin createsuperuser --pythonpath /usr/share/webapps/postorius/ --settings settings

ヒントとテクニック

エイリアスドメインを設定する

postfix と共に 仮想エイリアスドメイン のセットアップでドメインを使用するためには、ドメインの Alias Domain を設定する必要があります。ドメイン名は実在しなくても構いません。

Alias Domain を設定するためには、管理ユーザーでログインします (デフォルトでは postorius) し、Domains メニューでドメインの設定を変更します。

参照