NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.1k stars 13.41k forks source link

Gitea SSH auth stopped working #252140

Closed tcheronneau closed 3 weeks ago

tcheronneau commented 12 months ago

Describe the bug

A clear and concise description of what the bug is. Since my last upgrade of gitea to 1.20.2 (I don't remember which version I was before but not so far away) my ssh authentication stopped working. (I'm on NixOS) I checked and found out https://github.com/go-gitea/gitea/issues/26516. Checked the logs and saw : Unable to update WORK_PATH=/var/lib/gitea to config "/var/lib/gitea/custom/conf/app.ini": failed to save "/var/lib/gitea/custom/conf/app.ini": open /var/lib/gitea/custom/conf/app.ini: permission denied

So I'm guessing it's related. I think we cannot setup in settings this config so I put it into extraConfig (which is deprecated) and it did not fixed it :sweat_smile: So I've duplicated the current module locally and tried to simply add the option on the top :

  configFile = pkgs.writeText "app.ini" ''
    APP_NAME = ${cfg.appName}
    RUN_USER = ${cfg.user}
    RUN_MODE = prod
    WORK_PATH = ${cfg.stateDir}

And it fixed it.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Upgrade gitea to 1.20.2
  2. Try to clone / push / pull project using ssh key
  3. See it fail

Expected behavior

A clear and concise description of what you expected to happen. Being able to use SSH.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.46, NixOS, 23.05 (Stoat), 23.05.20230828.ea5234e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.5`
 - channels(root): `"nixos-22.05, nixos-unstable, nixpkgs-22.11"`
 - nixpkgs: `/root/.nix-defexpr/channels/nixpkgs`
tcheronneau commented 12 months ago

Wanted to fix it in the module but it seems it has already been done. Just need to push this fix into branch 23.05.

nixupp commented 3 weeks ago

can you close this issue please?