コンテンツにスキップ

「Firefox Sync Server」の版間の差分

提供: ArchWiki
削除された内容 追加された内容
Pkg/AUR テンプレートの更新
アーカイブ
タグ: 新規リダイレクト
 
1行目: 1行目:
#redirect [[ArchWiki:アーカイブ]]
[[Category:同期]]
[[Category:アーカイブ]]
[[en:Firefox Sync Server]]
[[Wikipedia:ja:Firefox_Sync|Wikipedia]] より:
: ''Firefox Sync (旧名 Mozilla Weave) はブックマークや回覧履歴、設定、パスワード、入力フォーム、最後に開いた25個のタブなどを他のコンピュータと同期することができるブラウザ同期機能である。''

: ''ユーザーのデータは Mozilla のサーバーに保存されるが、データは暗号化されるため第三者はもちろん Mozilla にも情報の閲覧はできない。ユーザーが自分・自社用に Firefox Sync サーバーを立ち上げることもできる。''

このページでは (Mozilla) Firefox Sync Server (略して FFSync) のバージョン 1.1 あるいはバージョン 1.5 を立ち上げて Firefox Account サーバーを使用できるようにする方法を解説します。

{{Note|Mozilla Firefox Sync Server のバージョン 1.1 は開発が停止しており Firefox 29 から非推奨となり Firefox 32 からは使えなくなっています。Firefox 29 以上では Mozilla Firefox Sync Server のバージョン 1.5 が利用できます。ただし Firefox アカウントの作成が必要です。詳しくは以下のリンクを見てください:
* https://wiki.mozilla.org/Identity/Firefox_Accounts
* https://blog.mozilla.org/blog/2014/02/07/introducing-mozilla-firefox-accounts/
* https://blog.mozilla.org/services/2014/02/07/a-better-firefox-sync/
* https://blog.mozilla.org/futurereleases/2014/02/07/test-the-new-firefox-sync-and-customize-the-new-ui-in-firefox-aurora/
}}
{{Note|バージョン 1.1 とバージョン 1.5 はデータベースを共有しないようすることで多少設定を変更して同時に使用することができます。}}
{{Tip|Firefox の URL バーに {{ic|about:sync-log}} と入力すると Firefox Sync に関連するログが表示されます。}}

==バージョン 1.5==

Firefox のバージョン 29 以上で使うことができます。

===インストール===

[[AUR]] から {{AUR|mozilla-firefox-sync-server-git}} パッケージをインストールしてください。

隔離された Python 環境が作成されて必要なライブラリは全てそこにダウンロード・インストールされます。サーバーは分離環境の Python にだけ依存し、システムの Python は使わずに動作します。

===サーバーの設定===

