「Ente サーバー」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(英語版より転載)
 
(add en page link.)
 
(同じ利用者による、間の16版が非表示)
1行目: 1行目:
 
[[Category:ファイル共有]]
 
[[Category:ファイル共有]]
  +
[[en:Ente server]]
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|AppArmor}}
 
{{Related|AppArmor}}
7行目: 8行目:
 
{{Related|PostgreSQL}}
 
{{Related|PostgreSQL}}
 
{{Related articles end}}
 
{{Related articles end}}
  +
[https://ente.io Ente サーバー] は、Ente (モバイル) クライアントに暗号化されたデータの塊を保存・提供するサーバー部分です。クライアントは暗号化されたデータを送受信し、それが Ente サーバーに届き、ローカルの [[MinIO]] オブジェクト ストレージ サービスを通じて保存・読み取りが行われます。
[https://ente.io Ente server] is the server part that stores and serves encrypted blobs of data to ente (mobile) clients. The clients send/receive encrypted data, which then arrives at the Ente server and is stored/read via the local [[MinIO]] object storage service.
 
   
  +
例えば、'''Ente''' フォトクライアントを使用すると、クライアントは写真を暗号化し、それらはサーバーに保存されます。後に、クライアントは暗号化された写真を検索し、ローカルで復号できます ('''エンドツーエンド暗号化''')。クライアント、もしくはクライアントが写真を共有した相手のみが暗号鍵を持っているため、データを復号して実際に写真を見ることができるのはその人たちだけであり、サーバーはその鍵の情報を持っていないため見ることができません。
For example when the '''Ente''' photos client is used, the client encrypts the photos, which are then stored on this server. Later on the client can then lookup the encrypted photos, and decrypt them locally ('''end-to-end encryption'''). Since only the client, or anyone the client shares the photos with, have the encryption key, only they can decrypt the data and actually see the photos, the server will never be able to do this due to the lack of that key material.
 
   
== Installation ==
+
== インストール ==
   
  +
{{AUR|ente-server-git}} パッケージは、デフォルトで提供される Docker 化された '''Ente''' サーバーとは異なり、セルフホスティング用に設計されています。Docker 化またはホスティングソリューションが必要な場合は、[https://ente.io/ ente.io] を参照してください。
The {{AUR|ente-server-git}} package is meant for self hosting in contrary to the by default provided dockerized '''Ente''' server. If a dockerized or hosted solution is required, see [https://ente.io/ ente.io].
 
   
Start by [[install]]ing the {{AUR|ente-server-git}} package.
+
まず、{{AUR|ente-server-git}} パッケージを[[インストール]]してください。
   
  +
セルフホストのサーバースペースは容量が限られていることが多いため、{{AUR|ente-server-git}} パッケージは、古くてリンクされていない Ente サーバー [[MinIO]] オブジェクトをより迅速にクリーンアップするように変更されています。デフォルトの Ente サーバーは通常 45 日ごとにオブジェクトをクリーンアップしますが、このパッケージではその期間が 5 分ごとに短縮されています。
Note that since self hosted server space is often available in limited quantity, the {{AUR|ente-server-git}} package has been modified to cleanup old unlinked ente-server [[MinIO]] objects much faster. The default upstream Ente server cleans these object every 45 days by default, but this package decreased the delay to cleanup every 5 minutes instead.
 
   
  +
'''Ente''' サーバーを稼働させるには、[[PostgreSQL]] データベース (Ente オブジェクトのメタデータやユーザーデータの保存用) と [[MinIO]] バケット (暗号化されたオブジェクトデータの保存用) が必要です。また、'''Ente''' サーバーにアクセスするための HTTPS プロキシとして [[Nginx]] の使用が推奨されます。最後に、''ente-cli'' ツールを使うと、Ente サーバーのアカウントの容量制限や有効期限の更新が簡単に行えます。
To get the '''Ente''' server running a working [[PostgreSQL]] database (to store Ente object meta data and user data) and [[MinIO]] bucket (to store encrypted object data) is required. Furthermore, a HTTPS proxy like [[Nginx]] is recommended to be used to access the '''Ente''' server. Lastly, the ''ente-cli'' tool can be used to easily upgrade ente-server account size limit and account expiry.
 
   
  +
これらの必要なコンポーネントをインストールするには、オプションの依存関係としてリストされている[[パッケージ]]をインストールすることが推奨されます。同じホストにインストールする場合は、依存パッケージとしてインストールするのが望ましいです。例えば、これらのパッケージをインストールする際、[[pacman]] の場合は {{ic|--asdeps}} オプションを使用し、または {{AUR|yay}} でインストールすることができます。
To install these required components, it is recommended installing the [[packages]] listed as optional dependencies, preferably as dependent [[package]] when installing them on the same host. For example, this can be done using the {{ic|--asdeps}} option when using [[pacman]] or {{AUR|yay}} to install these packages.
 
   
  +
参考までに、以下の[[パッケージ]]がオプションの依存関係としてリストされています。
For completeness, the following [[packages]] are currently listed as optional dependencies:
 
   
 
* {{ic|minio}}
 
* {{ic|minio}}
30行目: 31行目:
 
* {{ic|postgresql}}
 
* {{ic|postgresql}}
   
== Configuration ==
+
== 設定 ==
   
=== MinIO setup ===
+
=== MinIO のセットアップ ===
   
  +
設定ファイルを以下のように[[テキスト編集|編集]]してください:
[[textedit|Edit]] the configuration file as follows:
 
   
 
{{hc|/etc/minio/minio.conf|2=
 
{{hc|/etc/minio/minio.conf|2=
43行目: 44行目:
 
}}
 
}}
   
[[Enable/start]] {{ic|minio.service}}.
+
{{ic|minio.service}} を[[有効化/起動]]します。
   
  +
''mcli'' コマンドを使って (minio ユーザーとして) [[MinIO]] ente-server バケットを作成します:
Create [[MinIO]] ente-server bucket with the ''mcli'' command (as the minio user):
 
   
 
# cd /srv/minio/data
 
# cd /srv/minio/data
 
[minio]$ mcli mb -p ente-server
 
[minio]$ mcli mb -p ente-server
   
=== PostgreSQL setup ===
+
=== PostgreSQL のセットアップ ===
   
  +
postgres ユーザーとしてデータベースを初期化します:
Initialize the database as the postgres user:
 
   
 
[postgres]$ initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data' --data-checksums --auth=scram-sha-256 --pwprompt
 
[postgres]$ initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data' --data-checksums --auth=scram-sha-256 --pwprompt
   
Configure to only listen on a [https://man.archlinux.org/man/unix.7.en AF_UNIX] socket:
+
[https://man.archlinux.org/man/unix.7.en AF_UNIX] ソケットのみに接続するように設定してください:
   
 
{{hc|/var/lib/postgres/data/postgresql.conf|2=
 
{{hc|/var/lib/postgres/data/postgresql.conf|2=
62行目: 63行目:
 
}}
 
}}
   
  +
{{ic|postgresql.service}} を[[編集]]して、[[PostgreSQL]] ユーザーまたはグループにソケットアクセスを制限します:
Restrict socket access to [[PostgreSQL]] user or group by [[edit]]ing {{ic|postgresql.service}}:
 
   
 
{{hc|/etc/systemd/system/postgresql.d/socket-access-restriction.conf|2=
 
{{hc|/etc/systemd/system/postgresql.d/socket-access-restriction.conf|2=
69行目: 70行目:
 
}}
 
}}
   
Add {{ic|ente}} to the {{ic|postgres}} [[user group]], then [[start/enable]]{{ic|postgresql.service}}.
+
{{ic|ente}} {{ic|postgres}} [[ユーザーグループ]] に追加し、{{ic|postgresql.service}} を[[有効化/起動]]します。
   
  +
PostgreSQL データベースユーザーと、このユーザーが所有するデータベースを作成します (新しいパスワードを 2 回入力し、次に新しいアカウントを保存するために postgres パスワードを指定します):
Create [[PostgreSQL]] database user and a database owned by this user (specify new password twice, then specify postgres password to store new account):
 
   
 
[postgres]$ createuser -P ente
 
[postgres]$ createuser -P ente
   
  +
次に、新しいデータベースを作成するために postgres パスワードを指定します:
Then specify postgres password to create new database:
 
   
 
[postgres]$ createdb -T template0 -O ente -E unicode ente-server
 
[postgres]$ createdb -T template0 -O ente -E unicode ente-server
   
=== Running ente-server ===
+
=== ente-server の起動 ===
   
  +
[[MinIO]] バケットの詳細を追加します:
Add [[MinIO]] bucket details:
 
   
 
{{hc|/etc/ente-server/local.yaml|
 
{{hc|/etc/ente-server/local.yaml|
92行目: 93行目:
 
}}
 
}}
   
Add [[PostgreSQL]] details:
+
[[PostgreSQL]] の詳細を追加します:
   
 
{{hc|/etc/ente-server/local.yaml|
 
{{hc|/etc/ente-server/local.yaml|
103行目: 104行目:
 
}}
 
}}
   
Generate new secret key values using the ''ente-server-gen-random-keys'' command and use these values as a replacement of the default values in the {{ic|/etc/ente-server/local.yaml}} configuration file.
+
''ente-server-gen-random-keys'' コマンドを使って新しい秘密鍵を生成し、{{ic|/etc/ente-server/local.yaml}} 設定ファイルのデフォルト値の代わりにこれらの値を使用してください。
   
  +
''your_public_domain.tld'' の IP アドレスにアクセスできるように {{ic|ente-server.service}} を[[編集]]します (デフォルトでは、サービスは localhost からのアクセスのみを許可しています):
[[Edit]] {{ic|ente-server.service}} to allow it to access to the IP address of ''your_public_domain.tld'' (by default the service only allows access from and to localhost):
 
   
{{bc|
+
{{bc|1=
 
[Service]
 
[Service]
IPAddressAllow{{=}}''IP_address_of_your_public_domain.tld''
+
IPAddressAllow=''IP_address_of_your_public_domain.tld''
 
}}
 
}}
   
[[Enable/start]] {{ic|ente-server.service}}.
+
{{ic|ente-server.service}} を[[有効化/起動]]します。
   
=== Configuring Nginx proxy ===
+
=== Nginx プロキシの設定 ===
   
  +
サンプルの [[Nginx]] 設定ファイルとそれに付随する HTTP(S) セキュリティヘッダーファイルを、[[Nginx]] の設定ディレクトリにコピーします:
Copy the example [[Nginx]] config and the accompanying HTTP(S) security header config files to the [[Nginx]] configuration directory:
 
   
 
# cp -v /usr/lib/ente-server/ente-server-nginx.conf /etc/nginx/
 
# cp -v /usr/lib/ente-server/ente-server-nginx.conf /etc/nginx/
 
# cp -v /usr/lib/ente-server/http*security_headers.conf /etc/nginx/
 
# cp -v /usr/lib/ente-server/http*security_headers.conf /etc/nginx/
   
  +
このサンプル設定ファイルを編集し、''your_public_domain.tld'' を実際のパブリックドメイン名に置き換えてください。
Edit this example config, and replace ''your_public_domain.tld'' with your actual public domain name
 
   
  +
Let's Encrypt の証明書 (または他のプロバイダーからの SSL 証明書) がまだない場合はリクエストしてください:
Request a letsencrypt ceritifacte (or a SSL certificate from another provider) if not already done so:
 
   
 
# certbot certonly --email ''your_email'' --agree-tos --preferred-challenge http --webroot -w /var/lib/letsencrypt -d ''your_public_domain.tld''
 
# certbot certonly --email ''your_email'' --agree-tos --preferred-challenge http --webroot -w /var/lib/letsencrypt -d ''your_public_domain.tld''
   
Append an {{ic|include}} statement to the [[Nginx]] {{ic|http}} config to include the ''ente-server'' config:
+
''ente-server'' 設定を含む {{ic|include}} ステートメントを [[Nginx]] {{ic|http}} 構成ファイルに追加します:
   
 
{{hc|/etc/nginx/nginx.conf|
 
{{hc|/etc/nginx/nginx.conf|
135行目: 136行目:
 
}}
 
}}
   
  +
パーミッションを修正します:
Fix permissions:
 
   
 
# chmod 644 /etc/nginx/ente-server-nginx.conf
 
# chmod 644 /etc/nginx/ente-server-nginx.conf
 
# chmod 644 /etc/nginx/http*security_headers.conf
 
# chmod 644 /etc/nginx/http*security_headers.conf
   
[[Restart]] {{ic|nginx.service}} to apply the changes.
+
変更を反映させるために {{ic|nginx.service}} を[[再起動]]します。
   
=== Configuring ente-server and ente-cli ===
+
=== ente-server ente-cli の設定 ===
   
  +
* クライアントに {{ic|ente-cli}} をインストールします:
{{Style|Last section to adjust.|section=Cleanup}}
 
  +
** {{AUR|ente-cli-bin}} パッケージを[[インストール]]
 
* Install {{ic|ente-cli}} on the client:
+
* クライアントに {{ic|ente-cli}} 設定を追加します:
** [[Install]] the {{AUR|ente-cli-bin}} package
 
* Add {{ic|ente-cli}} config on the client:
 
 
{{bc|$ mkdir -p ~/.ente/export }}
 
{{bc|$ mkdir -p ~/.ente/export }}
 
{{hc|~/.ente/config.yaml|
 
{{hc|~/.ente/config.yaml|
 
endpoint:
 
endpoint:
api: "''<nowiki>https://your_public_domain.tld</nowiki>''" >}}
+
api: "''<nowiki>https://your_public_domain.tld</nowiki>''"
  +
}}
* Add a user account via the photos mobile app or web app on the client, using a custom endpoint:
 
  +
* 写真モバイルアプリまたは Web アプリでカスタムエンドポイントを使用してユーザーアカウントを追加します:
** In the photos mobile app:
 
  +
** 写真モバイルアプリで:
*** Click 7 times on the main screen to enable developers mode
 
  +
*** 開発者モードを有効にするためにメイン画面を 7 回タップします
*** Define your custom '''Ente''' server API endpoint:
 
  +
*** カスタム '''Ente''' サーバー API エンドポイントを定義します:
 
{{bc| URL: ''<nowiki>https://your_public_domain.tld</nowiki>''}}
 
{{bc| URL: ''<nowiki>https://your_public_domain.tld</nowiki>''}}
  +
** クライアントの Web アプリで:
** In the web app on the client:
 
{{bc| $ git clone https://github.com/ente-io/ente.git
+
{{bc|1= $ git clone https://github.com/ente-io/ente.git
 
cd ente/web
 
cd ente/web
 
git submodule update --init --recursive
 
git submodule update --init --recursive
 
yarn install
 
yarn install
NEXT_PUBLIC_ENTE_ENDPOINT{{=}}''<nowiki>https://your_public_domain.tld</nowiki>'' yarn dev:photos}}
+
NEXT_PUBLIC_ENTE_ENDPOINT=''<nowiki>https://your_public_domain.tld</nowiki>'' yarn dev:photos}}
* Follow the photos app or web app (''http://localhost:3000'') instructions to create a new user
+
* 写真アプリまたは Web アプリ (''http://localhost:3000'') の指示に従って新しいユーザーを作成します
  +
* OTP コードを取得します:
* Obtain the OTP code:
 
  +
** メールで:
** Via email:
 
*** Configure the {{ic|smtp}} section in {{ic|/etc/ente-server/local.yaml}}
+
*** {{ic|/etc/ente-server/local.yaml}} の {{ic|smtp}} セクションを設定します
*** Make sure the configure [https://man.archlinux.org/man/smtp.1.en SMTP] server is working
+
*** 設定された [https://man.archlinux.org/man/smtp.1.en SMTP] サーバーが動作していることを確認します
  +
*** メールが届くのを待ち、OTP コードをコピーします
*** Wait for the mail to arrive and copy the OTP code
 
** Via the ente-server log:
+
** ente-server ログから:
 
*** {{bc|# journalctl -u ente-server {{!}} grep SendEmailOTT {{!}} tail -n 1}}
 
*** {{bc|# journalctl -u ente-server {{!}} grep SendEmailOTT {{!}} tail -n 1}}
  +
* 新規ユーザーのアカウント ID を取得します:
* Obtain the new users account ID:
 
 
{{bc| # psql -U ente ente-server -c 'select user_id from users order by user_id desc limit 1;'}}
 
{{bc| # psql -U ente ente-server -c 'select user_id from users order by user_id desc limit 1;'}}
  +
* このユーザーを管理者として設定します:
* Configure this user as the admin:
 
 
{{hc|/etc/ente-server/local.yaml|
 
{{hc|/etc/ente-server/local.yaml|
 
internal:
 
internal:
 
admin: [''ADD_USER_ID_HERE'']}}
 
admin: [''ADD_USER_ID_HERE'']}}
* [[Restart]] {{ic|ente-server.service}} to activate the new admin privileges
+
* 新しい管理者権限を有効にするために {{ic|ente-server.service}} を[[再起動]]します
* Configure this admin within {{ic|ente-cli}} on the client:
+
* クライアントで {{ic|ente-cli}} 内のこの管理者を設定します:
 
{{bc| $ ente account add
 
{{bc| $ ente account add
 
photos
 
photos
187行目: 187行目:
 
}}
 
}}
   
  +
=== ユーザーストレージとアカウント有効期限の延長 ===
=== Increasing user storage and account expiry limit ===
 
   
* Use ''ente-cli'' to increase storage limit with 100 TB and expiry with 100 years:
+
* ''ente-cli'' を使ってストレージ制限を 100 TB、期限を 100 年に増やします:
 
{{bc| ente admin update-subscription -u "''user@domain.tld''"}}
 
{{bc| ente admin update-subscription -u "''user@domain.tld''"}}
   
=== (Optional) Copy and apply AppArmor profile ===
+
=== (オプション) AppArmor プロファイルのコピーと適用 ===
  +
  +
[[AppArmor]] プロファイルは、[[AppArmor]] を使用して '''ente-server''' バイナリのアクセスを制限したい人向けに提供されています。次の手順でプロファイルをコピーして適用します (すでに [[AppArmor]] がインストールおよび有効化されているものと仮定):
   
An [[AppArmor]] profile has been provided for those that wish to limit the access the '''ente-server''' binary has using [[AppArmor]]. Copy and apply this profile as follows (assuming that [[AppArmor]] has already been installed and enabled):
 
 
{{bc| # install -Dvm600 -o root -g root /usr/lib/ente-server/usr.bin.ente-server -t /etc/apparmor.d/
 
{{bc| # install -Dvm600 -o root -g root /usr/lib/ente-server/usr.bin.ente-server -t /etc/apparmor.d/
 
# aa-enforce /usr/bin/ente-server}}
 
# aa-enforce /usr/bin/ente-server}}
   
  +
=== (オプション) ファイアウォールの設定 ===
=== (Optional) Configure Firewall ===
 
   
  +
iptables や nftables などのホストファイアウォールが有効化および構成されている場合、次の項目が許可されていることを確認します:
If a host firewall like iptables or nftables has been enabled and configured, make sure the following is allowed:
 
   
* Traffic on {{ic|localhost}}
+
* {{ic|localhost}} へのトラフィック
* Traffic from your '''Ente''' (mobile) client to TCP port {{ic|443}} to reach [[Nginx]]
+
* クライアントの '''Ente''' (モバイル) クライアントから [[Nginx]] への TCP ポート {{ic|443}} のトラフィック
* Traffic from your '''Ente''' (mobile) client to TCP port {{ic|3200}} to reach the [[MinIO]] API port
+
* クライアントの '''Ente''' (モバイル) クライアントから [[MinIO]] API ポートへの TCP ポート {{ic|3200}} のトラフィック
   
  +
* Upstream Repository: [https://github.com/ente-io/ente/tree/main/server ente.io Ente Server Repository]
== Files ==
 
   
The {{AUR|ente-server-git}} package contains the {{man|1|ente-server|url=}} [[man page]] that lists and explains all files that are installed by this package.
+
{{AUR|ente-server-git}} パッケージには、インストールされるすべてのファイルが記載・説明された {{man|1|ente-server|url=}} [[man ページ]] が含まれています。
   
== See also ==
+
== 参照 ==
   
* Upstream Repository: [https://github.com/ente-io/ente/tree/main/server ente.io Ente Server Repository]
+
* 上流リポジトリ: [https://github.com/ente-io/ente/tree/main/server ente.io Ente サーバーリポジトリ]
  +
  +
{{TranslationStatus|Ente Server|2024-05-06|807551}}

2024年5月6日 (月) 21:14時点における最新版

関連記事

Ente サーバー は、Ente (モバイル) クライアントに暗号化されたデータの塊を保存・提供するサーバー部分です。クライアントは暗号化されたデータを送受信し、それが Ente サーバーに届き、ローカルの MinIO オブジェクト ストレージ サービスを通じて保存・読み取りが行われます。

例えば、Ente フォトクライアントを使用すると、クライアントは写真を暗号化し、それらはサーバーに保存されます。後に、クライアントは暗号化された写真を検索し、ローカルで復号できます (エンドツーエンド暗号化)。クライアント、もしくはクライアントが写真を共有した相手のみが暗号鍵を持っているため、データを復号して実際に写真を見ることができるのはその人たちだけであり、サーバーはその鍵の情報を持っていないため見ることができません。

インストール

ente-server-gitAUR パッケージは、デフォルトで提供される Docker 化された Ente サーバーとは異なり、セルフホスティング用に設計されています。Docker 化またはホスティングソリューションが必要な場合は、ente.io を参照してください。

まず、ente-server-gitAUR パッケージをインストールしてください。

セルフホストのサーバースペースは容量が限られていることが多いため、ente-server-gitAUR パッケージは、古くてリンクされていない Ente サーバー MinIO オブジェクトをより迅速にクリーンアップするように変更されています。デフォルトの Ente サーバーは通常 45 日ごとにオブジェクトをクリーンアップしますが、このパッケージではその期間が 5 分ごとに短縮されています。

Ente サーバーを稼働させるには、PostgreSQL データベース (Ente オブジェクトのメタデータやユーザーデータの保存用) と MinIO バケット (暗号化されたオブジェクトデータの保存用) が必要です。また、Ente サーバーにアクセスするための HTTPS プロキシとして Nginx の使用が推奨されます。最後に、ente-cli ツールを使うと、Ente サーバーのアカウントの容量制限や有効期限の更新が簡単に行えます。

これらの必要なコンポーネントをインストールするには、オプションの依存関係としてリストされているパッケージをインストールすることが推奨されます。同じホストにインストールする場合は、依存パッケージとしてインストールするのが望ましいです。例えば、これらのパッケージをインストールする際、pacman の場合は --asdeps オプションを使用し、または yayAUR でインストールすることができます。

参考までに、以下のパッケージがオプションの依存関係としてリストされています。

  • minio
  • minio-client
  • nginx
  • postgresql

設定

MinIO のセットアップ

設定ファイルを以下のように編集してください:

/etc/minio/minio.conf
MINIO_VOLUMES="/srv/minio/data"
MINIO_ROOT_USER=minio
MINIO_ROOT_PASSWORD='YOUR-STRONG-MINIO-ROOT-PASSWORD'
MINIO_OPTS="--address your_public_domain.tld:3200 --console-address 127.0.0.1:3201"

minio.service有効化/起動します。

mcli コマンドを使って (minio ユーザーとして) MinIO ente-server バケットを作成します:

# cd /srv/minio/data
[minio]$ mcli mb -p ente-server

PostgreSQL のセットアップ

postgres ユーザーとしてデータベースを初期化します:

[postgres]$ initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data' --data-checksums --auth=scram-sha-256 --pwprompt

AF_UNIX ソケットのみに接続するように設定してください:

/var/lib/postgres/data/postgresql.conf
listen_addresses = '' # AF_UNIX Socket only

postgresql.service編集して、PostgreSQL ユーザーまたはグループにソケットアクセスを制限します:

/etc/systemd/system/postgresql.d/socket-access-restriction.conf
[Service]
RuntimeDirectoryMode=750

entepostgres ユーザーグループ に追加し、postgresql.service有効化/起動します。

PostgreSQL データベースユーザーと、このユーザーが所有するデータベースを作成します (新しいパスワードを 2 回入力し、次に新しいアカウントを保存するために postgres パスワードを指定します):

[postgres]$ createuser -P ente

次に、新しいデータベースを作成するために postgres パスワードを指定します:

[postgres]$ createdb -T template0 -O ente -E unicode ente-server

ente-server の起動

MinIO バケットの詳細を追加します:

/etc/ente-server/local.yaml
b2-eu-cen:
    key: minio
    secret: "YOUR-STRONG-MINIO-ROOT-PASSWORD"
    endpoint: your_public_domain.tld:3200
    region: eu-central-2
    bucket: ente-server

PostgreSQL の詳細を追加します:

/etc/ente-server/local.yaml
db:
    host: /run/postgresql
    port: 5432
    name: ente-server
    user: ente
    password: "YOUR-STRONG-ENTE-DATABASE-USER-PASSWORD"

ente-server-gen-random-keys コマンドを使って新しい秘密鍵を生成し、/etc/ente-server/local.yaml 設定ファイルのデフォルト値の代わりにこれらの値を使用してください。

your_public_domain.tld の IP アドレスにアクセスできるように ente-server.service編集します (デフォルトでは、サービスは localhost からのアクセスのみを許可しています):

[Service]
IPAddressAllow=IP_address_of_your_public_domain.tld

ente-server.service有効化/起動します。

Nginx プロキシの設定

サンプルの Nginx 設定ファイルとそれに付随する HTTP(S) セキュリティヘッダーファイルを、Nginx の設定ディレクトリにコピーします:

# cp -v /usr/lib/ente-server/ente-server-nginx.conf /etc/nginx/
# cp -v /usr/lib/ente-server/http*security_headers.conf /etc/nginx/

このサンプル設定ファイルを編集し、your_public_domain.tld を実際のパブリックドメイン名に置き換えてください。

Let's Encrypt の証明書 (または他のプロバイダーからの SSL 証明書) がまだない場合はリクエストしてください:

# certbot certonly --email your_email --agree-tos --preferred-challenge http --webroot -w /var/lib/letsencrypt -d your_public_domain.tld

ente-server 設定を含む include ステートメントを Nginxhttp 構成ファイルに追加します:

/etc/nginx/nginx.conf
http {
    include /etc/nginx/ente-server-nginx.conf
}

パーミッションを修正します:

# chmod 644 /etc/nginx/ente-server-nginx.conf
# chmod 644 /etc/nginx/http*security_headers.conf

変更を反映させるために nginx.service再起動します。

ente-server と ente-cli の設定

  • クライアントに ente-cli をインストールします:
  • クライアントに ente-cli 設定を追加します:
$ mkdir -p ~/.ente/export 
~/.ente/config.yaml
endpoint:
  api: "https://your_public_domain.tld"
  • 写真モバイルアプリまたは Web アプリでカスタムエンドポイントを使用してユーザーアカウントを追加します:
    • 写真モバイルアプリで:
      • 開発者モードを有効にするためにメイン画面を 7 回タップします
      • カスタム Ente サーバー API エンドポイントを定義します:
        URL: https://your_public_domain.tld
    • クライアントの Web アプリで:
$ git clone https://github.com/ente-io/ente.git
      cd ente/web
      git submodule update --init --recursive
      yarn install
      NEXT_PUBLIC_ENTE_ENDPOINT=https://your_public_domain.tld yarn dev:photos
  • 写真アプリまたは Web アプリ (http://localhost:3000) の指示に従って新しいユーザーを作成します
  • OTP コードを取得します:
    • メールで:
      • /etc/ente-server/local.yamlsmtp セクションを設定します
      • 設定された SMTP サーバーが動作していることを確認します
      • メールが届くのを待ち、OTP コードをコピーします
    • ente-server ログから:
      • # journalctl -u ente-server | grep SendEmailOTT | tail -n 1
  • 新規ユーザーのアカウント ID を取得します:
 # psql -U ente ente-server -c 'select user_id from users order by user_id desc limit 1;'
  • このユーザーを管理者として設定します:
/etc/ente-server/local.yaml
internal:
     admin: [ADD_USER_ID_HERE]
  • 新しい管理者権限を有効にするために ente-server.service再起動します
  • クライアントで ente-cli 内のこの管理者を設定します:
 $ ente account add
     photos
     ~/.ente/export
     email_address_of_admin_account
     password_of_admin_account

ユーザーストレージとアカウント有効期限の延長

  • ente-cli を使ってストレージ制限を 100 TB、期限を 100 年に増やします:
 ente admin update-subscription -u "user@domain.tld"

(オプション) AppArmor プロファイルのコピーと適用

AppArmor プロファイルは、AppArmor を使用して ente-server バイナリのアクセスを制限したい人向けに提供されています。次の手順でプロファイルをコピーして適用します (すでに AppArmor がインストールおよび有効化されているものと仮定):

 # install -Dvm600 -o root -g root /usr/lib/ente-server/usr.bin.ente-server -t /etc/apparmor.d/
 # aa-enforce /usr/bin/ente-server

(オプション) ファイアウォールの設定

iptables や nftables などのホストファイアウォールが有効化および構成されている場合、次の項目が許可されていることを確認します:

  • localhost へのトラフィック
  • クライアントの Ente (モバイル) クライアントから Nginx への TCP ポート 443 のトラフィック
  • クライアントの Ente (モバイル) クライアントから MinIO API ポートへの TCP ポート 3200 のトラフィック

ente-server-gitAUR パッケージには、インストールされるすべてのファイルが記載・説明された ente-server(1) man ページ が含まれています。

参照

翻訳ステータス: このページは en:Ente Server の翻訳バージョンです。最後の翻訳日は 2024-05-06 です。もし英語版に 変更 があれば、翻訳の同期を手伝うことができます。