Closed sander1095 closed 2 years ago
Hey! So as you've realised, commento++ is indeed running and the port forwards are working - the redirect is produced by the commento server at https://github.com/souramoo/commentoplusplus/blob/master/api/router_static.go#L135
You basically just need to change the COMMENTO_ORIGIN to one that is accessible from the browsers you are intending to access the comments page (so they can contact the server hosting the dynamic functionality).
0.0.0.0
is simply a bind-all address which means the server will accept traffic from all network cards on your Pi, which means if you have two network cards and therefore two IPs, the server will still be able to accept traffic from all of them (rather than 127.0.0.1 which would only allow connections from localhost, or 192.168.2.2 which would only allow incoming connections from that network).
It is possible you have a firewall or similar that is blocking incoming traffic unless it is from certain ports, e.g. 80 after which it is reverse proxied?
I would recommend you set it to commento.stenbrinke.nl
. This needs to be done in the docker-compose.yml
file you had earlier. The commento.example.com
comes from the documentation in the readme and the website.lol
one comes from the tutorial you linked, so I fear you might be getting your different configurations mixed up - what is your current docker-compose file?
(Oh, and make sure you don't include the :8080
in the origin address - this is because it appears your particular setup this port is inaccessible unless through your reverse proxy!)
I have got it to work now!
My caddyfile looks like this:
https://commento.MYDOMAIN.COM { # Change this to your own domain
reverse_proxy localhost:8080
encode gzip
}
My docker-compose.yml
looks like this:
version: '3'
services:
server:
build: .
ports:
- 8080:8080
environment:
COMMENTO_ORIGIN: https://commento.MYDOMAIN.COM #Change this to your own domain. Must be the same as in caddyfile
COMMENTO_PORT: 8080
COMMENTO_POSTGRES: postgres://postgres:postgres@db:5432/commento?sslmode=disable
depends_on:
- db
networks:
- db_network
db:
image: postgres
environment:
POSTGRES_DB: commento
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
networks:
- db_network
volumes:
- postgres_data_volume:/var/lib/postgresql/data
networks:
db_network:
volumes:
postgres_data_volume:
I can now go to https://commento.MYDOMAIN.COM (which has a TLS cert thanks to Caddy's easy let's encrypt integration) or to 192.168.2.2:8080
/raspberrypi:8080
and I will be redirected to https://commento.MYDOMAIN.COM
.
Not fully what I expected; I was expecting that I could also fully run this thing on localhost
on the pi, without any reference to the live url (like any other service that I run on my pi like jellyfin), but this also works fine for me.
I guess this means that #119 can also be fixed by enabling arm architectures again, since building things locally seem to work fine on my pi! 🎉 I will go ahead and comment it there as well.
Hi!
I created #119 earlier, but like I commented there, when i clone the project and run docker compose, the project actually starts and the port binds, etc.. No errors whatsoever.
To recap: I run on a raspberry pi 3b+.
But, I can't actually get my requests to work. I don't know what I am doing wrong, and I'm pulling my hairs out.
The containers start up and the server says it's listening on
0.0.0.0:8080
. When I send acurl
from my Pi request to that address, the server responds with a permanent redirect to https://commento.website.lol/login. (COMMENTO_ORIGIN + /login, basically)When I perform a request to
0.0.0.0:8080
from the Pi, I get this response:I just don't get it, because connecting to that (even after changing it to my own domain and other domains (see below)) don't work, I just get an no response from the server. No logs. If I follow the official docs, things should work. But they don't.
So, let me sketch my scenario further.
I am running this on a Pi. I have a reverse proxy (caddy). It reverse proxies the traffic from commento.stenbrinke.nl to
127.0.0.1:8080
, which isCOMMENTO_ORIGIN
in my case.What should my
COMMENTO_ORIGIN
and my reverse_proxy URL be?I tried
http://localhost:8080
,http://127.0.0.1:8080
, `https://commento.stenbrinke.nl. None work.i tried doing a request on my PC to my PI (192.168.2.2:8080) and all of those other urls. No response! but i have many other services running on ports on my pi, and doing a request to 192.168.2.2:8096 reaches that service, for example.
i am completley stuck, I do not understand why this doesn't work :)
I'd appreciate the help!