microblog 3 posts

Inhji posted

How to setup microblog.pub for development on ubuntu 18.04

First clone the repo:

git clone https://github.com/tsileo/microblog.pub

You need a couple of dependencies, so install those:

# install pyenv and python3.7.5
curl https://pyenv.run | bash
exec $SHELL # reloads the shell
pyenv install 3.7.5

# docker
# follow the instructions at https://docs.docker.com/install/linux/docker-ce/ubuntu/
# then add your user to the docker group
sudo groupadd docker
sudo systemctl restart docker

# docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

In the microblog.pub directory, create and activate the virtual env:

pyenv virtualenv 3.7.5 microblog.pub
pyenv local microblog.pub

Now install the dependencies:

pip3 install wheel
pip3 install -r requirements.txt

create the initial config file me.yml

sudo make config

download static files (css, emojis)

make css

Now you can run create the container and run the flask server:

sudo env POUSSETACHES_AUTH_KEY="<secret-key>" docker-compose -f docker-compose-dev.yml up -d
FLASK_DEBUG=1 MICROBLOGPUB_DEBUG=1 FLASK_APP=app.py POUSSETACHES_AUTH_KEY="<secret-key>" flask run -p 5005 --with-threads

Inhji posted

How to setup microblog.pub for development on ubuntu 18.04

I had to install python3.8 via apt-get

sudo apt install python3.8 python3.8-venv python3.8-dev

Some packages failed to build so I had to install wheel:

pip3 install wheel

I also had to do the post installation steps for running docker as a non-root user, and then log out and back in:

sudo usermod -aG docker $USER

After that, I noticed that docker-compose was not correctly installed, so I reinstalled it (https://blog.csdn.net/clksjx/article/details/102657914)

I will create a proper tutorial for people that don’t have experience with python nor docker. Maybe.

Inhji posted

Remote Boosting throws 500 Error

When I click on a profile from within my stream and that person is on a mastodon instance, I have the options to remote boost from there.
I put in my handle (@inhji@m.inhji.de) and I get redirected to this page:

../authorize_follow?profile=https%3A%2F%2Fmastodon.social%2Fusers%2Fdansup%2Fstatuses %2F101775908584104648

With this message:

You’re about to follow https://mastodon.social/users/dansup/statuses/101775908584104648

If I click follow, the 500 happens. Here is the stacktrace:

  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/app/core/shared.py", line 121, in decorated_function
    return f(*args, **kwargs)
  File "/app/blueprints/admin.py", line 644, in authorize_follow
    abort(500)
  File "/usr/local/lib/python3.7/site-packages/werkzeug/exceptions.py", line 772, in abort
    return _aborter(status, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/werkzeug/exceptions.py", line 753, in __call__
    raise self.mapping[code](*args, **kwargs)

This shows up in the container logs (i guess it’s related):

web_1           | requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://mastodon.social/.well-known/webfinger?resource=https%3A%2F%2Fmastodon.social%2Fusers%2Fdansup%2Fstatuses%2F101775908584104648
web_1           | [2019-11-26 08:32:34 +0000] [38] [DEBUG] check_url http://mastodon.social/.well-known/webfinger debug=False
web_1           | [2019-11-26 08:32:34 +0000] [38] [DEBUG] Starting new HTTP connection (1): mastodon.social:80
web_1           | [2019-11-26 08:32:34 +0000] [38] [DEBUG] http://mastodon.social:80 "GET /.well-known/webfinger?resource=https%3A%2F%2Fmastodon.social%2Fusers%2Fdansup%2Fstatuses%2F101775908584104648 HTTP/1.1" 301 169
web_1           | [2019-11-26 08:32:34 +0000] [38] [DEBUG] Starting new HTTPS connection (1): mastodon.social:443
web_1           | [2019-11-26 08:32:34 +0000] [38] [DEBUG] https://mastodon.social:443 "GET /.well-known/webfinger?resource=https%3A%2F%2Fmastodon.social%2Fusers%2Fdansup%2Fstatuses%2F101775908584104648 HTTP/1.1" 404 None
web_1           | [2019-11-26 08:32:34 +0000] [38] [ERROR] HTTP error