Skip to content

Support reading env vars from .env files#59

Merged
yarikoptic merged 2 commits intomasterfrom
dotenv
May 28, 2021
Merged

Support reading env vars from .env files#59
yarikoptic merged 2 commits intomasterfrom
dotenv

Conversation

@jwodder
Copy link
Copy Markdown
Contributor

@jwodder jwodder commented May 27, 2021

I'm tired of having to always export APPVEYOR_TOKEN when testing tinuous on the datalad repo. This PR allows env vars to be set via a de facto standard file.

@jwodder jwodder added the minor Increment the minor version when merged label May 27, 2021
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 27, 2021

Codecov Report

Merging #59 (8958fb7) into master (6f1b95c) will decrease coverage by 0.23%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #59      +/-   ##
=========================================
- Coverage    2.03%   1.79%   -0.24%     
=========================================
  Files           3       3              
  Lines         638     834     +196     
  Branches       97     167      +70     
=========================================
+ Hits           13      15       +2     
- Misses        625     800     +175     
- Partials        0      19      +19     
Impacted Files Coverage Δ
src/tinuous/__main__.py 0.00% <0.00%> (ø)
src/tinuous/util.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f1b95c...8958fb7. Read the comment docs.

Comment thread README.rst
``.env`` file. By default, environment
variables are loaded from the first file named
"``.env``" found by searching from the current
directory upwards.
Copy link
Copy Markdown
Member

@yarikoptic yarikoptic May 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just setup a $PWD.env file with secrets and which I source before running...

We need a big fat warning here though -- in datalad mode or just with pure git users might commit and leak it. Conscientious of the problem user can configure .gitignore or add it to git-annex while annotating with metadata to not distribute with default datalad push or publish commands, but it should be for user to decide...

Suggested change
directory upwards.
directory upwards. WARNING: Placing in the same directory
as output whenever output is to be committed to git must be done
with care: either specify the file to be excluded in ``.gitignore`` or
place it under git-annex control and set it up with all necessary
provisions to avoid public sharing.

tune to your liking

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning added.

@yarikoptic
Copy link
Copy Markdown
Member

ok, let's proceed and be optimistic that we do not facilitate someone leaking the secrets. Might be worth adding somewhere in the docs that it is advisable to mint dedicated tokens with only Read-only permissions (or even more limited in set of queries needed to be supported) whenever possible.

@yarikoptic yarikoptic merged commit 0d352f1 into master May 28, 2021
@yarikoptic yarikoptic deleted the dotenv branch May 28, 2021 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants