From 1f031a6524dd68d598705a6fa48ed69332c63d63 Mon Sep 17 00:00:00 2001 From: rusko124 Date: Tue, 2 Jul 2024 12:55:40 +0400 Subject: [PATCH] Fix: screenly.secrets merged into screenly.settings in 'screenly edge-app run' (#171) --- src/commands/edge_app_server.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/commands/edge_app_server.rs b/src/commands/edge_app_server.rs index 696dd06..d778b26 100644 --- a/src/commands/edge_app_server.rs +++ b/src/commands/edge_app_server.rs @@ -146,13 +146,13 @@ fn format_js(data: MockData, secrets: &[(String, Value)]) -> String { .map(|(k, v)| (k, Value::Str(v))) .collect(); + settings.extend(secrets.iter().map(|(k, v)| (k.clone(), v.clone()))); settings.sort_by_key(|a| a.0.clone()); format!( - "var screenly = {{\n{metadata},\n{settings},\n{secrets},\n{cors_proxy}\n}};", + "var screenly = {{\n{metadata},\n{settings},\n{cors_proxy}\n}};", metadata = format_section("metadata", &hashmap_from_metadata(&data.metadata)), settings = format_section("settings", &settings), - secrets = format_section("secrets", secrets), cors_proxy = " cors_proxy_url: \"http://127.0.0.1:8080\"" ) } @@ -270,12 +270,10 @@ settings: }, settings: { "enable_analytics": "true", + "key": "value", "override_timezone": "", "tag_manager_id": "" }, - secrets: { - "key": "value" - }, cors_proxy_url: "http://127.0.0.1:8080" };"#; assert_eq!(content, expected_content);