Skip to content

Commit

Permalink
Fix: screenly.secrets merged into screenly.settings in 'screenly edge…
Browse files Browse the repository at this point in the history
…-app run' (#171)
  • Loading branch information
rusko124 authored Jul 2, 2024
1 parent 173a664 commit 1f031a6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/commands/edge_app_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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\""
)
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1f031a6

Please sign in to comment.