this post was submitted on 28 Mar 2026
37 points (100.0% liked)

Selfhosted

57954 readers
943 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I am experimenting with using forgejo instead of GitHub for my personal projects. So far I like it, however I would like to make it available to the outside world at some point.

I was wondering what kind of traps I should avoid. The following things come to mind so far:

  • Forgejo Actions seem like a massive potential security risk, however I do not intend to enable sign up for other
  • OpenID appears to be a thing for forgejo, I do not know how it works and it seems like it would allow access to my instance even with registering disabled
  • I would put the instance behind a nginx as reverse proxy, but how do you keep bot traffic to a minimum? Anubis?

I feel like there are a ton of things I have not thought of, which is why I am holding off on making anything available without a VPN so far.

top 17 comments
sorted by: hot top controversial new old
[–] GreenKnight23@lemmy.world 1 points 5 hours ago

I have thought about doing this with gitlab. honestly, I was just going to stand up a free instance on AWS and have my local repos sync to the public one.

no problems then.

[–] Jayjader@jlai.lu 1 points 6 hours ago

It's been a while since I set up my runner, and I have it on my personal desktop (which is wayyyyyy beefier than the VPS I host my forgejo instance on), but I'm pretty sure I was able to specify that only my user account can trigger actions to be run on this runner. What I'm getting at is that there is a decent amount of granularity for forgejo action permissions; you should be able to find a balance that suits you between "no actions at all" and "anyone can run any code they desire on your server".

[–] AcornTickler@sh.itjust.works 1 points 9 hours ago

I run it in a rootless Podman container using Quadlets. Instead of opening the server's ssh port, I only port-forward the container's ssh port (e.g. 22 -> 2222). I have sign-ups enabled, since I want people to be able to contribute (or just create issues). But I have configured the server so that nobody can create a repository. They can still fork my repos and send a pull request.

I have yet to experiment with Actions. I assume the safest option would be to only enable it for my own commits, but I am not sure.

[–] surewhynotlem@lemmy.world 3 points 12 hours ago

Lots of good answers already. Just want to add.

Block IP from every country that doesn't have your users in it. That will go a long way.

[–] tofu@lemmy.nocturnal.garden 15 points 18 hours ago (1 children)

Yes, Check Anubis, scraper bots follow every link they find and especially git forges basically have infinite links (every single commit and comparison between every single commit and every other).

I haven't thought it through but there may be some implications on opening port 22 for git via ssh.

[–] hendrik@palaver.p3x.de 10 points 18 hours ago* (last edited 18 hours ago)

If it's just you, and you're fine with the regular login... Just disable signup and don't add more authentication mechanisms like oauth/openID.

I'm using nginx as a reverse proxy as well. For now, I added a lot of "deny" directives to ban all the address ranges from Tencent, Alibaba, OpenAI. It's not a 100% solution, but works well enough for me. I'm mostly worried about AI crawlers causing too much load on my server. And it stopped since, so I don't think I'm gonna need Anubis and all these extra things in front if my applications. If you like you can look into solutions like a web application firewall like Crowdsec.

[–] emerald@lemmy.blahaj.zone 6 points 17 hours ago (1 children)

I run a forgejo server on the internet for myself so here's my two cents.

OpenID or any other log in method is just a way to log in to an account on the forgejo server. With registrations disabled it shouldn't be able to create an account, so there should be no issue. All the extra auth methods also need to be configured and are disabled by default.

Bot traffic can be pretty horrendous once they find your server, I'd say Anubis is basically a requirement at this point. I would also strongly recommend setting up fail2ban for http and ssh, and disabling ssh password auth.

[–] arschflugkoerper@feddit.org 1 points 16 hours ago (1 children)

Ah I see, I kinda assumed that OpenID would allow anyone with an OpenID server to just log in. That seemed like it would cause immediate spam issues. It would definitely be nice if I could allow users to create issues or stuff like that at some point. I will definitely have to take a look at fail2ban before I make it available. Thank you.

[–] EncryptKeeper@lemmy.world 1 points 3 hours ago

No OpenID is configured against your OpenID server

[–] morethanevil@lemmy.fedifriends.social 4 points 17 hours ago (1 children)

You can use Forgejo with OIDC or normal login behind a reverse proxy. If you want to make a repo public, you need to add this to your App.ini under the [service] section: REQUIRE_SIGNIN_VIEW = false

Example:

[service]
REGISTER_EMAIL_CONFIRM = true
ENABLE_INTERNAL_SIGNIN = false
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = true
ENABLE_CAPTCHA = false
REQUIRE_SIGNIN_VIEW = true
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.localhost
REQUIRE_SIGNIN_VIEW = false

Then you can create a public repo which people can view without an account. You can change visibilty at any time

[–] arschflugkoerper@feddit.org 2 points 16 hours ago

Yes, this has been configured already, thanks for the suggestion.

[–] moonpiedumplings@programming.dev 2 points 17 hours ago (1 children)
  • oauth, and control sign ups via there. Don't let people sign up via forgejo itself.
  • anubis, yeah. Or similar.
  • forgejo actions is an optional component... and forgejo users can bring their own actions server. Of course, it's a risk to them since the server owner could execute code in actions. But yeah.
[–] arschflugkoerper@feddit.org 1 points 16 hours ago

I definitely want to use forgejo actions, but I am mainly worried about random people being able to execute any code on them. Preferably only approved users can do that.

[–] frongt@lemmy.zip 1 points 16 hours ago (1 children)

Do you need to host it yourself? Codeberg is free, and they handle these concerns for you.

But yes, you will need to secure it against hackers and scrapers. Keep user permissions to a minimum, if you allow people to create accounts at all. And run it in a dmz network, so that in case it's compromised they can't access the rest of your LAN.

[–] arschflugkoerper@feddit.org 2 points 14 hours ago

I don’t need to, but I want to :D

[–] Decronym@lemmy.decronym.xyz 1 points 16 hours ago* (last edited 3 hours ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
Git Popular version control system, primarily for code
HTTP Hypertext Transfer Protocol, the Web
IP Internet Protocol
VPS Virtual Private Server (opposed to shared hosting)
nginx Popular HTTP server

4 acronyms in this thread; the most compressed thread commented on today has 5 acronyms.

[Thread #195 for this comm, first seen 28th Mar 2026, 14:10] [FAQ] [Full list] [Contact] [Source code]