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 to set user and password using environment variables at runtime #426

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

laurentlemercier
Copy link

@laurentlemercier laurentlemercier commented Feb 11, 2024

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/dockge/blob/master/CONTRIBUTING.md

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Allow to set user (at init) and password using an environment variable.
When used for init, need to restart docker container.

Fixes #(issue)
#194 (for example)

Type of change

Extension of reset-password.ts :
Set User and Password at init (container restart needed) :

docker exec -e USER=value1 -e PASSWORD=value2 -it dockge npm run reset-password
docker restart dockge

Just to set password (no restart needed):

docker exec --e PASSWORD=value2 -it dockge npm run reset-password

Please delete any options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings
  • [ x] My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.

You can use a variable in order to set password value : 
docker exec -e PASSWORD=value -it dockge npm run reset-password
and you still have the standard behavior when no PASSWORD provided : 
docker exec -it dockge npm run reset-password
Usefull for interactive action within the container
Set User and Password (previous version had a bug).
docker exec --e USER=uservalue -e PASSWORD=passwordvalue -it dockge npm run reset-password
Indent changes...
@laurentlemercier laurentlemercier changed the title Allow to set password using an environment variable at runtime Allow to set user and password using environment variables at runtime Mar 10, 2024
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

Successfully merging this pull request may close these issues.

1 participant