From c72f903e3168c2ff269ff0c49d5fffa345cb4ff5 Mon Sep 17 00:00:00 2001 From: shoopea Date: Mon, 31 Jul 2023 20:47:24 +0200 Subject: [PATCH] add /run --- admin.go | 7 +++++++ backup.go | 3 +-- version.go | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/admin.go b/admin.go index 0b8cacf..27326cc 100644 --- a/admin.go +++ b/admin.go @@ -67,6 +67,13 @@ func (a *AdminConfig) Run() { }) }) + r.GET("/run", func(c *gin.Context) { + cfg.Run() + c.JSON(http.StatusOK, gin.H{ + "message": "done", + }) + }) + srv := &http.Server{ Addr: a.Addr, Handler: r, diff --git a/backup.go b/backup.go index 398be69..0c2cf1d 100644 --- a/backup.go +++ b/backup.go @@ -9,13 +9,12 @@ import ( ) var ( - cfgFile = flag.String("config", "config.json", "config file") + cfgFile = flag.String("config", "backup.json", "config file") isDaemon = flag.Bool("daemon", false, "run as daemon") debug = flag.Bool("debug", false, "log debug messages") quiet = flag.Bool("quiet", false, "remove most log messages") logFile = flag.String("logfile", "", "log file") cfg Config - email *Email ) func main() { diff --git a/version.go b/version.go index 442f6bc..1ad253f 100644 --- a/version.go +++ b/version.go @@ -1,7 +1,7 @@ // Code generated by version.sh (@generated) DO NOT EDIT. package main -var githash = "ca3d817" +var githash = "f6fdd83" var branch = "v2" -var buildstamp = "2023-07-31_16:19:11" -var commits = "75" -var version = "ca3d817-b75 - 2023-07-31_16:19:11" +var buildstamp = "2023-07-31_18:47:13" +var commits = "76" +var version = "f6fdd83-b76 - 2023-07-31_18:47:13"