-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup-dev-env.sh
65 lines (47 loc) · 1.2 KB
/
setup-dev-env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Git clone BP
# Setup Mongo
# Setup NMV
# Setup NodeJS
# Setup Angular Globally
# npm install
BP_HOME="$(cd ../ && pwd)"
APP_HOME="$BP_HOME/bp"
DATA_HOME=$BP_HOME
DATA_DIR="data/db"
echo
echo
echo
echo '!____^_^____!'
echo 'BigPolicy.eu'
echo 'Initializing project'
echo ' BP HOME is:' $BP_HOME
echo ' APP HOME is:' $APP_HOME
echo 'DATA HOME is:' $DATA_HOME
echo ' DATA DIR is:' $DATA_DIR
echo
echo 'Creating DB folder in '$DATA_HOME' directory'
cd $DATA_HOME
mkdir -p $DATA_DIR
echo 'DB folder created: '
ls -lah
cd $APP_HOME
exit 0
## WIP:
## TODO: set acceess control: https://stackoverflow.com/questions/38921414/mongodb-what-are-the-default-user-and-password
## 1 Start MongoDB without access control.
# mongod --port 27027 --dbpath=data/db
## 2 Connect to the instance.
# mongo --port 27027
## 3 Create the user administrator
# db.createUser(
# {
# user: "bpqa",
# pwd: "bpqa81",
# roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
# }
# )
## 4 Re-start the MongoDB instance with access control.
# mongod --auth --port 27027 --dbpath=data/db
## 5 Authenticate as the user administrator.
# mongo --port 27027 -u "bpqa" -p "bpqa81" --authenticationDatabase "admin"