Add examples
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
services:
|
||||
service:
|
||||
build: service
|
||||
restart: always
|
||||
expose:
|
||||
- 1337
|
||||
networks:
|
||||
- net
|
||||
environment:
|
||||
- FLAG=${FLAG}
|
||||
labels:
|
||||
- owl.proxy=true
|
||||
- owl.proxy.port=1337
|
||||
- owl.label.conntype=http
|
||||
- owl.label.comment=This is the main service.
|
||||
|
||||
networks:
|
||||
net:
|
||||
external:
|
||||
name: ctfd_frp_containers
|
||||
@@ -0,0 +1,9 @@
|
||||
FROM python:3.12-alpine
|
||||
|
||||
WORKDIR /app
|
||||
COPY requirements.txt .
|
||||
RUN pip3 install -r requirements.txt
|
||||
COPY . .
|
||||
EXPOSE 1337
|
||||
|
||||
CMD ["flask", "--app", "main", "run", "--port", "1337", "--host", "0.0.0.0"]
|
||||
@@ -0,0 +1,18 @@
|
||||
from flask import Flask, request
|
||||
import os
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
FLAG = os.getenv("FLAG")
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
return "Send POST request to /flag to solve this!", 200
|
||||
|
||||
|
||||
@app.route("/flag", methods=["GET", "POST"])
|
||||
def flag():
|
||||
if request.method == "GET":
|
||||
return "Wrong method!", 400
|
||||
else:
|
||||
return FLAG, 200
|
||||
@@ -0,0 +1,7 @@
|
||||
blinker==1.8.2
|
||||
click==8.1.7
|
||||
Flask==3.0.3
|
||||
itsdangerous==2.2.0
|
||||
Jinja2==3.1.4
|
||||
MarkupSafe==3.0.0
|
||||
Werkzeug==3.0.4
|
||||
Reference in New Issue
Block a user