From 3928147414ffe6903af8d1d4cdad8c2f7fb1dbe6 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Sat, 12 Aug 2017 16:51:48 -0700 Subject: [PATCH] initial setup --- .gitignore | 7 +++++++ app.yaml | 46 +++++++++++++++++++++++++++++++++++++++++++++ appengine_config.py | 20 ++++++++++++++++++++ requirements.txt | 7 +++++++ 4 files changed, 80 insertions(+) create mode 100644 .gitignore create mode 100644 app.yaml create mode 100644 appengine_config.py create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..34f1837 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.coverage +datastore.dat* +/docs/_build/ +/l +/local +private_notes +TAGS diff --git a/app.yaml b/app.yaml new file mode 100644 index 0000000..98b7cbe --- /dev/null +++ b/app.yaml @@ -0,0 +1,46 @@ +# https://cloud.google.com/appengine/docs/standard/python/config/appref + +# application: bridgy-activitypub +runtime: python27 +threadsafe: yes +api_version: 1 +default_expiration: 1h + +builtins: +- remote_api: on + +libraries: +- name: ssl + version: latest +- name: webob + version: latest + +handlers: + +# static +- url: /(static/bootstrap.*\.css) + static_files: local/lib/python2.7/site-packages/oauth_dropins/\1 + upload: local/lib/python2.7/site-packages/oauth_dropins/static/bootstrap.*\.css + +- url: /static + static_dir: static + +- url: /oauth_dropins/static + static_dir: local/lib/python2.7/site-packages/oauth_dropins/static + +- url: / + static_files: static/index.html + upload: static/index.html + +# dynamic +- url: /[^/]+ + script: app.application + secure: always + +skip_files: +- ^(.*/)?.*\.py[co] +- ^(.*/)?.*/RCS/.* +- ^(.*/)?\.git.* +- ^(.*/)?.*\.bak$ +- ^(.*/)?(\.?coverage|debian|docs?|examples?|l|pydocs?|python3|ref|samples?|TAGS|tests?)/.* +- ^local/lib/python2.7/site-packages/setuptools/script\ \(dev\)\.tmpl$ diff --git a/appengine_config.py b/appengine_config.py new file mode 100644 index 0000000..ed6c6ca --- /dev/null +++ b/appengine_config.py @@ -0,0 +1,20 @@ +"""Bridgy App Engine config. +""" +import os + +# Load packages from virtualenv +# https://cloud.google.com/appengine/docs/python/tools/libraries27#vendoring +from google.appengine.ext import vendor +try: + vendor.add('local') +except ValueError as e: + import logging + logging.warning("Couldn't set up App Engine vendor virtualenv! %s", e) + +from granary.appengine_config import * + +# Make requests and urllib3 play nice with App Engine. +# https://github.com/snarfed/bridgy/issues/396 +# http://stackoverflow.com/questions/34574740 +from requests_toolbelt.adapters import appengine +appengine.monkeypatch() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3dd6596 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +granary +mf2py>=1.0.4 +mf2util>=0.5.0 +requests==2.10.0 +requests-toolbelt==0.6.2 +-e git+https://github.com/snarfed/webmention-tools.git#egg=webmentiontools +urllib3>=1.14