web-ui icon indicating copy to clipboard operation
web-ui copied to clipboard

Are the docs outdated? Cannot reach my server

Open Destewie opened this issue 1 month ago • 7 comments

At the moment i have a valid url associated with my peergos server with TLS ending in the nginx. I start the server with this command

#!/bin/bash
java -jar Peergos.jar daemon \
  -public-server true \
  -public-domain myserver.com \
  -log-to-console true

In the docs there is a Nginx config file that forwards location / to port 8000, but with ss -tulpn no socket is receiving on that port...
Even the 8888 has no open socket...

I can only access the web-ui by making a ssh tunnel to port 7777 of my server (because 7777 by default only receives from localhost)

The nginx file that is suggested:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    location ^~ /.well-known {
         allow all;
         proxy_pass http://127.0.0.1:8888;
    }

    return 301 https://$host$request_uri;
}

server {
        listen 443 ssl http2;
        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;

        ssl_ciphers TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:!TLS_AES_128_GCM_SHA256;
        ssl_certificate /etc/letsencrypt/live/$YOUR_DOMAIN_NAME/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/$YOUR_DOMAIN_NAME/privkey.pem;

        add_header Strict-Transport-Security "max-age=31536000" always;
        server_name $YOUR_DOMAIN_NAME;

        client_max_body_size 2M;

        location / {
                proxy_pass http://127.0.0.1:8000;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $http_host;
                allow all;
        }

        location ^~ /.well-known {
                 allow all;
                 proxy_pass http://127.0.0.1:8888;
        }
}

My ss -tulpn output while the server is up:

root@peergos:~# ss -tulpn
Netid  State   Recv-Q  Send-Q          Local Address:Port     Peer Address:Port  Process                                                                          
udp    UNCONN  0       0                           *:4001                *:*      users:(("java",pid=6664,fd=33))                                                 
udp    UNCONN  0       0                           *:5353                *:*      users:(("java",pid=6664,fd=41))                                                 
tcp    LISTEN  0       100                 127.0.0.1:25            0.0.0.0:*      users:(("master",pid=4342,fd=13))                                               
tcp    LISTEN  0       100                     [::1]:25               [::]:*      users:(("master",pid=4342,fd=14))                                               
tcp    LISTEN  0       4096                        *:22                  *:*      users:(("sshd",pid=4104,fd=3))                                                  
tcp    LISTEN  0       500        [::ffff:127.0.0.1]:7777                *:*      users:(("java",pid=6664,fd=118))                                                
tcp    LISTEN  0       500        [::ffff:127.0.0.1]:8080                *:*      users:(("java",pid=6664,fd=51))                                                 
tcp    LISTEN  0       500        [::ffff:127.0.0.1]:8003                *:*      users:(("java",pid=6664,fd=128))                                                
tcp    LISTEN  0       500        [::ffff:127.0.0.1]:5001                *:*      users:(("java",pid=6664,fd=44))                                                 
tcp    LISTEN  0       4096                        *:4001                *:*      users:(("java",pid=6664,fd=28))

Destewie avatar Oct 15 '26 14:10 Destewie

8000 is the default for servers. 7777 is the default for desktop apps. what does your .peergos/config file have for port?

ianopolous avatar Oct 15 '26 14:10 ianopolous

7777, as default. Should i change it to 8000?

Destewie avatar Oct 15 '26 14:10 Destewie

as long as it aligns with your nginx either is fine. Did you run any commands before daemon? Things like the proxy command will set the port to 7777, which the daemon then picks up.

ianopolous avatar Oct 15 '26 14:10 ianopolous

Just before opening this issue, i recreated the container from scratch. This is relevant because I had already configured the nginx with letsencrypt on the previous install. So the first command I launched was:

#!/bin/bash
java -jar Peergos.jar daemon \
  -public-server true \
  -public-domain myserver.com \
  -log-to-console true

I can retry from scratch again if there is the slight possibility that, for some error on my side, the config file was misconfigured on the first run. Btw now I've aligned the config file with the nginx putting port 8000 instead of the 7777, but nothing changed (not reachable).

Destewie avatar Oct 15 '26 14:10 Destewie

I have just created a public (IPv6-only) Peergos instance from scratch using the OCI container image, and I can observe too that Peergos starts with the 7777 port, and the 8000 port isn't used at all. Here are the details:

$ incus config show peergos | grep entrypoint
  oci.entrypoint: /opt/peergos/docker-entrypoint.sh daemon -log-to-console true -public-server -public-domain peergos.pappacoda.it -generate-token true

