Giter VIP home page Giter VIP logo

pubgate's Introduction

python_version

Asyncronous Lightweight ActivityPub API / CMS

Implements both the client-to-server(C2S) API and the federated server-to-server(S2S) API.

  • S2S compatible with Mastodon, Pixelfed, Pleroma and microblog.pub

Can do create / delete / un-/follow users / share / like / undo

The idea is to develop PubGate as CMS, which could be used same as WordPress - easy install on cheap hosting with customization by installing plugins and choosing themes. As far as it based on asynchronous python framework, which provides non-blocking delivery of AP objects to other instances, it supposed to be light and fast.

Support extensions (collects blueprints and tasks):

API documentation

Overview swagger docs example

More details at Postman documenter or download latest Postman collection

Deploy

Docker

Install Docker + Docker Compose

Shell

git clone https://github.com/autogestion/pubgate.git
cp -r config/extensions_sample_conf.cfg config/conf.cfg
Check/Edit config/conf.cfg to change setup of your instance

(registration status, title and description for UI App)

Then, instance could be started

domain=put-your-domain-here.com docker-compose up -d

This will install PubGate with extensions (marked * in list ). For custom configuration edit requirements/extensions.txt and config/conf.cfg . To install federator without extensions, empty requirements/extensions.txt and use config/base_sample_conf.cfg

Manual deploy on Android device

Guide from @traumschule

Could be used for manual install on Ubuntu/Debian as well

Install dory mongodb server and termux

In termux:

pkg install git python make
git clone https://github.com/autogestion/pubgate
pip install -r requirements/base.txt
pip install -r requirements/extensions.txt
cp config/extensions_sample_conf.cfg config/conf.cfg

edit config/conf.cfg and change example.com to ip address and https to http (for dev instance)

python run_api.py

Tests

python -m pytest tests/

pubgate's People

Contributors

arthurlutz avatar autogestion avatar undeadbeast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pubgate's Issues

Is it a miminmal activitypub backend / server?

Is it a minimal activitypub backend / server for api driven usage?
Are examples available?

Is it possible to add mysql database "driver" to switch db backend?
I'm not experienced with mongo / postgres and prefer mysql ;)

Domain based (virtual) users

I like the flexibility of pubgate server backend with api and would like to know if it is still active maintaned?

Would nee features possible?
Multi domain support with virtual users?
One user (login) could dependent on domain name have a (virtual) username dir example used Blog with author Name?

AttributeError: 'ParsedRequirement' object has no attribute 'req'

Python/pip get worse every day.

Yesterday i successfully installed this backend including all extensions on Android in termux (pip 19.2.3, python 3.8.3). Today on debian testing with pip 20.1.1 and , python 3.8.3 it fails:

$ pip install -r requirements/extensions.txt 
Collecting git+https://github.com/autogestion/pubgate-rssbot.git (from -r requirements/extensions.txt (line 3))
  Cloning https://github.com/autogestion/pubgate-rssbot.git to /tmp/pip-req-build-co_ffahe
  Running command git clone -q https://github.com/autogestion/pubgate-rssbot.git /tmp/pip-req-build-co_ffahe
    ERROR: Command errored out with exit status 1:
     command: /path/to/pubgate/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-co_ffahe/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-co_ffahe/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-poqf5jpx
         cwd: /tmp/pip-req-build-co_ffahe/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-co_ffahe/setup.py", line 24, in <module>
        install_requires=[str(x.req) for x in requirements],
      File "/tmp/pip-req-build-co_ffahe/setup.py", line 24, in <listcomp>
        install_requires=[str(x.req) for x in requirements],
    AttributeError: 'ParsedRequirement' object has no attribute 'req'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

After commenting git+https://github.com/autogestion/pubgate-rssbot.git on line 2 of requirements/extensions.txt:

