What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
what is the reason that the docker-sdk generator uses json_encode() to encode the project secrets? I
what is the reason that the docker-sdk generator uses json_encode() to encode the project secrets? I have a secret like MY_SECRET: "abc/def"
and this ends up like MY_SECRET: "abc\/def"
in the env file being generated because of this, which of course is a different value
Comments
-
should I always json_decode() the secret env variables in my application?
0 -
I am currently mis-using the secrets to set some env variables inside of the containers (e.g. COMPOSER_HOME), is there then another solution available for this?
0 -
Hi Rene,
Where do you set MY_SECRET value for docker/sdk to catch it up?
0 -
@ULYHPR789 in the deploy.yml under
project:secrets
0 -
- It is abuse of wrong-named internal intermediate variable.
And anyway according the code:
$projectData['secrets'] = buildSecrets($deploymentDir);
It will be overridden with auto-generated secrets.
How does it work for you?Secrets MUST NOT be defined in deploy.yml. We have a feature in backlog that will allow to declare secrets and pass it from env.
To solve your particular issue use the following:
image: tag: spryker/php:7.3 environment: COMPOSER_HOME: blah blah
That will embed env variable into image. And again this cannot be used for secrets.
0 - It is abuse of wrong-named internal intermediate variable.
-
hey @ULYHPR789 I am not talking about
$projectData['secrets']
, I am talking about$projectData['project']['secrets']
(the YAML definition isproject:secrets:
, not top-levelsecrets:
), they are being parsed bygenerator/src/templates/env/common.env.twig
:{% for secretKey, secretValue in project['secrets'] %}
it is definitely working for me, the values I set there are being added to the generated .env files. So this is a "wrong-named internal intermediate variable", yes? I should not use it? How should I do it then? π Currently not possible, because of your second point?
And regardingimage:environment:
thanks! This sounds definitely like a better solution. But why do you suggest it should also not be used for secrets? Because it is not secret? π0 -
Thanks for finding this caveat. It should not work that way.
0 -
oh okay π
0 -
Secrets must be secured. And deploy.yml should be committed into a repo. And that is not so secure. Secrets must be passed only in runtime. And we have only support for internal secrets only for now.
0 -
thank you @ULYHPR789!!! π Looking forward to the new feature with being able to store secrets correctly, until now I will use a workaround π
0 -
I'm already looking forward to this. I think it would be fine for many (local / development) cases to have a
.env
(if existing and maybe with environment naming scheme like .env.stage .env.prod) automatically been included while docker/sdk boot. the variables from this file should end up in the different{service}_{store}.env
files in/docker/deployment/default/env/
0 -
@UPZH5HHEV Please, register this as an idea. Thanks.
0 -
Little bit late, but here it is: https://spryker.ideas.aha.io/ideas/CUSTIDEAS-I-140
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 73 Spryker News
- 911 Developer Corner
- 771 Spryker Development
- 87 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 25 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 69 Spryker Safari Questions
- 50 Random