Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow registry username to be a secret #89

Closed
kjellberg opened this issue Mar 5, 2023 · 2 comments
Closed

Allow registry username to be a secret #89

kjellberg opened this issue Mar 5, 2023 · 2 comments

Comments

@kjellberg
Copy link
Contributor

From DigitalOcean docs:

For CI systems that support configuring registry authentication via username and password, use a DigitalOcean API token as both the username and the password. The API token must have read/write privileges to push to your registry.

The username config option should allow a secret reference, the same way as password does. This doesn't work:

# Credentials for your image host.
registry:
  # Specify the registry server, if you're not using Docker Hub
  server: registry.digitalocean.com
  username: 
    - SECRET_REGISTRY_TOKEN
  password: 
    - SECRET_REGISTRY_TOKEN
@kjellberg kjellberg changed the title Allow registry.username to be a secret Allow registry username to be a secret Mar 5, 2023
@kulturbande
Copy link

kulturbande commented Mar 7, 2023

That config is working for me:

# Credentials for your image host.
registry:
  # Specify the registry server, if you're not using Docker Hub
  server: registry.digitalocean.com
  username: <%= ENV.fetch("SECRET_REGISTRY_TOKEN") %>
  password: <%= ENV.fetch("SECRET_REGISTRY_TOKEN") %>

@kjellberg
Copy link
Contributor Author

That config is working for me:

# Credentials for your image host.
registry:
  # Specify the registry server, if you're not using Docker Hub
  server: registry.digitalocean.com
  username: <%= ENV.fetch("SECRET_REGISTRY_TOKEN") %>
  password: <%= ENV.fetch("SECRET_REGISTRY_TOKEN") %>

Thanks, it works! But I still think it's a good idea to accept the array format for references on both properties.

ERB looks weird and ugly for non-ruby programmers and may actually scare them away :D

@dhh dhh closed this as completed Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants