add /run
This commit is contained in:
parent
f6fdd83a23
commit
c72f903e31
7
admin.go
7
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{
|
srv := &http.Server{
|
||||||
Addr: a.Addr,
|
Addr: a.Addr,
|
||||||
Handler: r,
|
Handler: r,
|
||||||
|
@ -9,13 +9,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
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")
|
isDaemon = flag.Bool("daemon", false, "run as daemon")
|
||||||
debug = flag.Bool("debug", false, "log debug messages")
|
debug = flag.Bool("debug", false, "log debug messages")
|
||||||
quiet = flag.Bool("quiet", false, "remove most log messages")
|
quiet = flag.Bool("quiet", false, "remove most log messages")
|
||||||
logFile = flag.String("logfile", "", "log file")
|
logFile = flag.String("logfile", "", "log file")
|
||||||
cfg Config
|
cfg Config
|
||||||
email *Email
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||||
package main
|
package main
|
||||||
var githash = "ca3d817"
|
var githash = "f6fdd83"
|
||||||
var branch = "v2"
|
var branch = "v2"
|
||||||
var buildstamp = "2023-07-31_16:19:11"
|
var buildstamp = "2023-07-31_18:47:13"
|
||||||
var commits = "75"
|
var commits = "76"
|
||||||
var version = "ca3d817-b75 - 2023-07-31_16:19:11"
|
var version = "f6fdd83-b76 - 2023-07-31_18:47:13"
|
||||||
|
Loading…
Reference in New Issue
Block a user