I found a Python-based ActivityPub server, Epicyon (Epicyon ActivityPub server), that is easy to setup on a fresh server. However configuring it to run on an existing domain managed by HestiaCP will require some in-depth fiddling and troubleshooting.
I want to modify the Epicyon install instructions to make a scripted package that will work with HestiaCP. Upon success I would like to maintain a public repo so that others can just do a git clone and run a script, so they will not need to repeat all the rigamarole and troubleshooting.
My limited knowledge of HestiaCP internals puts me at a disadvantage so I would like pointers and thoughts from those who are experienced with HestiaCP.
Here is my HestiaCP setup scenario and the one for which I am targeting a solution:
The panel is managing several domains including the DNS for domains.
The panel is installed with the default settings.
Using Hestia interface I have created a user and a domain for Epicyon.
The domain works and is accessible from the web.
The domain root is in the usual place: /home/$USER/web/$DOMAIN.
It looks like these steps, and the setup for them can be scripted, which I can probably figure out from the HestiaCP documentation.
I believe that the chief goal is to get nginx for that domain to proxy the web requests between the Epicyon Python app and the web root for that domain. Epicyon has instructions for setting up certbot, which I wish to avoid if possible, so that HestiaCP can automatically manage SSL as usual.
So I need to answer some questions before fiddling any further.
- Where do I look to create a permanent HestiaCP template to enable the web user to run python on the selected domain?
- Where do I look to create a permanent HestiaCP nginx configuration like the one shipped with Epicyon, to proxy the web requests to the Python application?
In short, I need to run a Python application that mirrors its inputs and outputs in the web root for the domain, and has requests proxied by nginx from the web root to the Python application. The values established by the Epicyon systemd service appear like this:
ExecStart=/usr/bin/python3 /opt/epicyon/epicyon.py --port 443 --proxy 7156 --domain YOUR_DOMAIN --registration open --log_login_failures
And the values in the Epicyon nginx config have this line:
proxy_pass http://localhost:7156;
I need to figure out how to adapt this to HestiaCP in the right file paths for its unique templating scheme and file locations, so nginx knows how to proxy and so Python execution is properly authorized.