123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- #!/bin/sh
- export FORGEFED_HOSTNAME='c7fcb87a.ngrok.io'
- gunicorn --workers 2 --threads 2 --reload forgefed_wsgi:application
- read -r -d '' DB_OBJ <<-'DBOBJ'
- {
- '_tables':
- {
- 'activities':
- [
- {
- '@context' : 'https://www.w3.org/ns/activitystreams' ,
- 'attributedTo' : 'alice@example.net' ,
- 'cc' : [ 'alice@example.net/followers' ] ,
- 'content' : '<p>Hello Note</p>' ,
- 'id' : '12a8a47295735f7e' ,
- 'published' : '2019-03-08T21:09:14Z' ,
- 'sensitive' : False ,
- 'source' : { 'mediaType' : 'text/plain', 'content': 'Hello Note' } ,
- 'tag' : [] ,
- 'to' : [ 'bob@example.net' ] ,
- 'type' : 'Note' ,
- 'url' : 'https://example.net:5000/alice@example.net/note/12a8a47295735f7e' ,
- '_id' : ObjectId('5c8300f946d13f16edc1c77a')
- }
- ] ,
- 'actors':
- [
- {
- '@context' : 'https://www.w3.org/ns/activitystreams' ,
- 'endpoints' : {} ,
- 'followers' : 'alice@example.net/followers' ,
- 'following' : 'alice@example.net/following' ,
- 'id' : 'alice@example.net' ,
- 'inbox' : 'alice@example.net/inbox' ,
- 'liked' : 'alice@example.net/liked' ,
- 'likes' : 'alice@example.net/likes' ,
- 'outbox' : 'alice@example.net/outbox' ,
- 'type' : 'Person' ,
- 'url' : 'https://example.net:5000/alice@example.net' ,
- '_id' : ObjectId('5c8300f946d13f16edc1c779')
- }
- {
- '@context' : 'https://www.w3.org/ns/activitystreams' ,
- 'endpoints' : {} ,
- 'followers' : 'bob@example.net/followers' ,
- 'following' : 'bob@example.net/following' ,
- 'id' : 'bob@example.net' ,
- 'inbox' : 'bob@example.net/inbox' ,
- 'liked' : 'bob@example.net/liked' ,
- 'likes' : 'bob@example.net/likes' ,
- 'outbox' : 'bob@example.net/outbox' ,
- 'type' : 'Person' ,
- 'url' : 'https://example.net:5000/bob@example.net' ,
- '_id' : ObjectId('5c8300f946d13f16edc1c77a')
- }
- ]
- }
- }
- DBOBJ
- read -r -d '' REQ_ENV <<-'REQENV'
- env =>{ 'wsgi.errors': <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f2f9a283ac8>,
- 'wsgi.version': (1,
- 0),
- 'wsgi.multithread': False,
- 'wsgi.multiprocess': False,
- 'wsgi.run_once': False,
- 'wsgi.file_wrapper': <class 'gunicorn.http.wsgi.FileWrapper'>,
- 'SERVER_SOFTWARE': 'gunicorn/19.9.0',
- 'wsgi.input': <gunicorn.http.body.Body object at 0x7f2f98aa82e8>,
- 'gunicorn.socket': <socket.socket fd=9,
- family=AddressFamily.AF_INET,
- type=SocketKind.SOCK_STREAM,
- proto=0,
- laddr=('127.0.0.1',
- 8000),
- raddr=('127.0.0.1',
- 43436)>,
- 'REQUEST_METHOD': 'GET',
- 'QUERY_STRING': '',
- 'RAW_URI': '/inbox',
- 'SERVER_PROTOCOL': 'HTTP/1.1',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Iceape/2.49.4',
- 'HTTP_ACCEPT': 'text/html,
- application/xhtml+xml,
- application/xml;q=0.9,
- */*;q=0.8',
- 'HTTP_ACCEPT_LANGUAGE': 'en-US,
- en;q=0.5',
- 'HTTP_ACCEPT_ENCODING': 'gzip,
- deflate',
- 'HTTP_DNT': '1',
- 'HTTP_CONNECTION': 'keep-alive',
- 'HTTP_UPGRADE_INSECURE_REQUESTS': '1',
- 'HTTP_CACHE_CONTROL': 'max-age=0',
- 'wsgi.url_scheme': 'http',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REMOTE_PORT': '43436',
- 'SERVER_NAME': '127.0.0.1',
- 'SERVER_PORT': '8000',
- 'PATH_INFO': '/inbox',
- 'SCRIPT_NAME': '' }
- REQENV
|