Forgejo: Difference between revisions
Add a section on theming Forgejo |
Add section on setting up openssh integratiojn |
||
| (One intermediate revision by the same user not shown) | |||
| Line 17: | Line 17: | ||
== Usage == | == Usage == | ||
NixOS provides a module for easily setting-up a Forgejo server, here is an example of typical usage with some optional features: | |||
* Use Nginx to enable easy https configuration | * Use Nginx to enable easy https configuration | ||
| Line 86: | Line 86: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Runner == | == Setting up OpenSSH integration == | ||
If you plan to use SSH keys for authenticating your git usage, there's a little extra configuration to be done to set that up: | |||
{{File|3={ config, lib, ... }: { | |||
... | |||
services = { | |||
forgejo.settings.server.SSH_PORT = lib.head config.services.openssh.ports; | |||
openssh.settings.AcceptEnv = "GIT_PROTOCOL"; | |||
}; | |||
... | |||
}|name=/etc/nixos/configuration.nix|lang=nix}} | |||
== Actions Runner == | |||
According to the [https://forgejo.org/docs/latest/admin/actions/#forgejo-runner documentation] the <code>Forgejo runner</code> is:<blockquote>A daemon that fetches workflows to run from a Forgejo instance, executes them, sends back with the logs and ultimately reports its success or failure.</blockquote>In order to use Actions, you will need to setup at least one Runner. You can use your server, another machine or both as runners. | According to the [https://forgejo.org/docs/latest/admin/actions/#forgejo-runner documentation] the <code>Forgejo runner</code> is:<blockquote>A daemon that fetches workflows to run from a Forgejo instance, executes them, sends back with the logs and ultimately reports its success or failure.</blockquote>In order to use Actions, you will need to setup at least one Runner. You can use your server, another machine or both as runners. | ||
To register a runners you will need to generate a token. https://forgejo.org/docs/latest/user/actions/#forgejo-runner | To register a runners you will need to generate a token. https://forgejo.org/docs/latest/user/actions/#forgejo-runner | ||
You can create a server-wide Runner by going to ''Profile Picture > Site Administration > Actions > Runners > Create new Runner.'' | You can create a server-wide Runner by going to ''Profile Picture > Site Administration > Actions > Runners > Create new Runner.'' | ||
Store your token in your [[Comparison of secret managing schemes|secrets management system]] of choice, then add the following to the configuration of the machine to be used as a runner:<syntaxhighlight lang="nixos"> | Store your token in your [[Comparison of secret managing schemes|secrets management system]] of choice, then add the following to the configuration of the machine to be used as a runner:<syntaxhighlight lang="nixos"> | ||
{ pkgs, config, ... }: { | { pkgs, config, ... }: { | ||
| Line 120: | Line 127: | ||
== Ensure users == | == Ensure users == | ||
Using the following snippet, you can ensure users: | Using the following snippet, you can declaratively ensure these users will always exist: | ||
<syntaxhighlight lang="nixos"> | <syntaxhighlight lang="nixos"> | ||
sops.secrets.forgejo-admin-password.owner = "forgejo"; | sops.secrets.forgejo-admin-password.owner = "forgejo"; | ||