RESTIC_REPOSITORY_FILE will not be read if RESTIC_REPOSITORY is not set.
#51
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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_FILEwill not be read ifRESTIC_REPOSITORYis not set because the click optionrepositoryis 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_passwordsecret. Did you commentedSECRET_RESTIC_PASSWORD_VERSIONin your .env file?The only envs I have setup are
CRON_SCHEDULEandRESTIC_REPOSITORY_FILE. If I understand the following section correctly, you'd only need to set upRESTIC_REPOSITORY_FILEso I don't haveRESTIC_PASSWORD_FILEnorRESTIC_REPOSITORYbecause they'd be redundant as I am already passing the password throughRESTIC_REPOSITORY_FILEBut 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_FILEandRESTIC_REPOSITORY_FILEwould 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_REPOSITORYso thatRESTIC_REPOSITORY_FILEcan be read is kinda odd.OK yeah I would agree, if
RESTIC_REPOSITORY_FILEis set then neitherRESTIC_REPOSITORYnor-rshould be required. @cgalo5758 do you have a preferred fix?I tried just removing the
required=Truefrom 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.