Fix docker run.sh
This commit is contained in:
18
run.sh
18
run.sh
@@ -1,12 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/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."
|
echo "Running Revolt in detached mode."
|
||||||
docker run \
|
docker run \
|
||||||
-d \
|
-d \
|
||||||
--name revolt \
|
--name revolt \
|
||||||
-p 8000:8000 \
|
-p 8000:8000 \
|
||||||
-p 9000:9000 \
|
-p 9000:9000 \
|
||||||
-e "DB_URI=$DB_URI" \
|
$variables \
|
||||||
-e "PUBLIC_URI=$PUBLIC_URI" \
|
|
||||||
-e "PORTAL_URL=$PORTAL_URI" \
|
|
||||||
revolt
|
revolt
|
||||||
|
|||||||
@@ -4,11 +4,15 @@ use std::env;
|
|||||||
use log::warn;
|
use log::warn;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
// General Configuration
|
// Application Settings
|
||||||
pub static ref MONGO_URI: String =
|
pub static ref MONGO_URI: String =
|
||||||
env::var("REVOLT_MONGO_URI").expect("Missing REVOLT_MONGO_URI environment variable.");
|
env::var("REVOLT_MONGO_URI").expect("Missing REVOLT_MONGO_URI environment variable.");
|
||||||
pub static ref PUBLIC_URL: String =
|
pub static ref PUBLIC_URL: String =
|
||||||
env::var("REVOLT_PUBLIC_URL").expect("Missing REVOLT_PUBLIC_URL environment variable.");
|
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
|
// Application Flags
|
||||||
pub static ref DISABLE_REGISTRATION: bool = env::var("REVOLT_DISABLE_REGISTRATION").map_or(false, |v| v == "*1");
|
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 =
|
pub static ref SMTP_PASSWORD: String =
|
||||||
env::var("SMTP_PASSWORD").unwrap_or_else(|_| "".to_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());
|
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() {
|
pub fn preflight_checks() {
|
||||||
|
|||||||
Reference in New Issue
Block a user