Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Commit 472ed74

Browse files
authored
Merge pull request #14 from druuu/mods
Mods
2 parents 519bade + f757116 commit 472ed74

2 files changed

Lines changed: 28 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Currently supports:
4848

4949
### DockerBox Workflow Video.
5050

51-
[![Everything Is AWESOME](static/images/dbox.png)](https://www.youtube.com/watch?v=7tKSz5OkrA0 "DockerBox")
51+
[![Everything Is AWESOME](static/images/dbox.png)](https://www.youtube.com/watch?v=YCjkZLBNxUQ "DockerBox")
5252

5353

5454
License

install.sh

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22

3+
#TODO replace if condition with test to handle errors using status codes.
34
env_dir="$HOME/docker_box/db_env" &&
45
project_dir="$HOME/docker_box" &&
56
docker_api_port=2375 &&
@@ -87,7 +88,7 @@ dist_info(){
8788

8889
create_macvlan_network(){
8990
echo ' ' &&
90-
echo '########### Creating MACVLAN network(individual IP adresses) ###########' &&
91+
echo '########### Creating MACVLAN network(individual IP adresses)(https://github.com/MicroPyramid/docker-box/wiki/Network) ###########' &&
9192
printf "Enter Subnet(eg: 88.99.102.64/26): " &&
9293
read subnet &&
9394
printf "Enter gateway(eg: 88.99.102.65): " &&
@@ -99,7 +100,7 @@ create_macvlan_network(){
99100

100101
create_bridge_network(){
101102
echo ' ' &&
102-
echo "########### Creating bridge network(IP's from external subnet) ###########" &&
103+
echo "########### Creating bridge network(IP's from external subnet)(https://github.com/MicroPyramid/docker-box/wiki/Network) ###########" &&
103104
printf "Enter Subnet(eg: 88.99.114.16/28): " &&
104105
read subnet2 &&
105106
printf "Enter gateway(eg: 88.99.114.17): " &&
@@ -147,6 +148,9 @@ install(){
147148

148149
git init && git remote add origin 'https://github.com/MicroPyramid/docker-box' &&
149150
git pull origin master &&
151+
#sed replacement pattern considers ampersand, forward slash and backslash(if seperator) as special chars.
152+
secret_key=`python -c 'import random; print("".join([random.SystemRandom().choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^*(-_=+)") for i in range(50)]))'`
153+
sed -i "s/\(SECRET_KEY\s=\s\).*/\1'$secret_key'/g" $project_dir/docker_box/docker_box/settings.py &&
150154
yes | pip install -r requirements.txt &&
151155

152156
python manage.py migrate &&
@@ -177,8 +181,21 @@ install(){
177181
exit 0
178182
fi &&
179183

180-
create_macvlan_network &&
181-
create_bridge_network &&
184+
echo ' ' &&
185+
printf '############## Network Setup(https://github.com/MicroPyramid/docker-box/wiki/Network) #############' &&
186+
echo ' ' &&
187+
printf "Are there extra IP's"' with MAC addresses(y/n): ' &&
188+
read has_mac &&
189+
if [ "$has_mac" = "y" ]
190+
then
191+
create_macvlan_network
192+
fi &&
193+
printf "Are there extra IP's"' without MAC addresses(y/n): ' &&
194+
read has_no_mac &&
195+
if [ "$has_no_mac" = "y" ]
196+
then
197+
create_bridge_network
198+
fi &&
182199

183200
echo ' ' &&
184201
printf "Enter Host IP Address: " &&
@@ -209,6 +226,9 @@ install(){
209226

210227
git init && git remote add origin 'https://github.com/MicroPyramid/docker-box' &&
211228
git pull origin master &&
229+
#sed replacement pattern considers ampersand, forward slash and backslash(if seperator) as special chars.
230+
secret_key=`python -c 'import random; print("".join([random.SystemRandom().choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^*(-_=+)") for i in range(50)]))'`
231+
sed -i "s/\(SECRET_KEY\s=\s\).*/\1'$secret_key'/g" $project_dir/docker_box/docker_box/settings.py &&
212232
yes | pip install -r requirements.txt &&
213233

214234
python manage.py migrate &&
@@ -282,7 +302,9 @@ install(){
282302
#TODO update git for centos6
283303
git init && git remote add origin 'https://github.com/MicroPyramid/docker-box' &&
284304
git pull origin master &&
285-
305+
#sed replacement pattern considers ampersand, forward slash and backslash(if seperator) as special chars.
306+
secret_key=`python -c 'import random; print("".join([random.SystemRandom().choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^*(-_=+)") for i in range(50)]))'`
307+
sed -i "s/\(SECRET_KEY\s=\s\).*/\1'$secret_key'/g" $project_dir/docker_box/docker_box/settings.py &&
286308
yes | pip install -r requirements.txt &&
287309

288310
python manage.py migrate &&

0 commit comments

Comments
 (0)