diff --git a/.res/compose/docker-compose.yml b/.res/compose/docker-compose.yml index e9ce14f8..74e9f570 100644 --- a/.res/compose/docker-compose.yml +++ b/.res/compose/docker-compose.yml @@ -11,5 +11,4 @@ services: - "TZ=Europe/Paris" - "LOG_LEVEL=info" - "LOG_JSON=false" - - "RUN_STARTUP=false" restart: always diff --git a/README.md b/README.md index d942d0ac..29aa96ac 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,6 @@ Flags: --log-level="info" Set log level. --log-json Enable JSON logging output. --log-caller Enable to add file:line of the caller. - --run-startup Run on startup. --docker Enable Docker mode. --version Show application version. ``` @@ -86,7 +85,6 @@ Flags: * `--log-level ` : Log level output. _Optional_. (default: `info`). * `--log-json` : Enable JSON logging output. _Optional_. (default: `false`). * `--log-caller` : Enable to add file:line of the caller. _Optional_. (default: `false`). -* `--run-startup` : Run on startup. _Optional_. (default: `false`). ## Configuration @@ -221,7 +219,6 @@ Environment variables can be used within your container : * `LOG_LEVEL` : Log level output (default `info`) * `LOG_JSON`: Enable JSON logging output (default `false`) * `LOG_CALLER`: Enable to add file:line of the caller (default `false`) -* `RUN_STARTUP`: Run on startup (default `false`) Docker compose is the recommended way to run this image. Copy the content of folder [.res/compose](.res/compose) in `/opt/diun/` on your host for example. Edit the compose and config file with your preferences and run the following commands : @@ -237,7 +234,6 @@ $ docker run -d --name diun \ -e "TZ=Europe/Paris" \ -e "LOG_LEVEL=info" \ -e "LOG_JSON=false" \ - -e "RUN_STARTUP=false" \ -v "$(pwd)/data:/data" \ -v "$(pwd)/diun.yml:/diun.yml:ro" \ crazymax/diun:latest diff --git a/cmd/main.go b/cmd/main.go index 431a8208..743d6d10 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -30,7 +30,6 @@ func main() { kingpin.Flag("log-level", "Set log level.").Envar("LOG_LEVEL").Default("info").StringVar(&flags.LogLevel) kingpin.Flag("log-json", "Enable JSON logging output.").Envar("LOG_JSON").Default("false").BoolVar(&flags.LogJson) kingpin.Flag("log-caller", "Enable to add file:line of the caller.").Envar("LOG_CALLER").Default("false").BoolVar(&flags.LogCaller) - kingpin.Flag("run-startup", "Run on startup.").Envar("RUN_STARTUP").Default("false").BoolVar(&flags.RunStartup) kingpin.Flag("docker", "Enable Docker mode.").Envar("DOCKER").Default("false").BoolVar(&flags.Docker) kingpin.UsageTemplate(kingpin.CompactUsageTemplate).Version(version).Author("CrazyMax") kingpin.CommandLine.Name = "diun" diff --git a/internal/app/diun.go b/internal/app/diun.go index 9aff3d35..a871e878 100644 --- a/internal/app/diun.go +++ b/internal/app/diun.go @@ -53,9 +53,7 @@ func (di *Diun) Start() error { var err error // Run on startup - if di.cfg.Flags.RunStartup { - di.Run() - } + di.Run() // Init scheduler di.jobID, err = di.cron.AddJob(di.cfg.Watch.Schedule, di) diff --git a/internal/model/flags.go b/internal/model/flags.go index ce372c1b..8b52fa88 100644 --- a/internal/model/flags.go +++ b/internal/model/flags.go @@ -2,11 +2,10 @@ package model // Flags holds flags from command line type Flags struct { - Cfgfile string - Timezone string - LogLevel string - LogJson bool - LogCaller bool - RunStartup bool - Docker bool + Cfgfile string + Timezone string + LogLevel string + LogJson bool + LogCaller bool + Docker bool }