「Hyperkitty」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(カテゴリを修正)
(→‎Nginx と uWSGI: リンクを修正)
 
(同じ利用者による、間の12版が非表示)
1行目: 1行目:
 
[[Category:メールサーバー]]
 
[[Category:メールサーバー]]
 
[[Category:ウェブアプリケーション]]
 
[[Category:ウェブアプリケーション]]
  +
[[en:Hyperkitty]]
[https://gitlab.com/mailman/hyperkitty Hyperkitty] is a [[Django]] based archiver and archive interface for [[Mailman]].
 
  +
[https://gitlab.com/mailman/hyperkitty Hyperkitty] は、[[Django]] ベースのアーカイバおよび [[Mailman]] のアーカイブインターフェイスです。
   
== Installation ==
+
== インストール ==
   
To use Hyperkitty, a working [[web server]] setup is required (e.g. using [[Apache HTTP Server]] to forward to the [[wikipedia:Wsgi|WSGI]] directly, or using [[Nginx]] forwarding requests to an application server such as [[UWSGI]]).
+
Hyperkitty を使用するには、動作する [[ウェブサーバー]] のセットアップが必要です (たとえば、[[Apache HTTP Server]] を使用して [[wikipedia:Wsgi|WSGI]] に直接転送するか、[[Nginx]] を使用してリクエストを転送します) [[UWSGI]] などのアプリケーションサーバー)
   
[[Install]] the {{Pkg|hyperkitty}} package.
+
{{Pkg|hyperkitty}} パッケージを [[インストール]] します。
   
  +
{{Warning|Hyperkitty には [[TLS]] 経由でのみアクセスしてください (テスト目的でハイパーキティを実行しているマシンから直接アクセスする場合を除く)。そうしないと、パスワードやユーザー データがネットワークに公開されてしまいます。}}
{{Warning|Hyperkitty should only be accessed over [[TLS]] (unless only accessed directly from the machine running it for testing purposes), as it otherwise exposes passwords and user data to the network.}}
 
   
== Configuration ==
+
== 設定 ==
   
The web application is configured in {{ic|/etc/webapps/hyperkitty/settings_local.py}} (which is included by the default configuration in {{ic|/usr/share/webapps/hyperkitty/settings.py}}).
+
Web アプリケーションは、{{ic|/etc/webapps/hyperkitty/settings_local.py}} で設定されます (これは、{{ic|/usr/share/webapps/hyperkitty/settings.py}} のデフォルト設定に含まれています)
   
{{Note|Hyperkitty should store user sensitive data (e.g. sqlite database) in {{ic|/var/lib/hyperkitty/data/}}, as that directory is only accessible by root and the application itself.}}
+
{{Note|Hyperkitty は、ユーザーの機密データ (sqlite データベースなど) {{ic|/var/lib/hyperkitty/data/}} に保存する必要があります。このディレクトリには root とアプリケーション自体だけがアクセスできるためです。}}
   
  +
アプリケーションのデフォルトのシークレットを変更します。
Change the default secret for the application:
 
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
23行目: 24行目:
 
}}
 
}}
   
  +
運用環境で実行する場合は、必ずデバッグを無効にしてください。
Make sure to disable debugging when running in production:
 
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
29行目: 30行目:
 
}}
 
}}
   
  +
有効な電子メール設定を追加します ([[Django]] アプリケーションが購読者を確認できるようにします)
Add a valid email configuration (so that the [[Django]] application can verify subscribers):
 
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
39行目: 40行目:
 
}}
 
}}
   
{{Note|The {{ic|DEFAULT_FROM_MAIL}} and {{ic|SERVER_MAIL}} 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_MAIL}} 設定オプションと {{ic|SERVER_MAIL}} 設定オプションを使用して、それぞれ内部認証とエラー報告のために送信されるメールの {{ic|From:}} ヘッダーを定義できます。}}
   
  +
実行中の [[mailman]] インスタンスの REST API に接続するには、設定オプションを hyperkitty の構成に追加する必要があります。
To connect with a running [[mailman]] instance's REST API, configuration options have to be added to hyperkitty's configuration.
 
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|<nowiki>
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|<nowiki>
49行目: 50行目:
 
</nowiki>}}
 
</nowiki>}}
   
