ChangeLog: https://github.com/gotify/server/releases/tag/v2.0.22
ChangeLog: https://github.com/gotify/server/releases/tag/v2.0.23
ChangeLog: https://github.com/gotify/server/releases/tag/v2.1.0
While the update only contains a few small features and a few bugfixes,
the change was rather messy for us unfortunately:
* It seems as if `npmjs.org`-packages can't be transformed into
`pkg___pkg-x.y.z` for Yarn's offline cache. The name
`https___registry.npmjs.org_caniuse_lite___caniuse_lite_1.0.30001237.tgz`
isn't the problem because when changing the URL "parser" of `yarn2nix`
to transform this into `org_caniuse_lite___caniuse_lite_1.0.30001237`
this doesn't help either.
Instead, I derived the fix from `gitlab`[1] where `yarn.lock` gets
patched to make sure that it detects the package in the offline-cache
properly.
* The frontend is now built with `react-scripts`. This is a problem for
us because it tries to write into `node_modules/.cache` even though
`node_modules` is a store-path in the context of `yarn2nix`[2].
The change isn't pretty, but solves the issue for us.
[1] f007b794c7/pkgs/applications/version-management/gitlab/default.nix (L85-L86)
[2] https://github.com/facebook/create-react-app/issues/11263
After bisecting `nixpkgs-master` I realized that the usage of
`-trimpath`[0] by default for Go modules[1] is responsible for breaking UI
delivery of `gotify-server`[2].
This behavior can only be turned off by setting `allowGoReference` to
`true`.
We may want to find a better long-term fix, but given that this only
affects a leaf-package and actually fixes the problem, this is good
enough for now.
Fixes#105472
[0] https://golang.org/doc/go1.13#go-command
[1] 4e9f7bbf85
[2] https://hydra.nixos.org/build/131660876
In version 2.0.15 `gotify` switched to `packr` at 2.x which is why the
UI can't be served properly via HTTP and causes an empty 500 response and
the following errors in `journald`:
```
2020/09/12 19:18:33 [Recovery] 2020/09/12 - 19:18:33 panic recovered:
GET / HTTP/1.1
Host: localhost:8080
Accept: */*
User-Agent: curl/7.72.0
stat /home/ma27/Projects/ui/build/index.html: no such file or directory
```
This wasn't caught by the VM-test as it only tested the REST and push
APIs. Using their internal `packr.go` script in our build as it's the
case in the upstream build-system[1] fixes the issue.
[1] https://github.com/gotify/server/pull/277/files#diff-b67911656ef5d18c4ae36cb6741b7965R48