{ "name": "grafana", "version": "13.2.4", "summary": "Grafana dashboards and alerting: the backend built from source (static Go), the release's frontend, SQLite", "category": "server", "license": "AGPL-3.0-only", "homepage": "https://grafana.com/", "source": { "url": "https://github.com/grafana/grafana/archive/refs/tags/v13.2.4.tar.gz", "sha256": "fdd57503b5f591e951ea3dff80ab53a41487c3373dc89370da2e36e7bf752f52" }, "watch": {"kind": "github-tag", "repo": "grafana/grafana", "tag_regex": "^v([0-9]+(?:\\.[0-9]+)+[a-z]?[0-9]*)$", "revendor": {"tool": "go", "args": ["./pkg/cmd/grafana"], "work": true, "extras": [{"dest": "release", "checksum": "sha256-file"}], "stamp": {"var": "BUILDSTAMP", "release": "v{version}"}}}, "vendor": "vendor.txt", "deps": [], "env_packages": [], "static": true, "nss": false, "check": "pid= && trap '[ -z \"$pid\" ] || kill -9 \"$pid\" 2>/dev/null' EXIT && bin/grafana --version | first && bin/grafana --version | has -F 'grafana version 13.2.4' && elf=$(readelf -l bin/grafana) && [ -n \"$elf\" ] && ! printf '%s\\n' \"$elf\" | has 'program interpreter' && [ -f share/grafana/conf/defaults.ini ] && [ -d share/grafana/public/build ] && [ ! -e share/grafana/data/plugins-bundled ] && has -xF \"static_root_path = $PREFIX/share/grafana/public\" < etc/grafana/grafana.ini && has -xF 'disable_initial_admin_creation = true' < etc/grafana/grafana.ini && t=$(mktemp -d) && chmod 755 \"$t\" && mkdir \"$t/data\" \"$t/logs\" \"$t/plugins\" && chown 65534:65534 \"$t/data\" \"$t/logs\" \"$t/plugins\" && P=$(free_port) && pw=bvs$RANDOM$RANDOM && { setpriv --reuid=65534 --regid=65534 --clear-groups env -i PATH=/nonexistent GF_PATHS_DATA=\"$t/data\" GF_PATHS_LOGS=\"$t/logs\" GF_PATHS_PLUGINS=\"$t/plugins\" GF_SERVER_HTTP_PORT=\"$P\" GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION=false GF_SECURITY_ADMIN_PASSWORD=\"$pw\" bin/grafana server --homepath \"$PREFIX/share/grafana\" --config \"$PREFIX/etc/grafana/grafana.ini\" > \"$t/out\" 2>&1 & } && pid=$! && for i in $(seq 1 120); do curl -s -m 2 \"http://127.0.0.1:$P/api/health\" > \"$t/h\" 2>/dev/null && has '\"database\": *\"ok\"' < \"$t/h\" && break; kill -0 \"$pid\" 2>/dev/null || break; sleep 1; done && { has '\"database\": *\"ok\"' < \"$t/h\" || { echo \"grafana: /api/health did not answer ok; the last lines of its output:\"; tail -n 20 \"$t/out\"; false; }; } && has '\"version\": *\"13.2.4\"' < \"$t/h\" && echo \"healthy after about $i s on 127.0.0.1:$P, with PATH=/nonexistent\" && [ \"$(sed -n 's/^Uid:[[:space:]]*\\([0-9]*\\).*/\\1/p' \"/proc/$pid/status\")\" = 65534 ] && [ \"/proc/$pid/exe\" -ef bin/grafana ] && [ -s \"$t/data/grafana.db\" ] && [ \"$(stat -c %u \"$t/data/grafana.db\")\" = 65534 ] && u=http://127.0.0.1:$P && a=\"admin:$pw\" && curl -s -m 30 \"$u/login\" > \"$t/login\" && js=$(grep -o 'public/build/[^\"]*\\.js' \"$t/login\" | sed -n 1p) && [ -n \"$js\" ] && [ \"$(curl -s -o /dev/null -w '%{http_code}' -m 30 \"$u/$js\")\" = 200 ] && [ \"$(curl -s -o /dev/null -w '%{http_code}' -m 30 -u \"admin:x$pw\" \"$u/api/org\")\" = 401 ] && [ \"$(curl -s -o /dev/null -w '%{http_code}' -m 30 -u admin:admin \"$u/api/org\")\" = 401 ] && curl -s -m 30 -u \"$a\" -H 'content-type: application/json' -X POST \"$u/api/datasources\" -d '{\"name\":\"bvs-testdata\",\"type\":\"grafana-testdata-datasource\",\"access\":\"proxy\",\"uid\":\"bvstd\"}' | has '\"Datasource added\"' && curl -s -m 60 -u \"$a\" -H 'content-type: application/json' -X POST \"$u/api/ds/query\" -d '{\"queries\":[{\"refId\":\"A\",\"datasource\":{\"uid\":\"bvstd\"},\"scenarioId\":\"csv_metric_values\",\"stringInput\":\"1,20,300\",\"alias\":\"bvs\"}],\"from\":\"now-1h\",\"to\":\"now\"}' > \"$t/q\" && has '\"refId\": *\"A\"' < \"$t/q\" && has '300' < \"$t/q\" && curl -s -m 30 -u \"$a\" -H 'content-type: application/json' -X POST \"$u/api/dashboards/db\" -d '{\"dashboard\":{\"title\":\"bvs check\",\"panels\":[]},\"overwrite\":false}' | has '\"status\": *\"success\"' && curl -s -m 30 -u \"$a\" \"$u/api/search?query=bvs%20check\" | has '\"title\": *\"bvs check\"' && echo \"the login page and its script, 401 for a wrong password and for admin:admin (the ini makes no admin by itself), a TestData query, a dashboard saved and found\" && { kill -TERM \"$pid\"; n=0; while grep -qs '^State:[[:space:]]*[^Z[:space:]]' \"/proc/$pid/status\" && [ $n -lt 300 ]; do sleep 0.2; n=$((n + 1)); done; [ $n -lt 300 ] || kill -KILL \"$pid\"; wait \"$pid\"; r=$?; pid=; echo \"SIGTERM: exit status $r after about $((n / 5)) s\"; [ $r = 0 ]; } && ! grep -Eq \":$(printf '%04X' \"$P\") [0-9A-F]+:0000 0A \" /proc/net/tcp /proc/net/tcp6 && ! has -i 'preinstall\\|downloading plugin\\|grafana.com/api/plugins' < \"$t/out\"" }