Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
361acd3f
Commit
361acd3f
authored
Dec 05, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboards as cfg: include cfg files in dist packages
parent
1dfa5299
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
37 additions
and
8 deletions
+37
-8
conf/dashboards/sample.yaml
+0
-0
conf/datasources/sample.yaml
+0
-0
packaging/deb/control/postinst
+4
-0
packaging/deb/default/grafana-server
+4
-0
packaging/deb/init.d/grafana-server
+3
-1
packaging/deb/systemd/grafana-server.service
+5
-1
packaging/mac/bin/grafana
+3
-1
packaging/rpm/control/postinst
+4
-0
packaging/rpm/init.d/grafana-server
+3
-1
packaging/rpm/sysconfig/grafana-server
+4
-0
packaging/rpm/systemd/grafana-server.service
+4
-1
pkg/setting/setting.go
+2
-2
scripts/grunt/release_task.js
+1
-1
No files found.
conf/dashboards/
dashboards
.yaml
→
conf/dashboards/
sample
.yaml
View file @
361acd3f
File moved
conf/datasources/
datasources
.yaml
→
conf/datasources/
sample
.yaml
View file @
361acd3f
File moved
packaging/deb/control/postinst
View file @
361acd3f
...
@@ -29,6 +29,10 @@ case "$1" in
...
@@ -29,6 +29,10 @@ case "$1" in
if
[
!
-f
$CONF_FILE
]
;
then
if
[
!
-f
$CONF_FILE
]
;
then
cp /usr/share/grafana/conf/sample.ini
$CONF_FILE
cp /usr/share/grafana/conf/sample.ini
$CONF_FILE
cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml
cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml
mkdir
-p
/etc/grafana/dashboards /etc/grafana/datasources
cp /usr/share/grafana/conf/dashboards/sample.yaml /etc/grafana/dashboards/sample.yaml
cp /usr/share/grafana/conf/datasources/sample.yaml /etc/grafana/datasources/sample.yaml
fi
fi
# configuration files should not be modifiable by grafana user, as this can be a security issue
# configuration files should not be modifiable by grafana user, as this can be a security issue
...
...
packaging/deb/default/grafana-server
View file @
361acd3f
...
@@ -18,5 +18,9 @@ RESTART_ON_UPGRADE=true
...
@@ -18,5 +18,9 @@ RESTART_ON_UPGRADE=true
PLUGINS_DIR=/var/lib/grafana/plugins
PLUGINS_DIR=/var/lib/grafana/plugins
DATASOURCES_CFG_DIR=/etc/grafana/datasources
DASHBOARDS_CFG_DIR=/etc/grafana/dashboards
# Only used on systemd systems
# Only used on systemd systems
PID_FILE_DIR=/var/run/grafana
PID_FILE_DIR=/var/run/grafana
packaging/deb/init.d/grafana-server
View file @
361acd3f
...
@@ -33,6 +33,8 @@ DATA_DIR=/var/lib/grafana
...
@@ -33,6 +33,8 @@ DATA_DIR=/var/lib/grafana
PLUGINS_DIR
=
/var/lib/grafana/plugins
PLUGINS_DIR
=
/var/lib/grafana/plugins
LOG_DIR
=
/var/log/grafana
LOG_DIR
=
/var/log/grafana
CONF_FILE
=
$CONF_DIR
/grafana.ini
CONF_FILE
=
$CONF_DIR
/grafana.ini
DATASOURCES_CFG_DIR
=
$CONF_DIR
/datasources
DASHBOARDS_CFG_DIR
=
$CONF_DIR
/dashboards
MAX_OPEN_FILES
=
10000
MAX_OPEN_FILES
=
10000
PID_FILE
=
/var/run/
$NAME
.pid
PID_FILE
=
/var/run/
$NAME
.pid
DAEMON
=
/usr/sbin/
$NAME
DAEMON
=
/usr/sbin/
$NAME
...
@@ -55,7 +57,7 @@ if [ -f "$DEFAULT" ]; then
...
@@ -55,7 +57,7 @@ if [ -f "$DEFAULT" ]; then
.
"
$DEFAULT
"
.
"
$DEFAULT
"
fi
fi
DAEMON_OPTS
=
"--pidfile=
${
PID_FILE
}
--config=
${
CONF_FILE
}
cfg:default.paths.data=
${
DATA_DIR
}
cfg:default.paths.logs=
${
LOG_DIR
}
cfg:default.paths.plugins=
${
PLUGINS_DIR
}
"
DAEMON_OPTS
=
"--pidfile=
${
PID_FILE
}
--config=
${
CONF_FILE
}
cfg:default.paths.data
sources=
$DATASOURCES_CFG_DIR
cfg:default.paths.dashboards=
$DASHBOARDS_CFG_DIR
cfg:default.paths.data
=
${
DATA_DIR
}
cfg:default.paths.logs=
${
LOG_DIR
}
cfg:default.paths.plugins=
${
PLUGINS_DIR
}
"
function
checkUser
()
{
function
checkUser
()
{
if
[
`
id
-u
`
-ne
0
]
;
then
if
[
`
id
-u
`
-ne
0
]
;
then
...
...
packaging/deb/systemd/grafana-server.service
View file @
361acd3f
...
@@ -19,7 +19,11 @@ ExecStart=/usr/sbin/grafana-server \
...
@@ -19,7 +19,11 @@ ExecStart=/usr/sbin/grafana-server \
--pidfile=${PID_FILE_DIR}/grafana-server.pid \
--pidfile=${PID_FILE_DIR}/grafana-server.pid \
cfg:default.paths.logs=${LOG_DIR} \
cfg:default.paths.logs=${LOG_DIR} \
cfg:default.paths.data=${DATA_DIR} \
cfg:default.paths.data=${DATA_DIR} \
cfg:default.paths.plugins=${PLUGINS_DIR}
cfg:default.paths.plugins=${PLUGINS_DIR} \
cfg:default.paths.datasources=${DATASOURCES_CFG_DIR} \
cfg:default.paths.dashboards=${DASHBOARDS_CFG_DIR}
LimitNOFILE=10000
LimitNOFILE=10000
TimeoutStopSec=20
TimeoutStopSec=20
UMask=0027
UMask=0027
...
...
packaging/mac/bin/grafana
View file @
361acd3f
...
@@ -6,10 +6,12 @@ HOMEPATH=/usr/local/share/grafana
...
@@ -6,10 +6,12 @@ HOMEPATH=/usr/local/share/grafana
LOGPATH
=
/usr/local/var/log/grafana
LOGPATH
=
/usr/local/var/log/grafana
DATAPATH
=
/usr/local/var/lib/grafana
DATAPATH
=
/usr/local/var/lib/grafana
PLUGINPATH
=
/usr/local/var/lib/grafana/plugins
PLUGINPATH
=
/usr/local/var/lib/grafana/plugins
DATASOURCECFGPATH
=
/usr/local/etc/grafana/datasources
DASHBOARDSCFGPATH
=
/usr/local/etc/grafana/dashboards
case
"
$1
"
in
case
"
$1
"
in
start
)
start
)
$EXECUTABLE
--config
=
$CONFIG
--homepath
=
$HOMEPATH
cfg:default.paths.logs
=
$LOGPATH
cfg:default.paths.data
=
$DATAPATH
cfg:default.paths.plugins
=
$PLUGINPATH
2> /dev/null &
$EXECUTABLE
--config
=
$CONFIG
--homepath
=
$HOMEPATH
cfg:default.paths.
datasources
=
$DATASOURCECFGPATH
cfg:default.paths.dashboards
=
$DASHBOARDSCFGPATH
cfg:default.paths.
logs
=
$LOGPATH
cfg:default.paths.data
=
$DATAPATH
cfg:default.paths.plugins
=
$PLUGINPATH
2> /dev/null &
[
$?
-eq
0
]
&&
echo
"
$DAEMON
started"
[
$?
-eq
0
]
&&
echo
"
$DAEMON
started"
;;
;;
stop
)
stop
)
...
...
packaging/rpm/control/postinst
View file @
361acd3f
...
@@ -43,6 +43,10 @@ if [ $1 -eq 1 ] ; then
...
@@ -43,6 +43,10 @@ if [ $1 -eq 1 ] ; then
if
[
!
-f
$CONF_FILE
]
;
then
if
[
!
-f
$CONF_FILE
]
;
then
cp /usr/share/grafana/conf/sample.ini
$CONF_FILE
cp /usr/share/grafana/conf/sample.ini
$CONF_FILE
cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml
cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml
mkdir
-p
/etc/grafana/dashboards /etc/grafana/datasources
cp /usr/share/grafana/conf/dashboards/sample.yaml /etc/grafana/dashboards/sample.yaml
cp /usr/share/grafana/conf/datasources/sample.yaml /etc/grafana/datasources/sample.yaml
fi
fi
# Set user permissions on /var/log/grafana, /var/lib/grafana
# Set user permissions on /var/log/grafana, /var/lib/grafana
...
...
packaging/rpm/init.d/grafana-server
View file @
361acd3f
...
@@ -32,6 +32,8 @@ DATA_DIR=/var/lib/grafana
...
@@ -32,6 +32,8 @@ DATA_DIR=/var/lib/grafana
PLUGINS_DIR
=
/var/lib/grafana/plugins
PLUGINS_DIR
=
/var/lib/grafana/plugins
LOG_DIR
=
/var/log/grafana
LOG_DIR
=
/var/log/grafana
CONF_FILE
=
$CONF_DIR
/grafana.ini
CONF_FILE
=
$CONF_DIR
/grafana.ini
DATASOURCES_CFG_DIR
=
$CONF_DIR
/datasources
DASHBOARDS_CFG_DIR
=
$CONF_DIR
/dashboards
MAX_OPEN_FILES
=
10000
MAX_OPEN_FILES
=
10000
PID_FILE
=
/var/run/
$NAME
.pid
PID_FILE
=
/var/run/
$NAME
.pid
DAEMON
=
/usr/sbin/
$NAME
DAEMON
=
/usr/sbin/
$NAME
...
@@ -59,7 +61,7 @@ fi
...
@@ -59,7 +61,7 @@ fi
# overwrite settings from default file
# overwrite settings from default file
[
-e
/etc/sysconfig/
$NAME
]
&&
.
/etc/sysconfig/
$NAME
[
-e
/etc/sysconfig/
$NAME
]
&&
.
/etc/sysconfig/
$NAME
DAEMON_OPTS
=
"--pidfile=
${
PID_FILE
}
--config=
${
CONF_FILE
}
cfg:default.paths.data=
${
DATA_DIR
}
cfg:default.paths.logs=
${
LOG_DIR
}
cfg:default.paths.plugins=
${
PLUGINS_DIR
}
"
DAEMON_OPTS
=
"--pidfile=
${
PID_FILE
}
--config=
${
CONF_FILE
}
cfg:default.paths.data
sources=
$DATASOURCES_CFG_DIR
cfg:default.paths.dashboards=
$DASHBOARDS_CFG_DIR
cfg:default.paths.data
=
${
DATA_DIR
}
cfg:default.paths.logs=
${
LOG_DIR
}
cfg:default.paths.plugins=
${
PLUGINS_DIR
}
"
function
isRunning
()
{
function
isRunning
()
{
status
-p
$PID_FILE
$NAME
>
/dev/null 2>&1
status
-p
$PID_FILE
$NAME
>
/dev/null 2>&1
...
...
packaging/rpm/sysconfig/grafana-server
View file @
361acd3f
...
@@ -18,5 +18,9 @@ RESTART_ON_UPGRADE=true
...
@@ -18,5 +18,9 @@ RESTART_ON_UPGRADE=true
PLUGINS_DIR=/var/lib/grafana/plugins
PLUGINS_DIR=/var/lib/grafana/plugins
DATASOURCES_CFG_DIR=/etc/grafana/datasources
DASHBOARDS_CFG_DIR=/etc/grafana/dashboards
# Only used on systemd systems
# Only used on systemd systems
PID_FILE_DIR=/var/run/grafana
PID_FILE_DIR=/var/run/grafana
packaging/rpm/systemd/grafana-server.service
View file @
361acd3f
...
@@ -19,7 +19,10 @@ ExecStart=/usr/sbin/grafana-server \
...
@@ -19,7 +19,10 @@ ExecStart=/usr/sbin/grafana-server \
--pidfile=${PID_FILE_DIR}/grafana-server.pid \
--pidfile=${PID_FILE_DIR}/grafana-server.pid \
cfg:default.paths.logs=${LOG_DIR} \
cfg:default.paths.logs=${LOG_DIR} \
cfg:default.paths.data=${DATA_DIR} \
cfg:default.paths.data=${DATA_DIR} \
cfg:default.paths.plugins=${PLUGINS_DIR}
cfg:default.paths.plugins=${PLUGINS_DIR} \
cfg:default.paths.datasources=${DATASOURCES_CFG_DIR} \
cfg:default.paths.dashboards=${DASHBOARDS_CFG_DIR}
LimitNOFILE=10000
LimitNOFILE=10000
TimeoutStopSec=20
TimeoutStopSec=20
...
...
pkg/setting/setting.go
View file @
361acd3f
...
@@ -475,8 +475,8 @@ func NewConfigContext(args *CommandLineArgs) error {
...
@@ -475,8 +475,8 @@ func NewConfigContext(args *CommandLineArgs) error {
Env
=
Cfg
.
Section
(
""
)
.
Key
(
"app_mode"
)
.
MustString
(
"development"
)
Env
=
Cfg
.
Section
(
""
)
.
Key
(
"app_mode"
)
.
MustString
(
"development"
)
InstanceName
=
Cfg
.
Section
(
""
)
.
Key
(
"instance_name"
)
.
MustString
(
"unknown_instance_name"
)
InstanceName
=
Cfg
.
Section
(
""
)
.
Key
(
"instance_name"
)
.
MustString
(
"unknown_instance_name"
)
PluginsPath
=
makeAbsolute
(
Cfg
.
Section
(
"paths"
)
.
Key
(
"plugins"
)
.
String
(),
HomePath
)
PluginsPath
=
makeAbsolute
(
Cfg
.
Section
(
"paths"
)
.
Key
(
"plugins"
)
.
String
(),
HomePath
)
DatasourcesPath
=
makeAbsolute
(
Cfg
.
Section
(
"paths"
)
.
Key
(
"datasources"
)
.
String
(),
HomePath
)
DatasourcesPath
=
Cfg
.
Section
(
"paths"
)
.
Key
(
"datasources"
)
.
String
(
)
DashboardsPath
=
makeAbsolute
(
Cfg
.
Section
(
"paths"
)
.
Key
(
"dashboards"
)
.
String
(),
HomePath
)
DashboardsPath
=
Cfg
.
Section
(
"paths"
)
.
Key
(
"dashboards"
)
.
String
(
)
server
:=
Cfg
.
Section
(
"server"
)
server
:=
Cfg
.
Section
(
"server"
)
AppUrl
,
AppSubUrl
=
parseAppUrlAndSubUrl
(
server
)
AppUrl
,
AppSubUrl
=
parseAppUrlAndSubUrl
(
server
)
...
...
scripts/grunt/release_task.js
View file @
361acd3f
...
@@ -26,7 +26,7 @@ module.exports = function(grunt) {
...
@@ -26,7 +26,7 @@ module.exports = function(grunt) {
});
});
grunt
.
config
(
'copy.backend_files'
,
{
grunt
.
config
(
'copy.backend_files'
,
{
expand
:
true
,
expand
:
true
,
src
:
[
'conf/*'
,
'vendor/phantomjs/*'
,
'scripts/*'
],
src
:
[
'conf/*
*
'
,
'vendor/phantomjs/*'
,
'scripts/*'
],
options
:
{
mode
:
true
},
options
:
{
mode
:
true
},
dest
:
'<%= tempDir %>'
dest
:
'<%= tempDir %>'
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment