From 61c28406125b03bd56b710e4d2380b939e8fd0e9 Mon Sep 17 00:00:00 2001 From: satori Date: Sat, 26 Oct 2024 04:23:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20tmp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/main.go | 14 -------------- runner.conf | 2 +- update.sh | 26 -------------------------- 3 files changed, 1 insertion(+), 41 deletions(-) delete mode 100755 update.sh diff --git a/bin/main.go b/bin/main.go index b15c544..3d65f28 100644 --- a/bin/main.go +++ b/bin/main.go @@ -237,20 +237,6 @@ func main() { Pretty: false, }))) - //http.HandleFunc("/api", func(w http.ResponseWriter, r *http.Request) { - // defer LogComponent(time.Now().UnixNano(), r) // 最后打印日志 - // query := r.URL.Query().Get("query") - // params := graphql.Params{Schema: schema, RequestString: query} - // result := graphql.Do(params) - // if len(result.Errors) > 0 { - // fmt.Printf("failed to execute graphql operation, errors: %+v", result.Errors) - // http.Error(w, result.Errors[0].Error(), 500) - // return - // } - // rJSON, _ := json.MarshalIndent(result.Data, "", " ") - // w.Write(rJSON) - //}) - http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) { defer LogComponent(time.Now().UnixNano(), r) // 最后打印日志 http.Error(w, "Not Found", http.StatusNotFound) diff --git a/runner.conf b/runner.conf index d368f63..95218f0 100644 --- a/runner.conf +++ b/runner.conf @@ -1,5 +1,5 @@ root: ./bin -tmp_path: ./tmp +tmp_path: ./data build_name: bin/main build_log: runner-build-errors.log valid_ext: .go, .tpl, .tmpl, .html diff --git a/update.sh b/update.sh deleted file mode 100755 index 276c959..0000000 --- a/update.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -host="root@main" - -# 更新 go mod, 然後靜態編譯 -go mod tidy -go build -o dist/main bin/main.go - -# 重命名旧文件 -ssh $host "mv ~/webp/main ~/webp/main_old" - -# 上传到服务器, 然後刪除本地文件 -scp dist/main $host:~/webp/main -rm -rf dist - -# 重载服务 -ssh $host "systemctl restart webp" - -# 删除旧文件 -ssh $host "rm ~/webp/main_old" - -# 设为系统服务 -# sudo cp webp.service /etc/systemd/system/webp.service -# sudo systemctl enable webp - -# 设置日志轮转 -# sudo cp webp.logrotate /etc/logrotate.d/webp