mirror of
https://github.com/YunoHost-Apps/grafana_ynh.git
synced 2024-09-03 20:36:29 +02:00
cleaning
This commit is contained in:
parent
e7691ecef0
commit
ce15c659b3
2 changed files with 1619 additions and 30 deletions
1582
conf/graphana.ini
Normal file
1582
conf/graphana.ini
Normal file
File diff suppressed because it is too large
Load diff
|
@ -61,38 +61,45 @@ sed -i '/^\[\[opentsdb\]\]$/,/^\[/ s/^.* enabled = false/enabled = true/' /etc/i
|
|||
ynh_systemd_action --service_name=influxdb --action="restart"
|
||||
|
||||
# Configure Grafana
|
||||
cp ../conf/ldap.toml /etc/grafana
|
||||
#cp ../conf/ldap.toml /etc/grafana
|
||||
|
||||
grafana_conf="/etc/grafana/grafana.ini"
|
||||
# Set final port
|
||||
sed -i "/^\[server\]$/,/^\[/ s@;http_port = .*@http_port = $port@" $grafana_conf
|
||||
# Set domain
|
||||
sed -i "/^\[server\]$/,/^\[/ s@;domain = .*@domain = $domain@" $grafana_conf
|
||||
# Set final URL
|
||||
sed -i "/^\[server\]$/,/^\[/ s@;root_url = .*@root_url = https://$domain$path@" $grafana_conf
|
||||
# Disable check for updates
|
||||
sed -i '/^\[analytics\]$/,/^\[/ s/;check_for_updates = .*/check_for_updates = false/' $grafana_conf
|
||||
# Disable analytics reporting
|
||||
sed -i '/^\[analytics\]$/,/^\[/ s/;reporting_enabled = .*/reporting_enabled = false/' $grafana_conf
|
||||
# Disable organization creation
|
||||
sed -i '/^\[users\]$/,/^\[/ s/;allow_org_create = .*/allow_org_create = false/' $grafana_conf
|
||||
# Enable HTTP and LDAP authentication
|
||||
sed -i '/^\[auth.basic\]$/,/^\[/ s/;enabled = .*/enabled = false/' $grafana_conf
|
||||
sed -i '/^\[auth.proxy\]$/,/^\[/ s/;enabled = .*/enabled = true/' $grafana_conf
|
||||
sed -i '/^\[auth.ldap\]$/,/^\[/ {
|
||||
s/;enabled = .*/enabled = true/
|
||||
s/;allow_sign_up = .*/allow_sign_up = true/
|
||||
}' $grafana_conf
|
||||
# Set log level to debug
|
||||
sed -i '/^\[log\]$/,/^\[/ s/;level = .*/level = debug/' $grafana_conf
|
||||
ynh_add_config --template="ldap.toml" --destination="/etc/grafana/ldap.toml"
|
||||
|
||||
# Change URL and database credentials
|
||||
sed -i "/^\[database\]$/,/^\[/ {
|
||||
s/;type = .*/type = mysql/
|
||||
s/;name = .*/name = $db_name/
|
||||
s/;user = .*/user = $db_user/
|
||||
s/;\?password =.*/password = $db_pwd/
|
||||
}" $grafana_conf
|
||||
#grafana_conf="/etc/grafana/grafana.ini"
|
||||
## Set final port
|
||||
# sed -i "/^\[server\]$/,/^\[/ s@;http_port = .*@http_port = $port@" $grafana_conf
|
||||
# # Set domain
|
||||
# sed -i "/^\[server\]$/,/^\[/ s@;domain = .*@domain = $domain@" $grafana_conf
|
||||
# # Set final URL
|
||||
# sed -i "/^\[server\]$/,/^\[/ s@;root_url = .*@root_url = https://$domain$path@" $grafana_conf
|
||||
# # Disable check for updates
|
||||
# sed -i '/^\[analytics\]$/,/^\[/ s/;check_for_updates = .*/check_for_updates = false/' $grafana_conf
|
||||
# # Disable analytics reporting
|
||||
# sed -i '/^\[analytics\]$/,/^\[/ s/;reporting_enabled = .*/reporting_enabled = false/' $grafana_conf
|
||||
# # Disable organization creation
|
||||
# sed -i '/^\[users\]$/,/^\[/ s/;allow_org_create = .*/allow_org_create = false/' $grafana_conf
|
||||
# # Enable HTTP and LDAP authentication
|
||||
# sed -i '/^\[auth.basic\]$/,/^\[/ s/;enabled = .*/enabled = false/' $grafana_conf
|
||||
# sed -i '/^\[auth.proxy\]$/,/^\[/ s/;enabled = .*/enabled = true/' $grafana_conf
|
||||
# sed -i '/^\[auth.ldap\]$/,/^\[/ {
|
||||
# s/;enabled = .*/enabled = true/
|
||||
# s/;allow_sign_up = .*/allow_sign_up = true/
|
||||
# }' $grafana_conf
|
||||
# # Set log level to debug
|
||||
# sed -i '/^\[log\]$/,/^\[/ s/;level = .*/level = debug/' $grafana_conf
|
||||
|
||||
# # Change URL and database credentials
|
||||
# sed -i "/^\[database\]$/,/^\[/ {
|
||||
# s/;type = .*/type = mysql/
|
||||
# s/;name = .*/name = $db_name/
|
||||
# s/;user = .*/user = $db_user/
|
||||
# s/;\?password =.*/password = $db_pwd/
|
||||
# }" $grafana_conf
|
||||
|
||||
ynh_add_config --template="grafana.ini" --destination="/etc/grafana/grafana.ini"
|
||||
|
||||
chmod 650 "/etc/grafana/grafana.ini"
|
||||
chown $app:$app "/etc/grafana/grafana.ini"
|
||||
|
||||
# Calculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum --file="$grafana_conf"
|
||||
|
|
Loading…
Reference in a new issue