Show HN: My Private GitHub on Postgres

(github.com)

26 points | by calebhwin 2 hours ago

11 comments

  • supriyo-biswas 14 minutes ago
    I've always wanted to write something like this. The problem with Gitlab/Gitea etc. is their reliance on disk storage; which means self hosting them requires that I get the backup story just right. Whereas with this, I could just handle it as part of the database backup process.

    Having no web UI, at least even a rudimentary one is kinda a bummer though.

  • hk1337 1 hour ago
    Interesting idea but what's the use case for this? Why wouldn't I just create a private git server (gitlab, forgejo, etc) just for myself?
    • hungryhobbit 45 minutes ago
      This seems like the elephant in the room.

      I'm not saying this project isn't cool, but whenever you have ANY software that's designed to be hosted A-style, and you host it B-style, the obvious question is "Why not host it the A way?"

  • xp84 1 hour ago
    "doesn't support: ... Web UI."

    So, it's a git server with an interesting storage layer? Don't get me wrong, that part sounds like it might have been a ton of work to implement, but I think the web UI (pull requests, etc) is a lot of what Github has won on historically.

    Basically I don't feel qualified to judge the product itself, but I think positioning it against Github, while popular given the recent hard times, isn't quite correct.

    • nomel 9 minutes ago
      > "doesn't support: ... Web UI."

      "Doesn't" doesn't mean "can't". Someone just needs to do the work (with no thanks or pay expected).

  • lisperforlife 54 minutes ago
    This is really cool. PG has zlib compression on TOAST objects so this should still be okay even if you are not storing pack files. I am curious with your choice of hand-rolling pktline, upload-pack and receive pack implementations including rev-walking. Any particular reason you did not want to use libgit2 or something like the gitoxide implementation of pkt-line. Was it performance or is it because you wanted it to be in pure rust? Did you try running this on slightly heavier repository with a lot of commits, refs and objects?
  • throwatdem12311 1 hour ago
    Just use Fossil at this point.
    • sikozu 58 minutes ago
      I'm waiting for somebody to create fossilhub
    • lagniappe 1 hour ago
      Fossil really has it all.
  • bitbasher 38 minutes ago
    No license?
  • iririririr 58 minutes ago
    just use ssh and git bare.
  • JasonHEIN 1 hour ago
    Great idea
  • Mic92 2 hours ago
    Nice idea.
  • vishal_ch 2 hours ago
    Interesting approach using Postgres as the storage layer. Curious how you're handling the object model since Git's content-addressable storage maps pretty differently to relational tables. Are you storing blobs as bytea or going with something like a JSONB tree structure for the commit graph?
    • munk-a 1 hour ago
      While git internally uses a pretty loose system for connecting different model concepts that has always seemed more like a concession to the storage medium than a desired step. If git existed on an already ACID compliant system instead of trying to build one out of the filesystem itself I don't see a reason to keep all the references as loose as they are. If you can cascade changes with confidence you can likely just switch to using standard surrogate keys for linkages and allow the data to normalize more fully.

      The core model objects in git are all pretty straightforward and their interactions well defined.