diff --git a/docs/wiki.md b/docs/wiki.md index 3f07c99..f84cc80 100644 --- a/docs/wiki.md +++ b/docs/wiki.md @@ -92,3 +92,32 @@ func encodeCreateGroupResponse(response CreateGroupRes, w http.ResponseWriter, s switch response := response.(type) { 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 +} +```