FFsync サーバーは {{ic|/opt/mozilla-firefox-sync-server/syncserver.ini}} ファイルで設定できます。大体のオプションは [http://docs.services.mozilla.com/howtos/run-sync-1.5.html 公式ドキュメント] に説明があります。設定例:

{{bc|1=
# Use a Unix socket and the Gunicorn server
[server:main]
use = egg:gunicorn#main
bind = unix:/run/ffsync/syncserver.sock
workers = 2
timeout = 60
syslog = true
syslog_prefix = ffsync
syslog_facility = daemon

[app:main]
use = egg:syncserver

[syncserver]
# This must be edited to point to the public URL of your server,
# i.e. the URL as seen by Firefox.
public_url = <nowiki>http://example.com/ffsync/</nowiki>

# This defines the database in which to store all server data.
sqluri = sqlite:////var/lib/ffsync/sync_storage.db

# This is a secret key used for signing authentication tokens.
# It should be long and randomly-generated.
# The following command will give a suitable value on *nix systems:
#
# head -c 20 /dev/urandom | sha1sum
#
# If not specified then the server will generate a temporary one at startup.
secret = AZERTYUIOPQSDFGHJKLMWXCVBN

# Set this to "false" to disable new-user signups on the server.
# Only request by existing accounts will be honoured.
allow_new_users = true

# Uncomment and edit the following to use a local BrowserID verifier
# rather than posing assertions to the mozilla-hosted verifier.
# Audiences should be set to your public_url without a trailing slash.
#[browserid]
#backend = tokenserver.verifiers.LocalVerifier
#audiences = <nowiki>https://localhost:5000</nowiki>
}}

=== nginx の設定 ===

nginx の設定例:

{{bc|1=
# Firefox sync config
location /ffsync/ {
rewrite ^/ffsync(.+)$ $1 break;
proxy_pass <nowiki>http://unix:/run/ffsync/syncserver.sock;</nowiki>
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_read_timeout 120;
proxy_connect_timeout 10;
gzip off;
}
}}

===クライアントの設定===

デスクトップ版の Firefox で新しく立ち上げた Sync サーバーを使うには、{{ic|about:config}} を開いて {{ic|identity.sync.tokenserver.uri}} を検索してください。値をあなたのサーバーの URL に変更してください:
{{bc|1=
identity.sync.tokenserver.uri: <nowiki>http://example.com/ffsync/token/1.0/sync/1.5</nowiki>
}}

Firefox 42 以前では、デスクトップ版 Firefox の TokenServer の設定名は {{ic|services.sync.tokenServerURI}} でした。Firefox 42 以降でも旧設定名は使えますが、Sync からサインアウトしたときに旧設定名はリセットされるため、新しい設定名を使うことを推奨します。

===Firefox アカウントサーバー===

Mozilla によって提供されている公式の Firefox アカウントサービスを使用するか、あるいは [http://docs.services.mozilla.com/howtos/run-fxa.html 公式ドキュメント] に従って自分用のアカウントサーバーを立ち上げてください。

==バージョン 1.1==

Firefox のバージョン 32 未満で使うことができます。

===インストール===

[[AUR]] から {{AUR|mozilla-firefox-sync-server-hg}}{{Broken package link|パッケージが存在しません}} をインストールしてください。

隔離された Python 環境が作成されて必要なライブラリは全てそこにダウンロード・インストールされます。サーバーは分離環境の Python にだけ依存し、システムの Python は使わずに動作します。

===サーバーの設定===

FFsync サーバーは {{ic|/opt/mozilla-firefox-sync-server/development.ini}} と {{ic|/opt/mozilla-firefox-sync-server/etc/sync.conf}} ファイルで設定できます。

====基本設定====

フォールバックノード URL をサーバーの URL にあわせて変更してください (例: {{ic|<nowiki>https://example.com/ffsync/</nowiki>}})。{{ic|/opt/mozilla-firefox-sync-server/etc/sync.conf}} を編集して以下の部分を:
{{bc|1=
[nodes]
fallback_node = <nowiki>http://localhost:5000/</nowiki>
}}
以下のように変更します:
{{bc|1=
[nodes]
fallback_node = <nowiki>https://example.com/ffsync/</nowiki>
}}

====デバッグモードの無効化====

{{ic|/opt/mozilla-firefox-sync-server/development.ini}} で以下を設定:
{{bc|1=
[DEFAULT]
debug = False
}}

====メールアドレスの設定====

{{ic|/opt/mozilla-firefox-sync-server/etc/sync.conf}} で以下を設定:
{{bc|1=
[smtp]
sender = ffsync@example.com
}}

====ストレージバックエンド====

デフォルトのストレージバックエンドは SQLite です。ユーザーが大勢いるのでないかぎり十分な性能を発揮します。データベースを複数のファイルに分割するには、{{ic|/opt/mozilla-firefox-sync-server/etc/sync.conf}} の {{ic|sqluri}} フィールドを編集してください。

[http://docs.services.mozilla.com/howtos/run-sync.html 公式の FFsync サーバーハウツー] には MySQL や LDAP をバックエンドとして使用する方法が解説されています。

====ディスククォータ====

デフォルトの[[ディスククォータ]]は制限が強すぎてブックマークを大量に保存した場合すぐに使い切ってしまいます。{{ic|/opt/mozilla-firefox-sync-server/etc/sync.conf}} でディスククォータを 5 MB から 25 MB に変更:
{{bc|1=
[storage]
...
quota_size = 25600
...
}}

====ウェブサーバーの設定====

デフォルト設定では Sync に組み込まれているサーバーが起動しますが本番環境では使わないほうが無難です。

=====Apache と mod_wsgi=====

[http://docs.services.mozilla.com/howtos/run-sync.html 公式の FFsync サーバーハウツー] を見てください。

=====nginx と Gunicorn=====

AUR のパッケージはデフォルトで Python の {{ic|virtualenv}} に Gunicorn サーバーをインストールします。{{ic|/opt/mozilla-firefox-sync-server/development.ini}} の以下の行を変更することで有効にできます:

{{bc|1=
[server:main]
use = egg:gunicorn#main
host = unix:/run/ffsync/syncserver.sock
use_threadpool = True
threadpool_workers = 60
}}

{{ic|/etc/tmpfiles.d/ffsync.conf}} ファイルを作成することで起動時に {{ic|/run/ffsync/}} フォルダが作成されます:
{{bc|1=
D /run/ffsync 0750 ffsync http
}}

以下のコマンドを実行してフォルダを作成:
{{bc|1=
# systemd-tmpfiles --create ffsync.conf
}}

{{AUR|mozilla-firefox-sync-server-hg}}{{Broken package link|パッケージが存在しません}} に含まれている systemd サービスユニットを使って Gunicorn サーバーを起動・有効化:
{{bc|1=
# systemctl enable ffsync
# systemctl start ffsync
}}

nginx の設定例:
{{bc|1=
# Firefox sync config
location /ffsync/ {
rewrite ^/ffsync(.+)$ $1 break;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass <nowiki>http://unix:/run/ffsync/syncserver.sock</nowiki>;
}
}}

===クライアントの設定===

Firefox の設定で Sync 設定ウィザードを使ってサーバーに新しいアカウントを作成してください。リストで "Custom server..." を選択してサーバーのアドレスを入力してください: {{ic|<nowiki>https://example.com/ffsync/</nowiki>}}。

"Advanced Settings" ボタンで何を同期するのか設定したり、クライアントのホスト名を定義できます。

==参照==

* [http://docs.services.mozilla.com/howtos/run-sync.html 公式 Mozilla Firefox Sync Server ハウツー]
* [http://alien.slackbook.org/blog/setting-up-your-own-mozilla-sync-server/ Howto with Apache support by Eric Hameleers]
* [https://tim.siosm.fr/blog/2012/12/11/firefox-sync-nginx-systemd/ Howto with nginx and systemd support by Timothée Ravier]
* [http://amnesiak.org/blog/mozilla-sync-server-with-nginx.html Howto with nginx support]
* [http://terminal28.com/how-to-install-and-configure-own-firefox-sync-server-weave-debian/ Howto using MySQL]
* [[OwnCloud]] には Mozilla Sync サーバーのアプリケーションが存在します。

2024年9月8日 (日) 17:26時点における最新版