-
Notifications
You must be signed in to change notification settings - Fork 10
Deploying the MS
You can deploy the MS in one of two ways: as a Google AppEngine Python app, or as an AppScale Python app. You can also run it locally (i.e. in a test environment) with the Google AppEngine SDK.
Before you deploy your MS, you will need to set up an administrator account. To do so, you'll need an RSA 4096-bit key. You can generate an RSA 4096-bit key pair with these commands:
$ # Make sure the key is readable ONLY to you
$ touch /path/to/your/admin/key.pem
$ chmod 0600 /path/to/your/admin/key.pem
$ openssl genrsa -out /path/to/your/admin/key.pem 4096
$ openssl rsa -in /path/to/your/admin/key.pem -pubout > /path/to/your/admin/public/key.pub
Then, you can set up the administrator account with this command:
$ scons MS-setup-admin email=YOUR.EMAIL@EXAMPLE.COM pubkey=/path/to/your/admin/public/key.pub
You'll also need to generate an app.yaml file. The only thing Syndicate needs from you is the MS name to use. To generate the file, run this command:
$ scons MS-setup-app name=YOUR-APP-NAME
Now you can deploy the MS. For example, to deploy to Google AppEngine, you simply use Google's appcfg.py script to upload the MS you just built to the AppEngine PaaS:
$ appcfg.py update build/out/ms
Once the MS is up and running, you need to set up the Syndicate management tool syntool.py, so you can go on to create users, Volumes, and Gateways. You'll need to give it your administrator's email address and public key, as well as the URL to the MS's API (usually, this is the MS's hostname, followed by /api). To do so, simply run:
$ syntool.py --user_id YOUR.EMAIL@EXAMPLE.COM --MSAPI https://YOUR.RUNNING.MS/api --privkey /path/to/your/admin/key.pem setup
You can remove the private key you generated after this step, since syntool.py makes a copy of it and puts it into its configuration directory (by default, this is $HOME/.syndicate/).
From start to finish, here's a simple recipe that builds, sets up, and deploys the MS on Google AppEngine.
$ # Generate key with OpenSSL (make it unreadable except by you!)
$ touch ~/syndicate_admin.pem
$ chmod 0600 ~/syndicate_admin.pem
$ openssl genrsa -out ~/syndicate_admin.pem 4096
$ openssl rsa -in ~/syndicate_admin.pem -pubout > ~/syndicate_admin.pub
$ # Build and install the MS
$ scons MS
$ scons MS-setup-admin email=admin@syndicatedrive.com key=~/syndicate_admin.pub
$ scons MS-setup-app name=syndicate-drive-ms
$ appcfg.py update build/out/ms
$ syntool.py --user_id admin@syndicatedrive.com --MSAPI https://syndicate-drive-ms.appspot.com/api --privkey ~/syndicate_admin.pem setup
$ # Safely erase the private key, since syntool.py makes a copy for itself.
$ for i in $(seq 1 10); do dd if=/dev/urandom of=~/syndicate_admin.pem bs=10240 count=1; done
$ rm ~/syndicate_admin.pem