mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 13:36:59 +00:00
Fix docker run.sh
This commit is contained in:
18
run.sh
18
run.sh
@@ -1,12 +1,22 @@
|
||||
#!/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() {
|
||||
|
||||
Reference in New Issue
Block a user