Skip to content

Commit 5d32c37

Browse files
committed
MONGO_URL_SERVER added
1 parent a8c0251 commit 5d32c37

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: BioDataScience
22
Type: Package
3-
Version: 2020.0.9001
3+
Version: 2020.0.9002
44
Title: A Series of Learnr Documents for Biological Data Science
55
Description: Interactive documents using learnr for studying biological data science.
66
Authors@R: c(

NEWS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
# BioDataScience 2020.0.9002
2+
3+
- Add `MONGO_URL_SERVER` environmlent variable in `init()`.
4+
15
# BioDataScience 2020.0.9001
26

3-
- Separate `MONGO_SER` and `MONGO_PASSWORD` variables in `init()` and do not set them if already there.
7+
- Separate `MONGO_USER` and `MONGO_PASSWORD` variables in `init()` and do not set them if already there.
48

59
# BioDataScience 2020.0.9000
610

R/init.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#' Initialize the environment for our BioDataScience courses
22
#'
33
#' This function creates several environment variables that are widely used by
4-
#' other packages and applications. Currently, `MONGO_URL`, `MONGO_BASE`,
5-
#' `MONGO_USER` and `MONGO_PASSWORD` are set to default values if not already
6-
#' there.
4+
#' other packages and applications. Currently, `MONGO_URL`, `MONGO_URL_SERVER`
5+
#' (the later one is used if the application is run from a server),
6+
#' `MONGO_BASE`, `MONGO_USER` and `MONGO_PASSWORD` are set to default values if
7+
#' not already there.
78
#'
89
#' @return Nothing, the function is used for its side-effect of creating global
910
#' variables.
@@ -19,6 +20,8 @@ init <- function() {
1920
# Set variable environment required to locate our sdd MongoDB database
2021
if (Sys.getenv("MONGO_URL") == "")
2122
Sys.setenv(MONGO_URL = "mongodb://{user}:{password}@sdd-umons-shard-00-00-umnnw.mongodb.net:27017,sdd-umons-shard-00-01-umnnw.mongodb.net:27017,sdd-umons-shard-00-02-umnnw.mongodb.net:27017/test?ssl=true&replicaSet=sdd-umons-shard-0&authSource=admin")
23+
if (Sys.getenv("MONGO_URL_SERVER") == "")
24+
Sys.setenv(MONGO_URL_SERVER = "mongodb://localhost")
2225
if (Sys.getenv("MONGO_BASE") == "")
2326
Sys.setenv(MONGO_BASE = "sdd")
2427
if (Sys.getenv("MONGO_USER") == "")

0 commit comments

Comments
 (0)