To configure the archive integration with a [[mailman]] instance first setup the [[Mailman#Integrate with Hyperkitty|integration with hyperkitty]] on mailman's side and then configure hyperkitty to accept those connections:
+
[[mailman]] インスタンスとのアーカイブ統合を構成するには、Mailman 側で [[Mailman#Integrate with Hyperkitty|integration with hyperkitty]] をセットアップし、次にそれらの接続を受け入れるように hyperkitty を設定します。
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
56行目: 57行目:
 
}}
 
}}
   
  +
アプリケーションの有効なホスト名またはドメイン名を定義する必要があります。
The valid hosts or domain names for the application need to be defined:
 
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
65行目: 66行目:
 
}}
 
}}
   
== Hosting ==
+
== ホスティング ==
   
 
{{Expansion|Example for a setup using [[Apache HTTP Server]].}}
 
{{Expansion|Example for a setup using [[Apache HTTP Server]].}}
   
 
{{Note|
 
{{Note|
* Hyperkitty needs to be run as its own user and group (i.e. {{ic|hyperkitty}}). It is using {{ic|/etc/webapps/hyperkitty/}}, {{ic|/var/lib/hyperkitty/}} and {{ic|/run/hyperkitty/}} for configurations, static caches and (potentially) sockets, respectively.
+
* Hyperkitty は独自のユーザーおよびグループ (すなわち {{ic|hyperkitty}}) として実行する必要があります。{{ic|/etc/webapps/hyperkitty/}}{{ic|/var/lib/hyperkitty/}}{{ic|/run/hyperkitty/}} をそれぞれ設定、静的キャッシュ、(潜在的な) ソケットに使用します。
* As the static files are by default served from a top-level {{ic|static/}} directory, which will conflict with [[postorius]] on the same (sub)domain, it is advisable to set the {{ic|STATIC_URL}} variable in {{ic|/etc/webapps/hyperkitty/settings_local.py}} to something unique (e.g. {{ic|'/hyperkitty_static/'}}).
+
* 静的ファイルはデフォルトではトップレベルの {{ic|static/}} ディレクトリから提供され、同じ (サブ) ドメイン上の [[postorius]] と衝突するため、{{ic|/etc/webapps/hyperkitty/settings_local.py}} 内の {{ic|STATIC_URL}} 変数をユニークなもの (例えば{{ic|'/hyperkitty_static/'}}) に設定することを推奨します。
 
}}
 
}}
   
=== Nginx and uWSGI ===
+
=== Nginx uWSGI ===
   
