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.

  • Possibly linux@lemmy.zip
    link
    fedilink
    English
    arrow-up
    4
    ·
    30 days ago

    I would strongly recommend against publicly exposing it. It will get hammered by bots continuously.

    Instead, I would move public repos to Codeberg

  • surewhynotlem@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    2
    ·
    1 month 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.

  • moonpiedumplings@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month ago
    • 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.orgOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 month 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.

      • moonpiedumplings@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        28 days ago

        The way forgejo actions works, is that it is not a universal thing for every repo. Each repo, can have it’s own forgejo actions instance connected to it, running stuff.

        The big benefit of that, is that you can make users bring their own actions servers, and not bother to deploy your own.

  • AcornTickler@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month 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.

  • frongt@lemmy.zip
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    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.

  • GreenKnight23@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    1 month 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.