aboutsummaryrefslogtreecommitdiffstats
path: root/license-generator/src/database.rs
diff options
context:
space:
mode:
authorTeddy Wing2018-11-20 07:20:15 +0100
committerTeddy Wing2018-11-20 07:20:15 +0100
commit7d7ac8d747be198088664e45e5423919d9876651 (patch)
treed76fbd483b96f4425653143ae739f9f835939a3e /license-generator/src/database.rs
parent3002290d98c31dc941b33946197e7f58c7ff9dad (diff)
downloaddome-key-web-7d7ac8d747be198088664e45e5423919d9876651.tar.bz2
license-generator: Use compile-time environment variables
For whatever reason, the environment variables in my `.htaccess` weren't getting passed to my FastCGI executables on my production server. Wasn't sure how to get them passed to the programs, so decided instead to compile the env variables into the binaries. To do that, we source the environment file before building the release builds in the Docker container.
Diffstat (limited to 'license-generator/src/database.rs')
-rw-r--r--license-generator/src/database.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/license-generator/src/database.rs b/license-generator/src/database.rs
index 478c97e..85683e9 100644
--- a/license-generator/src/database.rs
+++ b/license-generator/src/database.rs
@@ -1,12 +1,9 @@
-use std::env;
-
use mysql;
use errors::*;
pub fn get_database_pool() -> Result<mysql::Pool> {
- let connection_url = env::var("DATABASE_URL")
- .chain_err(|| "DATABASE_URL environment variable not found")?;
+ let connection_url = env!("DATABASE_URL");
let pool = mysql::Pool::new_manual(4, 15, connection_url)?;
Ok(pool)