systemprompt_cloud/
constants.rs1pub use systemprompt_models::paths::constants::{build, dir_names, file_names, storage};
2
3pub mod container {
4 use systemprompt_models::paths::constants::cloud_container;
5
6 pub const APP: &str = cloud_container::APP_ROOT;
7 pub const APP_ROOT: &str = cloud_container::APP_ROOT;
8 pub const BIN: &str = cloud_container::BIN;
9 pub const LOGS: &str = cloud_container::LOGS;
10 pub const SERVICES: &str = cloud_container::SERVICES;
11 pub const STORAGE: &str = cloud_container::STORAGE;
12 pub const WEB: &str = cloud_container::WEB;
13 pub const PROFILES: &str = cloud_container::PROFILES;
14 pub const TEMPLATES: &str = cloud_container::TEMPLATES;
15 pub const ASSETS: &str = cloud_container::ASSETS;
16}
17
18pub mod oauth {
19 pub const CALLBACK_PORT: u16 = 8765;
20 pub const CALLBACK_TIMEOUT_SECS: u64 = 300;
21}
22
23pub mod checkout {
24 pub const CALLBACK_PORT: u16 = 8766;
25 pub const CALLBACK_TIMEOUT_SECS: u64 = 300;
26 pub const PROVISIONING_POLL_INTERVAL_MS: u64 = 2000;
27}
28
29pub mod credentials {
30 use super::{dir_names, file_names};
31
32 pub const DEFAULT_DIR_NAME: &str = dir_names::SYSTEMPROMPT;
33 pub const DEFAULT_FILE_NAME: &str = file_names::CREDENTIALS;
34}
35
36pub mod tenants {
37 use super::{dir_names, file_names};
38
39 pub const DEFAULT_DIR_NAME: &str = dir_names::SYSTEMPROMPT;
40 pub const DEFAULT_FILE_NAME: &str = file_names::TENANTS;
41}
42
43pub mod cli_session {
44 use super::{dir_names, file_names};
45
46 pub const DEFAULT_DIR_NAME: &str = dir_names::SYSTEMPROMPT;
47 pub const DEFAULT_FILE_NAME: &str = file_names::SESSION;
48}
49
50pub mod docker {
51 pub const CONTAINER_NAME_PREFIX: &str = "systemprompt-postgres";
52 pub const COMPOSE_PATH: &str = "infrastructure/docker";
53
54 pub fn container_name(env_name: &str) -> String {
55 format!("{}-{}", CONTAINER_NAME_PREFIX, env_name)
56 }
57}
58
59pub mod api {
60 pub const PRODUCTION_URL: &str = "https://api.systemprompt.io";
61 pub const SANDBOX_URL: &str = "https://api-sandbox.systemprompt.io";
62}
63
64pub mod regions {
65 pub const AVAILABLE: &[(&str, &str)] = &[
66 ("iad", "US East (Virginia)"),
67 ("lhr", "Europe (London)"),
68 ("fra", "Europe (Frankfurt)"),
69 ("ams", "Europe (Amsterdam)"),
70 ("sin", "Asia (Singapore)"),
71 ("nrt", "Asia (Tokyo)"),
72 ("syd", "Australia (Sydney)"),
73 ("gru", "South America (São Paulo)"),
74 ];
75}
76
77pub mod paths {
78 use super::{dir_names, file_names};
79
80 pub const ROOT_DIR: &str = dir_names::SYSTEMPROMPT;
81 pub const PROFILES_DIR: &str = dir_names::PROFILES;
82 pub const DOCKER_DIR: &str = dir_names::DOCKER;
83 pub const STORAGE_DIR: &str = dir_names::STORAGE;
84 pub const DOCKERFILE: &str = file_names::DOCKERFILE;
85 pub const PROFILE_CONFIG: &str = file_names::PROFILE_CONFIG;
86 pub const PROFILE_SECRETS: &str = file_names::PROFILE_SECRETS;
87 pub const CREDENTIALS_FILE: &str = file_names::CREDENTIALS;
88 pub const TENANTS_FILE: &str = file_names::TENANTS;
89 pub const SESSION_FILE: &str = file_names::SESSION;
90 pub const PROFILE_DOCKER_DIR: &str = dir_names::DOCKER;
91 pub const ENTRYPOINT: &str = file_names::ENTRYPOINT;
92 pub const DOCKERIGNORE: &str = file_names::DOCKERIGNORE;
93 pub const COMPOSE_FILE: &str = file_names::COMPOSE;
94}
95
96pub mod profile {
97 use super::container;
98
99 pub const DEFAULT_DB_TYPE: &str = "postgres";
100 pub const DEFAULT_PORT: u16 = 8080;
101 pub const LOCAL_HOST: &str = "127.0.0.1";
102 pub const CLOUD_HOST: &str = "0.0.0.0";
103 pub const DEFAULT_CLOUD_URL: &str = "https://cloud.systemprompt.io";
104 pub const LOCAL_ISSUER: &str = "systemprompt-local";
105 pub const CLOUD_ISSUER: &str = "systemprompt";
106 pub const ACCESS_TOKEN_EXPIRATION: i64 = 2_592_000;
107 pub const REFRESH_TOKEN_EXPIRATION: i64 = 15_552_000;
108 pub const CLOUD_APP_PATH: &str = container::APP_ROOT;
109 pub const CREDENTIALS_PATH: &str = "../../credentials.json";
110 pub const TENANTS_PATH: &str = "../../tenants.json";
111}
112
113pub mod env_vars {
114 pub const SYSTEM_MANAGED: &[&str] = &["FLY_APP_NAME", "FLY_MACHINE_ID"];
115
116 pub const CLI_SYNCED: &[&str] = &[
117 "SYSTEMPROMPT_API_TOKEN",
118 "SYSTEMPROMPT_USER_EMAIL",
119 "SYSTEMPROMPT_CLI_REMOTE",
120 "SYSTEMPROMPT_PROFILE",
121 ];
122
123 pub fn is_system_managed(key: &str) -> bool {
124 SYSTEM_MANAGED.iter().any(|&k| k.eq_ignore_ascii_case(key))
125 }
126}