Hyperkitty comes with a working [[uWSGI]] configuration file in {{ic|/etc/uwsgi/hyperkitty.ini}}.
+
Hyperkitty には、{{ic|/etc/uwsgi/hyperkitty.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 [[Systemd#Using units|activate]] the {{ic|uwsgi-secure@hyperkitty.socket}} unit.
+
{{Pkg|nginx}}{{Pkg|uwsgi-plugin-python}} [[インストール]] し、[[uWSGI]] 用のアプリケーションごとのソケットを作成し ([[uWSGI#uWSGI ソケットのアクセシビリティ]] を参照)、{{ic|uwsgi-secure@hyperkitty.socket}} ユニットを [[Systemd#ユニットを使う|activate]] します。
   
For a local test setup, serving Hyperkitty at http://localhost/hyperkitty/ add the following [[Nginx]] configuration to your setup:
+
ローカルテストセットアップの場合、http://localhost/hyperkitty/ Hyperkitty を提供し、次の [[Nginx]] 設定をセットアップに追加します。
   
 
{{hc|/etc/nginx/hyperkitty.conf|<nowiki>
 
{{hc|/etc/nginx/hyperkitty.conf|<nowiki>
103行目: 104行目:
 
</nowiki>}}
 
</nowiki>}}
   
== Setup ==
+
== セットアップ ==
   
{{Note| Run the following commands as the {{ic|hyperkitty}} user (e.g. using [[sudo]] or [[su]]).}}
+
{{Note| {{ic|hyperkitty}} ユーザーとして次のコマンドを実行します (例: [[sudo]] または [[su]] を使用)}}
   
  +
最初のインストール後、必ずデータベースを生成してください。
After first installation make sure to generate a database:
 
   
 
[hyperkitty]$ django-admin migrate --pythonpath /usr/share/webapps/hyperkitty/ --settings settings
 
[hyperkitty]$ django-admin migrate --pythonpath /usr/share/webapps/hyperkitty/ --settings settings
   
  +
その後、アプリケーションの静的データを収集する必要があります。
Afterwards, the static data for the application needs to be collected:
 
   
 
[hyperkitty]$ django-admin collectstatic --pythonpath /usr/share/webapps/hyperkitty/ --settings settings
 
[hyperkitty]$ django-admin collectstatic --pythonpath /usr/share/webapps/hyperkitty/ --settings settings
   
  +
データを圧縮するには、次のコマンドを実行します。
To compress the data, run the following:
 
   
 
[hyperkitty]$ django-admin compress --pythonpath /usr/share/webapps/hyperkitty/ --settings settings
 
[hyperkitty]$ django-admin compress --pythonpath /usr/share/webapps/hyperkitty/ --settings settings
   
[[Enable]] and [[start]] the {{ic|hyperkitty-qcluster.service}} [[systemd]] service for required asynchronous operations on the web application.
+
Web アプリケーションで必要な非同期操作のための {{ic|hyperkitty-qcluster.service}} [[systemd]] サービスを [[有効化]] および [[起動]] します。
   
  +
データベースにデフォルトデータを入力します (初めてセットアップする場合)
Populate the database with default data (when setting up for the first time):
 
   
 
[hyperkitty]$ django-admin loaddata --pythonpath /usr/share/webapps/hyperkitty/ --settings settings first_start
 
[hyperkitty]$ django-admin loaddata --pythonpath /usr/share/webapps/hyperkitty/ --settings settings first_start
   
  +
[[Django]] アプリケーションのスーパーユーザーアカウントを作成します。
Create a superuser account for the [[Django]] application:
 
   
 
[hyperkitty]$ django-admin createsuperuser --pythonpath /usr/share/webapps/hyperkitty --settings settings
 
[hyperkitty]$ django-admin createsuperuser --pythonpath /usr/share/webapps/hyperkitty --settings settings
   
  +
http://localhost/hyperkitty/admin にある [[Django]] アプリケーションの管理インターフェイスにログインして、デフォルトの {{ic|example.com}} 以外に {{ic|Sites}} を追加できるようにするか、さらに {{ic|Mail ドメイン}} を追加します。
Log in to the admin interface of the [[Django]] application at http://localhost/hyperkitty/admin to be able to add more {{ic|Sites}} besides the default {{ic|example.com}} or to add additional {{ic|Mail domains}}.
 
   
{{Note|After adding a new {{ic|site}} make sure to set the {{ic|SITE_ID}} variable in {{ic|/etc/webapps/hyperkitty/settings_local.py}} to the respective ID!}}
+
{{Note|新しい {{ic|site}} を追加した後、{{ic|/etc/webapps/hyperkitty/settings_local.py}} {{ic|SITE_ID}} 変数をそれぞれの ID に設定してください。}}
   
  +
== ヒントとテクニック ==
== Tips and tricks ==
 
   
=== Importing mailman2 archives ===
+
=== mailman2 アーカイブのインポート ===
   
  +
Hyperkitty は、mailman 3.0 より前のバージョンからアーカイブをインポートできます。
Hyperkitty can import archives from mailman < 3.0.
 
   
{{Note|Run the following commands as the {{ic|hyperkitty}} user (e.g. using [[sudo]] or [[su]]).}}
+
{{Note|次のコマンドを {{ic|hyperkitty}} ユーザーとして実行します (例: [[sudo]] または [[su]] を使用)}}
   
 
[hyperkitty]$ django-admin hyperkitty_import --pythonpath /usr/share/webapps/hyperkitty --settings settings -l ''ADDRESS'' ''mbox_file'' [''mbox_file'' ...]
 
[hyperkitty]$ django-admin hyperkitty_import --pythonpath /usr/share/webapps/hyperkitty --settings settings -l ''ADDRESS'' ''mbox_file'' [''mbox_file'' ...]
   
Here {{ic|''ADDRESS''}} is the fully-qualified list name (e.g. {{ic|list@example.com}}) and the {{ic|''mbox_file''}} argument represents existing archives (in [[Wikipedia:Mbox|mbox]] format) to import (usually found in {{ic|/var/lib/mailman/archives/private/''LIST_NAME''.mbox/''LIST_NAME''.mbox}}).
+
ここで、{{ic|''ADDRESS''}} は完全修飾リスト名 (例: {{ic|list@example.com}}) で、引数 {{ic|''mbox_file''}} は既存のアーカイブを表します。([[Wikipedia:Mbox|mbox]] 形式) でインポートします (通常は {{ic|/var/lib/mailman/archives/private/''LIST_NAME''.mbox/''LIST_NAME''.mbox}} にあります。)
   
  +
その後、全文検索インデックスを手動で更新します。
Afterwards the full-text search index can be updated manually:
 
   
 
[hyperkitty]$ django-admin update_index_one_list --pythonpath /usr/share/webapps/hyperkitty --settings settings ''ADDRESS''
 
[hyperkitty]$ django-admin update_index_one_list --pythonpath /usr/share/webapps/hyperkitty --settings settings ''ADDRESS''
   
  +
{{Note|全文検索インデックスは、分単位で実行される cron ジョブによって自動的に作成されます。}}
{{Note|The full-text search index should be created by the minutely running cron-job automatically.}}
 
   
=== Content-Security-Policy Header ===
+
=== Content-Security-Policy ヘッダー ===
   
It is possible to define a [https://content-security-policy.com/ Content-Security-Policy] HTTP response header for HyperKitty. This allows content and resources only from specified locations.
+
HyperKitty [https://content-security-policy.com/Content-Security-Policy] HTTP 応答ヘッダーを定義できます。これにより、指定された場所からのコンテンツとリソースのみが許可されます。
   
  +
[[nginx]] を使用する場合は、HyperKitty がセットアップされている {{ic|server}} ディレクティブに以下を追加します。
When using [[nginx]] add the following to the {{ic|server}} directive in which HyperKitty is setup in:
 
   
 
{{hc|/etc/nginx/hyperkitty.conf|2=
 
{{hc|/etc/nginx/hyperkitty.conf|2=
163行目: 164行目:
 
}}
 
}}
   
=== Disabling Gravatar support ===
+
=== Gravatar サポートの無効化 ===
   
The builtin [[Wikipedia:Gravatar (web service)|Gravatar]] support can be disabled in the configuration:
+
組み込みの [[Wikipedia:ja:Gravatar|Gravatar]] サポートは、設定で無効にすることができます。
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
171行目: 172行目:
 
}}
 
}}
   
  +
このオプションは Hyperkitty 1.3.4 で導入されました。以前のバージョンでは、代わりにこれを使用してください。
This option was introduced in Hyperkitty 1.3.4. In earlier versions, use this instead:
 
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
177行目: 178行目:
 
}}
 
}}
   
  +
=== メールの添付ファイルをディスクに保存する ===
=== Saving mail attachments to disk ===
 
   
  +
デフォルトでは、Hyperkitty はメールの添付ファイルをデータベースに保存します。ただし、代わりに添付ファイルをディスクに保存するように構成できます。
By default Hyperkitty stores mail attachments in its database. However, it can be configured to save the attachments to disk instead:
 
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
185行目: 186行目:
 
}}
 
}}
   
  +
{{Note|この場所には、{{ic|hyperkitty}} ユーザーがアクセスおよび書き込みできる必要があります。}}
{{Note|The location needs to be accessible and writable by the {{ic|hyperkitty}} user.}}
 
   
  +
