kopia lustrzana https://github.com/snarfed/bridgy-fed
switch from gcloud datastore emulator to firestore emulator
...since the datastore emulator evidently doesn't support != query filters: https://github.com/googleapis/python-ndb/issues/962pull/965/head
rodzic
393605bde9
commit
f02ba80304
|
@ -22,7 +22,7 @@ jobs:
|
|||
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
|
||||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y apt-transport-https ca-certificates gnupg google-cloud-sdk google-cloud-sdk-datastore-emulator default-jre
|
||||
sudo apt-get install -y apt-transport-https ca-certificates gnupg google-cloud-sdk google-cloud-cli-firestore-emulator default-jre
|
||||
|
||||
- run:
|
||||
name: Python dependencies
|
||||
|
@ -40,7 +40,7 @@ jobs:
|
|||
- run:
|
||||
name: Build and test
|
||||
command: |
|
||||
CLOUDSDK_CORE_PROJECT=bridgy-federated gcloud beta emulators datastore start --no-store-on-disk --use-firestore-in-datastore-mode --host-port=localhost:8089 < /dev/null >& /dev/null &
|
||||
CLOUDSDK_CORE_PROJECT=brid-gy gcloud emulators firestore start --host-port=:8089 --database-mode=datastore-mode < /dev/null >& /tmp/firestore-emulator.log &
|
||||
sleep 5s
|
||||
python -m coverage run --source=. --omit=appengine_config.py,logs.py,tests/\* -m unittest discover -v
|
||||
python -m coverage html -d /tmp/coverage_html
|
||||
|
|
|
@ -12,7 +12,8 @@ Development
|
|||
---
|
||||
Development reference docs are at [bridgy-fed.readthedocs.io](https://bridgy-fed.readthedocs.io/). Pull requests are welcome! Feel free to [ping me in #indieweb-dev](https://indieweb.org/discuss) with any questions.
|
||||
|
||||
First, fork and clone this repo. Then, install the [Google Cloud SDK](https://cloud.google.com/sdk/) and run `gcloud components install beta cloud-datastore-emulator` to install the [datastore emulator](https://cloud.google.com/datastore/docs/tools/datastore-emulator). Once you have them, set up your environment by running these commands in the repo root directory:
|
||||
First, fork and clone this repo. Then, install the [Google Cloud SDK](https://cloud.google.com/sdk/) and run `gcloud components install cloud-firestore-emulator` to install the [Firestore emulator](https://cloud.google.com/firestore/docs/emulator). Once you have them, set up your environment by running these commands in the repo root directory:
|
||||
|
||||
|
||||
```sh
|
||||
gcloud config set project bridgy-federated
|
||||
|
@ -24,7 +25,7 @@ pip install -r requirements.txt
|
|||
Now, run the tests to check that everything is set up ok:
|
||||
|
||||
```shell
|
||||
gcloud beta emulators datastore start --use-firestore-in-datastore-mode --no-store-on-disk --host-port=localhost:8089 --quiet < /dev/null >& /dev/null &
|
||||
gcloud emulators firestore start --host-port=:8089 --database-mode=datastore-mode < /dev/null >& /dev/null &
|
||||
python3 -m unittest discover
|
||||
```
|
||||
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
Bridgy Fed developer documentation
|
||||
----------------------------------
|
||||
|
||||
Bridgy Fed connects your web site to
|
||||
`Mastodon <https://joinmastodon.org>`__ and the
|
||||
`fediverse <https://en.wikipedia.org/wiki/Fediverse>`__ via
|
||||
`ActivityPub <https://activitypub.rocks/>`__,
|
||||
`webmentions <https://webmention.net/>`__, and
|
||||
`microformats2 <https://microformats.org/wiki/microformats2>`__. Your
|
||||
site gets its own fediverse profile, posts and avatar and header and
|
||||
all. Bridgy Fed translates likes, reposts, mentions, follows, and more
|
||||
back and forth. `See the user docs <https://fed.brid.gy/docs>`__ and
|
||||
`developer docs <https://bridgy-fed.readthedocs.io/>`__ for more
|
||||
details.
|
||||
Bridgy Fed connects different decentralized social network protocols. It
|
||||
currently supports the
|
||||
`fediverse <https://en.wikipedia.org/wiki/Fediverse>`__ (eg
|
||||
`Mastodon <https://joinmastodon.org>`__) via
|
||||
`ActivityPub <https://activitypub.rocks/>`__, and the
|
||||
`IndieWeb <https://indieweb.org/>`__ via
|
||||
`webmentions <https://webmention.net/>`__ and
|
||||
`microformats2 <https://microformats.org/wiki/microformats2>`__.
|
||||
`Bluesky/AT
|
||||
Protocol <https://github.com/snarfed/bridgy-fed/issues/381>`__ and
|
||||
`Nostr <https://github.com/snarfed/bridgy-fed/issues/446>`__ are planned
|
||||
for 2024. Bridgy Fed translates profiles, likes, reposts, mentions,
|
||||
follows, and more from any supported network to any other. `See the user
|
||||
docs <https://fed.brid.gy/docs>`__ and `developer
|
||||
docs <https://bridgy-fed.readthedocs.io/>`__ for more details.
|
||||
|
||||
https://fed.brid.gy/
|
||||
|
||||
Also see the
|
||||
`original <https://snarfed.org/indieweb-activitypub-bridge>`__
|
||||
`design <https://snarfed.org/indieweb-ostatus-bridge>`__ blog posts.
|
||||
|
||||
License: This project is placed in the public domain.
|
||||
License: This project is placed in the public domain. You may also use
|
||||
it under the `CC0
|
||||
License <https://creativecommons.org/publicdomain/zero/1.0/>`__.
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
@ -31,11 +33,11 @@ requests are welcome! Feel free to `ping me in
|
|||
|
||||
First, fork and clone this repo. Then, install the `Google Cloud
|
||||
SDK <https://cloud.google.com/sdk/>`__ and run
|
||||
``gcloud components install beta cloud-datastore-emulator`` to install
|
||||
the `datastore
|
||||
emulator <https://cloud.google.com/datastore/docs/tools/datastore-emulator>`__.
|
||||
Once you have them, set up your environment by running these commands in
|
||||
the repo root directory:
|
||||
``gcloud components install cloud-firestore-emulator`` to install the
|
||||
`Firestore
|
||||
emulator <https://cloud.google.com/firestore/docs/emulator>`__. Once you
|
||||
have them, set up your environment by running these commands in the repo
|
||||
root directory:
|
||||
|
||||
.. code:: sh
|
||||
|
||||
|
@ -48,7 +50,7 @@ Now, run the tests to check that everything is set up ok:
|
|||
|
||||
.. code:: shell
|
||||
|
||||
gcloud beta emulators datastore start --use-firestore-in-datastore-mode --no-store-on-disk --host-port=localhost:8089 --quiet < /dev/null >& /dev/null &
|
||||
gcloud emulators firestore start --host-port=:8089 --database-mode=datastore-mode < /dev/null >& /dev/null &
|
||||
python3 -m unittest discover
|
||||
|
||||
Finally, run this in the repo root directory to start the web app
|
||||
|
@ -112,8 +114,9 @@ How to add a new protocol
|
|||
5. TODO: add a new usage section to the docs for the new protocol.
|
||||
6. TODO: does the new protocol need any new UI or signup functionality?
|
||||
Unusual, but not impossible. Add that if necessary.
|
||||
7. Add the new protocol’s logo to ``static/``, use it in
|
||||
`templates/user.html <https://github.com/snarfed/bridgy-fed/blob/main/templates/user.html>`__.
|
||||
7. Protocol logos may be emoji or image files. If this one is a file,
|
||||
add it ``static/``. Then add the emoji or file ``<img>`` tag in the
|
||||
``Protocol`` subclass’s ``LOGO_HTML`` constant.
|
||||
|
||||
Stats
|
||||
-----
|
||||
|
|
|
@ -1180,7 +1180,7 @@ class Follower(ndb.Model):
|
|||
query = Follower.query(
|
||||
Follower.status == 'active',
|
||||
filter_prop == user.key,
|
||||
).order(-Follower.updated)
|
||||
)
|
||||
|
||||
followers, before, after = fetch_page(query, Follower, by=Follower.updated)
|
||||
users = ndb.get_multi(f.from_ if collection == 'followers' else f.to
|
||||
|
|
|
@ -1649,7 +1649,7 @@ class ActivityPubTest(TestCase):
|
|||
def test_following_collection_page(self, *_):
|
||||
self.store_following()
|
||||
after = datetime(1900, 1, 1).isoformat()
|
||||
prev = Follower.query(Follower.to == ActivityPub(id='http://baz').key,
|
||||
prev = Follower.query(Follower.to == ActivityPub(id='http://bar').key,
|
||||
Follower.from_ == self.user.key,
|
||||
).get().updated.isoformat()
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue