Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitea module: init at 1.1.3 #28851

Closed
wants to merge 2 commits into from
Closed

gitea module: init at 1.1.3 #28851

wants to merge 2 commits into from

Conversation

betaboon
Copy link
Contributor

@betaboon betaboon commented Sep 1, 2017

Motivation for this change

As Gogs has been forked to Gitea I wanted to be able to run gitea.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

'';

systemd.services.gitea = {
description = "Gitea (Go Git Service)";
Copy link
Member

@Mic92 Mic92 Sep 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Gitea" is enough here. Reason: on boot it will show the description as name:

Something like:

Starting Gitea...

password = mkOption {
type = types.str;
default = "";
description = "Database password.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be an option to store this in a external file. Explanation: #24288


system.activationScripts.gitea = ''
mkdir -p ${cfg.stateDir}
chown -R ${cfg.user}:${cfg.group} ${cfg.stateDir}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be an expensive operation (if a lot git repositories are present). Since you have allocated static uid/gid number, please only change permission of the root state directory:

install -d -g ${cfg.group} -o ${cfg.user} ${cfg.stateDir}

touch ${cfg.stateDir}/.db-created
fi
''}
chown -R ${cfg.user}:${cfg.group} ${cfg.stateDir}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you chown again. I would remove activationsScripts and create stateDir at the beginning of preStart.

@orivej
Copy link
Contributor

orivej commented Nov 2, 2017

@disassembler has added gitea in #30528

@orivej orivej closed this Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants