add docker
This commit is contained in:
parent
8c6be8273e
commit
d62d7b61d0
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,7 +2,6 @@ t
|
|||||||
.env
|
.env
|
||||||
*.json
|
*.json
|
||||||
*.sqlite
|
*.sqlite
|
||||||
#*.zsh
|
|
||||||
tmp/card_limit.zsh
|
tmp/card_limit.zsh
|
||||||
tmp/card_day.zsh
|
tmp/card_day.zsh
|
||||||
tmp/card_delete.zsh
|
tmp/card_delete.zsh
|
||||||
|
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM syui/aios
|
||||||
|
|
||||||
|
RUN pacman -Syu --noconfirm go
|
||||||
|
WORKDIR /app
|
||||||
|
RUN git clone https://git.syui.ai/ai/api tmp
|
||||||
|
|
||||||
|
WORKDIR /app/tmp
|
||||||
|
RUN go build
|
||||||
|
RUN mv api /app/api
|
||||||
|
|
||||||
|
#ADD ./app /app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
ENTRYPOINT ["/app/api"]
|
0
app/data/keep
Normal file
0
app/data/keep
Normal file
11
compose.yml
Normal file
11
compose.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
services:
|
||||||
|
api:
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
restart: always
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
volumes:
|
||||||
|
- ./app/data:/app/data
|
24
scpt/t.zsh
24
scpt/t.zsh
@ -1,24 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
host=https://api.syui.ai
|
|
||||||
uid=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .id`
|
|
||||||
did=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .did`
|
|
||||||
pass=`cat ~/.config/atr/api_card.json|jq -r .password`
|
|
||||||
card=36
|
|
||||||
cp=`echo $(($RANDOM % 1000 + 400))`
|
|
||||||
s=$(($RANDOM % 7))
|
|
||||||
if [ $s -eq 1 ];then
|
|
||||||
s=super
|
|
||||||
skill=post
|
|
||||||
plus=$(($RANDOM % 1000 + 300))
|
|
||||||
cp=$((cp + plus))
|
|
||||||
else
|
|
||||||
s=normal
|
|
||||||
skill=ten
|
|
||||||
fi
|
|
||||||
tmp=`curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$uid,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\",\"skill\":\"$skill\"}" -sL $host/cards`
|
|
||||||
|
|
||||||
card=`echo $tmp|jq -r .card`
|
|
||||||
cp=`echo $tmp|jq -r .cp`
|
|
||||||
body="[card]\nid : $card\ncp : $cp"
|
|
||||||
|
|
||||||
atr @ $did -p "`echo $body`"
|
|
Loading…
Reference in New Issue
Block a user