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