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

Commit

Permalink
merged new dockers
Browse files Browse the repository at this point in the history
  • Loading branch information
David Garcia committed Feb 14, 2020
2 parents 6b39532 + 23e810f commit 3bd866b
Show file tree
Hide file tree
Showing 712 changed files with 77 additions and 28,088 deletions.
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,19 @@ venv.bak/
# mypy
.mypy_cache/
__pycache__/*
thethe_venv/*
notes.txt
tags
TODO
sources
Pipfile
Pipfile.lock
frontend/public/static/phishtank/*
!frontend/public/static/phishtank/.gitkeep
node_modules/

# thethe
external/*
utils/db.dump
utils/db.dump.gz
db.dump.gz
mongodb_data/*
node_modules/
external/*
thethe_server/*
thethe_frontend/*
8 changes: 8 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Core Developers
---------------

David Garcia
Alvaro Nuñez-Romero


Contributors
------------

Pablo San Emeterio
Antonio Reina
Carlos Avila
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

49 changes: 39 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ theTHE also contains some command-line tools integrated so you don't have to ope

Your feedback is welcome.

## Installation
---

### Installation

First, clone this repository with:

Expand All @@ -24,23 +26,27 @@ docker-compose up -d

You should see **thethe** in [https://localhost](https://localhost) after a :coffee:

## Default user
---

### Default user

By default, there is a single user **admin** with password **admin**

Change the **admin** password as soon as you log into **thethe** the very first time.

_(It is planned to have a proper multiuser support)_

---

## API keys
### API keys

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

To add an API key, there is an option in the user menu (upper-right corner) to manage your keys.

---

## Database backups and restoration
### Database backups and restoration

Mongodb has a bind volume to ease external storage and backups in a folder **mongodb_data**

Expand All @@ -62,23 +68,44 @@ restore_thethe_db.sh <mongodb_container_name>

---

## Updating thethe
### External storage

See [updating thethe](https://github.com/ElevenPaths/thethe/wiki/How-to-update-thethe)
There is a folder called **extenal** for everything theTHE should store outside a database: files, images, etc.

Backup this folder according to your backup policy.

---

### Updating thethe

See [updating thethe](https://github.com/ElevenPaths/thethe/wiki/How-to-update-thethe)

---

## Development environment
### Development environment

If you want to collaborate with the project, a development version is provided:

### Get the repository
### Get the repositories

```bash
git clone https://github.com/ElevenPaths/thethe.git
```

Inside **thethe** main repo:

for the server:

```bash
git clone https://github.com/ElevenPaths/thethe_server.git
```

for the frontend:

```bash
git clone https://github.com/ElevenPaths/thethe_frontend.git
```

### Docker (don't forget your :coffee:)

```bash
Expand All @@ -87,15 +114,17 @@ docker-compose -f docker-compose_dev.yml up -d

### Run the frontend

In develop mode the frontnd does not run inside a container, do:

```bash
cd frontend
cd thethe_frontend
npm install
npm run serve
```

---

## More info
### More info

Website: [https://thethe.e-paths.com](https://thethe.e-paths.com/)

Expand Down
26 changes: 11 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Use root/example as user/password credentials
version: "3.3"

services:
Expand All @@ -10,7 +9,6 @@ services:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
MONGO_INITDB_DATABASE: thethe

volumes:
- ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
- ./mongodb_data/:/data/db
Expand All @@ -21,38 +19,36 @@ services:
restart: always

celery:
build: .
build:
context: https://github.com/ElevenPaths/thethe_server.git
container_name: thethe_celery
command: /usr/local/bin/celery -A tasks.tasks:celery_app worker -l info
command: /usr/local/bin/celery -A tasks.tasks:celery_app worker --concurrency 1 -l info
volumes:
- ./server:/usr/src/thethe/server
- ./tasks:/usr/src/thethe/tasks
- ./frontend/public/static/phishtank:/temp/phishtank
- ./external/phishtank:/temp/phishtank
depends_on:
- redis

nginx:
frontend:
build:
context: ./frontend
container_name: thethe_nginx
context: https://github.com/ElevenPaths/thethe_frontend.git
container_name: thethe_frontend
volumes:
- ./frontend/public/static/phishtank:/usr/share/nginx/html/static/phishtank
- ./external/phishtank:/usr/share/nginx/html/static/phishtank
ports:
- 80:80
- 443:443
depends_on:
- server

server:
build: .
build:
context: https://github.com/ElevenPaths/thethe_server.git
container_name: thethe_server
command: >
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"
volumes:
- ./server:/usr/src/thethe/server
- ./tasks:/usr/src/thethe/tasks
- ./frontend/public/static/phishtank:/temp/phishtank
- ./external/phishtank:/temp/phishtank
depends_on:
- mongo
- celery
21 changes: 11 additions & 10 deletions docker-compose_dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Use root/example as user/password credentials
version: "3.3"

services:
Expand All @@ -25,25 +24,27 @@ services:
- 6379:6379

celery:
build: .
build:
context: thethe_server/
container_name: thethe_celery
command: /usr/local/bin/watchmedo auto-restart -d tasks -p '*.py' -- celery -A tasks.tasks:celery_app worker -l info
command: /usr/local/bin/watchmedo auto-restart -d ./tasks -p '*.py' -- celery -A tasks.tasks:celery_app worker --concurrency 1 -l info
volumes:
- ./server:/usr/src/thethe/server
- ./tasks:/usr/src/thethe/tasks
- ./frontend/public/static/phishtank:/temp/phishtank
- ./thethe_server/server:/usr/src/thethe/server
- ./thethe_server/tasks:/usr/src/thethe/tasks
- ./external/phishtank:/temp/phishtank
depends_on:
- redis

server:
build: .
build:
context: thethe_server/
container_name: thethe_server
command: >
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"
volumes:
- ./server:/usr/src/thethe/server
- ./tasks:/usr/src/thethe/tasks
- ./frontend/public/static/phishtank:/temp/phishtank
- ./thethe_server/server:/usr/src/thethe/server
- ./thethe_server/tasks:/usr/src/thethe/tasks
- ./external/phishtank:/temp/phishtank
ports:
- 8000:8000
depends_on:
Expand Down
22 changes: 0 additions & 22 deletions frontend/Dockerfile

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/babel.config.js

This file was deleted.

29 changes: 0 additions & 29 deletions frontend/default.conf

This file was deleted.

27 changes: 0 additions & 27 deletions frontend/generate_certs.sh

This file was deleted.

17 changes: 0 additions & 17 deletions frontend/index.html

This file was deleted.

Loading

0 comments on commit 3bd866b

Please sign in to comment.