cmd

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2023 License: Unlicense Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Root = &cobra.Command{
	SilenceUsage: true,
	Use:          meta.ProgramFilename,
	Short:        "Update a CloudFlare DNS record with your public IP",
	Long: `A dynamic DNS client for CloudFlare. Automatically detects your public IP and
creates/updates a DNS record in CloudFlare.

Configuration flags can be set by defining an environment variable of the same name.
For example:
    DOMAIN=mydomain.com RECORD=sub.mydomain.com TOKEN=<api-token> cloudflare-ddns
`,
	RunE: func(cmd *cobra.Command, args []string) error {
		provider, err := providers.NewCloudFlareProvider(context.Background(), conf.Token.Get())
		if err != nil {
			return errors.Annotatef(err, "failed to configure DDNS provider")
		}
		daemon := ddns.NewDefaultDaemon(provider, ddns.NewDefaultIPProvider(), ddns.NewDefaultConfigProvider())
		if conf.Daemon.Get() {
			return errors.Trace(runDaemon(provider, daemon))
		}
		return errors.Trace(daemon.Update())
	},
	Version: meta.Version,
}

Root is the root command of the program

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL