SeppeBudenaers / IoT_Technologie_PXL_2024

1 stars 0 forks source link

Added API key in secrets so we can safely use it and it isn't stored in plain text for the end user #32

Closed SeppeBudenaers closed 8 months ago

SeppeBudenaers commented 8 months ago

I tried a lot of shit so its a lot of commit messages. But basicly

secrets: API= ${{ secrets.API_KEY }}

this line tranfers the API_KEY github secret into a secret docker variable API

RUN --mount=type=secret,id=API,target=/usr/app/src/secret cat /usr/app/src/secret > ./secretfile.txt

we ask docker in this line to search for the secret variable API and store it somewhere for this line. than we make a text file and put out API variable inside.

I know this is still stored in plain text inside of the docker container but I may have some ideas to fix that in the future if needed. By doing arguments to main. so u can do CMD [ "python","./main.py","cat /usr/app/src/secret"]

SamyWarnants commented 8 months ago

looks good to me!