mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-14 06:13:33 +01:00
question regarding safety #63
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gilbrotheraway on GitHub (Apr 21, 2025).
i love how simple the setup was however it was scary to see all my services automatically exposed, i wonder if there's any crowdsec/geoblock integrations?
@yusing commented on GitHub (Apr 21, 2025):
Edit: Geoblock is now available on v0.11
If you do not want to expose your services automatically, you have several options:
Add an exclamation mark
!after docker provider name (e.g.local!: $DOCKER_HOST) See: https://github.com/yusing/godoxy/wiki#behaviors. With this only containers with GoDoxy labelsproxy.{anything...}will be exposed.Use the CIDRWhitelist middleware
(Recommended) Use ACL (Maxmind account required for
countryandtzmatchingFull article: https://tailscale.com/kb/1077/secure-server-ubuntu
@gilbrotheraway commented on GitHub (Apr 22, 2025):
these are indeed great options
i only mentioned them because geoip alone here(brazil) blocks 100% of IPs
not sure how to check if there's traffic coming?
btw i restarted the server and noticed this, any tips how to fix detection on cold start or is it feature maybe?
@yusing commented on GitHub (Apr 22, 2025):
Incoming requests will be logged to a file, check your
config.yml@yusing commented on GitHub (Apr 22, 2025):
You have set the wrong
DOCKER_HOSTin.envso it's not connecting to Docker.@gilbrotheraway commented on GitHub (Apr 22, 2025):
though it works fine when i reboot godoxy, it's only on cold starts because the container spins up faster than others, i love how little resources it uses and how fast it is just thought there might be an ENV to delay containers detection?
now on the middleware topic is there something like security-headers
@yusing commented on GitHub (Apr 22, 2025):
What do you mean by cold start? It does not matter whether GoDoxy start before or after other containers.
I guess you're talking about the "loaded 0 routes" message. It's simply because you have enabled explict only mode for provider
local. Only containers with labelsproxy.{...}will be loaded.GoDoxy does not set security headers automatically, most apps will set CSP headers, CORS headers, etc. on their own, based on the infrastructure of the app and environment variables user have set (e.g.
BASE_URL,ORIGIN. etc.)If you want to enforce security headers, you can use the request middleware like this (may break the app / UI depends on what you've set):
@gilbrotheraway commented on GitHub (Apr 22, 2025):
i mean restarting the server, it's starting before the socket can be read or something
all works when i restart godoxy
is there any documentation you can point me that describes these options?
I'm also trying to set CloudflareRealIP so the geoblock from Cloudflare works, but no idea what to set on "recursive" directive or the value fields
@yusing commented on GitHub (Apr 22, 2025):
Put GoDoxy and docker-socket-proxy together in the same docker compose, then
https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html#introduction
CloudflareRealIPdoes not affect how Cloudflare works. Cloudflare's geoblock will work no matter you set it or not, as long as Cloudflare is in front of GoDoxy:End User -> CF -> GoDoxy -> ServiceWhat it does is basically looking up the
CF-Connecting-IPheader and treat it as the remote ip if the original remote ip is in the cloudflare ip list:Doing so let the access logger can record the correct client ip instead of cloudflare's ips.
CloudflareRealIPmiddleware is a preset of theReadIPmiddleware, it requires no value field.@gilbrotheraway commented on GitHub (Apr 22, 2025):
i set in the config
and now I can't access any routes including godoxy frontend
request error="no such route: godoxy" method=GET remote=192.168.15.1:34946 url=/edit: same happens when setting redirecttohttp
Thanks will try that
can one use exact same syntax?
is this AI answer wrong?
I'm not using tunnels if that's what you mean, all i have is a cloudflare domain with firewall rules to block all countries but the vpn is still able to access it
@yusing commented on GitHub (Apr 22, 2025):
I guess you’ve set something wrong, revert the config.yml and add middlewares to the entrypoint with WebUI.
Ya, they’re just key-value mappings. Just make sure to double quote the value in case there’re special characters.
AI was right, I’ve just had a presumption that you’re running cf tunnels and blocking other traffic. People can still bypass cf if you didn’t block port 80 and 443 publicly.
@gilbrotheraway commented on GitHub (Apr 22, 2025):
yeah, i think it's because i forgot to add middleware labels to the container sorry
gotcha, aside from CIDR/set-headers what other middlewares need custom values?
i managed to get it working by ticking the "proxy" switch on in Cloudflare DNS records panel
before i was under the impression that reverse proxies needed the real IP and proxied wouldn't work
@gilbrotheraway commented on GitHub (Apr 22, 2025):
now I'm wondering will Cloudflare decrypt my traffic in this setup?? 🤔
@yusing commented on GitHub (Apr 22, 2025):
Not talking about container, you should add the middleware to entrypoint in
config.ymlso it will work for every servicesThey're all here: https://github.com/yusing/godoxy/wiki/Middlewares
I'll clean this up for easier to read and understand.
Nice.
They will, in order to get page rules and other cloudflare features to work.
@gilbrotheraway commented on GitHub (Apr 22, 2025):
how is it possible if they don't have the ssl key?
@gilbrotheraway commented on GitHub (Apr 22, 2025):
any idea what's going on I'm trying to proxy kiwix-serve but it's stuck on "starting screen"
it's the only one of a dozen services with any problem
@yusing commented on GitHub (Apr 22, 2025):
AFAIK, when you turn on proxy or use CF tunnels, the cert being served will be CF's cert.
End User <-- CF SSL --> CF <-- [Origin SSL] --> Origin@yusing commented on GitHub (Apr 22, 2025):
The Error: read ECONNRESET is about you've reset the connection (e.g. quiting GoDoxy or leaving the docker logs page) while you were on the docker logs page.
Not related to you being stuck on the starting screen. Go check for browser logs and kiwix's log to see what's going wrong.
@gilbrotheraway commented on GitHub (Apr 23, 2025):
you're right, I'll do it later because when i try to up kiwix with the proxy label it brings the whole compose system down
@gilbrotheraway commented on GitHub (Apr 23, 2025):
i think i found away around it:
set the wildcard subdomains to dns only and cname
leave base domain proxied
use whatever CF WAF/rules
this way i get geoblock working and the certificate shows letsencrypt in the browser
@yusing commented on GitHub (Apr 23, 2025):
Lol. How is that even possible?
@yusing commented on GitHub (Apr 23, 2025):
Only people visiting your base domain will be blocked, they will still bypass cf when visiting subdomains.
@yusing commented on GitHub (Apr 25, 2025):
Geoblock here you go: https://github.com/yusing/godoxy/wiki/Access-Control-List#connection-level-acl
@gilbrotheraway commented on GitHub (Apr 25, 2025):
of course i tested it before sharing here
what happens is the cloudflare page is not shown but a simple "forbidden" text instead
just to update whoever may get here, this is not working anymore not sure what changed
@yusing commented on GitHub (Apr 25, 2025):
Alright my bad.
I do in the same thing in the CIDRWhitelist middleware.
Yeah let's go.
@gilbrotheraway commented on GitHub (Apr 28, 2025):
@yusing after updating the containers aren't idling anymore :(
tried with 11.6 11.4, 11.1, 11.0
@yusing commented on GitHub (Apr 28, 2025):
Just fixed on 0.11.7, please pull and try again.
Log rotation is also fixed.
@gilbrotheraway commented on GitHub (Apr 29, 2025):
wow you're fast, can confirm idlesleep works now
also i noticed the oidc timeout is not being respected anymore
@yusing commented on GitHub (Apr 29, 2025):
If you have added the scope
offline_accessor/and when your IdP responded with a refresh_token, GoDoxy will now do this:Let's use Authentik as an example. When you log in you will have two cookies, one is granted by Authentik (Id token, expires in 5 minutes) and the other is granted by GoDoxy (session_token, expires in `API_JWT_TOKEN_TTL). GoDoxy will also get a refresh token from the IdP, which will be stored on the server.
So when the former is expired and the latter is not, GoDoxy will do token refresh for you, until the refresh token was invalidated by your IdP / after 1 month of the initial auth / any error occurred.
On successful token refresh, you will get a new ID token and session token. So on and so on until either the session token or the refresh token expires.
Default expiry:
Session cookie:
API_JWT_TOKEN_TTL(24 hours if unset)ID Token: 5 minutes by default for Authentik
Refresh Token: 30 days by default for Authentik
You can tune these settings to a comfortable level.
@gilbrotheraway commented on GitHub (Apr 29, 2025):
what is that?
any way to do that on pocket-id?
@yusing commented on GitHub (Apr 29, 2025):
Pocket ID seems to respond with a refresh token without the
offline_accessscope, so this is the reason of "i noticed the oidc timeout is not being respected anymore"@yusing commented on GitHub (Apr 29, 2025):
Hey, I'm closing this issue for now. Should you have any questions, please submit a new issue or reach me on Discord.