コンテンツにスキップ

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

提供: ArchWiki
削除された内容 追加された内容
参照: update TranslationStatus.
 
(同じ利用者による、間の24版が非表示)
1行目: 1行目:
[[Category:ファイル共有]]
[[Category:ファイル共有]]
[[en:Ente server]]
{{Related articles start}}
{{Related articles start}}
{{Related|AppArmor}}
{{Related|AppArmor}}
9行目: 10行目:
[https://ente.io Ente サーバー] は、Ente (モバイル) クライアントに暗号化されたデータの塊を保存・提供するサーバー部分です。クライアントは暗号化されたデータを送受信し、それが Ente サーバーに届き、ローカルの [[MinIO]] オブジェクト ストレージ サービスを通じて保存・読み取りが行われます。
[https://ente.io Ente サーバー] は、Ente (モバイル) クライアントに暗号化されたデータの塊を保存・提供するサーバー部分です。クライアントは暗号化されたデータを送受信し、それが Ente サーバーに届き、ローカルの [[MinIO]] オブジェクト ストレージ サービスを通じて保存・読み取りが行われます。


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


== インストール ==
== インストール ==
17行目: 18行目:
まず、{{AUR|ente-server-git}} パッケージを[[インストール]]してください。
まず、{{AUR|ente-server-git}} パッケージを[[インストール]]してください。


セルフホストサーバー スペースは容量が限られていることが多いため、{{AUR|ente-server-git}} パッケージは、古くてリンクていない Ente サーバー [[MinIO]] オブジェクトをより迅速にクリーンアップするように変更されています。デフォルトの Ente サーバーは通常 45 日ごとにオブジェクトをクリーンアップしますが、このパッケージではその期間が 5 分ごとに短縮されています。
セルフホストされるサーバースペースは、しばしば限られた容量しか利用できないため、{{AUR|ente-server-git}} パッケージは、古リンクした ente-server [[MinIO]] オブジェクトが実際削除される前のクリーンアップ遅延を変更できる機能が追加されています。これは、''ente-server'' の設定パラメータ {{ic|internal:delete-object-delay}} で構成することができます。デフォルトの Ente サーバーは、これらのオブジェクトをデフォルトで {{ic|45日}} ごとにクリーンアップしますが、レプリケーション必要ない場合、この設定を例えば {{ic|5分}} ごとにクリーンアップするように設定することができます。

{{Note|この設定は、''ente-server'' が破損するリスクがあるため、'''Ente''' の開発者によってサポートされていません。完全な警告は、''ente-server'' の設定ファイルに記載されています。}}


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


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

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

* {{ic|minio}}
* {{ic|minio-client}}
* {{ic|nginx}}
* {{ic|postgresql}}


== 設定 ==
== 設定 ==
40行目: 36行目:
MINIO_ROOT_USER=minio
MINIO_ROOT_USER=minio
MINIO_ROOT_PASSWORD='<nowiki/>''YOUR-STRONG-MINIO-ROOT-PASSWORD''<nowiki/>'
MINIO_ROOT_PASSWORD='<nowiki/>''YOUR-STRONG-MINIO-ROOT-PASSWORD''<nowiki/>'
MINIO_OPTS="--address ''your_public_domain.tld'':3200 --console-address 127.0.0.1:3201"
MINIO_OPTS="--address 127.0.0.1:43200 --console-address 127.0.0.1:43201"
}}
}}


50行目: 46行目:
[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 -c listen_addresses=<nowiki>''</nowiki>


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行目: 58行目:
}}
}}


既存の PostgreSQL セットアップがある場合は、[[PostgreSQL#PostgreSQL を UNIX ソケット経由でのみアクセス可能に設定する]]を参照してください:
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行目: 65行目:
}}
}}


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|
87行目: 83行目:
key: minio
key: minio
secret: "''YOUR-STRONG-MINIO-ROOT-PASSWORD''"
secret: "''YOUR-STRONG-MINIO-ROOT-PASSWORD''"
endpoint: ''your_public_domain.tld'':3200
endpoint: https://''<nowiki>your_public_domain.tld</nowiki>'':3200
region: eu-central-2
region: eu-central-2
bucket: ente-server
bucket: ente-server
}}
}}