=== テンプレートのカスタマイズ ===
=== Template customization ===
 
   
Using [[Django]]'s [https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-TEMPLATES-DIRS TEMPLATES-DIRS] capabilities, it is possible to override the following templates to change the looks of the application:
+
[[Django]] [https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-TEMPLATES-DIRS TEMPLATES-DIRS] 機能を使用すると、次のテンプレートをオーバーライドすることができます。アプリケーションの外観を変更します。
   
 
* {{ic|hyperkitty/headers.html}}: the content will appear before the {{ic|</head>}} tag
 
* {{ic|hyperkitty/headers.html}}: the content will appear before the {{ic|</head>}} tag
195行目: 196行目:
 
* {{ic|hyperkitty/bottom.html}}: the content will appear before the {{ic|</body>}} tag
 
* {{ic|hyperkitty/bottom.html}}: the content will appear before the {{ic|</body>}} tag
   
=== Xapian search backend ===
+
=== Xapian 検索バックエンド ===
   
Hyperkitty can make use of a Xapian based search backend. [[Install]] the {{Pkg|python-xapian-haystack}} package and configure the backend:
+
Hyperkitty は、Xapian ベースの検索バックエンドを利用できます。{{Pkg|python-xapian-haystack}} パッケージを [[インストール]] してバックエンドを設定します。
   
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
 
{{hc|/etc/webapps/hyperkitty/settings_local.py|2=
208行目: 209行目:
 
}}
 
}}
   
  +
その後、必ずすべてのリストの検索インデックスを作成してください。次のコマンドを {{ic|hyperkitty}} ユーザーとして実行します (例: [[sudo]] または [[su]] を使用)
Make sure to create the search index for all lists afterwards. Run the following command as the {{ic|hyperkitty}} user (e.g. using [[sudo]] or [[su]]):
 
   
 
