You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Revolyssup (via GitHub)" <gi...@apache.org> on 2024/03/22 06:46:32 UTC
[PR] feat: Add automatic key generation in docker compose [apisix-docker]
Revolyssup opened a new pull request, #548:
URL: https://github.com/apache/apisix-docker/pull/548
This PR is part of the proposal which removes hardcoding of sensitive API keys by autogenerating them at either application level(APISIX) or deployment level(like docker.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add automatic key generation in docker compose [apisix-docker]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #548:
URL: https://github.com/apache/apisix-docker/pull/548#issuecomment-2270893651
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add automatic key generation in docker compose [apisix-docker]
Posted by "starsz (via GitHub)" <gi...@apache.org>.
starsz commented on code in PR #548:
URL: https://github.com/apache/apisix-docker/pull/548#discussion_r1540772212
##########
compose/modify_config.sh:
##########
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Generate a random string
+random_string=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
+
+# Perform substitution using sed
+sed "s/key: ''/key: $random_string/g" /config.yaml > /tmp/temp_config.yaml
+
+# Copy the content of the temporary file back to the original file
+cat /tmp/temp_config.yaml > /config.yaml
+
+# Remove the temporary file
+rm /tmp/temp_config.yaml
Review Comment:
I think we can combine those command into one command.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add automatic key generation in docker compose [apisix-docker]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #548: feat: Add automatic key generation in docker compose
URL: https://github.com/apache/apisix-docker/pull/548
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add automatic key generation in docker compose [apisix-docker]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #548:
URL: https://github.com/apache/apisix-docker/pull/548#issuecomment-2213587287
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add automatic key generation in docker compose [apisix-docker]
Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup commented on code in PR #548:
URL: https://github.com/apache/apisix-docker/pull/548#discussion_r1541839765
##########
compose/modify_config.sh:
##########
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Generate a random string
+random_string=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
+
+# Perform substitution using sed
+sed "s/key: ''/key: $random_string/g" /config.yaml > /tmp/temp_config.yaml
+
+# Copy the content of the temporary file back to the original file
+cat /tmp/temp_config.yaml > /config.yaml
+
+# Remove the temporary file
+rm /tmp/temp_config.yaml
Review Comment:
Directly pushing to config.yaml was giving some errors so i created a temp file
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add automatic key generation in docker compose [apisix-docker]
Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup commented on code in PR #548:
URL: https://github.com/apache/apisix-docker/pull/548#discussion_r1545267694
##########
compose/modify_config.sh:
##########
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Generate a random string
+random_string=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)
+
+# Perform substitution using sed
+sed "s/key: ''/key: $random_string/g" /config.yaml > /tmp/temp_config.yaml
+
+# Copy the content of the temporary file back to the original file
+cat /tmp/temp_config.yaml > /config.yaml
+
+# Remove the temporary file
+rm /tmp/temp_config.yaml
Review Comment:
<img width="986" alt="Screenshot 2024-03-30 at 3 57 05 PM" src="https://github.com/apache/apisix-docker/assets/43276904/df022a0a-6b94-4faa-9963-4f1795616a24">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add automatic key generation in docker compose [apisix-docker]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #548:
URL: https://github.com/apache/apisix-docker/pull/548#issuecomment-2156424239
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time ordiscuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add automatic key generation in docker compose [apisix-docker]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #548: feat: Add automatic key generation in docker compose
URL: https://github.com/apache/apisix-docker/pull/548
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org