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

Commit 9f48fb8

Browse files
author
David Garcia
committed
initial user, env file
1 parent 9a214f4 commit 9f48fb8

8 files changed

+30
-45
lines changed

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ mv thethe/install.sh
3535
./install.sh
3636
```
3737

38+
You **MUST** have a .env file with the following structure in thethe root directory:
39+
40+
```bash
41+
MONGO_INITDB_ROOT_USERNAME=
42+
MONGO_INITDB_ROOT_PASSWORD=
43+
MONGO_INITDB_DATABASE=thethe
44+
THETHE_SECRET=
45+
```
46+
47+
- Select a **secure** user/pass/secret combination at your own for each value.
48+
- Leave **MONGO_INITDB_DATABASE** with "thethe" value.
49+
3850
---
3951

4052
### Running thethe
@@ -53,16 +65,6 @@ Are you a developer?
5365

5466
---
5567

56-
### Default user
57-
58-
By default, there is a single user **admin** with password **admin**
59-
60-
Change the **admin** password as soon as you log into **thethe** the very first time.
61-
62-
_(It is planned to have a proper multiuser support)_
63-
64-
---
65-
6668
### API keys
6769

6870
There are not API keys stored by default on the system.

docker-compose.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ services:
55
image: mongo
66
container_name: thethe_mongo
77
restart: always
8-
environment:
9-
MONGO_INITDB_ROOT_USERNAME: root
10-
MONGO_INITDB_ROOT_PASSWORD: root
11-
MONGO_INITDB_DATABASE: thethe
8+
env_file: .env
129
volumes:
13-
- ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
1410
- ./mongodb_data/:/data/db
15-
1611
redis:
1712
image: redis
1813
container_name: thethe_redis
@@ -45,8 +40,7 @@ services:
4540
build:
4641
context: ./thethe_server
4742
container_name: thethe_server
48-
environment:
49-
- THETHE_SECRET
43+
env_file: .env
5044
command: >
5145
sh -c "python server/register_plugins.py &&
5246
/usr/local/bin/gunicorn server.main:app -w 4 -t 90 --log-level=info -b 0.0.0.0:8000"

docker-compose_dev.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ services:
77
restart: always
88
ports:
99
- 27017:27017
10-
environment:
11-
MONGO_INITDB_ROOT_USERNAME: root
12-
MONGO_INITDB_ROOT_PASSWORD: root
13-
MONGO_INITDB_DATABASE: thethe
14-
10+
env_file: .env
1511
volumes:
16-
- ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
1712
- ./mongodb_data:/data/db
1813

1914
redis:
@@ -38,8 +33,7 @@ services:
3833
server:
3934
build:
4035
context: thethe_server/
41-
environment:
42-
- THETHE_SECRET
36+
env_file: .env
4337
container_name: thethe_server
4438
command: >
4539
sh -c "python server/register_plugins.py && /usr/local/bin/gunicorn server.main:app -w 4 -t 90 --log-level=info -b 0.0.0.0:8000 --reload"

install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ echo -e "${Green}[+] Building docker images. It will take a while.${Color_Off}"
103103
docker-compose build
104104

105105
echo -e "${BGreen}[*] Installation completed.${Color_Off}"
106-
echo -e "${Blue}Run start.sh (inside thethe directory) if you want to launch thethe.${Color_Off}"
106+
echo -e "${Blue}Make sure you have a proper .env file with your desired values. Then, run start.sh (inside thethe directory).${Color_Off}"

mongo-init.js

-10
This file was deleted.

start.sh

+11-6
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ echo " "
4848
echo -e "${Blue}Welcome to The Threat Hunting Environment ${Color_Off} "
4949
echo " "
5050

51-
function set_secret() {
52-
secret=$(openssl rand -hex 64)
53-
echo -e "${BGreen}[*] Generating secret...${Color_Off}"
54-
export THETHE_SECRET=$secret
55-
}
51+
# function set_secret() {
52+
# secret=$(openssl rand -hex 64)
53+
# echo -e "${BGreen}[*] Generating secret...${Color_Off}"
54+
# export THETHE_SECRET=$secret
55+
# }
5656

5757
function check_certs() {
5858
CERT_CRT=./external/certs/thethe.crt
@@ -78,7 +78,12 @@ function check_certs() {
7878

7979
development=$1
8080

81-
set_secret
81+
if [[ -f ".env" ]]; then
82+
echo ".env file exists...ok"
83+
else
84+
echo ".env file not found...go to README"
85+
exit
86+
fi
8287

8388
if [[ $1 == "dev" ]]; then
8489
echo -e "${Red}Development mode on${Color_Off}"

0 commit comments

Comments
 (0)