# ss --tcp --udp --listening
Netid  State   Recv-Q  Send-Q         Local Address:Port     Peer Address:Port
udp    UNCONN  43072   0                          *:4001                *:*
udp    UNCONN  0       0                          *:5353                *:*
tcp    LISTEN  0       500       [::ffff:127.0.0.1]:5001                *:*
tcp    LISTEN  0       4096                       *:4001                *:*
tcp    LISTEN  0       500       [::ffff:127.0.0.1]:7777                *:*
tcp    LISTEN  0       500       [::ffff:127.0.0.1]:8080                *:*
tcp    LISTEN  0       500       [::ffff:127.0.0.1]:8003                *:*

# cat /opt/peergos/data/config 
account-sql-file = login.sql
bat-store = bats.sql
collect-metrics = false
daemon = true
default-quota = 1073741824
enable-gc = true
gateway-port = 9000
gc.period.millis = 43200000
generate-token = true
global-download-bandwidth-limit = 1000000000
global-s3-read-requests-limit = 100000
ipfs-api-address = /ip4/127.0.0.1/tcp/5001
ipfs-config-bootstrap-node-list = /ip4/172.104.157.121/tcp/4001/p2p/QmVdFZgHnEgcedCS2G2ZNiEN59LuVrnRm7z3yXtEBv2XiF,/ip6/2a01:7e01::f03c:92ff:fe26:f671/tcp/4001/p2p/QmVdFZgHnEgcedCS2G2ZNiEN59LuVrnRm7z3yXtEBv2XiF,/ip4/172.104.143.23/tcp/4001/p2p/12D3KooWFv6ZcoUKyaDBB7nR5SQg6HpmEbDXad48WyFSyEk7xrSR,/ip6/2a01:7e01::f03c:92ff:fee5:154a/tcp/4001/p2p/12D3KooWFv6ZcoUKyaDBB7nR5SQg6HpmEbDXad48WyFSyEk7xrSR,/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN,/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa,/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb,/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt,/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ,/ip4/104.236.179.241/tcp/4001/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM,/ip4/128.199.219.111/tcp/4001/p2p/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu,/ip4/104.236.76.40/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64,/ip4/178.62.158.247/tcp/4001/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd,/ip6/2604:a880:1:20::203:d001/tcp/4001/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM,/ip6/2400:6180:0:d0::151:6001/tcp/4001/p2p/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu,/ip6/2604:a880:800:10::4a:5001/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64,/ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd,/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
ipfs-gateway-address = /ip4/127.0.0.1/tcp/8080
ipfs.identity.peerid = 12D3KooWNsYUK4ThK7Cphnswt9myJi36ud6iGFy9enyXR5hicZqU
ipfs.identity.priv-key = CAESILt6lJEjHCRqWs3/ruvP+DLLWqXZjt7E56LmdI2yk91Q
link-counts-sql-file = link-counts.sql
listen-host = localhost
log-to-console = true
metrics.address = localhost
metrics.port = 8001
minimised = false
mutable-pointers-file = mutable.sql
native-sqlite-path = /opt/peergos/native-libs/libsqlitejdbc.so
native-tweetnacl-path = /opt/peergos/native-libs/libtweetnacl.so
partition-status-file = partition-status.sql
peergos.identity.hash = z59vuwzfFDp3ZA8ZpnnmHEuMtyA1q34m3Th49DYXQVJntWpxdGrRqXi
pki-node-id = QmVdFZgHnEgcedCS2G2ZNiEN59LuVrnRm7z3yXtEBv2XiF
pki.node.ipaddress = 172.104.157.121
pki.node.swarm.port = 5001
port = 7777
proxy-target = /ip4/127.0.0.1/tcp/8003
public-domain = peergos.pappacoda.it
public-server = true
quota-upload-limit-seconds = 86400
quotas-sql-file = quotas.sql
s3.versioned-bucket = false
server-messages-sql-file = server-messages.sql
serverids-file = serverids.sql
social-sql-file = social.sql
space-requests-sql-file = space-requests.sql
space-usage-sql-file = space-usage.sql
transactions-sql-file = transactions.sql
useIPFS = true
user-download-bandwidth-limit = 100000000
user-s3-read-requests-limit = 1000

Tachi107 avatar Oct 15 '26 14:10 Tachi107

Thanks for reporting. This was a regression in April. Fix incoming soon.

ianopolous avatar Oct 15 '26 16:10 ianopolous

Thanks for the rapid fix! I can confirm everything works as expected now :)

Tachi107 avatar Oct 16 '26 15:10 Tachi107