mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-21 13:23:09 +01:00
Remove --docker flag
This commit is contained in:
@@ -41,6 +41,8 @@ RUN apk --update --no-cache add \
|
|||||||
COPY --from=builder /app/diun /usr/local/bin/diun
|
COPY --from=builder /app/diun /usr/local/bin/diun
|
||||||
COPY --from=builder /app/zoneinfo.zip /usr/local/go/lib/time/zoneinfo.zip
|
COPY --from=builder /app/zoneinfo.zip /usr/local/go/lib/time/zoneinfo.zip
|
||||||
|
|
||||||
|
ENV DIUN_DB="/data/diun.db"
|
||||||
|
|
||||||
VOLUME [ "/data" ]
|
VOLUME [ "/data" ]
|
||||||
|
|
||||||
CMD [ "diun", "--config", "/diun.yml", "--docker" ]
|
CMD [ "diun", "--config", "/diun.yml" ]
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ func main() {
|
|||||||
kingpin.Flag("log-level", "Set log level.").Envar("LOG_LEVEL").Default("info").StringVar(&flags.LogLevel)
|
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-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("log-caller", "Enable to add file:line of the caller.").Envar("LOG_CALLER").Default("false").BoolVar(&flags.LogCaller)
|
||||||
kingpin.Flag("docker", "Enable Docker mode.").Envar("DOCKER").Default("false").BoolVar(&flags.Docker)
|
|
||||||
kingpin.UsageTemplate(kingpin.CompactUsageTemplate).Version(version).Author("CrazyMax")
|
kingpin.UsageTemplate(kingpin.CompactUsageTemplate).Version(version).Author("CrazyMax")
|
||||||
kingpin.CommandLine.Name = "diun"
|
kingpin.CommandLine.Name = "diun"
|
||||||
kingpin.CommandLine.Help = `Docker image update notifier. More info on https://github.com/crazy-max/diun`
|
kingpin.CommandLine.Help = `Docker image update notifier. More info on https://github.com/crazy-max/diun`
|
||||||
|
|||||||
@@ -85,10 +85,6 @@ func Load(flags model.Flags, version string) (*Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cfg *Config) validate() error {
|
func (cfg *Config) validate() error {
|
||||||
if cfg.Flags.Docker {
|
|
||||||
cfg.Db.Path = "/data/diun.db"
|
|
||||||
}
|
|
||||||
|
|
||||||
cfg.Db.Path = utl.GetEnv("DIUN_DB", cfg.Db.Path)
|
cfg.Db.Path = utl.GetEnv("DIUN_DB", cfg.Db.Path)
|
||||||
if cfg.Db.Path == "" {
|
if cfg.Db.Path == "" {
|
||||||
return errors.New("database path is required")
|
return errors.New("database path is required")
|
||||||
|
|||||||
@@ -7,5 +7,4 @@ type Flags struct {
|
|||||||
LogLevel string
|
LogLevel string
|
||||||
LogJson bool
|
LogJson bool
|
||||||
LogCaller bool
|
LogCaller bool
|
||||||
Docker bool
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user