Commit Graph

343 Commits

Author SHA1 Message Date
Luflosi
ada7f14219
kubo: 0.19.2 -> 0.20.0
https://github.com/ipfs/kubo/releases/tag/v0.20.0

When creating a repository with `ipfs init`, `--empty-repo=true` is now the default according to the changelog. Modify the NixOS module to reflect this change and fix the `emptyRepo` setting to work with this change.
2023-05-10 19:50:46 +02:00
Sandro
7b22f5b4a2
Merge pull request #215494 from poelzi/webdav-server-rs-debug 2023-05-10 14:29:26 +02:00
Artturi
b83db86a9e
Merge pull request #222080 from Stunkymonkey/nixos-optionalString 2023-04-20 16:07:30 +03:00
Luflosi
f2be3ae30d
nixos/kubo: restrict access to the API to users in a group by default 2023-04-15 15:25:20 +02:00
Luflosi
7ceebbb35b
nixos/kubo: allow multiple API and Gateway addresses
The daemon allows specifying an array of multiaddrs for Addresses.API and Addresses.Gateway, so the NixOS module should allow that as well.
2023-04-15 15:25:06 +02:00
Luflosi
929a00bd84
nixos/kubo: give normal users access to the daemon by default
Fixes https://github.com/NixOS/nixpkgs/issues/223289.

This doesn't reduce the security in any way since it was already possible for normal users to do what I do here and create such a fake repo for themselves and set their $IPFS_PATH variable to it. It was and still is also possible to just use the --api CLI option.
This change just removes the manual setup that would otherwise be required.

