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

restic: use repository-file if the repo flag contains a password #336

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

jkellerer
Copy link
Collaborator

Experimental PR to replace restic --repo https://user:password@host with restic --repository-file /tmp/profile-repo.txt (with file mode 0600)

Currently fails tests (as they don't expect replacement) and depends on some functions from other PRs to complete it.

@creativeprojects
Copy link
Owner

I guess this is to hide the password if someone looks at the process list?

Makes sense 👍🏻

@jkellerer
Copy link
Collaborator Author

Exactly. A process list may also be sent by monitoring software so its easy to leak passwords around.

Copy link

codecov bot commented Mar 17, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 71.02%. Comparing base (00360a2) to head (c1d9cf4).
Report is 2 commits behind head on master.

Files Patch % Lines
config/profile.go 88.89% 3 Missing and 3 partials ⚠️
util/maybe/bool.go 87.50% 1 Missing and 1 partial ⚠️
util/templates/functions.go 90.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #336      +/-   ##
==========================================
+ Coverage   70.85%   71.02%   +0.16%     
==========================================
  Files         121      121              
  Lines       12273    12373     +100     
==========================================
+ Hits         8696     8787      +91     
- Misses       3183     3190       +7     
- Partials      394      396       +2     
Flag Coverage Δ
unittests 71.02% <88.89%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jkellerer jkellerer marked this pull request as ready for review March 17, 2024 14:54
@jkellerer
Copy link
Collaborator Author

Tests are fixed and the enhancement disables itself when it detects that the repo is set by env variables

also uses cast.ToBool to be on-par with vipers bool parsing from string
@jkellerer jkellerer added this to the v0.27.0 milestone Mar 17, 2024
Copy link
Owner

@creativeprojects creativeprojects left a comment

Choose a reason for hiding this comment

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

I tried it on one of my REST repo and it worked like a charm 🥇

Nice one! thanks 😉

@jkellerer jkellerer merged commit e5b17d3 into creativeprojects:master Mar 18, 2024
8 checks passed
@jkellerer jkellerer deleted the ft/auto-repo-file branch March 18, 2024 00:47
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.

2 participants