Add [[PostgreSQL]] details:
[[PostgreSQL]] の詳細を追加します:


{{hc|/etc/ente-server/local.yaml|
{{hc|/etc/ente-server/local.yaml|
103行目: 99行目:
}}
}}


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 プロキシの設定 ===


例として提供されている [[MinIO]] と '''Ente''' サーバーの [[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/
# cp -v /usr/lib/ente-server/minio-server-nginx.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行目: 132行目:
}}
}}


パーミッションを修正します:
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}} をインストールするには、{{AUR|ente-cli-bin}} パッケージを使用します。
{{Style|Last section to adjust.|section=Cleanup}}


* 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:

** In the photos mobile app:
カスタムエンドポイントを使用して、クライアントで '''Ente''' フォトモバイル、デスクトップ、またはウェブアプリを介してユーザーアカウントを追加します。
*** Click 7 times on the main screen to enable developers mode

*** Define your custom '''Ente''' server API endpoint:
モバイルアプリで、開発者モードを有効にするにはメイン画面を7回クリックし、その後カスタム '''Ente''' サーバー API エンドポイントを設定します:
{{bc| URL: ''<nowiki>https://your_public_domain.tld</nowiki>''}}

** In the web app on the client:
URL: ''<nowiki>https://your_public_domain.tld</nowiki>''
{{bc| $ git clone https://github.com/ente-io/ente.git

cd ente/web
クライアントのウェブアプリで:
git submodule update --init --recursive
{{bc|1=
yarn install
$ git clone https://github.com/ente-io/ente.git
NEXT_PUBLIC_ENTE_ENDPOINT{{=}}''<nowiki>https://your_public_domain.tld</nowiki>'' yarn dev:photos}}
$ cd ente/web
* Follow the photos app or web app (''http://localhost:3000'') instructions to create a new user
$ git submodule update --init --recursive
* Obtain the OTP code:
$ yarn install
** Via email:
$ NEXT_PUBLIC_ENTE_ENDPOINT=''<nowiki>https://your_public_domain.tld</nowiki>'' yarn dev:photos
*** Configure the {{ic|smtp}} section in {{ic|/etc/ente-server/local.yaml}}
}}
*** Make sure the configure [https://man.archlinux.org/man/smtp.1.en SMTP] server is working

*** Wait for the mail to arrive and copy the OTP code
{{AUR|ente-desktop-git}} パッケージを使用してデスクトップアプリを利用する場合は、ビルド前に {{ic|NEXT_PUBLIC_ENTE_ENDPOINT}} 環境変数をエクスポートしてください。
** Via the ente-server log:

*** {{bc|# journalctl -u ente-server {{!}} grep SendEmailOTT {{!}} tail -n 1}}
モバイル、デスクトップ、またはウェブアプリ(''http://localhost:3000'')の指示に従って新しいユーザーを作成します。
* 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;'}}
OTP コードを取得します:
* Configure this user as the admin:

* メールで:
** {{ic|/etc/ente-server/local.yaml}} の {{ic|smtp}} セクションを設定します
** 設定された {{man|1|smtp}} サーバーが動作していることを確認します
** メールが届くのを待ち、OTP コードをコピーします
* ente-server のログから:
:{{bc|# journalctl -au 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;'

このユーザーを管理者として設定します:

{{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
* Configure this admin within {{ic|ente-cli}} on the client:
{{bc| $ ente account add
photos
~/.ente/export
''email_address_of_admin_account''
''password_of_admin_account''
}}
}}


新しい管理者権限を有効にするために、{{ic|ente-server.service}} を[[再起動]]します。
=== Increasing user storage and account expiry limit ===


クライアントでこの管理者を {{ic|ente-cli}} に設定します:
* Use ''ente-cli'' to increase storage limit with 100 TB and expiry with 100 years:

{{bc|
$ ente account add
photos
~/.ente/export
''email_address_of_admin_account''
''password_of_admin_account''
}}

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

* ''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 などのホストファイアウォールが有効化および構成されている場合、次の項目が許可されていることを確認します:


* {{ic|localhost}} へのトラフィック
If a host firewall like iptables or nftables has been enabled and configured, make sure the following is allowed:
* クライアントの '''Ente''' (モバイル) クライアントから [[Nginx]] への TCP ポート {{ic|443}} のトラフィック
* クライアントの '''Ente''' (モバイル) クライアントから [[MinIO]] API ポートへの TCP ポート {{ic|3200}} のトラフィック


== ファイル ==
* Traffic on {{ic|localhost}}
* Traffic from your '''Ente''' (mobile) client to TCP port {{ic|443}} to reach [[Nginx]]
* Traffic from your '''Ente''' (mobile) client to TCP port {{ic|3200}} to reach the [[MinIO]] API port


{{AUR|ente-server-git}} パッケージには、インストールされるすべてのファイルを一覧表示し、説明する {{man|1|ente-server|url=}} [[man ページ]]が含まれています。
== 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.


* 上流リポジトリ: [https://github.com/ente-io/ente/tree/main/server ente.io Ente サーバーリポジトリ]
== See also ==


{{TranslationStatus|Ente Server|2024-08-14|809494}}
* Upstream Repository: [https://github.com/ente-io/ente/tree/main/server ente.io Ente Server Repository]

2024年8月14日 (水) 18:48時点における最新版

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

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

インストール

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

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

セルフホストされるサーバースペースは、しばしば限られた容量しか利用できないため、ente-server-gitAUR パッケージでは、古いリンク切れした ente-server MinIO オブジェクトが実際に削除される前のクリーンアップ遅延を変更できる機能が追加されています。これは、ente-server の設定パラメータ internal:delete-object-delay で構成することができます。デフォルトの Ente サーバーは、これらのオブジェクトをデフォルトで 45日 ごとにクリーンアップしますが、レプリケーションが必要ない場合、この設定を例えば 5分 ごとにクリーンアップするように設定することができます。

ノート この設定は、ente-server が破損するリスクがあるため、Ente の開発者によってサポートされていません。完全な警告は、ente-server の設定ファイルに記載されています。

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

これらの必要なコンポーネントは、オプションの依存関係としてリストされており、依存関係としてインストールすることが推奨されます: Pacman#Installation_reason

設定

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 127.0.0.1:43200 --console-address 127.0.0.1:43201"

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 -c listen_addresses=''

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

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

既存の PostgreSQL セットアップがある場合は、PostgreSQL#PostgreSQL を UNIX ソケット経由でのみアクセス可能に設定するを参照してください:

/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: https://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 プロキシの設定

例として提供されている MinIOEnte サーバーの 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/
# cp -v /usr/lib/ente-server/minio-server-nginx.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-binAUR パッケージを使用します。

クライアントに ente-cli の設定を追加します:

$ mkdir -p ~/.ente/export 
~/.ente/config.yaml
endpoint:
  api: "https://your_public_domain.tld" >

カスタムエンドポイントを使用して、クライアントで Ente フォトモバイル、デスクトップ、またはウェブアプリを介してユーザーアカウントを追加します。

モバイルアプリで、開発者モードを有効にするにはメイン画面を7回クリックし、その後カスタム Ente サーバー API エンドポイントを設定します:

URL: https://your_public_domain.tld

クライアントのウェブアプリで:

$ 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

ente-desktop-gitAUR パッケージを使用してデスクトップアプリを利用する場合は、ビルド前に NEXT_PUBLIC_ENTE_ENDPOINT 環境変数をエクスポートしてください。

モバイル、デスクトップ、またはウェブアプリ(http://localhost:3000)の指示に従って新しいユーザーを作成します。

OTP コードを取得します:

  • メールで:
 ** /etc/ente-server/local.yamlsmtp セクションを設定します
 ** 設定された smtp(1) サーバーが動作していることを確認します
 ** メールが届くのを待ち、OTP コードをコピーします
  • ente-server のログから:
# journalctl -au 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-08-14 です。もし英語版に 変更 があれば、翻訳の同期を手伝うことができます。