These are instructions for how to set up a Google App Engine application
for the appspot rendezvous method (flashproxy-reg-appspot). It requires
the HTTP rendezvous to be available, so you should set that up first and
ensure it is working correctly, or find someone else's to use. If you
choose the latter, note that it is *their* reg-daemon.pub that your users
must give to flashproxy-reg-appspot.

For more information about Google App Engine, see the links at the bottom
of this document.

You are strongly recommended to create a Google account dedicated for
this purpose, rather than a personal or organisation account. See
email-howto.txt for how to do that.

Download the SDK:
https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Go
This guide was written for version 1.8.9 of the SDK.

Find your facilitator appengine installation, probably in reg-appspot/
in your flashproxy config dir. Edit config.go to point to the address of
the HTTP facilitator.

Follow the directions to register a new application:
https://developers.google.com/appengine/docs/go/gettingstarted/uploading
Enter an application ID and create the application.

To run locally using the development server:
$ ~/go_appengine/goapp serve reg-appspot/
You are advised to do this on a non-production machine, away from the main
facilitator.

Use the appcfg.py program to upload the program. It should look
something like this:

$ torify ./go_appengine/goapp --no_cookies -A <YOUR_APP_ID> update reg-appspot/
07:25 PM Host: appengine.google.com
07:25 PM Application: application-id; version: 1
07:25 PM
Starting update of app: application-id, version: 1
07:25 PM Getting current resource limits.
Email: xxx@gmail.com
Password for xxx@gmail.com:
07:26 PM Scanning files on local disk.
07:26 PM Cloning 2 application files.
07:26 PM Uploading 1 files and blobs.
07:26 PM Uploaded 1 files and blobs
07:26 PM Compilation starting.
07:26 PM Compilation: 1 files left.
07:26 PM Compilation completed.
07:26 PM Starting deployment.
07:26 PM Checking if deployment succeeded.
07:26 PM Deployment successful.
07:26 PM Checking if updated app version is serving.
07:26 PM Completed update of app: application-id, version: 1

The --no_cookies flag stops authentication cookies from being written
to disk, in ~/.appcfg_cookies. We recommend this for security, since no
long-running services need this password, only the update process above
which is run once. However, if this reasoning doesn't apply to you
(e.g. if your fp-registrar-email uses the same account, so that
the password is already on the disk) *and* you find yourself running
update a lot for some reason, then you may at your own risk omit it for
convenience.

Once logged in, you can disable logging for the application. Click
"Logs" on the left panel. Under "Total Logs Storage", click "Change
Settings". Enter "0" in the "days of logs" box and click "Save
Settings".

General links:
https://developers.google.com/appengine/
https://developers.google.com/appengine/docs/whatisgoogleappengine
https://developers.google.com/appengine/docs/go/gettingstarted/
