[www-apps/grafana] add
This commit is contained in:
131
www-apps/grafana/files/grafana-12.1.1-node-22.18.0.patch
Normal file
131
www-apps/grafana/files/grafana-12.1.1-node-22.18.0.patch
Normal file
@@ -0,0 +1,131 @@
|
||||
From 481caac25da9fcf329833a8730d0b43db486fe82 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Cowley <me@mattcowley.co.uk>
|
||||
Date: Wed, 9 Jul 2025 17:54:00 +0100
|
||||
Subject: [PATCH] Plugin Configs: Fix Env types (#107908)
|
||||
|
||||
(cherry picked from commit 21f305c6a0e242463f5219cc6944fb880ea809f0)
|
||||
---
|
||||
e2e/test-plugins/grafana-extensionstest-app/webpack.config.ts | 4 ++--
|
||||
e2e/test-plugins/grafana-test-datasource/webpack.config.ts | 4 ++--
|
||||
packages/grafana-plugin-configs/webpack.config.ts | 2 +-
|
||||
public/app/plugins/datasource/azuremonitor/webpack.config.ts | 4 ++--
|
||||
.../datasource/grafana-pyroscope-datasource/webpack.config.ts | 4 ++--
|
||||
public/app/plugins/datasource/jaeger/webpack.config.ts | 4 ++--
|
||||
public/app/plugins/datasource/mssql/webpack.config.ts | 4 ++--
|
||||
7 files changed, 13 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/e2e/test-plugins/grafana-extensionstest-app/webpack.config.ts b/e2e/test-plugins/grafana-extensionstest-app/webpack.config.ts
|
||||
index 6268c183d3553..564555396a5e4 100644
|
||||
--- a/e2e/test-plugins/grafana-extensionstest-app/webpack.config.ts
|
||||
+++ b/e2e/test-plugins/grafana-extensionstest-app/webpack.config.ts
|
||||
@@ -1,5 +1,5 @@
|
||||
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
||||
-import grafanaConfig from '@grafana/plugin-configs/webpack.config.ts';
|
||||
+import grafanaConfig, { type Env } from '@grafana/plugin-configs/webpack.config.ts';
|
||||
import { mergeWithCustomize, unique } from 'webpack-merge';
|
||||
import { type Configuration } from 'webpack';
|
||||
|
||||
@@ -19,7 +19,7 @@ function skipFiles(f: string): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
-const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
+const config = async (env: Env): Promise<Configuration> => {
|
||||
const baseConfig = await grafanaConfig(env);
|
||||
const customConfig = {
|
||||
plugins: [
|
||||
diff --git a/e2e/test-plugins/grafana-test-datasource/webpack.config.ts b/e2e/test-plugins/grafana-test-datasource/webpack.config.ts
|
||||
index 6268c183d3553..564555396a5e4 100644
|
||||
--- a/e2e/test-plugins/grafana-test-datasource/webpack.config.ts
|
||||
+++ b/e2e/test-plugins/grafana-test-datasource/webpack.config.ts
|
||||
@@ -1,5 +1,5 @@
|
||||
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
||||
-import grafanaConfig from '@grafana/plugin-configs/webpack.config.ts';
|
||||
+import grafanaConfig, { type Env } from '@grafana/plugin-configs/webpack.config.ts';
|
||||
import { mergeWithCustomize, unique } from 'webpack-merge';
|
||||
import { type Configuration } from 'webpack';
|
||||
|
||||
@@ -19,7 +19,7 @@ function skipFiles(f: string): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
-const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
+const config = async (env: Env): Promise<Configuration> => {
|
||||
const baseConfig = await grafanaConfig(env);
|
||||
const customConfig = {
|
||||
plugins: [
|
||||
diff --git a/packages/grafana-plugin-configs/webpack.config.ts b/packages/grafana-plugin-configs/webpack.config.ts
|
||||
index 86c1d1eafc992..c1bfc469d7b5b 100644
|
||||
--- a/packages/grafana-plugin-configs/webpack.config.ts
|
||||
+++ b/packages/grafana-plugin-configs/webpack.config.ts
|
||||
@@ -31,7 +31,7 @@ function skipFiles(f: string): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
-type Env = {
|
||||
+export type Env = {
|
||||
[key: string]: true | string | Env;
|
||||
};
|
||||
|
||||
diff --git a/public/app/plugins/datasource/azuremonitor/webpack.config.ts b/public/app/plugins/datasource/azuremonitor/webpack.config.ts
|
||||
index 301bafbd1f90f..875ef0a489376 100644
|
||||
--- a/public/app/plugins/datasource/azuremonitor/webpack.config.ts
|
||||
+++ b/public/app/plugins/datasource/azuremonitor/webpack.config.ts
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Configuration } from 'webpack';
|
||||
import { merge } from 'webpack-merge';
|
||||
|
||||
-import grafanaConfig from '@grafana/plugin-configs/webpack.config.ts';
|
||||
+import grafanaConfig, { type Env } from '@grafana/plugin-configs/webpack.config.ts';
|
||||
|
||||
-const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
+const config = async (env: Env): Promise<Configuration> => {
|
||||
const baseConfig = await grafanaConfig(env);
|
||||
|
||||
return merge(baseConfig, {
|
||||
diff --git a/public/app/plugins/datasource/grafana-pyroscope-datasource/webpack.config.ts b/public/app/plugins/datasource/grafana-pyroscope-datasource/webpack.config.ts
|
||||
index 7a579fa172b60..f48f8b1a69353 100644
|
||||
--- a/public/app/plugins/datasource/grafana-pyroscope-datasource/webpack.config.ts
|
||||
+++ b/public/app/plugins/datasource/grafana-pyroscope-datasource/webpack.config.ts
|
||||
@@ -1,6 +1,6 @@
|
||||
-import config from '@grafana/plugin-configs/webpack.config.ts';
|
||||
+import config, { type Env } from '@grafana/plugin-configs/webpack.config.ts';
|
||||
|
||||
-const configWithFallback = async (env: Record<string, unknown>) => {
|
||||
+const configWithFallback = async (env: Env) => {
|
||||
const response = await config(env);
|
||||
if (response !== undefined && response.resolve !== undefined) {
|
||||
response.resolve.fallback = {
|
||||
diff --git a/public/app/plugins/datasource/jaeger/webpack.config.ts b/public/app/plugins/datasource/jaeger/webpack.config.ts
|
||||
index 9ff90fccf0c3d..0346a64c5f22e 100644
|
||||
--- a/public/app/plugins/datasource/jaeger/webpack.config.ts
|
||||
+++ b/public/app/plugins/datasource/jaeger/webpack.config.ts
|
||||
@@ -1,10 +1,10 @@
|
||||
import { createRequire } from 'node:module';
|
||||
|
||||
-import config from '@grafana/plugin-configs/webpack.config.ts';
|
||||
+import config, { type Env } from '@grafana/plugin-configs/webpack.config.ts';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
-const configWithFallback = async (env: Record<string, unknown>) => {
|
||||
+const configWithFallback = async (env: Env) => {
|
||||
const response = await config(env);
|
||||
if (response !== undefined && response.resolve !== undefined) {
|
||||
response.resolve.fallback = {
|
||||
diff --git a/public/app/plugins/datasource/mssql/webpack.config.ts b/public/app/plugins/datasource/mssql/webpack.config.ts
|
||||
index af2e94ddecf42..8a119f88315bd 100644
|
||||
--- a/public/app/plugins/datasource/mssql/webpack.config.ts
|
||||
+++ b/public/app/plugins/datasource/mssql/webpack.config.ts
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Configuration } from 'webpack';
|
||||
import { merge } from 'webpack-merge';
|
||||
|
||||
-import grafanaConfig from '@grafana/plugin-configs/webpack.config.ts';
|
||||
+import grafanaConfig, { type Env } from '@grafana/plugin-configs/webpack.config.ts';
|
||||
|
||||
-const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
+const config = async (env: Env): Promise<Configuration> => {
|
||||
const baseConfig = await grafanaConfig(env);
|
||||
|
||||
return merge(baseConfig, {
|
||||
2
www-apps/grafana/files/grafana.conf
Normal file
2
www-apps/grafana/files/grafana.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
#Type Path Mode UID GID Age Argument
|
||||
d /run/~PN_S~ 0755 grafana grafana - -
|
||||
7
www-apps/grafana/files/grafana.confd
Normal file
7
www-apps/grafana/files/grafana.confd
Normal file
@@ -0,0 +1,7 @@
|
||||
GRAFANA_CONFIG="/etc/~PN_S~/grafana.ini"
|
||||
GRAFANA_DATADIR="/var/lib/~PN_S~"
|
||||
GRAFANA_LOGDIR="/var/log/~PN_S~"
|
||||
|
||||
GRAFANA_OPTS="-config=${GRAFANA_CONFIG} \
|
||||
cfg:default.paths.data=${GRAFANA_DATADIR} \
|
||||
cfg:default.paths.logs=${GRAFANA_LOGDIR}"
|
||||
29
www-apps/grafana/files/grafana.initd
Normal file
29
www-apps/grafana/files/grafana.initd
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2022 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
description="The open-source platform for monitoring and observability"
|
||||
|
||||
: ${GRAFANA_USER:=grafana}
|
||||
: ${GRAFANA_DATADIR:=/var/lib/~PN_S~}
|
||||
: ${GRAFANA_LOGDIR:=/var/log/~PN_S~}
|
||||
: ${GRAFANA_TERMTIMEOUT:="TERM/20/KILL/5"}
|
||||
: ${SSD_OPTS:="-d /usr/share/~PN_S~ -w 1000"}
|
||||
|
||||
name="Grafana"
|
||||
command="/usr/bin/~PN_S~-server"
|
||||
command_args="${GRAFANA_OPTS}"
|
||||
command_user="${GRAFANA_USER}"
|
||||
command_background=true
|
||||
pidfile="/run/${SVCNAME}.pid"
|
||||
required_files="${GRAFANA_CONFIG}"
|
||||
retry="${GRAFANA_TERMTIMEOUT}"
|
||||
start_stop_daemon_args="${SSD_OPTS}"
|
||||
|
||||
depend() {
|
||||
need localmount net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -d -m 0750 -o "${GRAFANA_USER}" "${GRAFANA_DATADIR}" "${GRAFANA_LOGDIR}"
|
||||
}
|
||||
25
www-apps/grafana/files/grafana.service
Normal file
25
www-apps/grafana/files/grafana.service
Normal file
@@ -0,0 +1,25 @@
|
||||
[Unit]
|
||||
Description=Grafana - The open-source platform for monitoring and observability
|
||||
Documentation=http://docs.grafana.org
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
User=grafana
|
||||
Group=grafana
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
RuntimeDirectory=~PN_S~
|
||||
WorkingDirectory=/usr/share/~PN_S~
|
||||
ExecStart=/usr/libexec/~PN_S~/grafana-server \
|
||||
--config=/etc/~PN_S~/grafana.ini \
|
||||
--pidfile=/run/~PN_S~/grafana.pid \
|
||||
cfg:default.paths.logs=/var/log/~PN_S~ \
|
||||
cfg:default.paths.data=/var/lib/~PN_S~ \
|
||||
cfg:default.paths.plugins=/var/lib/~PN_S~/plugins
|
||||
LimitNOFILE=10000
|
||||
TimeoutStopSec=20
|
||||
UMask=0027
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user