$ pip install -r requirements/extensions.txt 
Collecting git+https://github.com/autogestion/pubgate-philip.git (from -r requirements/extensions.txt (line 4))
  Cloning https://github.com/autogestion/pubgate-philip.git to /tmp/pip-req-build-no_xb9of
  Running command git clone -q https://github.com/autogestion/pubgate-philip.git /tmp/pip-req-build-no_xb9of
    ERROR: Command errored out with exit status 1:
     command: /path/to/pubgate/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-no_xb9of/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-no_xb9of/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-mmc_u3f1
         cwd: /tmp/pip-req-build-no_xb9of/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-no_xb9of/setup.py", line 23, in <module>
        install_requires=[str(x.req) for x in requirements],
      File "/tmp/pip-req-build-no_xb9of/setup.py", line 23, in <listcomp>
        install_requires=[str(x.req) for x in requirements],
    AttributeError: 'ParsedRequirement' object has no attribute 'req'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Reason
pip changed its internals again.

pip 20.1 introduces some breaking changes. Instead of using InstallRequirement class with req property (until pip==20.0.2), it now uses creates a ParsedRequirement object with requirement as underlying property.

Workaround:
pip==20.0.2

Solution:

try:
    requirements = [str(ir.req) for ir in install_reqs]
except:
    requirements = [str(ir.requirement) for ir in install_reqs]

better:

Self-governing pod, based on stellar token

The idea is that when deploying, pod will programmatically create issuing and distribution account, emit limited number of tokens (and lock issuing account after it), and put tokens for sale. Then participants buys that tokens, creates accounts on pod and add their stellar public keys to profiles. After it, any user could initiate governing issue, like assigning pod moderators, or initiate payment (for example for hosting) from distribution account, and all participants will be able to vote. Pod will fetch participant's balances from horizon, and the vote weight will be equal to number of pod tokens at participant’s stellar wallet.

The questions are, how to verify that certain user is owner of stellar wallet, as he mentioned in profile. And how to avoid issue, that server admin could launch deployment process once again, and switch pod governing to newly generated token

Usage examples register user or generate an user invite

Hi,
I searching for a blog with the feature to be followed by mastodon and other activitypub systems. pubgate sounds like a headless cms with an api to create posts?

Looks like all the needed requests to use the api are documented here: https://documenter.getpostman.com/view/4625755/RzZCFdXv#3f32ece1-76a5-39ae-fb19-173a0a864cf1

I would like to use pubgate as headless cms, but have problems to start with it... How can I

  1. create an admin user?
  2. register (and validate! e-mail verification?) a new user?
  3. create an invite?

I know that would be stupid questions, but before I used php cms / cmf which have server side ways to validate. I'm new with headless cms and do all the work with an rest api (in a secure way).

pubgate-philip

Not really an issue, just didn't find another way to contact you: I've noticed that you forked my personal website to use as a basis for an ActivityPub-based blogging engine.

That's really cool 😁

Just wanted to give you a quick heads up in regards to the less-than-optimal dependency situation: markdown as well as rfeed are currently personal forks of these projects. With rfeed that isn't too much of an issue, as it is basically unmaintained, but markdown will start trailing behind upstream at some point.
The codebase currently isn't all that well documented, so if you get stuck on something feel free to reach out 😉

Oh and by the way: You don't have to name the extension after me 😅

With kind regards,
Philip Trauner

Dissenter plug

Analog of Gab's Dissenter plugin, with comments, published as activitypub posts, and their ids stored in DHT, which is distributed among PubGate servers. User could log into browser extension with account on pubgate server, extension will fetch comments to the visited page from that server, and could send new comment back to user's server

Use cjdns ids for user identification

what if use cjdns address as primary id for nomadicidentity . activitypub nodes could be interconnected via hyperboria, and handle user's interaction using their cjdns address. If chosen instance dies, user can just join another, without losing his social network. Node's domain will just expose user's content to www

ActivtityPub client

If you know any app, js or mobile, that could interact with server using activitypub client-to-server specification (excluding apps which could only utilize Mastodon API), please provide a link in comments

Fix asyncio.base_futures.InvalidStateError: invalid state

Occurs when there are to many queries to MongoDB when trying to build cache for ~100 elements in a row
Marked as TODO in pubgate/db/cached.py

Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 70, in uvloop.loop.Handle._run
  File "/.../p2/lib/python3.7/site-packages/motor/core.py", line 1542, in _on_started
    len(self.delegate._CommandCursor__data))
asyncio.base_futures.InvalidStateError: invalid state

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.