Skip to content

Commit

Permalink
bug fixes and tweaks for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Sep 27, 2021
1 parent 19194b5 commit 976b512
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
35 changes: 30 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Then, create a Python 3 virtualenv and install the dependencies with:
python3 -m venv local
source local/bin/activate
pip install -r requirements.txt
ln -s local/lib/python3*/site-packages/oauth_dropins # needed to serve static file assets in dev_appserver
# needed to serve static file assets in dev_appserver
ln -s local/lib/python3*/site-packages/oauth_dropins/static oauth_dropins_static
gcloud config set project brid-gy
Now, you can fire up the gcloud emulator and run the tests:
Expand Down Expand Up @@ -68,7 +69,7 @@ To run the entire app locally, run this in the repo root directory:

dev_appserver.py --log_level debug --enable_host_checking false \
--support_datastore_emulator --datastore_emulator_port=8089 \
--application=brid-gy ~/src/bridgy/app.yaml ~/src/bridgy/background.yaml
--application=brid-gy ./app.yaml ./background.yaml

(Note: dev_appserver.py is incompatible with python3. if python3 is your
default python, you can run
Expand Down Expand Up @@ -110,11 +111,17 @@ them in “source” mode with:

pip uninstall -y oauth-dropins
pip install -e <path-to-oauth-dropins-repo>
ln -sf <path-to-oauth-dropins-repo>/oauth_dropins # needed to serve static file assets in dev_appserver
ln -sf <path-to-oauth-dropins-repo>/oauth_dropins/static oauth_dropins_static

pip uninstall -y granary
pip install -e <path to granary>

To use dev_appserver with local granary and oauth-dropins, you’ll need
to either replace their GitHub lines in ``requirements.txt`` with
``-e <path-to-local-repo>``, or `apply this patch to dev_appserver.py to
make it use your virtualenv in
place <https://issuetracker.google.com/issues/144150446>`__.

To deploy to App Engine, run
`scripts/deploy.sh <https://github.com/snarfed/bridgy/blob/master/scripts/deploy.sh>`__.

Expand Down Expand Up @@ -157,6 +164,24 @@ tabs <https://github.com/mozilla/contain-facebook>`__ add-on. If you
have that enabled, you’ll need to disable it to use Bridgy’s browser
extension.

Extension logs in the JavaScript console
----------------------------------------

If you’re working on the browser extension, or `you’re sending in a bug
report for it, <https://github.com/snarfed/bridgy/issues>`__, its
JavaScript console logs are invaluable for debugging. Here’s how to get
them in Firefox:

Thanks for trying! And for offering to send logs, those would definitely
be helpful. Here’s how to get them: 1. Open ``about:debugging`` 2. Click
*This Firefox* on the left 3. Scroll down to Bridgy 4. Click *Inspect*
5. Click on the *Console* tab

Here’s how to send them in with a bug report: 1. Right click, *Export
Visible Messages To*, *File*, save the file. 2. Email the file to bridgy
@ ryanb.org. *Do not* post or attach it to a GitHub issue, or anywhere
else public, because it contains sensitive tokens and cookies.

Adding a new silo
-----------------

Expand Down Expand Up @@ -284,7 +309,7 @@ dataset <https://console.cloud.google.com/bigquery?p=brid-gy&d=datastore&page=da

::

gcloud datastore export --async gs://brid-gy.appspot.com/stats/ --kinds Blogger,BlogPost,BlogWebmention,Facebook,FacebookPage,Flickr,GitHub,GooglePlusPage,Instagram,Mastodon,Medium,Meetup,Publish,PublishedPage,Reddit,Response,SyndicatedPost,Tumblr,Twitter,WordPress
gcloud datastore export --async gs://brid-gy.appspot.com/stats/ --kinds Activity, Blogger,BlogPost,BlogWebmention,Facebook,FacebookPage,Flickr,GitHub,GooglePlusPage,Instagram,Mastodon,Medium,Meetup,Publish,PublishedPage,Reddit,Response,SyndicatedPost,Tumblr,Twitter,WordPress

Note that ``--kinds`` is required. `From the export
docs <https://cloud.google.com/datastore/docs/export-import-entities#limitations>`__,
Expand All @@ -299,7 +324,7 @@ dataset <https://console.cloud.google.com/bigquery?p=brid-gy&d=datastore&page=da

::

for kind in BlogPost BlogWebmention Publish Response SyndicatedPost; do
for kind in Activity BlogPost BlogWebmention Publish Response SyndicatedPost; do
bq load --replace --nosync --source_format=DATASTORE_BACKUP datastore.$kind gs://brid-gy.appspot.com/stats/all_namespaces/kind_$kind/all_namespaces_kind_$kind.export_metadata
done

Expand Down
30 changes: 27 additions & 3 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Reference documentation.
.. toctree::
modules

app
---
.. automodule:: app
admin
-----
.. automodule:: admin

blog_webmention
---------------
Expand All @@ -18,18 +18,34 @@ blogger
-------
.. automodule:: blogger

browser
-------
.. automodule:: browser

cron
----
.. automodule:: cron

facebook
--------
.. automodule:: facebook

flickr
------
.. automodule:: flickr

github
------
.. automodule:: github

handlers
--------
.. automodule:: handlers

indieauth
---------
.. automodule:: indieauth

instagram
---------
.. automodule:: instagram
Expand All @@ -54,10 +70,18 @@ original_post_discovery
-----------------------
.. automodule:: original_post_discovery

pages
-----
.. automodule:: pages

publish
-------
.. automodule:: publish

reddit
------
.. automodule:: reddit

superfeedr
----------
.. automodule:: superfeedr
Expand Down
3 changes: 2 additions & 1 deletion flask_app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Bridgy user-facing views: front page, user pages, and delete POSTs.
"""
from pathlib import Path
import string

from flask import Flask
Expand All @@ -16,7 +17,7 @@
# Flask app
app = Flask('default')
app.template_folder = './templates'
app.config.from_pyfile('config.py')
app.config.from_pyfile(Path(__file__).parent / 'config.py')
app.url_map.converters['regex'] = flask_util.RegexConverter
app.after_request(flask_util.default_modern_headers)
app.register_error_handler(Exception, flask_util.handle_exception)
Expand Down

0 comments on commit 976b512

Please sign in to comment.