Update chirpstack configfile template.

See also chirpstack/chirpstack-docs#25
This commit is contained in:
Orne Brocaar 2025-03-20 11:47:42 +00:00
parent 27689d172f
commit c137136d4d

View File

@ -3,9 +3,7 @@ use handlebars::Handlebars;
use super::super::config;
pub fn run() {
#[allow(clippy::useless_vec)]
let template = vec![
r#"
let template = r#"
# Logging configuration
[logging]
@ -21,10 +19,11 @@ r#"
# Log as JSON.
json={{ logging.json }}
"#,
#[cfg(feature = "postgres")]
r#"
# PostgreSQL configuration.
#
# Note: this option is only available to ChirpStack with PostgreSQL support (default).
[postgresql]
# PostgreSQL DSN.
@ -49,16 +48,20 @@ r#"
# the server-certificate is not signed by a CA in the platform certificate
# store.
ca_cert="{{ postgresql.ca_cert }}"
"#,
#[cfg(feature = "sqlite")]
r#"
# SQLite configuration.
#
# Note: this option is only available to ChirpStack with SQLite support.
[sqlite]
# Sqlite DB path.
#
# Format example: sqlite:///<DATABASE>.
# Make sure the path exists and that the ChirpStack process has read-write
# access to it. If the database file does not exists, it will be created the
# first time ChirpStack starts.
#
# Format example: sqlite:///<DATABASE>.
path="{{ sqlite.path }}"
# Max open connections.
@ -77,8 +80,8 @@ r#"
"{{this}}",
{{/each}}
]
"#,
r#"
# Redis configuration.
[redis]
@ -990,7 +993,7 @@ r#"
# default tileserver_url (OSM). If you configure a different tile-server, you
# might need to update the map_attribution.
map_attribution="{{ui.map_attribution}}"
"#].join("\n");
"#;
let mut reg = Handlebars::new();
reg.register_escape_fn(|s| s.to_string().replace('"', r#"\""#));