Skip to content

Commit 09598ba

Browse files
Add specification constants
1 parent 7f6de0b commit 09598ba

File tree

1 file changed

+53
-0
lines changed
  • specifications/src/constants

1 file changed

+53
-0
lines changed

specifications/src/constants/mod.rs

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
//! Constants
2+
//!
3+
//! This file is a collection of constants that may be used throughout the Brane codebase
4+
//! Using this file we can change defaults on various parts of the infrastructure without modifying
5+
//! a whole bunch of files and inevitably missing one. Some examples of things that should be
6+
//! stored in here are URLs to the documentation. These can change easily and it would be
7+
//! unforunate if it would require more changes than one.
8+
9+
pub const BRANE_CENTRAL_PRX_PORT: u16 = 50050;
10+
pub const BRANE_CENTRAL_API_PORT: u16 = 50051;
11+
pub const BRANE_CENTRAL_PLR_PORT: u16 = 50052;
12+
pub const BRANE_CENTRAL_DRV_PORT: u16 = 50053;
13+
14+
pub const BRANE_WORKER_PRX_PORT: u16 = 50150;
15+
pub const BRANE_WORKER_REG_PORT: u16 = 50151;
16+
pub const BRANE_WORKER_JOB_PORT: u16 = 50152;
17+
pub const BRANE_WORKER_CHK_PORT: u16 = 50153;
18+
19+
pub const SCYLLA_PORT: u16 = 9042;
20+
21+
pub const BRANE_CENTRAL_PRX_NAME: &str = "brane-prx";
22+
pub const BRANE_CENTRAL_API_NAME: &str = "brane-api";
23+
pub const BRANE_CENTRAL_PLR_NAME: &str = "brane-plr";
24+
pub const BRANE_CENTRAL_DRV_NAME: &str = "brane-drv";
25+
26+
// The only way this can be static path is using something lazy lock or lazy cell.
27+
pub const CERTIFICATE_PATH: &str = "certs";
28+
pub const PACKAGE_PATH: &str = "packages";
29+
30+
pub const NODE_HEADER: &str = indoc::indoc!("
31+
# This file defines the environment of the local node.
32+
# Edit this file to change service properties. Some require a restart
33+
# of the service (typically any 'ports' or 'topics' related setting), but most
34+
# will be reloaded dynamically by the services themselves.
35+
");
36+
37+
pub const PROXY_HEADER: &str = indoc::indoc!("
38+
# This file defines the settings for the proxy service on this node.
39+
# This file is loaded eagerly, so changing it requires a restart of the proxy
40+
# service itself.
41+
");
42+
43+
pub const INFRA_HEADER: &str = indoc::indoc!("
44+
# This file defines the nodes part of this Brane instance.
45+
# Edit this file to change the location of nodes and relevant services.
46+
# This file is loaded lazily, so changing it typically does not require a
47+
# restart.
48+
");
49+
50+
pub const INFRA_CONFIG_URL: &str = "https://wiki.enablingpersonalizedinterventions.nl/user-guide/system-admins/docs/config/infra.html";
51+
pub const PROXY_CONFIG_URL: &str = "https://wiki.enablingpersonalizedinterventions.nl/user-guide/system-admins/docs/config/proxy.html";
52+
pub const CENTRAL_NODE_CONFIG_URL: &str = "https://wiki.enablingpersonalizedinterventions.nl/user-guide/system-admins/docs/config/node.html";
53+
pub const WORKER_NODE_CONFIG_URL: &str = "https://wiki.enablingpersonalizedinterventions.nl/user-guide/system-admins/docs/config/node.html";

0 commit comments

Comments
 (0)