-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f91e5dd
commit f771c33
Showing
3 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,5 +154,3 @@ cython_debug/ | |
.idea/ | ||
*.pem | ||
test.py | ||
dgp_tools.py | ||
run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import requests | ||
import json | ||
|
||
|
||
def get_log(device_id: str) -> dict | None: | ||
url = f"https://homa.snapgenshin.com/HutaoLog/ByDeviceId?id={device_id}" | ||
headers = { | ||
"authority": "dgp-bot" | ||
} | ||
response = requests.get(url, headers=headers) | ||
if response.status_code == 200: | ||
return json.loads(response.text) | ||
else: | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Docker Image Settings | ||
imageName=dgp-github-bot | ||
containerName=DGP-GitHub-Bot | ||
imageVersion=1.9 | ||
externalPort=3524 | ||
internalPort=8080 | ||
|
||
oldContainer=`docker ps -a| grep ${containerName} | head -1|awk '{print $1}' ` | ||
echo Delete old container... | ||
docker rm $oldContainer -f | ||
echo Delete success | ||
|
||
docker build -f Dockerfile -t $imageName:$imageVersion . | ||
docker run -d -itp $externalPort:$internalPort \ | ||
-v $(pwd)/.env:/app/.env \ | ||
--restart=always \ | ||
--name="$containerName" \ | ||
$imageName:$imageVersion |