[hyperkitty]$ django-admin update_index --pythonpath /usr/share/webapps/hyperkitty --settings settings
 
[hyperkitty]$ django-admin update_index --pythonpath /usr/share/webapps/hyperkitty --settings settings
   
  +
== トラブルシューティング ==
== Troubleshooting ==
 
   
=== SMTP AUTH extension not supported by server ===
+
=== SMTP AUTH 拡張子はサーバーでサポートされていません ===
   
If upon first login with the admin user a {{ic|SMTNotSupportedError}} is thrown (logged to {{ic|/var/log/hyperkitty/hyperkitty.log}}), make sure to verify the {{ic|EMAIL_*}} settings in {{ic|/etc/webapps/hyperkitty/settings_local.py}}.
+
管理者ユーザーとして初めてログインしたときに、{{ic|SMTNotSupportedError}} がスローされた場合 ({{ic|/var/log/hyperkitty/hyperkitty.log}} に記録されます)、必ず {{ic|/etc/webapps/hyperkitty/settings_local.py}} の {{ic|EMAIL_*}} 設定を確認してください
   
  +
デフォルトでは、たとえば {{ic|EMAIL_USE_TLS}} は {{ic|False}} に設定されており、SMTP 経由でのログイン失敗がトリガーされる可能性があります。
By default e.g. {{ic|EMAIL_USE_TLS}} is set to {{ic|False}} which might trigger a failed login via SMTP.
 
   
== See also ==
+
== 参照 ==
   
