Docker: multiple issues #3
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
This issue consolidates several issues related to 4get's current Docker setup.
Publicly accessible private resources
The Apache configurations used by docker-entrypoint.sh (
http.conf
andhttps.conf
) do not properly restrict access to private resources. The configurations lack a block like the following to deny access:Additionally, the line
Options Indexes FollowSymLinks
(http.conf
andhttps.conf
) exposes the directory structure and file names to anyone accessing the directory URL. It should be changed toOptions FollowSymLinks
.These issues make sensitive directories like
data/proxies
publicly accessible and easily traversable for instances using the official Docker image.Breakage caused by anti-bot measures
Commits 2976c0a6a4 and fea09d9580 introduced filtering of certain HTTP headers (like
X-Forwarded-For
) to block proxy traffic:src: https://git.lolcat.ca/lolcat/4get/src/commit/dd3469aeb67631fd49b4f7a78a036187628eda44/lib/frontend.php#L101-L106
However, headers like
X-Forwarded-For
are also typically forwarded by reverse proxies. This results in all requests being blocked as if they came from a proxy or bot, potentially preventing legitimate traffic from reaching the 4get instance.Setting an environment variable like
FOURGET_FILTERED_HEADER_KEYS="not-a-real-header"
also failed as a workaround during testing.Use of
restart: always
indocker-compose.yaml
The
restart: always
policy in thedocker-compose.yaml
file causes the container to always restart, regardless of the exit status.Generally, the
unless-stopped
policy is preferred as it allows for more control over container restarts. It prevents unintended restarts of manually stopped containers, while still automatically restarting containers that exit unexpectedly or crash.Hello...
I've been trying to get in touch with @throwaway, the guy who helps me with docker shit, but his account has been nuked because I couldn't be bothered to migrate gitea data to the new server. Anyway, I'll try and look at this myself but don't expect much since I really really hate docker.
Take care xx
So that's what happened to the account I had on here before lol
I'd be happy to open a PR with all of the necessary changes, but I can't fork the repository.
I have updated your account permissions
The apache2 setup guide securely sets up everything: https://git.lolcat.ca/lolcat/4get/src/branch/master/docs/apache2.md
Maybe you can use this as reference.
@throwaway (love u bb) should have fixed all of this, feel free to re-open if issues arises
Unfortunately the search is still broken on my end since thefag protection
commitsSearch works correctly when using an image built from commit81502d4721
, but is non-functional with any later versionsI've tried specifing the env vars~FOURGET_HEADER_REGEX=not-a-real-header-0,not-a-real-header-1
andFOURGET_FILTERED_HEADER_KEYS=not-a-real-header-0,not-a-real-header-1
, but no luck so farIf it's useful, the following variables are being templated intodata/config.php
:Turns out disabling the proxies for the scrapers solved the issue, so maybe the issue was caused by some other commit after
81502d4721
?@throwaway does your latest commit fix the issues talked about here?
Latest commit should fix this, feel free to re-open if other issues arises :)