infrastructure/nixos-modules/qois/git
Fabian Hauser 220cc229c1
Some checks are pending
CI / build (push) Waiting to run
Upgrade forgejo to 9
2024-12-06 22:34:42 +02:00
..
default.nix Upgrade forgejo to 9 2024-12-06 22:34:42 +02:00
README.md Commit files for public release 2024-10-02 16:57:36 +03:00

Git

Configuration for Git Clients

Authentication

To use oauth authentication, your git configuration should have something like:

[credential]
  helper = "libsecret"
  helper = "cache --timeout 21600"
  helper = "/usr/bin/git-credential-oauth" # See https://github.com/hickford/git-credential-oauth

On NixOS with HomeManager, this can be achieved by following home-manager config:

programs.git.extraConfig.credential.helper = [ "libsecret" "cache --timeout 21600" ];
programs.git-credential-oauth.enable = true;

Administration

Create Accounts

Accounts can be created by an admin in the administrator area.

  • use their full firstname.lastname@qo.is email so users may be connected to a LDAP database in the future
  • Username should be in form of "firstnamelastname" (Forgejo doesn't support usernames with dots)

To create a new admin user from the commandline, run:

sudo -u forgejo 'nix run nixpkgs#forgejo -- admin user create --config ~custom/conf/app.ini --admin --email "xy.z@qo.is" --username firstnamelastname --password Chur7000'

Backup / Restore

  1. systemctl stop forgejo.service
  2. Import Postgresql Database Backup
  3. Restore /var/lib/forgejo
  4. systemctl start forgejo.service