* [https://hyperkitty.readthedocs.io/en/latest/ Hyperkitty Documentation] - The upstream documentation
+
* [https://hyperkitty.readthedocs.io/en/latest/ Hyperkitty Documentation] - ドキュメント
* [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 Documentation] - Mailman スイート全体 (MailmanHyperkitty、Postorius) (高レベルの) アップストリームドキュメント

2023年10月28日 (土) 14:51時点における最新版

Hyperkitty は、Django ベースのアーカイバおよび Mailman のアーカイブインターフェイスです。

インストール

Hyperkitty を使用するには、動作する ウェブサーバー のセットアップが必要です (たとえば、Apache HTTP Server を使用して WSGI に直接転送するか、Nginx を使用してリクエストを転送します) UWSGI などのアプリケーションサーバー)

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

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

設定

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

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

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

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

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

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

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

/etc/webapps/hyperkitty/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_MAIL 設定オプションと SERVER_MAIL 設定オプションを使用して、それぞれ内部認証とエラー報告のために送信されるメールの From: ヘッダーを定義できます。

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

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

mailman インスタンスとのアーカイブ統合を構成するには、Mailman 側で integration with hyperkitty をセットアップし、次にそれらの接続を受け入れるように hyperkitty を設定します。

/etc/webapps/hyperkitty/settings_local.py
MAILMAN_ARCHIVER_KEY = 'SecretArchiverAPIKey'
MAILMAN_ARCHIVER_FROM = ('127.0.0.1', '::1')

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

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

ホスティング

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

Nginx と uWSGI

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

nginxuwsgi-plugin-pythonインストール し、uWSGI 用のアプリケーションごとのソケットを作成し (uWSGI#uWSGI ソケットのアクセシビリティ を参照)、uwsgi-secure@hyperkitty.socket ユニットを activate します。

ローカルテストセットアップの場合、http://localhost/hyperkitty/ で Hyperkitty を提供し、次の Nginx 設定をセットアップに追加します。

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

  location /hyperkitty_static {
    alias /var/lib/hyperkitty/static;
  }

  location ~^/(hyperkitty|user-profile)/(.*)$ {
    include /etc/nginx/uwsgi_params;
    uwsgi_pass unix:/run/hyperkitty/hyperkitty.sock;
  }
}

セットアップ

ノート: hyperkitty ユーザーとして次のコマンドを実行します (例: sudo または su を使用)

最初のインストール後、必ずデータベースを生成してください。

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

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

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

データを圧縮するには、次のコマンドを実行します。

[hyperkitty]$ django-admin compress --pythonpath /usr/share/webapps/hyperkitty/ --settings settings

Web アプリケーションで必要な非同期操作のための hyperkitty-qcluster.service systemd サービスを 有効化 および 起動 します。

データベースにデフォルトデータを入力します (初めてセットアップする場合)

[hyperkitty]$ django-admin loaddata --pythonpath /usr/share/webapps/hyperkitty/ --settings settings first_start

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

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

http://localhost/hyperkitty/admin にある Django アプリケーションの管理インターフェイスにログインして、デフォルトの example.com 以外に Sites を追加できるようにするか、さらに Mail ドメイン を追加します。

ノート: 新しい site を追加した後、/etc/webapps/hyperkitty/settings_local.pySITE_ID 変数をそれぞれの ID に設定してください。

ヒントとテクニック

mailman2 アーカイブのインポート

Hyperkitty は、mailman 3.0 より前のバージョンからアーカイブをインポートできます。

ノート: 次のコマンドを hyperkitty ユーザーとして実行します (例: sudo または su を使用)
[hyperkitty]$ django-admin hyperkitty_import --pythonpath /usr/share/webapps/hyperkitty --settings settings -l ADDRESS mbox_file [mbox_file ...]

ここで、ADDRESS は完全修飾リスト名 (例: list@example.com) で、引数 mbox_file は既存のアーカイブを表します。(mbox 形式) でインポートします (通常は /var/lib/mailman/archives/private/LIST_NAME.mbox/LIST_NAME.mbox にあります。)

その後、全文検索インデックスを手動で更新します。

[hyperkitty]$ django-admin update_index_one_list --pythonpath /usr/share/webapps/hyperkitty --settings settings ADDRESS
ノート: 全文検索インデックスは、分単位で実行される cron ジョブによって自動的に作成されます。

Content-Security-Policy ヘッダー

HyperKitty の [1] HTTP 応答ヘッダーを定義できます。これにより、指定された場所からのコンテンツとリソースのみが許可されます。

nginx を使用する場合は、HyperKitty がセットアップされている server ディレクティブに以下を追加します。

/etc/nginx/hyperkitty.conf
[..]
add_header Content-Security-Policy "default-src 'self'; connect-src 'self'; img-src 'self' https://secure.gravatar.com; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'";
[..]

Gravatar サポートの無効化

組み込みの Gravatar サポートは、設定で無効にすることができます。

/etc/webapps/hyperkitty/settings_local.py
HYPERKITTY_ENABLE_GRAVATAR = False

このオプションは Hyperkitty 1.3.4 で導入されました。以前のバージョンでは、代わりにこれを使用してください。

/etc/webapps/hyperkitty/settings_local.py
GRAVATAR_SECURE_URL = ''

メールの添付ファイルをディスクに保存する

デフォルトでは、Hyperkitty はメールの添付ファイルをデータベースに保存します。ただし、代わりに添付ファイルをディスクに保存するように構成できます。

/etc/webapps/hyperkitty/settings_local.py
HYPERKITTY_ATTACHMENT_FOLDER = /var/lib/hyperkitty/data/attachments
ノート: この場所には、hyperkitty ユーザーがアクセスおよび書き込みできる必要があります。

テンプレートのカスタマイズ

DjangoTEMPLATES-DIRS 機能を使用すると、次のテンプレートをオーバーライドすることができます。アプリケーションの外観を変更します。

  • hyperkitty/headers.html: the content will appear before the </head> tag
  • hyperkitty/top.html: the content will appear before the <body> tag
  • hyperkitty/bottom.html: the content will appear before the </body> tag

Xapian 検索バックエンド

Hyperkitty は、Xapian ベースの検索バックエンドを利用できます。python-xapian-haystack パッケージを インストール してバックエンドを設定します。

/etc/webapps/hyperkitty/settings_local.py
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'xapian_backend.XapianEngine',
        'PATH': "/var/lib/hyperkitty/data/xapian_index",
    },
}

その後、必ずすべてのリストの検索インデックスを作成してください。次のコマンドを hyperkitty ユーザーとして実行します (例: sudo または su を使用)

[hyperkitty]$ django-admin update_index --pythonpath /usr/share/webapps/hyperkitty --settings settings

トラブルシューティング

SMTP AUTH 拡張子はサーバーでサポートされていません

管理者ユーザーとして初めてログインしたときに、SMTNotSupportedError がスローされた場合 (/var/log/hyperkitty/hyperkitty.log に記録されます)、必ず /etc/webapps/hyperkitty/settings_local.pyEMAIL_* 設定を確認してください

デフォルトでは、たとえば EMAIL_USE_TLSFalse に設定されており、SMTP 経由でのログイン失敗がトリガーされる可能性があります。

参照