2018-11-11 11:30:07 +00:00
|
|
|
{ system, pkgs, callTest }:
|
|
|
|
# The return value of this function will be an attrset with arbitrary depth and
|
|
|
|
# the `anything` returned by callTest at its test leafs.
|
|
|
|
# The tests not supported by `system` will be replaced with `{}`, so that
|
2018-11-11 13:55:23 +00:00
|
|
|
# `passthru.tests` can contain links to those without breaking on architectures
|
2018-11-11 11:30:07 +00:00
|
|
|
# where said tests are unsupported.
|
|
|
|
# Example callTest that just extracts the derivation from the test:
|
|
|
|
# callTest = t: t.test;
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
discoverTests = val:
|
|
|
|
if !isAttrs val then val
|
|
|
|
else if hasAttr "test" val then callTest val
|
|
|
|
else mapAttrs (n: s: discoverTests s) val;
|
|
|
|
handleTest = path: args:
|
|
|
|
discoverTests (import path ({ inherit system pkgs; } // args));
|
|
|
|
handleTestOn = systems: path: args:
|
|
|
|
if elem system systems then handleTest path args
|
|
|
|
else {};
|
|
|
|
in
|
|
|
|
{
|
2019-10-10 11:56:05 +00:00
|
|
|
_3proxy = handleTest ./3proxy.nix {};
|
2018-11-11 12:27:58 +00:00
|
|
|
acme = handleTestOn ["x86_64-linux"] ./acme.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
atd = handleTest ./atd.nix {};
|
2019-04-12 23:06:11 +00:00
|
|
|
automysqlbackup = handleTest ./automysqlbackup.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
avahi = handleTest ./avahi.nix {};
|
2019-10-11 23:30:55 +00:00
|
|
|
babeld = handleTest ./babeld.nix {};
|
2018-11-11 12:27:58 +00:00
|
|
|
bcachefs = handleTestOn ["x86_64-linux"] ./bcachefs.nix {}; # linux-4.18.2018.10.12 is unsupported on aarch64
|
2019-02-22 13:10:02 +00:00
|
|
|
beanstalkd = handleTest ./beanstalkd.nix {};
|
2019-11-24 00:10:17 +00:00
|
|
|
bees = handleTest ./bees.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
bind = handleTest ./bind.nix {};
|
|
|
|
bittorrent = handleTest ./bittorrent.nix {};
|
2020-01-23 16:19:53 +00:00
|
|
|
buildkite-agents = handleTest ./buildkite-agents.nix {};
|
2018-11-11 12:27:58 +00:00
|
|
|
boot = handleTestOn ["x86_64-linux"] ./boot.nix {}; # syslinux is unsupported on aarch64
|
2018-11-11 11:30:07 +00:00
|
|
|
boot-stage1 = handleTest ./boot-stage1.nix {};
|
|
|
|
borgbackup = handleTest ./borgbackup.nix {};
|
|
|
|
buildbot = handleTest ./buildbot.nix {};
|
2019-10-09 11:32:03 +00:00
|
|
|
caddy = handleTest ./caddy.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
cadvisor = handleTestOn ["x86_64-linux"] ./cadvisor.nix {};
|
2020-02-19 19:43:48 +00:00
|
|
|
cage = handleTest ./cage.nix {};
|
2019-04-22 16:06:40 +00:00
|
|
|
cassandra = handleTest ./cassandra.nix {};
|
2019-11-01 12:12:18 +00:00
|
|
|
ceph-single-node = handleTestOn ["x86_64-linux"] ./ceph-single-node.nix {};
|
|
|
|
ceph-multi-node = handleTestOn ["x86_64-linux"] ./ceph-multi-node.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
certmgr = handleTest ./certmgr.nix {};
|
|
|
|
cfssl = handleTestOn ["x86_64-linux"] ./cfssl.nix {};
|
|
|
|
chromium = (handleTestOn ["x86_64-linux"] ./chromium.nix {}).stable or {};
|
|
|
|
cjdns = handleTest ./cjdns.nix {};
|
2018-12-19 14:06:53 +00:00
|
|
|
clickhouse = handleTest ./clickhouse.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
cloud-init = handleTest ./cloud-init.nix {};
|
|
|
|
codimd = handleTest ./codimd.nix {};
|
2019-11-24 14:08:53 +00:00
|
|
|
consul = handleTest ./consul.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
containers-bridge = handleTest ./containers-bridge.nix {};
|
2019-08-18 19:37:38 +00:00
|
|
|
containers-ephemeral = handleTest ./containers-ephemeral.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
containers-extra_veth = handleTest ./containers-extra_veth.nix {};
|
|
|
|
containers-hosts = handleTest ./containers-hosts.nix {};
|
|
|
|
containers-imperative = handleTest ./containers-imperative.nix {};
|
2019-11-25 23:44:12 +00:00
|
|
|
containers-ip = handleTest ./containers-ip.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
containers-macvlans = handleTest ./containers-macvlans.nix {};
|
|
|
|
containers-physical_interfaces = handleTest ./containers-physical_interfaces.nix {};
|
2019-12-10 19:34:37 +00:00
|
|
|
containers-portforward = handleTest ./containers-portforward.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
containers-restart_networking = handleTest ./containers-restart_networking.nix {};
|
|
|
|
containers-tmpfs = handleTest ./containers-tmpfs.nix {};
|
2020-01-07 16:52:32 +00:00
|
|
|
corerad = handleTest ./corerad.nix {};
|
2019-07-24 18:48:43 +00:00
|
|
|
couchdb = handleTest ./couchdb.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
deluge = handleTest ./deluge.nix {};
|
|
|
|
dhparams = handleTest ./dhparams.nix {};
|
2020-02-01 23:59:02 +00:00
|
|
|
dnscrypt-proxy2 = handleTestOn ["x86_64-linux"] ./dnscrypt-proxy2.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
docker = handleTestOn ["x86_64-linux"] ./docker.nix {};
|
2019-03-24 22:59:09 +00:00
|
|
|
docker-containers = handleTestOn ["x86_64-linux"] ./docker-containers.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
docker-edge = handleTestOn ["x86_64-linux"] ./docker-edge.nix {};
|
|
|
|
docker-preloader = handleTestOn ["x86_64-linux"] ./docker-preloader.nix {};
|
|
|
|
docker-registry = handleTest ./docker-registry.nix {};
|
|
|
|
docker-tools = handleTestOn ["x86_64-linux"] ./docker-tools.nix {};
|
|
|
|
docker-tools-overlay = handleTestOn ["x86_64-linux"] ./docker-tools-overlay.nix {};
|
2019-03-26 18:04:28 +00:00
|
|
|
documize = handleTest ./documize.nix {};
|
2019-12-25 22:04:55 +00:00
|
|
|
dokuwiki = handleTest ./dokuwiki.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
dovecot = handleTest ./dovecot.nix {};
|
|
|
|
# ec2-config doesn't work in a sandbox as the simulated ec2 instance needs network access
|
|
|
|
#ec2-config = (handleTestOn ["x86_64-linux"] ./ec2.nix {}).boot-ec2-config or {};
|
|
|
|
ec2-nixops = (handleTestOn ["x86_64-linux"] ./ec2.nix {}).boot-ec2-nixops or {};
|
|
|
|
ecryptfs = handleTest ./ecryptfs.nix {};
|
2019-06-15 09:16:28 +00:00
|
|
|
ejabberd = handleTest ./xmpp/ejabberd.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
elk = handleTestOn ["x86_64-linux"] ./elk.nix {};
|
|
|
|
env = handleTest ./env.nix {};
|
|
|
|
etcd = handleTestOn ["x86_64-linux"] ./etcd.nix {};
|
2019-07-09 23:46:21 +00:00
|
|
|
etcd-cluster = handleTestOn ["x86_64-linux"] ./etcd-cluster.nix {};
|
2019-10-29 14:06:32 +00:00
|
|
|
fancontrol = handleTest ./fancontrol.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
ferm = handleTest ./ferm.nix {};
|
|
|
|
firefox = handleTest ./firefox.nix {};
|
2020-02-10 17:01:47 +00:00
|
|
|
firefox-esr = handleTest ./firefox.nix { esr = true; };
|
2018-11-11 11:30:07 +00:00
|
|
|
firewall = handleTest ./firewall.nix {};
|
2018-12-17 19:12:09 +00:00
|
|
|
fish = handleTest ./fish.nix {};
|
2019-02-12 17:26:08 +00:00
|
|
|
flannel = handleTestOn ["x86_64-linux"] ./flannel.nix {};
|
2019-07-29 15:35:27 +00:00
|
|
|
fluentd = handleTest ./fluentd.nix {};
|
2019-08-29 12:02:20 +00:00
|
|
|
fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {};
|
2020-01-07 14:53:34 +00:00
|
|
|
freeswitch = handleTest ./freeswitch.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
fsck = handleTest ./fsck.nix {};
|
2020-03-05 21:11:28 +00:00
|
|
|
gerrit = handleTest ./gerrit.nix {};
|
2019-10-25 13:14:57 +00:00
|
|
|
gotify-server = handleTest ./gotify-server.nix {};
|
2020-02-07 22:30:40 +00:00
|
|
|
grocy = handleTest ./grocy.nix {};
|
2020-02-26 13:05:00 +00:00
|
|
|
gitdaemon = handleTest ./gitdaemon.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
gitea = handleTest ./gitea.nix {};
|
|
|
|
gitlab = handleTest ./gitlab.nix {};
|
|
|
|
gitolite = handleTest ./gitolite.nix {};
|
2019-12-04 23:10:57 +00:00
|
|
|
gitolite-fcgiwrap = handleTest ./gitolite-fcgiwrap.nix {};
|
2019-08-16 23:28:43 +00:00
|
|
|
glusterfs = handleTest ./glusterfs.nix {};
|
2019-08-07 02:01:17 +00:00
|
|
|
gnome3-xorg = handleTest ./gnome3-xorg.nix {};
|
|
|
|
gnome3 = handleTest ./gnome3.nix {};
|
2019-11-06 00:56:21 +00:00
|
|
|
installed-tests = pkgs.recurseIntoAttrs (handleTest ./installed-tests {});
|
2018-11-11 11:30:07 +00:00
|
|
|
gocd-agent = handleTest ./gocd-agent.nix {};
|
|
|
|
gocd-server = handleTest ./gocd-server.nix {};
|
2019-05-17 01:29:17 +00:00
|
|
|
google-oslogin = handleTest ./google-oslogin {};
|
2018-11-11 11:30:07 +00:00
|
|
|
grafana = handleTest ./grafana.nix {};
|
|
|
|
graphite = handleTest ./graphite.nix {};
|
2019-07-09 00:01:43 +00:00
|
|
|
graylog = handleTest ./graylog.nix {};
|
2019-11-27 07:01:46 +00:00
|
|
|
gvisor = handleTest ./gvisor.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
hadoop.hdfs = handleTestOn [ "x86_64-linux" ] ./hadoop/hdfs.nix {};
|
|
|
|
hadoop.yarn = handleTestOn [ "x86_64-linux" ] ./hadoop/yarn.nix {};
|
2018-11-12 06:45:00 +00:00
|
|
|
handbrake = handleTestOn ["x86_64-linux"] ./handbrake.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
haproxy = handleTest ./haproxy.nix {};
|
2019-01-06 13:04:41 +00:00
|
|
|
hardened = handleTest ./hardened.nix {};
|
2020-03-26 13:33:57 +00:00
|
|
|
# 9pnet_virtio used to mount /nix partition doesn't support
|
|
|
|
# hibernation. This test happens to work on x86_64-linux but
|
|
|
|
# not on other platforms.
|
|
|
|
hibernate = handleTestOn ["x86_64-linux"] ./hibernate.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
hitch = handleTest ./hitch {};
|
|
|
|
hocker-fetchdocker = handleTest ./hocker-fetchdocker {};
|
|
|
|
home-assistant = handleTest ./home-assistant.nix {};
|
|
|
|
hound = handleTest ./hound.nix {};
|
|
|
|
hydra = handleTest ./hydra {};
|
2020-03-27 21:09:13 +00:00
|
|
|
hydra-db-migration = handleTest ./hydra/db-migration.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
i3wm = handleTest ./i3wm.nix {};
|
2019-07-07 01:03:59 +00:00
|
|
|
icingaweb2 = handleTest ./icingaweb2.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
iftop = handleTest ./iftop.nix {};
|
2019-09-16 15:08:32 +00:00
|
|
|
ihatemoney = handleTest ./ihatemoney.nix {};
|
2018-11-14 22:51:15 +00:00
|
|
|
incron = handleTest ./incron.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
influxdb = handleTest ./influxdb.nix {};
|
|
|
|
initrd-network-ssh = handleTest ./initrd-network-ssh {};
|
|
|
|
initrdNetwork = handleTest ./initrd-network.nix {};
|
|
|
|
installer = handleTest ./installer.nix {};
|
2020-02-02 12:00:00 +00:00
|
|
|
iodine = handleTest ./iodine.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
ipv6 = handleTest ./ipv6.nix {};
|
2019-01-25 06:09:36 +00:00
|
|
|
jackett = handleTest ./jackett.nix {};
|
2019-05-01 09:57:34 +00:00
|
|
|
jellyfin = handleTest ./jellyfin.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
jenkins = handleTest ./jenkins.nix {};
|
2020-02-06 16:00:19 +00:00
|
|
|
jirafeau = handleTest ./jirafeau.nix {};
|
2019-04-01 12:39:25 +00:00
|
|
|
kafka = handleTest ./kafka.nix {};
|
2019-12-22 07:45:31 +00:00
|
|
|
keepalived = handleTest ./keepalived.nix {};
|
2019-01-11 04:36:51 +00:00
|
|
|
kerberos = handleTest ./kerberos/default.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
kernel-latest = handleTest ./kernel-latest.nix {};
|
|
|
|
kernel-lts = handleTest ./kernel-lts.nix {};
|
2019-04-01 12:31:36 +00:00
|
|
|
kernel-testing = handleTest ./kernel-testing.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
keymap = handleTest ./keymap.nix {};
|
2019-03-13 00:12:56 +00:00
|
|
|
knot = handleTest ./knot.nix {};
|
2020-02-14 08:56:43 +00:00
|
|
|
krb5 = discoverTests (import ./krb5 {});
|
2018-11-11 11:30:07 +00:00
|
|
|
kubernetes.dns = handleTestOn ["x86_64-linux"] ./kubernetes/dns.nix {};
|
|
|
|
# kubernetes.e2e should eventually replace kubernetes.rbac when it works
|
|
|
|
#kubernetes.e2e = handleTestOn ["x86_64-linux"] ./kubernetes/e2e.nix {};
|
|
|
|
kubernetes.rbac = handleTestOn ["x86_64-linux"] ./kubernetes/rbac.nix {};
|
|
|
|
latestKernel.login = handleTest ./login.nix { latestKernel = true; };
|
|
|
|
ldap = handleTest ./ldap.nix {};
|
|
|
|
leaps = handleTest ./leaps.nix {};
|
2019-01-24 22:09:42 +00:00
|
|
|
lidarr = handleTest ./lidarr.nix {};
|
2019-08-06 22:29:50 +00:00
|
|
|
lightdm = handleTest ./lightdm.nix {};
|
2019-03-16 12:24:23 +00:00
|
|
|
limesurvey = handleTest ./limesurvey.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
login = handleTest ./login.nix {};
|
2019-06-27 16:11:09 +00:00
|
|
|
loki = handleTest ./loki.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
#logstash = handleTest ./logstash.nix {};
|
2019-11-05 10:57:05 +00:00
|
|
|
lorri = handleTest ./lorri/default.nix {};
|
2019-11-13 18:17:32 +00:00
|
|
|
magnetico = handleTest ./magnetico.nix {};
|
2019-03-27 11:35:24 +00:00
|
|
|
mailcatcher = handleTest ./mailcatcher.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
mathics = handleTest ./mathics.nix {};
|
2019-10-04 20:38:58 +00:00
|
|
|
matomo = handleTest ./matomo.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
matrix-synapse = handleTest ./matrix-synapse.nix {};
|
2019-06-06 01:19:11 +00:00
|
|
|
mediawiki = handleTest ./mediawiki.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
memcached = handleTest ./memcached.nix {};
|
|
|
|
mesos = handleTest ./mesos.nix {};
|
2019-08-18 07:28:16 +00:00
|
|
|
metabase = handleTest ./metabase.nix {};
|
2018-12-21 18:36:58 +00:00
|
|
|
miniflux = handleTest ./miniflux.nix {};
|
2019-02-05 16:38:34 +00:00
|
|
|
minio = handleTest ./minio.nix {};
|
2019-03-07 10:29:25 +00:00
|
|
|
minidlna = handleTest ./minidlna.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
misc = handleTest ./misc.nix {};
|
2019-07-15 23:06:19 +00:00
|
|
|
moinmoin = handleTest ./moinmoin.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
mongodb = handleTest ./mongodb.nix {};
|
2019-06-21 14:09:15 +00:00
|
|
|
moodle = handleTest ./moodle.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
morty = handleTest ./morty.nix {};
|
2019-04-24 08:23:13 +00:00
|
|
|
mosquitto = handleTest ./mosquitto.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
mpd = handleTest ./mpd.nix {};
|
|
|
|
mumble = handleTest ./mumble.nix {};
|
|
|
|
munin = handleTest ./munin.nix {};
|
|
|
|
mutableUsers = handleTest ./mutable-users.nix {};
|
2019-05-18 20:18:01 +00:00
|
|
|
mxisd = handleTest ./mxisd.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
mysql = handleTest ./mysql.nix {};
|
|
|
|
mysqlBackup = handleTest ./mysql-backup.nix {};
|
|
|
|
mysqlReplication = handleTest ./mysql-replication.nix {};
|
2019-12-30 12:00:00 +00:00
|
|
|
nagios = handleTest ./nagios.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
nat.firewall = handleTest ./nat.nix { withFirewall = true; };
|
|
|
|
nat.firewall-conntrack = handleTest ./nat.nix { withFirewall = true; withConntrackHelpers = true; };
|
|
|
|
nat.standalone = handleTest ./nat.nix { withFirewall = false; };
|
2019-02-03 15:47:01 +00:00
|
|
|
ndppd = handleTest ./ndppd.nix {};
|
2019-02-01 13:29:54 +00:00
|
|
|
neo4j = handleTest ./neo4j.nix {};
|
2019-05-25 22:35:29 +00:00
|
|
|
nesting = handleTest ./nesting.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
netdata = handleTest ./netdata.nix {};
|
|
|
|
networking.networkd = handleTest ./networking.nix { networkd = true; };
|
|
|
|
networking.scripted = handleTest ./networking.nix { networkd = false; };
|
|
|
|
# TODO: put in networking.nix after the test becomes more complete
|
|
|
|
networkingProxy = handleTest ./networking-proxy.nix {};
|
|
|
|
nextcloud = handleTest ./nextcloud {};
|
|
|
|
nexus = handleTest ./nexus.nix {};
|
2019-11-27 14:37:27 +00:00
|
|
|
# TODO: Test nfsv3 + Kerberos
|
|
|
|
nfs3 = handleTest ./nfs { version = 3; };
|
|
|
|
nfs4 = handleTest ./nfs { version = 4; };
|
2018-11-11 11:30:07 +00:00
|
|
|
nghttpx = handleTest ./nghttpx.nix {};
|
|
|
|
nginx = handleTest ./nginx.nix {};
|
nginx: Clear Last-Modified if ETag is from store
This is what I've suspected a while ago[1]:
> Heads-up everyone: After testing this in a few production instances,
> it seems that some browsers still get cache hits for new store paths
> (and changed contents) for some reason. I highly suspect that it might
> be due to the last-modified header (as mentioned in [2]).
>
> Going to test this with last-modified disabled for a little while and
> if this is the case I think we should improve that patch by disabling
> last-modified if serving from a store path.
Much earlier[2] when I reviewed the patch, I wrote this:
> Other than that, it looks good to me.
>
> However, I'm not sure what we should do with Last-Modified header.
> From RFC 2616, section 13.3.4:
>
> - If both an entity tag and a Last-Modified value have been
> provided by the origin server, SHOULD use both validators in
> cache-conditional requests. This allows both HTTP/1.0 and
> HTTP/1.1 caches to respond appropriately.
>
> I'm a bit nervous about the SHOULD here, as user agents in the wild
> could possibly just use Last-Modified and use the cached content
> instead.
Unfortunately, I didn't pursue this any further back then because
@pbogdan noted[3] the following:
> Hmm, could they (assuming they are conforming):
>
> * If an entity tag has been provided by the origin server, MUST
> use that entity tag in any cache-conditional request (using If-
> Match or If-None-Match).
Since running with this patch in some deployments, I found that both
Firefox and Chrome/Chromium do NOT re-validate against the ETag if the
Last-Modified header is still the same.
So I wrote a small NixOS VM test with Geckodriver to have a test case
which is closer to the real world and I indeed was able to reproduce
this.
Whether this is actually a bug in Chrome or Firefox is an entirely
different issue and even IF it is the fault of the browsers and it is
fixed at some point, we'd still need to handle this for older browser
versions.
Apart from clearing the header, I also recreated the patch by using a
plain "git diff" with a small description on top. This should make it
easier for future authors to work on that patch.
[1]: https://github.com/NixOS/nixpkgs/pull/48337#issuecomment-495072764
[2]: https://github.com/NixOS/nixpkgs/pull/48337#issuecomment-451644084
[3]: https://github.com/NixOS/nixpkgs/pull/48337#issuecomment-451646135
Signed-off-by: aszlig <aszlig@nix.build>
2019-12-30 13:06:00 +00:00
|
|
|
nginx-etag = handleTest ./nginx-etag.nix {};
|
nginx: Fix ETag patch to ignore realpath(3) error
While our ETag patch works pretty fine if it comes to serving data off
store paths, it unfortunately broke something that might be a bit more
common, namely when using regexes to extract path components of
location directives for example.
Recently, @devhell has reported a bug with a nginx location directive
like this:
location ~^/\~([a-z0-9_]+)(/.*)?$" {
alias /home/$1/public_html$2;
}
While this might look harmless at first glance, it does however cause
issues with our ETag patch. The alias directive gets broken up by nginx
like this:
*2 http script copy: "/home/"
*2 http script capture: "foo"
*2 http script copy: "/public_html/"
*2 http script capture: "bar.txt"
In our patch however, we use realpath(3) to get the canonicalised path
from ngx_http_core_loc_conf_s.root, which returns the *configured* value
from the root or alias directive. So in the example above, realpath(3)
boils down to the following syscalls:
lstat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/$1", 0x7ffd08da6f60) = -1 ENOENT (No such file or directory)
During my review[1] of the initial patch, I didn't actually notice that
what we're doing here is returning NGX_ERROR if the realpath(3) call
fails, which in turn causes an HTTP 500 error.
Since our patch actually made the canonicalisation (and thus additional
syscalls) necessary, we really shouldn't introduce an additional error
so let's - at least for now - silently skip return value if realpath(3)
has failed.
However since we're using the unaltered root from the config we have
another issue, consider this root:
/nix/store/...-abcde/$1
Calling realpath(3) on this path will fail (except if there's a file
called "$1" of course), so even this fix is not enough because it
results in the ETag not being set to the store path hash.
While this is very ugly and we should fix this very soon, it's not as
serious as getting HTTP 500 errors for serving static files.
I added a small NixOS VM test, which uses the example above as a
regression test.
It seems that my memory is failing these days, since apparently I *knew*
about this issue since digging for existing issues in nixpkgs, I found
this similar pull request which I even reviewed:
https://github.com/NixOS/nixpkgs/pull/66532
However, since the comments weren't addressed and the author hasn't
responded to the pull request, I decided to keep this very commit and do
a follow-up pull request.
[1]: https://github.com/NixOS/nixpkgs/pull/48337
Signed-off-by: aszlig <aszlig@nix.build>
Reported-by: @devhell
Acked-by: @7c6f434c
Acked-by: @yorickvP
Merges: https://github.com/NixOS/nixpkgs/pull/80671
Fixes: https://github.com/NixOS/nixpkgs/pull/66532
2020-02-20 19:43:42 +00:00
|
|
|
nginx-pubhtml = handleTest ./nginx-pubhtml.nix {};
|
2018-12-28 10:41:52 +00:00
|
|
|
nginx-sso = handleTest ./nginx-sso.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
nix-ssh-serve = handleTest ./nix-ssh-serve.nix {};
|
2019-08-07 16:04:18 +00:00
|
|
|
nixos-generate-config = handleTest ./nixos-generate-config.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {};
|
|
|
|
nsd = handleTest ./nsd.nix {};
|
2019-04-22 12:06:33 +00:00
|
|
|
nzbget = handleTest ./nzbget.nix {};
|
2019-10-22 14:20:56 +00:00
|
|
|
openarena = handleTest ./openarena.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
openldap = handleTest ./openldap.nix {};
|
|
|
|
opensmtpd = handleTest ./opensmtpd.nix {};
|
|
|
|
openssh = handleTest ./openssh.nix {};
|
2020-02-03 17:07:57 +00:00
|
|
|
openstack-image-userdata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).userdata or {};
|
2019-01-28 14:09:48 +00:00
|
|
|
openstack-image-metadata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).metadata or {};
|
2019-08-20 22:27:14 +00:00
|
|
|
orangefs = handleTest ./orangefs.nix {};
|
2019-06-09 18:26:05 +00:00
|
|
|
os-prober = handleTestOn ["x86_64-linux"] ./os-prober.nix {};
|
2019-01-05 12:13:10 +00:00
|
|
|
osrm-backend = handleTest ./osrm-backend.nix {};
|
2019-01-23 09:19:23 +00:00
|
|
|
overlayfs = handleTest ./overlayfs.nix {};
|
2019-04-24 08:45:29 +00:00
|
|
|
packagekit = handleTest ./packagekit.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
pam-oath-login = handleTest ./pam-oath-login.nix {};
|
2019-01-29 16:45:26 +00:00
|
|
|
pam-u2f = handleTest ./pam-u2f.nix {};
|
2019-01-24 22:33:05 +00:00
|
|
|
pantheon = handleTest ./pantheon.nix {};
|
2019-01-27 14:26:31 +00:00
|
|
|
paperless = handleTest ./paperless.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
peerflix = handleTest ./peerflix.nix {};
|
|
|
|
pgjwt = handleTest ./pgjwt.nix {};
|
|
|
|
pgmanage = handleTest ./pgmanage.nix {};
|
|
|
|
php-pcre = handleTest ./php-pcre.nix {};
|
|
|
|
plasma5 = handleTest ./plasma5.nix {};
|
|
|
|
plotinus = handleTest ./plotinus.nix {};
|
|
|
|
postgis = handleTest ./postgis.nix {};
|
|
|
|
postgresql = handleTest ./postgresql.nix {};
|
2019-08-11 17:09:42 +00:00
|
|
|
postgresql-wal-receiver = handleTest ./postgresql-wal-receiver.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
powerdns = handleTest ./powerdns.nix {};
|
2019-10-15 04:26:54 +00:00
|
|
|
pppd = handleTest ./pppd.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
predictable-interface-names = handleTest ./predictable-interface-names.nix {};
|
|
|
|
printing = handleTest ./printing.nix {};
|
|
|
|
prometheus = handleTest ./prometheus.nix {};
|
|
|
|
prometheus-exporters = handleTest ./prometheus-exporters.nix {};
|
2019-06-15 09:16:28 +00:00
|
|
|
prosody = handleTest ./xmpp/prosody.nix {};
|
2019-06-15 09:58:00 +00:00
|
|
|
prosodyMysql = handleTest ./xmpp/prosody-mysql.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
proxy = handleTest ./proxy.nix {};
|
|
|
|
quagga = handleTest ./quagga.nix {};
|
2020-03-22 16:26:55 +00:00
|
|
|
quorum = handleTest ./quorum.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
rabbitmq = handleTest ./rabbitmq.nix {};
|
2019-01-24 22:09:21 +00:00
|
|
|
radarr = handleTest ./radarr.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
radicale = handleTest ./radicale.nix {};
|
2019-08-31 18:17:33 +00:00
|
|
|
redis = handleTest ./redis.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
redmine = handleTest ./redmine.nix {};
|
2020-01-30 21:31:52 +00:00
|
|
|
restic = handleTest ./restic.nix {};
|
2018-11-28 16:33:26 +00:00
|
|
|
roundcube = handleTest ./roundcube.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
rspamd = handleTest ./rspamd.nix {};
|
2018-10-27 09:33:43 +00:00
|
|
|
rss2email = handleTest ./rss2email.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
rsyslogd = handleTest ./rsyslogd.nix {};
|
|
|
|
runInMachine = handleTest ./run-in-machine.nix {};
|
|
|
|
rxe = handleTest ./rxe.nix {};
|
|
|
|
samba = handleTest ./samba.nix {};
|
2019-10-27 03:37:30 +00:00
|
|
|
sanoid = handleTest ./sanoid.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
sddm = handleTest ./sddm.nix {};
|
2020-02-28 11:17:01 +00:00
|
|
|
service-runner = handleTest ./service-runner.nix {};
|
2019-11-08 17:17:08 +00:00
|
|
|
shiori = handleTest ./shiori.nix {};
|
2019-05-22 22:50:51 +00:00
|
|
|
signal-desktop = handleTest ./signal-desktop.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
simple = handleTest ./simple.nix {};
|
|
|
|
slurm = handleTest ./slurm.nix {};
|
|
|
|
smokeping = handleTest ./smokeping.nix {};
|
|
|
|
snapper = handleTest ./snapper.nix {};
|
|
|
|
solr = handleTest ./solr.nix {};
|
2019-05-24 19:17:51 +00:00
|
|
|
spacecookie = handleTest ./spacecookie.nix {};
|
2019-01-24 22:08:16 +00:00
|
|
|
sonarr = handleTest ./sonarr.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
strongswan-swanctl = handleTest ./strongswan-swanctl.nix {};
|
|
|
|
sudo = handleTest ./sudo.nix {};
|
|
|
|
switchTest = handleTest ./switch-test.nix {};
|
2019-07-06 18:56:30 +00:00
|
|
|
sympa = handleTest ./sympa.nix {};
|
2019-04-21 21:05:07 +00:00
|
|
|
syncthing-init = handleTest ./syncthing-init.nix {};
|
2018-11-17 14:02:00 +00:00
|
|
|
syncthing-relay = handleTest ./syncthing-relay.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
systemd = handleTest ./systemd.nix {};
|
2019-11-24 23:03:55 +00:00
|
|
|
systemd-analyze = handleTest ./systemd-analyze.nix {};
|
2019-03-14 14:26:10 +00:00
|
|
|
systemd-confinement = handleTest ./systemd-confinement.nix {};
|
2019-05-15 09:05:37 +00:00
|
|
|
systemd-timesyncd = handleTest ./systemd-timesyncd.nix {};
|
2020-01-25 15:46:55 +00:00
|
|
|
systemd-networkd-vrf = handleTest ./systemd-networkd-vrf.nix {};
|
2020-02-29 18:34:48 +00:00
|
|
|
systemd-networkd = handleTest ./systemd-networkd.nix {};
|
2019-11-02 18:55:41 +00:00
|
|
|
systemd-nspawn = handleTest ./systemd-nspawn.nix {};
|
2019-04-04 18:38:56 +00:00
|
|
|
pdns-recursor = handleTest ./pdns-recursor.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
taskserver = handleTest ./taskserver.nix {};
|
2019-01-21 11:30:11 +00:00
|
|
|
telegraf = handleTest ./telegraf.nix {};
|
2019-04-29 20:46:00 +00:00
|
|
|
tiddlywiki = handleTest ./tiddlywiki.nix {};
|
2019-12-02 22:28:53 +00:00
|
|
|
timezone = handleTest ./timezone.nix {};
|
2019-05-16 21:42:02 +00:00
|
|
|
tinydns = handleTest ./tinydns.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
tor = handleTest ./tor.nix {};
|
|
|
|
transmission = handleTest ./transmission.nix {};
|
2019-11-03 16:24:22 +00:00
|
|
|
trac = handleTest ./trac.nix {};
|
2019-12-22 13:34:54 +00:00
|
|
|
trilium-server = handleTestOn ["x86_64-linux"] ./trilium-server.nix {};
|
2019-08-16 15:00:07 +00:00
|
|
|
trezord = handleTest ./trezord.nix {};
|
2019-11-01 10:03:23 +00:00
|
|
|
trickster = handleTest ./trickster.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
udisks2 = handleTest ./udisks2.nix {};
|
|
|
|
upnp = handleTest ./upnp.nix {};
|
2019-05-27 21:03:22 +00:00
|
|
|
uwsgi = handleTest ./uwsgi.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
vault = handleTest ./vault.nix {};
|
2020-01-19 17:55:56 +00:00
|
|
|
victoriametrics = handleTest ./victoriametrics.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
|
2019-11-28 08:32:13 +00:00
|
|
|
wg-quick = handleTest ./wireguard/wg-quick.nix {};
|
2019-03-17 12:20:38 +00:00
|
|
|
wireguard = handleTest ./wireguard {};
|
2019-04-24 02:30:05 +00:00
|
|
|
wireguard-generated = handleTest ./wireguard/generated.nix {};
|
2019-09-19 20:54:38 +00:00
|
|
|
wireguard-namespaces = handleTest ./wireguard/namespaces.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
wordpress = handleTest ./wordpress.nix {};
|
2019-12-14 00:17:49 +00:00
|
|
|
xandikos = handleTest ./xandikos.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
xautolock = handleTest ./xautolock.nix {};
|
|
|
|
xfce = handleTest ./xfce.nix {};
|
|
|
|
xmonad = handleTest ./xmonad.nix {};
|
|
|
|
xrdp = handleTest ./xrdp.nix {};
|
|
|
|
xss-lock = handleTest ./xss-lock.nix {};
|
|
|
|
yabar = handleTest ./yabar.nix {};
|
2019-06-27 15:56:10 +00:00
|
|
|
yggdrasil = handleTest ./yggdrasil.nix {};
|
2020-02-03 17:33:26 +00:00
|
|
|
zfs = handleTest ./zfs.nix {};
|
2019-12-13 20:47:15 +00:00
|
|
|
zsh-history = handleTest ./zsh-history.nix {};
|
2018-11-11 11:30:07 +00:00
|
|
|
zookeeper = handleTest ./zookeeper.nix {};
|
|
|
|
}
|