diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ae9e5..8c17f36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `setting get` command to get configuration options. - `setting list|ls` command to print configuration options. - `--format` flag to select output format from "table", "json" or a custom Go template. Defaults to "table". +- `config access` command to set access control for configs. + - `--admins` flag to limit access to administrators. + - `--private` flag to limit access to current user. + - `--public` flag to give access to all users. - `container access` command to set access control for containers. - `--admins` flag to limit access to administrators. - `--private` flag to limit access to current user. diff --git a/Dockerfile b/Dockerfile index 0ade75e..d16af2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ FROM alpine:3.10 ENV PSU_AUTH_TOKEN="" +ENV PSU_CONFIG_ACCESS_ADMINS="" +ENV PSU_CONFIG_ACCESS_ENDPOINT="" +ENV PSU_CONFIG_ACCESS_PRIVATE="" +ENV PSU_CONFIG_ACCESS_PUBLIC="" ENV PSU_CONTAINER_ACCESS_ADMINS="" ENV PSU_CONTAINER_ACCESS_ENDPOINT="" ENV PSU_CONTAINER_ACCESS_PRIVATE="" diff --git a/cmd/config.go b/cmd/config.go new file mode 100644 index 0000000..4aa57fe --- /dev/null +++ b/cmd/config.go @@ -0,0 +1,15 @@ +package cmd + +import ( + "github.com/spf13/cobra" +) + +// configCmd represents the config command +var configCmd = &cobra.Command{ + Use: "config", + Short: "Manage configs", +} + +func init() { + rootCmd.AddCommand(configCmd) +} diff --git a/cmd/configAccess.go b/cmd/configAccess.go new file mode 100644 index 0000000..77492ae --- /dev/null +++ b/cmd/configAccess.go @@ -0,0 +1,10 @@ +package cmd + +import ( + "github.com/greenled/portainer-stack-utils/client" + "github.com/greenled/portainer-stack-utils/common" +) + +func init() { + common.AccessCmdInitFunc(configCmd, client.ResourceConfig) +}