Merge pull request #177081 from azahi/trickster

trickster: 0.1.10 -> 1.1.5
This commit is contained in:
Lassulus 2022-06-23 22:24:54 +02:00 committed by GitHub
commit 8c2e25e98e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 254 deletions

View File

@ -6,6 +6,9 @@ let
cfg = config.services.trickster;
in
{
imports = [
(mkRenamedOptionModule [ "services" "trickster" "origin" ] [ "services" "trickster" "origin-url" ])
];
options = {
services.trickster = {
@ -58,11 +61,19 @@ in
'';
};
origin = mkOption {
origin-type = mkOption {
type = types.enum [ "prometheus" "influxdb" ];
default = "prometheus";
description = ''
Type of origin (prometheus, influxdb)
'';
};
origin-url = mkOption {
type = types.str;
default = "http://prometheus:9090";
description = ''
URL to the Prometheus Origin. Enter it like you would in grafana, e.g., http://prometheus:9090 (default http://prometheus:9090).
URL to the Origin. Enter it like you would in grafana, e.g., http://prometheus:9090 (default http://prometheus:9090).
'';
};
@ -87,7 +98,7 @@ in
config = mkIf cfg.enable {
systemd.services.trickster = {
description = "Dashboard Accelerator for Prometheus";
description = "Reverse proxy cache and time series dashboard accelerator";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
@ -96,7 +107,8 @@ in
${cfg.package}/bin/trickster \
-log-level ${cfg.log-level} \
-metrics-port ${toString cfg.metrics-port} \
-origin ${cfg.origin} \
-origin-type ${cfg.origin-type} \
-origin-url ${cfg.origin-url} \
-proxy-port ${toString cfg.proxy-port} \
${optionalString (cfg.configFile != null) "-config ${cfg.configFile}"} \
${optionalString (cfg.profiler-port != null) "-profiler-port ${cfg.profiler-port}"} \

View File

@ -1,26 +1,53 @@
{ lib, buildGoPackage, fetchFromGitHub }:
{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoPackage rec {
buildGoModule rec {
pname = "trickster";
version = "0.1.10";
goPackagePath = "github.com/Comcast/trickster";
goDeps = ./trickster_deps.nix;
version = "1.1.5";
rev = "4595bd6a1ae1165ef497251ad85c646dadc8a925";
src = fetchFromGitHub {
owner = "Comcast";
repo = pname;
owner = "trickstercache";
repo = "trickster";
rev = "v${version}";
sha256 = "12z71rf03g2x8r7cgns0n4n46r0gjsfyig6z9r5xrn9kfghabfi8";
sha256 = "sha256-BRD8IF3s9RaDorVtXRvbKLVVVXWiEQTQyKBR9jFo1eM=";
};
doCheck = true;
vendorSha256 = null;
subPackages = [ "cmd/trickster" ];
preBuild =
let
ldflags = with lib;
concatStringsSep " " (
[ "-extldflags '-static'" "-s" "-w" ] ++
(mapAttrsToList (n: v: "-X main.application${n}=${v}") {
BuildTime = "1970-01-01T00:00:00+0000";
GitCommitID = rev;
GoVersion = "$(go env GOVERSION)";
GoArch = "$(go env GOARCH)";
})
);
in
''
buildFlagsArray+=("-ldflags=${ldflags}")
'';
# Tests are broken.
doCheck = false;
meta = with lib; {
description = "Reverse proxy cache for the Prometheus HTTP APIv1";
homepage = "https://github.com/Comcast/trickster";
description = "Reverse proxy cache and time series dashboard accelerator";
longDescription = ''
Trickster is a fully-featured HTTP Reverse Proxy Cache for HTTP
applications like static file servers and web APIs.
'';
homepage = "https://trickstercache.org/";
license = licenses.asl20;
maintainers = with maintainers; [ _1000101 ];
platforms = platforms.linux;
};
}

View File

@ -1,237 +0,0 @@
# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix)
[
{
goPackagePath = "github.com/BurntSushi/toml";
fetch = {
type = "git";
url = "https://github.com/BurntSushi/toml";
rev = "v0.3.1";
sha256 = "1fjdwwfzyzllgiwydknf1pwjvy49qxfsczqx5gz3y0izs7as99j6";
};
}
{
goPackagePath = "github.com/alicebob/gopher-json";
fetch = {
type = "git";
url = "https://github.com/alicebob/gopher-json";
rev = "5a6b3ba71ee6";
sha256 = "0hx6n722zq51p852lv56k39yjy09lw6mnr2c3x0p23rfyyrakj2p";
};
}
{
goPackagePath = "github.com/alicebob/miniredis";
fetch = {
type = "git";
url = "https://github.com/alicebob/miniredis";
rev = "cfad8aca71cc";
sha256 = "0x2401nxyhdz037lj98c0sa77d8k49jfcq7is3ddiyim3csg5a0w";
};
}
{
goPackagePath = "github.com/beorn7/perks";
fetch = {
type = "git";
url = "https://github.com/beorn7/perks";
rev = "3a771d992973";
sha256 = "1l2lns4f5jabp61201sh88zf3b0q793w4zdgp9nll7mmfcxxjif3";
};
}
{
goPackagePath = "github.com/chzyer/readline";
fetch = {
type = "git";
url = "https://github.com/chzyer/readline";
rev = "2972be24d48e";
sha256 = "104q8dazj8yf6b089jjr82fy9h1g80zyyzvp3g8b44a7d8ngjj6r";
};
}
{
goPackagePath = "github.com/coreos/bbolt";
fetch = {
type = "git";
url = "https://github.com/coreos/bbolt";
rev = "v1.3.0";
sha256 = "0cp5v9iypg9ysiq40k3h3lg7aisxplnmxshha7nama6b170izyay";
};
}
{
goPackagePath = "github.com/go-kit/kit";
fetch = {
type = "git";
url = "https://github.com/go-kit/kit";
rev = "v0.8.0";
sha256 = "1rcywbc2pvab06qyf8pc2rdfjv7r6kxdv2v4wnpqnjhz225wqvc0";
};
}
{
goPackagePath = "github.com/go-logfmt/logfmt";
fetch = {
type = "git";
url = "https://github.com/go-logfmt/logfmt";
rev = "v0.4.0";
sha256 = "06smxc112xmixz78nyvk3b2hmc7wasf2sl5vxj1xz62kqcq9lzm9";
};
}
{
goPackagePath = "github.com/go-redis/redis";
fetch = {
type = "git";
url = "https://github.com/go-redis/redis";
rev = "v6.14.2";
sha256 = "0s1if96r8xnadan7pz1j8hvzk9g4fm3phwmwzadwpq21pgni66d7";
};
}
{
goPackagePath = "github.com/go-stack/stack";
fetch = {
type = "git";
url = "https://github.com/go-stack/stack";
rev = "v1.8.0";
sha256 = "0wk25751ryyvxclyp8jdk5c3ar0cmfr8lrjb66qbg4808x66b96v";
};
}
{
goPackagePath = "github.com/golang/protobuf";
fetch = {
type = "git";
url = "https://github.com/golang/protobuf";
rev = "v1.2.0";
sha256 = "0kf4b59rcbb1cchfny2dm9jyznp8ri2hsb14n8iak1q8986xa0ab";
};
}
{
goPackagePath = "github.com/golang/snappy";
fetch = {
type = "git";
url = "https://github.com/golang/snappy";
rev = "2e65f85255db";
sha256 = "05w6mpc4qcy0pv8a2bzng8nf4s5rf5phfang4jwy9rgf808q0nxf";
};
}
{
goPackagePath = "github.com/gomodule/redigo";
fetch = {
type = "git";
url = "https://github.com/gomodule/redigo";
rev = "v2.0.0";
sha256 = "1kg7s8027b4g1sfw0v3nh30c15j407kv684s53gg281r807dnfpk";
};
}
{
goPackagePath = "github.com/gorilla/context";
fetch = {
type = "git";
url = "https://github.com/gorilla/context";
rev = "v1.1.1";
sha256 = "03p4hn87vcmfih0p9w663qbx9lpsf7i7j3lc7yl7n84la3yz63m4";
};
}
{
goPackagePath = "github.com/gorilla/handlers";
fetch = {
type = "git";
url = "https://github.com/gorilla/handlers";
rev = "v1.4.0";
sha256 = "0mnw81ayjm4d8462qg8spmcwxmchn24158bf93zxjab51pg8n9gm";
};
}
{
goPackagePath = "github.com/gorilla/mux";
fetch = {
type = "git";
url = "https://github.com/gorilla/mux";
rev = "v1.6.2";
sha256 = "0pvzm23hklxysspnz52mih6h1q74vfrdhjfm1l3sa9r8hhqmmld2";
};
}
{
goPackagePath = "github.com/kr/logfmt";
fetch = {
type = "git";
url = "https://github.com/kr/logfmt";
rev = "b84e30acd515";
sha256 = "02ldzxgznrfdzvghfraslhgp19la1fczcbzh7wm2zdc6lmpd1qq9";
};
}
{
goPackagePath = "github.com/matttproud/golang_protobuf_extensions";
fetch = {
type = "git";
url = "https://github.com/matttproud/golang_protobuf_extensions";
rev = "v1.0.1";
sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya";
};
}
{
goPackagePath = "github.com/pkg/errors";
fetch = {
type = "git";
url = "https://github.com/pkg/errors";
rev = "v0.8.0";
sha256 = "001i6n71ghp2l6kdl3qq1v2vmghcz3kicv9a5wgcihrzigm75pp5";
};
}
{
goPackagePath = "github.com/prometheus/client_golang";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_golang";
rev = "v0.9.1";
sha256 = "01gnylazia30pcp069xcng482gwmm3xcx5zgrlwdkhic1lyb6i9l";
};
}
{
goPackagePath = "github.com/prometheus/client_model";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_model";
rev = "5c3871d89910";
sha256 = "04psf81l9fjcwascsys428v03fx4fi894h7fhrj2vvcz723q57k0";
};
}
{
goPackagePath = "github.com/prometheus/common";
fetch = {
type = "git";
url = "https://github.com/prometheus/common";
rev = "4724e9255275";
sha256 = "0pcx8hlnrxx5nnmpk786cn99rsgqk1jrd3c9f6fsx8qd8y5iwjy6";
};
}
{
goPackagePath = "github.com/prometheus/procfs";
fetch = {
type = "git";
url = "https://github.com/prometheus/procfs";
rev = "1dc9a6cbc91a";
sha256 = "1zlv1x30xp7z5c3vn5vp870v4bjim0zcidzc3mr2l3xhazc0svab";
};
}
{
goPackagePath = "github.com/yuin/gopher-lua";
fetch = {
type = "git";
url = "https://github.com/yuin/gopher-lua";
rev = "a0dfe84f6227";
sha256 = "13k2dphx4zv6fwgqsydsc0g0b0pf7qx3yb6i7hai6nnkh0db91nn";
};
}
{
goPackagePath = "golang.org/x/sys";
fetch = {
type = "git";
url = "https://go.googlesource.com/sys";
rev = "a5c9d58dba9a";
sha256 = "02qv5i7yps35p7fa81345qz7k8i73gkigj69anwmpw9rhpmzayf9";
};
}
{
goPackagePath = "gopkg.in/natefinch/lumberjack.v2";
fetch = {
type = "git";
url = "https://gopkg.in/natefinch/lumberjack.v2";
rev = "a96e63847dc3";
sha256 = "1l3vlv72b7rfkpy1164kwd3qzrqmmjnb67akzxqp2mlvc66k6p3d";
};
}
]