2019-11-09 Epicyon needs Python 3.6 which needs a Debian upgrade

I’ve tried to install Epicyon on my server but I’m running into a Python problem. I think I have everything set up correctly (my notes below) but I’m getting a syntax error in `webfinger.py`:

python3 webfinger.py
  File "webfinger.py", line 81
    return f"data:application/magic-public-key,RSA.{mod}.{pubexp}"

SyntaxError: invalid syntax

I’m using Debian stable (9.11) on my server which means I have Python 3.5.3 installed. f-strings joined Python in 3.6, apparently.

So... Upgrade my server? Make Epicyon work with Python 3.5? Postpone the entire thing?

Upgrade my server

I don’t know...

Epicyon

I was more or less following the official installation instructions.

the official installation instructions

Some decisions:

Install the code as root:

apt-get -y install tor python3-pip python3-socks imagemagick python3-numpy python3-setuptools python3-crypto python3-dateutil python3-pil.imagetk
pip3 install commentjson beautifulsoup4 pycryptodome
adduser --system --home=/home/epicyon --group epicyon
cd /home
git clone https://gitlab.com/bashrc2/epicyon
cd epicyon
./theme purple
chown -R epicyon:epicyon /home/epicyon

Create the demon by creating the file `/etc/systemd/system/epicyon.service` as follows:

[Unit]
Description=epicyon
After=syslog.target
After=network.target

[Service]
Type=simple
User=epicyon
Group=epicyon
WorkingDirectory=/home/epicyon
ExecStart=/usr/bin/python3 /home/epicyon/epicyon.py --port 443 --proxy 7156 --domain fedi.alexschroeder.ch --registration open --debug
Environment=USER=epicyon
Restart=always
StandardError=syslog
CPUQuota=30%

[Install]
WantedBy=multi-user.target

Activate the demon:

systemctl enable epicyon
systemctl start epicyon

Check how it is doing:

journalctl -u epicyon

On my first attempt I had forgotten to install the Python modules using pip3 and saw the error messages in the journal alerting me to the fact.

As for the website, I’m using Apache. I’m on my own, now. I edited `/etc/apache2/sites-enabled/100-alexschroeder.ch.conf` because that’s where my site is configured and added the following:

I’m basically trusting my remaining SSL and security settings.

Here’s what I added to the site configuration:

<VirtualHost *:80>
    ServerName fedi.alexschroeder.ch
    Redirect permanent / https://fedi.alexschroeder.ch/
</VirtualHost>
<VirtualHost *:443>
    ServerName fedi.alexschroeder.ch
    SSLEngine on
    SSLCertificateFile      /var/lib/dehydrated/certs/alexschroeder.ch/cert.pem
    SSLCertificateKeyFile   /var/lib/dehydrated/certs/alexschroeder.ch/privkey.pem
    SSLCertificateChainFile /var/lib/dehydrated/certs/alexschroeder.ch/chain.pem
    SSLVerifyClient None
    ProxyPass /             http://alexschroeder.ch:7156/
</VirtualHost>

Next I had to tell my domain name service provider (Gandi) about the new subdomain. In the DNS zone file, I had to add a line for IPv4 and IPv6:

fedi 10800 IN A 178.209.50.237
fedi 10800 IN AAAA 2a02:418:6a04:178:209:50:237:1

Then I had to tell `dehydrated` about the new subdomain by editing `/etc/dehydrated/domains.txt` and changing the line for my site to:

alexschroeder.ch www.alexschroeder.ch fedi.alexschroeder.ch

With that, I was ready to regenerate the certificates (still doing everything as root). The version of `dehydrated` in Debian isn’t working for me so I have to use a copy of the master branch I checked out.

/home/alex/src/dehydrated/dehydrated -c

And now I should be ready!

Or is it? I’m getting an error! `journalctl -u epicyon` shows the following:

Nov 09 14:56:01 sibirocobombus python3[27300]: Traceback (most recent call last):
Nov 09 14:56:01 sibirocobombus python3[27300]:   File "/home/epicyon/epicyon.py", line 9, in <module>
Nov 09 14:56:01 sibirocobombus python3[27300]:     from person import createPerson
Nov 09 14:56:01 sibirocobombus python3[27300]:   File "/home/epicyon/person.py", line 19, in <module>
Nov 09 14:56:01 sibirocobombus python3[27300]:     from webfinger import createWebfingerEndpoint
Nov 09 14:56:01 sibirocobombus python3[27300]:   File "/home/epicyon/webfinger.py", line 81
Nov 09 14:56:01 sibirocobombus python3[27300]:     return f"data:application/magic-public-key,RSA.{mod}.{pubexp}"
Nov 09 14:56:01 sibirocobombus python3[27300]:                                                                  ^
Nov 09 14:56:01 sibirocobombus python3[27300]: SyntaxError: invalid syntax

​#Epicyon ​#Mastodon ​#Social Media ​#Administration

Comments

(Please contact me if you want to remove your comment.)

I decided to stop Epicyon for now. It was basically using up all the CPU resources I had granted it via systemd. With no actual activity, I find that unacceptable.

Load goes up

Sometime between November 10 and 11 I managed to get it up and running and load goes up, and stays up.

– Alex Schroeder 2019-11-14 21:30 UTC

---

A lot of back and forth on this issue. Increase the CPU quota? Work on debugging this? What’s the problem?

on this issue

Or should I just try Pleroma instead?

– Alex Schroeder 2019-11-16 22:09

---

I think I’ll give Pleroma a try...

systemctl stop epicyon
systemctl disable epicyon
apt remove tor python3-socks python3-numpy python3-setuptools \
  python3-crypto python3-dateutil python3-pil.imagetk

– Alex Schroeder 2019-11-17 11:09