Skip to content
Snippets Groups Projects
Commit c95dc19f authored by insert's avatar insert
Browse files

Fix docker run.sh

parent ab2a510b
No related merge requests found
#!/bin/bash
export $(egrep -v '^#' .env | xargs)
# Split at \n instead of space.
# https://unix.stackexchange.com/a/39482
set -f
IFS='
'
input=($(egrep -v '^#' .env))
prepended=(${input[@]/#/-e\"})
variables=${prepended[@]/%/\"}
unset IFS
set +f
echo "Running Revolt in detached mode."
docker run \
-d \
--name revolt \
-p 8000:8000 \
-p 9000:9000 \
-e "DB_URI=$DB_URI" \
-e "PUBLIC_URI=$PUBLIC_URI" \
-e "PORTAL_URL=$PORTAL_URI" \
$variables \
revolt
......@@ -4,11 +4,15 @@ use std::env;
use log::warn;
lazy_static! {
// General Configuration
// Application Settings
pub static ref MONGO_URI: String =
env::var("REVOLT_MONGO_URI").expect("Missing REVOLT_MONGO_URI environment variable.");
pub static ref PUBLIC_URL: String =
env::var("REVOLT_PUBLIC_URL").expect("Missing REVOLT_PUBLIC_URL environment variable.");
pub static ref HCAPTCHA_KEY: String =
env::var("REVOLT_HCAPTCHA_KEY").unwrap_or_else(|_| "".to_string());
pub static ref WS_HOST: String =
env::var("REVOLT_WS_HOST").unwrap_or_else(|_| "0.0.0.0:9999".to_string());
// Application Flags
pub static ref DISABLE_REGISTRATION: bool = env::var("REVOLT_DISABLE_REGISTRATION").map_or(false, |v| v == "*1");
......@@ -29,12 +33,6 @@ lazy_static! {
pub static ref SMTP_PASSWORD: String =
env::var("SMTP_PASSWORD").unwrap_or_else(|_| "".to_string());
pub static ref SMTP_FROM: String = env::var("SMTP_FROM").unwrap_or_else(|_| "".to_string());
// Application Settings
pub static ref HCAPTCHA_KEY: String =
env::var("REVOLT_HCAPTCHA_KEY").unwrap_or_else(|_| "".to_string());
pub static ref WS_HOST: String =
env::var("REVOLT_WS_HOST").unwrap_or_else(|_| "0.0.0.0:9999".to_string());
}
pub fn preflight_checks() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment