1
0
This commit is contained in:
syui 2024-02-21 16:47:15 +09:00
parent 788faa73e1
commit 15ffa62a02
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56

View File

@ -92,3 +92,32 @@ func encodeCreateGroupResponse(response CreateGroupRes, w http.ResponseWriter, s
switch response := response.(type) { switch response := response.(type) {
w.Header().Set("Access-Control-Allow-Origin", "https://card.syui.ai") w.Header().Set("Access-Control-Allow-Origin", "https://card.syui.ai")
``` ```
### northflank
`cron`, `repo(private)`, `pass(token)`
```sh
#!/bin/zsh
pass=password
/usr/bin/northflank exec service --project $project --service $service --cmd "/app/data/api/backup.sh $pass"
function f(){
rm /app/data/api/backup.sh
echo '#!/bin/bash
pass=$1
git config --global user.email syui@syui.ai
git config --global user.name syui
cp -rf /app/data/new.sqlite /app/data/api/latest.sqlite
cp -rf /app/data/new.sqlite /app/data/api/`date '+%w'`.sqlite
cd /app/data/api
git remote add origin https://$pass@github.com/ai/api
git add .
git commit -m backup
git push origin main
git remote rm origin
' >> /app/data/api/backup.sh
chmod +x /app/data/api/backup.sh
}
```