about summary refs log tree commit diff
path: root/nixos/modules/services/misc/taskserver
Commit message (Collapse)AuthorAge
* nixos/taskserver: Fix manual PKI managementaszlig2017-07-16
| | | | | | | | | | | | | | | The helper tool had a very early check whether the automatically created CA key/cert are available and thus it would abort if the key was unavailable even though we don't need or even want to have the CA key. Unfortunately our NixOS test didn't catch this, because it was just switching from a configuration with an automatically created CA to a manual configuration without deleting the generated keys and certs. This is done now in the tests and it's also fixed in the helper tool. Reported-by: @jpotier Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos: revert changes from 3ab45f4b369c in taskserver modulePeter Simons2017-05-06
| | | | | | See https://github.com/NixOS/nixpkgs/commit/3ab45f4b369c9c741b55ddedeaac4c797dc61c04#commitcomment-22029298. Fixes https://github.com/NixOS/nixpkgs/issues/25529 (I hope).
* treewide: use boolToString functionFranz Pletz2017-04-11
|
* nixos/treewide: remove boolean examples for optionsFranz Pletz2017-03-17
| | | | | | | They contain no useful information and increase the length of the autogenerated options documentation. See discussion in #18816.
* taskserver: Remove taskserver from systemPackagesaszlig2017-02-17
| | | | | | | | | | | | | This is deliberate because using the taskd binary to configure Taskserver has a good chance of messing up permissions. The nixos-taskserver tool now can manage even manual configurations, so there really is no need anymore to expose the taskd binary. If people still want to use the taskd binary at their own risk they can still add taskserver to systemPackages themselves. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* taskserver: Pass configuration via command lineaszlig2017-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Putting an include directive in the configuration file referencing a store path with the real configuration file has the disavantage that once we change the real configuration file the store path is also a different one. So we would have to replace that include directive with the new configuration file, which is very much error-prone, because whenever taskd modifies the configuration file on its own it generates a new one with *only* the key/value options and without any include directives. Another problem is that we only added the include directive on the first initalization, so whenever there is *any* configuration change, it won't affect anything. We're now passing all the configuration options via command line, because taskd treats everything in the form of --<name>=<value> to be a configuration directive. This also has the effect that we now no longer have extraConfig, because configuration isn't a file anymore. Instead we now have an attribute set that is mapped down to configuration options. Unfortunately this isn't so easy with the way taskd is configured, because there is an option called "server" and also other options like "server.cert", "server.key" and so on, which do not map very well to attribute sets. So we have an exception for the "server" option, which is now called "server.listen", because it specifies the listening address. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Fixes: #22705
* taskserver: Allow helper tool in manual configaszlig2017-02-17
| | | | | | | | | | | | | | The helper tool so far was only intended for use in automatic PKI handling, but it also is very useful if you have an existing CA. One of the main advantages is that you don't need to specify the data directory anymore and the right permissions are also handled as well. Another advantage is that we now have an uniform management tool for both automatic and manual config, so the documentation in the NixOS manual now applies to the manual PKI config as well. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* taskserver/helpertool: Fix error message on exportaszlig2017-02-17
| | | | | | | | | | | The error message displays that a specific user doesn't exist in an organisation, but uses the User object's name attribute to show which user it was. This is basically a very stupid chicken and egg problem and easily fixed by using the user name provided on the command line. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos: fix taskserver module to evaluate properly when keys are managed manuallyPeter Simons2017-02-07
|
* types: loeOf -> listOfEric Sagnes2016-11-05
|
* taskserver : use pythonPackage.buildPythonPackageregnat2016-10-12
|
* modules: move meta at top levelEric Sagnes2016-08-11
|
* manual: automatically generate modules entriesEric Sagnes2016-08-11
|
* Escape all shell arguments uniformlyzimbatm2016-06-12
|
* taskserver service: Really check that it is enabledTuomas Tynkkynen2016-04-28
|
* nixos/taskserver: Fix reference to certtool.aszlig2016-04-15
| | | | | | | | | | | With the merge of the closure-size branch, most packages now have multiple outputs. One of these packages is gnutls, so previously everything that we needed was to reference "${gnutls}/bin/..." and now we need to use "${gnutls.bin}/bin/...". So it's not a very big issue to fix. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver/doc: Improve example org nameaszlig2016-04-14
| | | | | | | | | Suggested by @nbp: "Choose a better organization name in this example, such that it is less confusing. Maybe something like my-company" Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver/helper: Fix docstring of add_useraszlig2016-04-12
| | | | | | | | | We have already revamped the CLI subcommands in commit e2383b84f88e0e7d35f6a3a846b54c69e3bee6ee. This was just an artifact that was left because of this. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Fix wrong option doc referencesaszlig2016-04-12
| | | | | | | | | | The options client.allow and client.deny are gone since the commit 8b793d1916387c67f8eeb137789b1b41a1f94537, so let's fix that. No feature changes, only fixes the descriptions of allowedClientIDs and disallowedClientIDs. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Restart service on failureaszlig2016-04-12
| | | | | | | This is the recommended way for long-running services and ensures that Taskserver will keep running until it has been stopped manually. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Improve service dependenciesaszlig2016-04-12
| | | | | | | | | | | Using requiredBy is a bad idea for the initialisation units, because whenever the Taskserver service is restarted the initialisation units get restarted as well. Also, make sure taskserver-init.service will be ordered *before* taskserver.service. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Set up service namespacesaszlig2016-04-12
| | | | | | | | The Taskserver doesn't need access to the full /dev nor does it need a shared /tmp. In addition, the initialisation services don't need network access, so let's constrain them to the loopback device. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Finish module documentationaszlig2016-04-12
| | | | | | | | Apart from the options manual, this should cover the basics for setting up a Taskserver. I am not a native speaker so this can and (probably) should be improved, especially the wording/grammar. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver/helper: Improve CLI subcommandsaszlig2016-04-12
| | | | | | | Try to match the subcommands to act more like the subcommands from the taskd binary and also add a subcommand to list groups. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Set allowedTCPPorts accordinglyaszlig2016-04-12
| | | | | | | | | | | | | | | | | As suggested by @matthiasbeyer: "We might add a short note that this port has to be opened in the firewall, or is this done by the service automatically?" This commit now adds the listenPort to networking.firewall.allowedTCPPorts as soon as the listenHost is not "localhost". In addition to that, this is now also documented in the listenHost option declaration and I have removed disabling of the firewall from the VM test. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Reorder into one mkMergeaszlig2016-04-12
| | | | | | | | | No changes in functionality but rather just restructuring the module definitions to be one mkMerge, which now uses mkIf from the top-level scope of the CA initialization service so we can better abstract additional options we might need there. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver/helper: Assert CA existenceaszlig2016-04-12
| | | | | | | | | | We want to make sure that the helper tool won't work if the automatic CA wasn't properly set up. This not only avoids race conditions if the tool is started before the actual service is running but it also fails if something during CA setup has failed so the user can investigate what went wrong. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Setup CA before main serviceaszlig2016-04-12
| | | | | | | | | We need to explicitly make sure the CA is created before we actually launch the main Taskserver service in order to avoid race conditions where the preStart phase of the main service could possibly corrupt certificates if it would be started in parallel. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Introduce an extraConfig optionaszlig2016-04-12
| | | | | | | | | | | | | | | | | | | | | | | This is simply to add configuration lines to the generated configuration file. The reason why I didn't went for an attribute set is that the taskdrc file format doesn't map very well on Nix attributes, for example the following can be set in taskdrc: server = somestring server.key = anotherstring In order to use a Nix attribute set for that, it would be way too complicated, for example if we want to represent the mentioned example we'd have to do something like this: { server._top = somestring; server.key = anotherstring; } Of course, this would work as well but nothing is more simple than just appending raw strings. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Allow to specify expiration/bitsaszlig2016-04-12
| | | | | | | | | At least this should allow for some customisation of how the certificates and keys are created. We now have two sub-namespaces within PKI so it should be more clear which options you have to set if you want to either manage your own CA or let the module create it automatically. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Don't change imperative usersaszlig2016-04-12
| | | | | | | | | | | | | | | | | | | | Whenever the nixos-taskserver tool was invoked manually for creating an organisation/group/user we now add an empty file called .imperative to the data directory. During the preStart of the Taskserver service, we use process-json which in turn now checks whether those .imperative files exist and if so, it doesn't do anything with it. This should now ensure that whenever there is a manually created user, it doesn't get killed off by the declarative configuration in case it shouldn't exist within that configuration. In addition, we also add a small subtest to check whether this is happening or not and fail if the imperatively created user got deleted by process-json. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Silence certtool everywhereaszlig2016-04-12
| | | | | | | | | | We only print the output whenever there is an error, otherwise let's shut it up because it only shows information the user can gather through other means. For example by invoking certtool manually, or by just looking at private key files (the whole blurb it's outputting is in there as well). Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver/helper: Implement deletionaszlig2016-04-12
| | | | | | | | | | | | | | | | Now we finally can delete organisations, groups and users along with certificate revocation. The new subtests now make sure that the client certificate is also revoked (both when removing the whole organisation and just a single user). If we use the imperative way to add and delete users, we have to restart the Taskserver in order for the CRL to be effective. However, by using the declarative configuration we now get this for free, because removing a user will also restart the service and thus its client certificate will end up in the CRL. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Add a command to reload serviceaszlig2016-04-12
| | | | | | | | | | | Unfortunately we don't have a better way to check whether the reload has been done successfully, but at least we now *can* reload it without figuring out the exact signal to send to the process. Note that on reload, Taskserver will not reload the CRL file. For that to work, a full restart needs to be done. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Generate a cert revocation listaszlig2016-04-11
| | | | | | | | | | | | If we want to revoke client certificates and want the server to actually notice the revocation, we need to have a valid certificate revocation list. Right now the expiration_days is set to 10 years, but that's merely to actually get certtool to actually generate the CRL without trying to prompt for user input. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Constrain server cert permsaszlig2016-04-11
| | | | | | | | | | | It doesn't do much harm to make the server certificate world readable, because even though it's not accessible anymore via the file system, someone can still get it by simply doing a TLS handshake with the server. So this is solely for consistency. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Handle declarative conf via JSONaszlig2016-04-11
| | | | | | | | | | | | | | | | | | | | We now no longer have the stupid --service-helper option, which silences messages about already existing organisations, users or groups. Instead of that option, we now have a new subcommand called "process-json", which accepts a JSON file directly from the specified NixOS module options and creates/deletes the users accordingly. Note that this still has a two issues left to solve in this area: * Deletion is not supported yet. * If a user is created imperatively, the next run of process-json will delete it once deletion is supported. So we need to implement deletion and a way to mark organisations, users and groups as "imperatively managed". Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver/helper: Factor out program logicaszlig2016-04-11
| | | | | | | | | | | | | | | | The Click functions really are for the command line and should be solely used for that. What I have in mind is that instead of that crappy --service-helper argument, we should really have a new subcommand that is expecting JSON which is directly coming from the services.taskserver.organisations module option. That way we can decrease even more boilerplate and we can also ensure that organisations, users and groups get properly deleted if they're removed from the NixOS configuration. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Link to manual within .enableaszlig2016-04-11
| | | | | | | | With <olink/> support in place, we can now reference the Taskserver section within the NixOS manual, so that users reading the manpage of configuration.nix(5) won't miss this information. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Set server.crl for automatic CAaszlig2016-04-11
| | | | | | | Currently, we don't handle this yet, but let's set it so that we cover all the options. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Rename .pki optionsaszlig2016-04-11
| | | | | | | | | We're now using .pki.server.* and .pki.ca.* so that it's entirely clear what these keys/certificates are for. For example we had just .pki.key before, which doesn't really tell very much about what it's for except if you look at the option description. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Improve doc for PKI optionsaszlig2016-04-11
| | | | | | | | The improvement here is just that we're adding a big <note/> here so that users of these options are aware that whenever they're setting one of these the certificates and keys are _not_ created automatically. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Move .trust out of .pkiaszlig2016-04-11
| | | | | | | | This is clearly a server configuration option and has nothing to do with certificate creation and signing, so let's move it away from the .pki namespace. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Move .pki.fqdn to .fqdnaszlig2016-04-11
| | | | | | | | | | | | It's not necessarily related to the PKI options, because this is also used for setting the server address on the Taskwarrior client. So if someone doesn't have his/her own certificates from another CA, all options that need to be adjusted are in .pki. And if someone doesn't want to bother with getting certificates from another CA, (s)he just doesn't set anything in .pki. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Rename .server options to .pkiaszlig2016-04-11
| | | | | | | | | | After moving out the PKI-unrelated options, let's name this a bit more appropriate, so we can finally get rid of the taskserver.server thing. This also moves taskserver.caCert to taskserver.pki.caCert, because that clearly belongs to the PKI options. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Rename server.{host,port}aszlig2016-04-11
| | | | | | | | | Having an option called services.taskserver.server.host is quite confusing because we already have "server" in the service name, so let's first get rid of the listening options before we rename the rest of the options in that .server attribute. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Rewrite helper-tool in Pythonaszlig2016-04-11
| | | | | | | | | | | | | | | | | | In the comments of the pull request @nbp wrote: "Why is it implemented in 3 different languages: Nix, Bash and C?" And he's right, it doesn't make sense, because we were using C as a runuser replacement and used Nix to generate the shellscript boilerplates. Writing this in Python gets rid of all of this and we also don't need the boilerplate as well, because we're using Click to handle all the command line stuff. Note that this currently is a 1:1 implementation of what we had before. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Remove client.cert optionaszlig2016-04-10
| | | | | | | | | | | The option is solely for debugging purposes (particularly the unit tests of the project itself) and doesn't make sense to include it in the NixOS module options. If people want to use this, we might want to introduce another option so that we can insert arbitrary configuration lines. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Add module documentationaszlig2016-04-07
| | | | | | | It's not by any means exhaustive, but we're still going to change the implementation, so let's just use this as a starting point. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
* nixos/taskserver: Rename client.{allow,deny}aszlig2016-04-07
| | | | | | | | | These values match against the client IDs only, so let's rename it to something that actually reflects that. Having client.cert in the same namespace also could lead to confusion, because the client.cert setting is for the *debugging* client only. Signed-off-by: aszlig <aszlig@redmoonstudios.org>