Skip to content
Permalink
Browse files
install the appengine files as data files in $(pkgdatadir)
  • Loading branch information
Ximin Luo committed Sep 13, 2013
1 parent fc251f7 commit aafd15b8927e0d7519152d3e88f655b571037f04
Showing with 15 additions and 6 deletions.
  1. +2 −0 facilitator/Makefile.am
  2. +2 −2 facilitator/appengine/README
  3. +2 −1 facilitator/appengine/app.yaml
  4. +5 −0 facilitator/appengine/config.go
  5. +4 −3 facilitator/appengine/fp-reg.go
@@ -3,6 +3,7 @@
fpfacilitatoruser = @fpfacilitatoruser@
initscriptdir = $(sysconfdir)/init.d
exampledir = $(docdir)/examples
appenginedir = $(pkgdatadir)/appengine

# automake PLVs

@@ -11,6 +12,7 @@ initscript_SCRIPTS = init.d/facilitator init.d/facilitator-email-poller init.d/f

dist_doc_DATA = doc/appengine-howto.txt doc/facilitator-howto.txt doc/gmail-howto.txt README
dist_example_DATA = conf/fp-facilitator
dist_appengine_DATA = appengine/app.yaml appengine/config.go appengine/fp-reg.go appengine/README

dist_TESTS = facilitator-test

@@ -4,8 +4,8 @@ This is the server-side code that runs on Google App Engine for the
See doc/appengine-howto.txt for information about setting up an
application.

To run with the development server:
To run locally using the development server:
$ ~/google_appengine/dev_appserver.py appengine/

To upload a new version:
$ torify ~/google_appengine/appcfg.py update appengine/
$ torify ~/google_appengine/appcfg.py -A $YOUR_APP_ID update appengine/
@@ -1,4 +1,5 @@
application: fp-reg-a
# override this with appcfg.py -A $YOUR_APP_ID
application: facilitator-registration-example
version: 1
runtime: go
api_version: go1
@@ -0,0 +1,5 @@
package fp_reg

// host[:port] of the facilitator you want to register with
// for example, fp-facilitator.org
const FP_FACILITATOR = ""
@@ -10,8 +10,6 @@ import (
"appengine/urlfetch"
)

const BASE = "https://fp-facilitator.org/reg/"

func robotsTxtHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.Write([]byte("User-agent: *\nDisallow:\n"))
@@ -33,7 +31,7 @@ func regHandler(w http.ResponseWriter, r *http.Request) {
return
}
client := urlfetch.Client(appengine.NewContext(r))
resp, err := client.Get(BASE + blob)
resp, err := client.Get("https://" + FP_FACILITATOR + "/reg/" + blob)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
@@ -51,4 +49,7 @@ func init() {
http.HandleFunc("/robots.txt", robotsTxtHandler)
http.HandleFunc("/ip", ipHandler)
http.HandleFunc("/reg/", regHandler)
if FP_FACILITATOR == "" {
panic("FP_FACILITATOR empty; did you forget to edit config.go?")
}
}

0 comments on commit aafd15b

Please sign in to comment.