mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
build: don't ship tcp.csv and udp.csv
Fetch them when building. Keep them up-to-date for Nix like NPM/Go modules.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,8 @@
|
||||
/bin/
|
||||
/test/
|
||||
/orchestrator/clickhouse/data/asns.csv
|
||||
/orchestrator/clickhouse/data/tcp.csv
|
||||
/orchestrator/clickhouse/data/udp.csv
|
||||
/console/filter/parser.go
|
||||
/common/schema/definition_gen.go
|
||||
mock_*.go
|
||||
|
||||
15
flake.nix
15
flake.nix
@@ -25,6 +25,10 @@
|
||||
cp -r ../data/frontend $out/data
|
||||
'';
|
||||
};
|
||||
ianaServiceNames = pkgs.fetchurl {
|
||||
url = "https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv";
|
||||
hash = builtins.readFile ./nix/ianaServiceNamesHash.txt;
|
||||
};
|
||||
backend = pkgs.buildGoModule.override { inherit go; } {
|
||||
doCheck = false;
|
||||
name = "akvorado";
|
||||
@@ -42,7 +46,8 @@
|
||||
GOIMPORTS=${pkgs.gotools}/bin/goimports \
|
||||
PIGEON=${pkgs.pigeon}/bin/pigeon \
|
||||
REVIVE=${pkgs.coreutils}/bin/true \
|
||||
ASNS_URL=${asn2org}/asns.csv
|
||||
ASNS_URL=${asn2org}/asns.csv \
|
||||
SERVICES_URL=${ianaServiceNames}
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
@@ -71,14 +76,20 @@
|
||||
| ${pkgs.gnused}/bin/sed -nE "s/\s+got:\s+(sha256-.*)/\1/p")
|
||||
[[ -z "$sha256" ]] || echo $sha256 > nix/npmDepsHash.txt
|
||||
'';
|
||||
update-ianaServiceNamesHash = ''
|
||||
sha256=$(2>&1 nix build --no-link .#ianaServiceNames \
|
||||
| ${pkgs.gnused}/bin/sed -nE "s/\s+got:\s+(sha256-.*)/\1/p")
|
||||
[[ -z "$sha256" ]] || echo $sha256 > nix/ianaServiceNamesHash.txt
|
||||
'';
|
||||
update = ''
|
||||
${update-vendorHash}
|
||||
${update-npmDepsHash}
|
||||
${update-ianaServiceNamesHash}
|
||||
'';
|
||||
};
|
||||
|
||||
packages = {
|
||||
inherit backend frontend;
|
||||
inherit backend frontend ianaServiceNames;
|
||||
default = backend;
|
||||
};
|
||||
|
||||
|
||||
1
nix/ianaServiceNamesHash.txt
Normal file
1
nix/ianaServiceNamesHash.txt
Normal file
@@ -0,0 +1 @@
|
||||
sha256-qG0QEo+tJFGxoZ4ZJMlNIcWENTXZcwv1JA9+q3jF7Es=
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user