8月に以前サービスされていた
Ubuntu One File Sync
「Ubuntu One」
そんなUbuntu Oneですが、
その後は、
しかしながらオンラインストレージサービスそのものは、
サービス終了時に、
公開されたソースコードでできること
公開された
Web UIやREST API部分はありませんし、
公開されたコードにしても、
つまりこのコードを使って新しいオンラインストレージサービスを立ち上げるには足りないものが多すぎます。既存のサービスに縛られないオンラインストレージサービスがほしいのであれば、 普通にownCloudあたりを使うのが無難でしょう。
これだけ書いておけばさすがに、
サーバー側の準備
まずサーバー側はUbuntu 12.
まず最初にSSL接続のための秘密鍵
$ openssl genrsa -out privkey.pem $ openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095 (中略) Common Name (e.g. server FQDN or YOUR name) []:10.0.3.19 (後略)
次に必要なパッケージをインストールします。Ubuntu Oneは一度性能の問題でCouchDBからPostgreSQLに移行しています。よってPostgreSQLとPythonの各種モジュールのパッケージが必要になります。
$ sudo apt-get install bzr make python-transaction protobuf-compiler \ python-setuptools gcc python-dev python-twisted-web postgresql-9.1 \ python-yaml python-psycopg2 postgresql-contrib supervisor \ postgresql-plpython-9.1 python-django python-boto squid \ python-protobuf python-psutil python-testresources \ python-tz python-bson python-iso8601 python-openid
あとはUbuntu Oneのソースコードを取得します。
$ bzr branch lp:filesync-server $ cd filesync-server
設定ファイル
secret:
api_server_crt: |
-----BEGIN CERTIFICATE-----
(privkey.pemの内容を記述)
-----END CERTIFICATE-----
api_server_key: |
-----BEGIN RSA PRIVATE KEY-----
(cacert.pemの内容を記述)
-----END RSA PRIVATE KEY-----
api_server_crt_chain:
privkey.
あとは次のコマンドで必要なライブラリのダウンロードとデータベースの構築、 サーバーの起動を行います。
$ make start-oauth
Checking out external source dependencies...
build/link-external-sourcecode \
-p ../sourcedeps/sourcecode/ \
-t /home/ubuntu/filesync-server/.sourcecode \
-c build/config-manager.txt
configglue: checked out r1 of lp:~configglue/configglue/trunk
(中略)
filesync: started
ssl-proxy: started
DJANGO_SETTINGS_MODULE=backends.django_settings python dev-scripts/load_sample_data.py
python -c 'from config import config; print >> file("tmp/filesyncserver.port", "w"), config.api_server.tcp_port; print >> file("tmp/filesyncserver.port.ssl", "w"), config.ssl_proxy.port; print >> file("tmp/filesyncserver-status.port", "w"), config.api_server.status_port'
最終的に上記のように
ちなみにこれらのサーバーのログはtmp/
最後に新規アカウントを作成します。
$ dev-scripts/user-mgr.py create testuser John Doe [email protected] testpass
createの後ろは
クライアント側の準備
次にクライアントの設定を行います。これまでのUbuntu Oneクライアントパッケージは、 サーバーとしてone.
まずクライアントの環境ですが、
$ sudo apt-get install python-twisted-bin python-twisted-core \
python-dirspec python-pyinotify python-configglue \
python-twisted-names python-ubuntu-sso-client \
python-distutils-extra protobuf-compiler python-protobuf
適当なディレクトリを作成し、
$ mkdir -p ~/u1client/cacert/ $ cp cacert.pem ~/u1client/cacert/
次にUbuntu Oneと通信するためのメッセージプロトコルを定義したPythonモジュールを インストールしましょう。
$ cd ~/u1client/ $ bzr branch lp:~facundo/ubuntuone-storage-protocol/opensourcing storage-protocol $ cd storage-protocol $ ./setup.py build
最後にクライアント本体をインストールします。
$ cd ~/u1client/ $ bzr branch lp:~facundo/ubuntuone-client/opensourcing client $ cd client/ubuntuone $ ln -s ~/u1client/storage-protocol/ubuntuone/storageprotocol . $ cd .. $ ./setup.py build
あとはクライアントを起動するだけです。
$ export $(dbus-launch) $ PYTHONPATH=. SSL_CERTIFICATES_DIR=$HOME/u1client/cacert bin/ubuntuone-syncdaemon \ --auth=testuser:testpass --host=10.0.3.19 \ --port=21101 --logging-level=DEBUG
クライアントはデーモンとして動作します。終了するときは
「~/.cache/
クライアントが起動したら
ubuntuone.SyncDaemon.EQ - DEBUG - push_event: FS_FILE_CREATE,
kwargs: {'path': '/home/ubuntu/Ubuntu One/testfile'}
同期イベントが開始したら、
TRACE storage.server[16866]: 1b42e918-c57a-4857-acf9-e6a79992e1d0 127.0.0.1:47878 testuser MakeResponse 15 - IN: id: 15 type: MAKE_FILE make { share: "" parent_node: "04142ddc-98ef-4c84-b2e0-0f209b4eab43" name: "testfile" }
あとは同じように複数のマシンにクライアントを準備して、
Ubuntu Oneのフォーク「Magicicada」
「Magicicada」
当面は開発プラットフォームを14.