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/
|
/bin/
|
||||||
/test/
|
/test/
|
||||||
/orchestrator/clickhouse/data/asns.csv
|
/orchestrator/clickhouse/data/asns.csv
|
||||||
|
/orchestrator/clickhouse/data/tcp.csv
|
||||||
|
/orchestrator/clickhouse/data/udp.csv
|
||||||
/console/filter/parser.go
|
/console/filter/parser.go
|
||||||
/common/schema/definition_gen.go
|
/common/schema/definition_gen.go
|
||||||
mock_*.go
|
mock_*.go
|
||||||
|
|||||||
15
flake.nix
15
flake.nix
@@ -25,6 +25,10 @@
|
|||||||
cp -r ../data/frontend $out/data
|
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; } {
|
backend = pkgs.buildGoModule.override { inherit go; } {
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
name = "akvorado";
|
name = "akvorado";
|
||||||
@@ -42,7 +46,8 @@
|
|||||||
GOIMPORTS=${pkgs.gotools}/bin/goimports \
|
GOIMPORTS=${pkgs.gotools}/bin/goimports \
|
||||||
PIGEON=${pkgs.pigeon}/bin/pigeon \
|
PIGEON=${pkgs.pigeon}/bin/pigeon \
|
||||||
REVIVE=${pkgs.coreutils}/bin/true \
|
REVIVE=${pkgs.coreutils}/bin/true \
|
||||||
ASNS_URL=${asn2org}/asns.csv
|
ASNS_URL=${asn2org}/asns.csv \
|
||||||
|
SERVICES_URL=${ianaServiceNames}
|
||||||
'';
|
'';
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
@@ -71,14 +76,20 @@
|
|||||||
| ${pkgs.gnused}/bin/sed -nE "s/\s+got:\s+(sha256-.*)/\1/p")
|
| ${pkgs.gnused}/bin/sed -nE "s/\s+got:\s+(sha256-.*)/\1/p")
|
||||||
[[ -z "$sha256" ]] || echo $sha256 > nix/npmDepsHash.txt
|
[[ -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 = ''
|
||||||
${update-vendorHash}
|
${update-vendorHash}
|
||||||
${update-npmDepsHash}
|
${update-npmDepsHash}
|
||||||
|
${update-ianaServiceNamesHash}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
inherit backend frontend;
|
inherit backend frontend ianaServiceNames;
|
||||||
default = backend;
|
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