How to use seafile with a custom port? (In v12)

As the title suggests. I’ve tried basically everything, but it just doesn’t work, unless i use port 80.

Note:- I’ve removed all caddy labels and removed caddy from .env file as well. I don’t run caddy when running docker-compose up. Just tell me if i should switch back to caddy if it’ll be easier to run on custom port with caddy.

My first attempt was using cloudflare zero tunnel- and it worked flawlessly, just one problem - very slow speed- but that’s inherent of cloudflare zero tunnel. Because im behind cgnat, i can’t just expose port 80 and 443.

My next and current attempt is using zerotier - it works but only when i leave the ports : “80:80” in the seafile-server.yml. But i can’t assign my port 80 to seafile, because it’ll be used by npm. So i need to use a custom port, say 8015, when i set ports : “8015:8015” in the .yml, after compose up -d i have to manually change the seafile.nginx.conf to listen on 8015, otherwise the website doesn’t load. But then when i try to upload anything, i get network error, and nothing uploads. Then even i change the seahub_settings.py FILE_SERVER_ROOT=10.245.1.10:8015/seafhttp, (note there’s http:// before 10.245… because forum won’t let me input full url) it still doesn’t work.

I read in docs that in v12 service_url is no longer used??

Also in a similar discusstion someone suggested as a solution for them is to use http’s’. My port 80 also didn’t work without https, even tho i have no ssl and can’t have one because domain is an ip and it’s not public.

My conf : - using docker-compose, the .env file is set to hostname=10.245.1.10, protocol=http, then in the seafile-server.yml.

Any help will be immensely appreciated!!

It’s solved!! Here’s what worked : in the .env set hostname=10.245.1.10:8015 and protocol as http and in seafile-server.yml set ports : “8015:80” and do docker-compose up. Now when seafile-data and seafile-mysql gets created, in the seahub_settings.py the service_url and file_server_root already have 8015 after 10.245.1.10. What i got from this is : Manually making edits in the seahub_settings.py don’t come into effect after a simple docker-compose down and up -d, either that or there’s some other files or places where i also need to make same changes, i do not know what or where those files are. But for now, it works! Also, https is not needed it seems.

1 Like

Just one last question or rather asking for advice from a security standpoint : Since I’m using zerotier ip as the hostname and http as the protocol and I’m the only user with say 2-3 devices. If you don’t know zerotier— it’s basically a vpn-like service that uses NAT-hole punching to bypass CGNAT restrictions along with NAT Masquerade. But anyways, my point is : since I’m using a vpn to connect to my seafile server, how much would i benefit from setting up a DNS and a self-signed cert and installing the ROOT CA on my devices — all just so i could use https rather than http — but again im using a vpn- does it really even matter?

Also, what are some other security considerations??

Hello! Glad you solved your initial issue! And I know others have seen that issue as well so thank you for your efforts!

If you want to use HTTPS, I had a somewhat similar problem with my CGNAT ISP. To solve that problem I use a VPS with reverse proxy that performs SSL termination. It also runs Headscale which creates a tailnet that I put my Seafile server on, and bingo!

And generally, the more isolation the better when it comes to security considerations I’d say, using some kind of DMZ’d reverse proxy in concert with firewall rules to privileged VLAN’s. In practice though, I really haven’t had any security issues with my above setup though.

So best of luck, and nice work!

UPDATE 1: Security considerations.