We wouldn't need this workaround if https://github.com/ipfs/kubo/pull/9366 was merged but the fix seems to have been ignored upstream. Patching it ourselves seems like a bad idea since the patch has security implications.
2023-04-15 15:24:58 +02:00
Karmanyaah Malhotra
6086d85777 nixos/kubo: documentation suggestions
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2023-04-13 03:14:59 -05:00
Karmanyaah Malhotra
4bd622cd9d nixos/kubo: unmount on service stop
When kubo is force killed with `pkill -KILL ipfs` or by systemd-oomd,
it doesn't unmount /ipfs and /ipns. That prevents it
from starting up the next time. So, unmount on postStop.
2023-04-13 03:14:59 -05:00
Michael Raitza
9f0e1b6047 modules.openafsServer: Add FABS backup server 2023-04-11 08:30:56 -03:00
Felix Buehler
327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
Luflosi
ef9c99a035
nixos/kubo: add QUICv1 and WebTransport to Addresses.Swarm list
According to https://github.com/ipfs/kubo/blob/v0.18.0/docs/config.md#addressesswarm, the default list of swarm multiaddrs includes QUICv1 and WebTransport since v0.18.0.
More information can be found in the release notes at https://github.com/ipfs/kubo/releases/tag/v0.18.0.
2023-03-22 20:02:56 +01:00
Daniel Poelzleithner
fa60722e96 webdav-server-rs: Add debug option 2023-02-09 11:53:06 +01:00
pennae
bf4c0c1900 nixos/*: remove trailing period in mkEnableOptions
those are added by mkEnableOption, and .. is replaced to … by markdown
processing.
2023-02-08 15:23:34 +01:00
Sandro
8b598ff3d6
Merge pull request #199731 from Luflosi/kubo-idempotence 2023-01-31 22:12:49 +01:00
pennae
0a6e6cf7e6 nixos/manual: render module chapters with nixos-render-docs
this converts meta.doc into an md pointer, not an xml pointer. since we
no longer need xml for manual chapters we can also remove support for
manual chapters from md-to-db.sh

since pandoc converts smart quotes to docbook quote elements and our
nixos-render-docs does not we lose this distinction in the rendered
output. that's probably not that bad, our stylesheet didn't make use of
this anyway (and pre-23.05 versions of the chapters didn't use quote
elements either).

also updates the nixpkgs manual to clarify that option docs support all
extensions (although it doesn't support headings at all, so heading
anchors don't work by extension).
2023-01-27 20:07:34 +01:00
Luflosi
78f357f134
nixos/kubo: make the configuration options idempotent
Without this commit, unsetting any of the `services.kubo.settings` options does not reset the value back to the default. This commit gets rid of this statefulness.
This is achieved by generating the default config, applying the user specified config options to it and then patching the `Identity` and `Pinning` config options from the old config back in. This new config is then applied using `ipfs config replace`.
The only remaining stateful parts of the config are the `Identity` and `Pinning.RemoteServices` settings as those can't be changed with `ipfs config replace`. `Pinning.RemoteServices` also contains secrets that shouldn't be in the Nix store. Setting these options wasn't possible before as it would result in an error when the daemon tried to start. I added some assertions to guard against this case.
2023-01-24 16:33:03 +01:00
pennae
53fc887582 nixos/manual: move "edit the MD file" comments to generated XML 2023-01-10 12:34:37 +01:00
pennae
bf92eaebe4 nixos/manual: generate module chapters with md-to-db.sh 2023-01-10 10:32:00 +01:00
pennae
23ea73b416 nixos/manual: enable smart quotes for all MD chapters 2023-01-10 10:31:59 +01:00
pennae
d075d2c276 nixos/litestream: convert manual chapter to MD 2023-01-10 10:31:57 +01:00
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Daniel Nagy
ad866e565d
treewide: switch to port type for nixos modules 2022-12-08 00:00:00 +01:00
Daniel Nagy
b4674b39c1
treewide: use mkEnableOption in nixos modules 2022-11-10 09:30:00 +01:00
Sandro
432e5e65a9
Merge pull request #197104 from Luflosi/kubo-RFC42 2022-10-27 23:48:33 +02:00
KFears
9f963f36e5 nixos/grafana: refactor settings for RFC42 2022-10-22 23:56:14 +04:00
Luflosi
a255c43f44
nixos/kubo: convert to RFC42-style settings 2022-10-21 20:54:00 +02:00
Luflosi
eefaaf41d6
kubo: rename from ipfs
Go-IPFS was renamed to Kubo in version 0.14.0, see https://github.com/ipfs/kubo/issues/8959.
2022-10-02 16:00:22 +02:00
pennae
f2ea09ecbe nixos/*: convert options with listings
minor rendering changes.
2022-08-31 17:27:36 +02:00
pennae
722b99bc0e nixos/*: convert options with admonitions to MD
rendering changes only slightly, most changes are in spacing.
2022-08-31 16:36:16 +02:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00
pennae
6039648c50 nixos/*: automatically convert option docs 2022-08-19 22:40:58 +02:00
pennae
7e7d68a250 nixos/*: mark pre-existing markdown descriptions as mdDoc 2022-08-19 22:40:58 +02:00
pennae
b51f8036c2 nixos/*: use properly indented strings for option docs
using regular strings works well for docbook because docbook is not as
whitespace-sensitive as markdown. markdown would render all of these as
code blocks when given the chance.
2022-08-19 22:40:58 +02:00
pennae
087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02:00
pennae
423545fe48 nixos/*: normalize manpage references to single-line form
now nix-doc-munge will not introduce whitespace changes when it replaces
manpage references with the MD equivalent.

no change to the manpage, changes to the HTML manual are whitespace only.
2022-08-05 18:34:50 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Sandro
f7f8721b1e
Merge pull request #162689 from astro/glusterfs
nixos/glusterfs: exclude hook "S10selinux-label-brick.sh"
2022-07-21 22:15:00 +02:00
Artturi
3cff3f75b4
Merge pull request #166340 from max-privatevoid/patch-6 2022-06-28 19:55:10 +03:00
Max
2a8bf9777d nixos/ipfs: do not leak config to journal on startup
The preStart script for the IPFS service will print parts of the configuration
to stdout (and therefore, the journal) when applying profiles on startup. This
may lead to unwanted disclosure of private information, such as remote pinning
service API keys. Fix by sending stdout to /dev/null.
2022-06-17 23:41:27 +02:00
Max
72d6d73e37 nixos/ipfs: Only set ReadWritePaths when hardened
Co-authored-by: Luflosi <Luflosi@users.noreply.github.com>
2022-04-16 20:48:28 +02:00
Luflosi
faad370edc nixos/ipfs: fix the services.ipfs.autoMigrate option
Apparently this was never properly tested and never worked. When the IPFS repo needs upgrading, the first call to ipfs, which is run before running the migration, fails with the error message "Error: ipfs repo needs migration".
To fix this, simply run the migration before any `ipfs config` calls but don't run it when `dataDir` is empty and we need to call `ipfs init`.
Writing a NixOS test for this would require keeping at least two versions of IPFS in Nixpkgs, which we don't currently do.
2022-04-16 07:38:13 -04:00
Luflosi
8a5e51525d nixos/ipfs: add Luflosi as maintainer 2022-04-16 07:38:13 -04:00
Luflosi
6b2eca8d56 nixos/ipfs: remove unused code
This code became obsolete with 4044d81d5c, just a couple days after it was introduced.
2022-04-16 07:38:13 -04:00
Robert Hensing
39e0bd705b
Merge pull request #165259 from Luflosi/ipfs-recursiveUpdate
nixos/ipfs: use lib.recursiveUpdate instead of // operator
2022-04-05 19:16:39 +02:00
Luflosi
ec415055ba nixos/ipfs: improve how the commandline flags are generated
Use `utils.escapeSystemdExecArgs` instead of relying on the exact way in which `toString` formats a list.
In https://github.com/NixOS/nixpkgs/pull/156706#discussion_r795867283 a suggestion was made and then implemented to replace `toString` with `concatStringsSep " "`.
@pennae then suggested to use `utils.escapeSystemdExecArgs` instead in https://github.com/NixOS/nixpkgs/pull/164846#issuecomment-1073001848.
2022-03-24 20:42:07 +00:00
Luflosi
38f1576ba9
nixos/ipfs: use lib.recursiveUpdate instead of // operator
Use `recursiveUpdate` instead of the // operator, as recommended in https://nix.dev/anti-patterns/language#attr1-attr2-merge-operator. Without this change, setting `services.ipfs.extraConfig.Addresses.NoAnnounce` for example will cause `services.ipfs.apiAddress`, `services.ipfs.gatewayAddress` and `services.ipfs.swarmAddress` to be ignored.
2022-03-22 13:01:35 +01:00
Luflosi
41d45d674a
nixos/ipfs: add systemd hardening
Use the hardened systemd unit from upstream.
2022-03-22 11:12:14 +01:00
Pascal Bach
4c3c80df54
Merge pull request #114393 from DarkDNA/feature/samba/network-online
nixos/samba: Add a wants=network-online.target to the target.
2022-03-21 19:25:50 +01:00
Astro
06ea5e780b nixos/glusterfs: exclude hook "S10selinux-label-brick.sh"
fails due to missing selinux binaries
2022-03-06 21:09:05 +01:00
Luflosi
0eb1d070c8 ipfs-migrator: 1.7.1 -> 2.0.2
https://github.com/ipfs/fs-repo-migrations/releases/tag/v2.0.2

This is pretty much a complete rewrite of the ipfs-migrator package.
In version 2.0.0 a major change was made to the way the migrator works. Before, there was one binary that contained every migration. Now every migration has its own binary. If fs-repo-migrations can't find a required binary in the PATH, it will download it off the internet. To prevent that, build every migration individually, symlink them all into one package and then wrap fs-repo-migrations so it finds the package with all the migrations.
The change to the IPFS NixOS module and the IPFS package is needed because without explicitly specifying a repo version to migrate to, fs-repo-migrations will query the internet to find the latest version. This fails in the sandbox, for example when testing the ipfs passthru tests.
While it may seem like the repoVersion and IPFS version are in sync and the code could be simplified, this is not the case. See https://github.com/ipfs/fs-repo-migrations#when-should-i-migrate for a table with the IPFS versions and corresponding repo versions.
Go 1.17 breaks the migrations, so use Go 1.16 instead. This is also the Go version used in their CI, see 3dc218e300/.github/workflows/test.yml (L4). See https://github.com/ipfs/fs-repo-migrations/pull/140#issuecomment-982715907 for a previous mention of this issue. The issue manifests itself when doing anything with a migration, for example `fs-repo-11-to-12 --help`:
```
panic: qtls.ClientHelloInfo doesn't match

goroutine 1 [running]:
github.com/marten-seemann/qtls-go1-15.init.0()
	github.com/marten-seemann/qtls-go1-15@v0.1.1/unsafe.go:20 +0x132
```
Also add myself as a maintainer for this package.
This fixes the test failure discovered in https://github.com/NixOS/nixpkgs/pull/160914.
See https://github.com/ipfs/fs-repo-migrations/issues/148 to read some of my struggles with updating this package.
2022-02-25 11:12:19 -08:00