Skip to content

Commit

Permalink
fixes checker functions to work with new code. also fixes checker port
Browse files Browse the repository at this point in the history
  • Loading branch information
moaath committed Jun 6, 2024
1 parent 4fd1d1a commit 4f41dcb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion checker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
build: .
# The checker runs a HTTP interfaces, so we need to map port 3031 to the outside (port 8000).
ports:
- 5008:8000
- 18080:8000
environment:
- MONGO_ENABLED=1
- MONGO_HOST=imagidate-mongo
Expand Down
28 changes: 26 additions & 2 deletions checker/src/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,29 @@ def assert_response(
errmsg = f"{res.request.method} {res.request.url.path} failed with {res.text}"
raise MumbleException(errmsg)

punchlines = [
"Hi! How's your day going?",
"What kind of music do you like?",
"Have you seen any good movies lately?",
"What's the most interesting book you've read recently?",
"Do you have any hobbies or interests?",
"What's your favorite way to spend a weekend?",
"Have you traveled anywhere exciting recently?",
"What's your favorite cuisine or dish?",
"Do you have any pets?",
"What's the best advice you've ever received?",
"If you could visit any place in the world, where would it be?",
"What's a skill you'd like to learn someday?",
"What's your favorite season of the year and why?",
"Do you prefer the beach or the mountains?",
"What's the last TV show you binge-watched?",
"What's something you're really passionate about?",
"What's your favorite way to relax after a long day?",
"What's the most memorable concert or event you've been to?",
"Do you enjoy cooking or baking? What's your favorite recipe?",
"If you could have dinner with any three people, dead or alive, who would they be?"
]

"""
CHECKER FUNCTIONS
"""
Expand Down Expand Up @@ -168,7 +191,8 @@ async def putflag_api(
"age" : age,
"gender" : gender,
"requested_username" : secrets.choice(["habibi", "habibti"]),
"punchline" : task.flag
"punchline" : secrets.choice(punchlines),
"custom_filename" : task.flag
}
match_res = await client.post("/match.php", data=data)
assert_response(logger, match_res, "Data sent succesfully")
Expand Down Expand Up @@ -199,7 +223,7 @@ async def getflag_api(
}
profile_res = await client.post(f"/check_response.php", data=data)
output = profile_res.content.replace(b"\\\\", b"\\").decode("unicode-escape")
assert_in(task.flag, output, "FLAG NOT FOUND")
assert_in(task.flag.encode().hex(), output, "FLAG NOT FOUND")

#@checker.putnoise(0)
#async def putnoise0(task: PutnoiseCheckerTaskMessage, db: ChainDB, logger: LoggerAdapter, conn: Connection):
Expand Down

0 comments on commit 4f41dcb

Please sign in to comment.