RESTIC_REPOSITORY_FILE will not be read if RESTIC_REPOSITORY is not set.
#51
Closed
opened 2024-04-16 16:28:19 +00:00 by cgalo5758
·
7 comments
No Branch/Tag Specified
main
renovate/docker-29.x
feature/makeDeleteDefault
restic-exporter
cmd-setup-restic-s3
prom-mon
feature/dockerfile
bb2-classic
feature/selective_paths
list
enable-label
backupbot_revolution
backup_volumes
multi_path
2.4.0+2.4.0
2.3.0+2.3.0-beta
2.2.0+2.2.1-beta
2.1.0+2.2.0-beta
2.0.1+2.1.1-beta
1.0.0+2.0.0-beta
0.2.0+1.0.0
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
appletalk
arjan
basebuilder
BornDeleuze
Brooke
carla
cas (Cassowary)
codegod100
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
flancian
Frando
iexos
jade (Jade Ambrose)
javielico (Javielico)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
marlon (marlon)
mayel
mirsal
moosemower
moritz
nicksellen (Nick Sellen)
notplants
oxaliq (sorrel)
p4u1
pau
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
PhiNatalie
renovate-bot (Comrade Renovate Bot)
ripclap
rix
rscmbbng
sef (sef)
simon
sixsmith (Sixsmith)
stevensting
tobias
trav (Trav Fryer)
val (val (he/him))
vaznasty
virtualboys
wolcen (Chris Thompson)
wykwit
xynosis
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/backup-bot-two#51
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.