Skip to content

Commit

Permalink
docker-compose fixes | redirection bug fixed | admin views modified
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaan7 committed May 1, 2020
1 parent cf975e7 commit 59d0796
Show file tree
Hide file tree
Showing 5 changed files with 1,185 additions and 2 deletions.
53 changes: 53 additions & 0 deletions docker-compose-for-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: "3"

services:
rtbctf:
build: .
container_name: rtb_gunicorn
restart: unless-stopped
expose:
- "8000"
environment:
- DEBUG=False
- SECRET_KEY=changeme
- DB_USER=eshaan
- DB_PASSWORD=eshaan
- DB_NAME=rtbctf
- DB_PORT=5432
- WORKERS=8
- ADMIN_PASS=admin
depends_on:
- postgres
- redis

postgres:
image: library/postgres:12.1-alpine
container_name: rtb_postgres
restart: unless-stopped
expose:
- "5432"
environment:
- POSTGRES_USER=eshaan
- POSTGRES_PASSWORD=eshaan
- POSTGRES_DB=rtbctf

redis:
image: redis:6.0-rc4-alpine
container_name: rtb_redis
restart: unless-stopped
expose:
- "6379"


nginx:
image: library/nginx:1.16.1-alpine
container_name: rtb_nginx
restart: unless-stopped
hostname: nginx
volumes:
- ./rtb_nginx_http:/etc/nginx/conf.d/default.conf
ports:
- "80:80"
- "443:443"
depends_on:
- rtbctf
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ version: "3"

services:
rtbctf:
build: .
container_name: rtb_gunicorn
image: eshaan7/rtb-ctf-framework
restart: unless-stopped
expose:
- "8000"
Expand Down
2 changes: 2 additions & 0 deletions src/FlaskRTBCTF/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def after_model_delete(model):

class MachineAdminView(BaseModelView):
can_view_details = True
column_exclude_list = ("user_hash", "root_hash", "updated_on")
column_searchable_list = ("name", "ip")

@expose("/new/")
Expand All @@ -69,6 +70,7 @@ def edit_view(self):

class ChallengeAdminView(BaseModelView):
can_view_details = True
column_exclude_list = ("description", "flag", "url")
column_searchable_list = ("title", "url")
form_choices = {
"difficulty": [
Expand Down
3 changes: 3 additions & 0 deletions src/create_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def populate_tags():
db.session.add(Tag(label="osint", color="#CB7303"))
db.session.add(Tag(label="binary", color="#AE1438"))
db.session.add(Tag(label="forensics", color="#2B2B52"))
db.session.add(Tag(label="programming", color="#2B2B52"))


def populate_categories():
Expand All @@ -28,6 +29,8 @@ def populate_categories():
"steganography",
"cryptography",
"OSINT",
"scripting",
"networking",
"misc",
]
for name in category_names:
Expand Down
Loading

0 comments on commit 59d0796

Please sign in to comment.