1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#[cfg(test)]
mod tests;

use std::env;
use crate::entry_point::Config;

pub fn read_system_environment_variables() {
    println!("  Start Of System Environment Variables Section");

    let boxed_ip = env::var(Config::RWS_CONFIG_IP);
    if boxed_ip.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_IP,
                 boxed_ip.unwrap());
    }

    let boxed_port = env::var(Config::RWS_CONFIG_PORT);
    if boxed_port.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_PORT,
                 boxed_port.unwrap());
    }

    let boxed_request_allocation_size = env::var(Config::RWS_CONFIG_REQUEST_ALLOCATION_SIZE_IN_BYTES);
    if boxed_request_allocation_size.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_REQUEST_ALLOCATION_SIZE_IN_BYTES,
                 boxed_request_allocation_size.unwrap());
    }

    let boxed_thread_count = env::var(Config::RWS_CONFIG_THREAD_COUNT);
    if boxed_thread_count.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_THREAD_COUNT,
                 boxed_thread_count.unwrap());
    }

    let boxed_cors_allow_all = env::var(Config::RWS_CONFIG_CORS_ALLOW_ALL);
    if boxed_cors_allow_all.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_CORS_ALLOW_ALL,
                 boxed_cors_allow_all.unwrap());
    }

    let boxed_cors_allow_origins = env::var(Config::RWS_CONFIG_CORS_ALLOW_ORIGINS);
    if boxed_cors_allow_origins.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_CORS_ALLOW_ORIGINS,
                 boxed_cors_allow_origins.unwrap());
    }

    let boxed_cors_allow_methods = env::var(Config::RWS_CONFIG_CORS_ALLOW_METHODS);
    if boxed_cors_allow_methods.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_CORS_ALLOW_METHODS,
                 boxed_cors_allow_methods.unwrap());
    }

    let boxed_cors_allow_headers = env::var(Config::RWS_CONFIG_CORS_ALLOW_HEADERS);
    if boxed_cors_allow_headers.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_CORS_ALLOW_HEADERS,
                 boxed_cors_allow_headers.unwrap());
    }

    let boxed_cors_allow_credentials = env::var(Config::RWS_CONFIG_CORS_ALLOW_CREDENTIALS);
    if boxed_cors_allow_credentials.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_CORS_ALLOW_CREDENTIALS,
                 boxed_cors_allow_credentials.unwrap());
    }

    let boxed_cors_expose_headers = env::var(Config::RWS_CONFIG_CORS_EXPOSE_HEADERS);
    if boxed_cors_expose_headers.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_CORS_EXPOSE_HEADERS,
                 boxed_cors_expose_headers.unwrap());
    }

    let boxed_cors_max_age = env::var(Config::RWS_CONFIG_CORS_MAX_AGE);
    if boxed_cors_max_age.is_ok() {
        println!("    Environment variable '{}' set to value '{}'",
                 Config::RWS_CONFIG_CORS_MAX_AGE,
                 boxed_cors_max_age.unwrap());
    }

    println!("  End of System Environment Variables Section");
}