RESTIC_REPOSITORY_FILE
will not be read if RESTIC_REPOSITORY
is not set. #51
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/backup-bot-two#51
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
RESTIC_REPOSITORY_FILE
will not be read ifRESTIC_REPOSITORY
is not set because the click optionrepository
is required.Additionally, even if you managed to pass in a dummy value forRESTIC_REPOSITORY
, anticipating it to be overwritten, it still wouldn't work unless you pass in the restic password (redundantly):raise restic.errors.ResticFailedError(restic.errors.ResticFailedError: Restic failed with exit code 1: Resolving password failed: Fatal: /var/run/secrets/restic_password does not existedit:
forget the strikethrough part.
Hey @cgalo5758 thank you for your bug report. Can you give some more information. Can you post your .env file, which secrets have you set and a debug output (passing
--log DEBUG
).From the error you posted it looks like you haven't set the
restic_password
secret. Did you commentedSECRET_RESTIC_PASSWORD_VERSION
in your .env file?The only envs I have setup are
CRON_SCHEDULE
andRESTIC_REPOSITORY_FILE
. If I understand the following section correctly, you'd only need to set upRESTIC_REPOSITORY_FILE
so I don't haveRESTIC_PASSWORD_FILE
norRESTIC_REPOSITORY
because they'd be redundant as I am already passing the password throughRESTIC_REPOSITORY_FILE
But basically, it won't pass this line in
backupbot.py
:E.g.:
And then if I pass repository:
Thanks both!
Drive-by comment on this:
AFAIU the "restic password" is the encryption password, whereas the password included in the restic repo when using HTTPS is the HTTP password.
So basically I think
RESTIC_PASSWORD_FILE
andRESTIC_REPOSITORY_FILE
would both be required when using HTTPS.Oh wait that's correct. My bad 😅. Forget about this part then:
The other issue still persists. Passing in a dummy value for
RESTIC_REPOSITORY
so thatRESTIC_REPOSITORY_FILE
can be read is kinda odd.OK yeah I would agree, if
RESTIC_REPOSITORY_FILE
is set then neitherRESTIC_REPOSITORY
nor-r
should be required. @cgalo5758 do you have a preferred fix?I tried just removing the
required=True
from the click option, but that doesn't fix it entirely. Whenexport_secrets()
sets RESTIC_REPOSITORY from RESTIC_REPOSITORY_FILE, both environment variables are set, leading to the following error:And so to fix this, I suggest also editing
export_secrets()
This is not elegant, but it is the least invasive way of doing this as RESTIC_REPOSITORY is the only variable of these two that is used by the script directly.
@cgalo5758 thank you for your input, this should be fixed now.