Compare commits
4 Commits
77ac4dca59
...
35efd063c2
Author | SHA1 | Date | |
---|---|---|---|
35efd063c2 | |||
6bae62ddb6 | |||
b2c319d4ec | |||
f2594a2449 |
@ -1,8 +1,10 @@
|
||||
FROM python:3.9.20-slim-bookworm
|
||||
|
||||
RUN pip install python-dotenv flask
|
||||
RUN apt-get update && apt-get install -y curl && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY api.py tx.sh .
|
||||
RUN chmod +x tx.sh api.py
|
||||
|
||||
CMD python /app/api.py
|
||||
CMD ./api.py
|
||||
|
@ -7,4 +7,4 @@ COPY keepalive.sh .
|
||||
|
||||
RUN chmod +x keepalive.sh
|
||||
|
||||
CMD /app/keepalive.sh
|
||||
CMD ./keepalive.sh
|
||||
|
5
api.py
Normal file → Executable file
5
api.py
Normal file → Executable file
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from flask import Flask, request, jsonify
|
||||
import subprocess
|
||||
import json
|
||||
@ -73,4 +75,5 @@ def verify_payment():
|
||||
|
||||
if __name__ == '__main__':
|
||||
debug_mode = os.getenv('APP_DEBUG', 'False').lower() in ('true', '1', 't')
|
||||
app.run(debug=debug_mode)
|
||||
port = int(os.getenv('PORT', 5000))
|
||||
app.run(host='0.0.0.0', port=port, debug=debug_mode)
|
||||
|
9
compose.yml
Normal file
9
compose.yml
Normal file
@ -0,0 +1,9 @@
|
||||
services:
|
||||
keepalive:
|
||||
env_file: .env
|
||||
image: git.shihaam.dev/shihaam/mib-payment-verify/keepalive
|
||||
api:
|
||||
env_file: .env
|
||||
image: git.shihaam.dev/shihaam/mib-payment-verify/api
|
||||
ports:
|
||||
- 5000:5000
|
@ -2,9 +2,9 @@
|
||||
|
||||
while true; do
|
||||
source .env 2> /dev/null
|
||||
curl 'https://faisanet.mib.com.mv/aProfile/keepAlive' \
|
||||
KEEP_ALIVE=$(curl -s 'https://faisanet.mib.com.mv/aProfile/keepAlive' \
|
||||
-X 'POST' \
|
||||
-H "cookie: prefTheme=1; ql_0=${QL_0}; IBSID=${IBSID}; dashboardStatsMode=1; _zwaf_ua=Brave; time-tracker=600"
|
||||
|
||||
-H "cookie: prefTheme=1; ql_0=${QL_0}; IBSID=${IBSID}; dashboardStatsMode=1; _zwaf_ua=Brave; time-tracker=600")
|
||||
echo $KEEP_ALIVE
|
||||
sleep 30
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user