Use Fedder's TrueNAS for Restic backups #153

Merged
samsapti merged 8 commits from restic_fedder into main 2023-03-05 22:01:54 +00:00
5 changed files with 216 additions and 149 deletions

View file

@ -1,141 +1,161 @@
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
66323763353537626539666332316663373864616237386436666239366561366431396430626530 66636338343431616564613639346264306161343566303835363432623939376366353962656631
3132383163653632383133393861373235623931636136390a353132383763626437373065663430 3530626163323838363236356534353065346535333666320a353662643837623033353237313234
64643662393961303936323265343663656431666563653633646532373563663263616634333764 33653766303862653535343935306261353131623834343230386437356666643839643334623063
3766333631343961370a373237343531383863336632373862663435643239353934626637356365 6131626436313434310a623730633262636162623232323632366564613037313232626364633936
30666332626666333530656135343866613161643034383634373736636436636166346562666331 37346365366537663763623535633234316538643766386566396636653634363432383932333135
30396437306263363564363862303737646232623266653032343230303965366338623238343134 65396435363665613562663861373237343633616637386234303831653130353332623731643737
61353835663136383531663765653038323762313932313733646338623931353865363933333338 38613238386164393762646631383333363035643338626364386161306162383933623433616564
39336434373137353738316336663038366334663231616263633565613464306439356235656630 61383966636438653434356466323835313562313633346663643639643632343131353761656233
33396331313036623661353464626263393962306638353433343535613964353966313462613235 39336262333036306230383038373031633036313564343135353264383963656366353665386139
36383563386461353036323164353539616135353761346361313363373266393464363864373633 30626636336336363634316632356434353436613236626264323531326533656637366436656265
33636637366235383264353765383438646130373162323730663363303862333564383439633261 37613230303530303836616533393035343064663139376261363837626637646365353364373165
64663961363161623037393830616466366632633661393463303732323365353665373435633537 35326462393961313234643866336638393364613863653565616438656565353061633564393134
66356166336232366438333533616233363465623034623233363438346139656138336631366231 66643735303631373665613866643230353462623936656561643961613765323039613531656336
33383238633532323665306338643562636135396566663537643733393931316131623262373164 34643432323131626536623065616137333365623666383438653936396131386566356265313033
66393062376666383734393334646463616162363935343363303165393665613066306431366164 65613765353732666232656433353035363030623461353134393463663362646464616632633931
64326564393464646664663839373563353966663063396434313362623664613834626636363233 35373632623432303930633566626333343465346563643435656537623336373235323637386166
33343562343539663332346361316330383830623436306362373966366438653534313561366539 37356535386564363131643162383835633331363961313636343262333863613765306130353266
34356166623562396361356161303739613230333663613232663861313331663233326633643530 39313566653735646438663739386433313735383730366530336533346465643166323765393334
64353933626237636435303736623063373463326265633236653366303039313233623837306132 34653436653133393665303265373535353430366464653030386234386332343230646263393766
65366235663666316631623361303634383539396661323232616338386133373330646365303238 38363532303761636666346436313539363935626635356166653739643139386138616230313663
39306431366337333764373965623563383061323364396564366435376163663139346164323231 66636634663936616537386332346437363163636465653365643263666164633530623532303331
63366435343761303562393933313263303265383237616261663838333430333935626563666162 31373661303737626632663339306430633037306161313166323430373266643833306365386234
31363264356333663337313833353239316163643961393131346136633561623037636130353166 37663937356333626335653737303634396137303738396533633537653461393630613739363762
38646239623433613031646465326431623461383036356266643534346430363033316230656662 30323739633265303634626237643066626631393639353039306438353830313634333866656461
39643636383863336436363134633336613638356635623035313766633335323731343837393536 62396637656635623466626665353064646233636366313239626438343333353139316432373162
31343861336237356234633366643932323366653461373636646131393935656162613238343263 33373831613937323738383332346364623863613861616538626639633039306232363063653439
32333962333239643733333363303233633333383733336262373463623935663531313830653935 63383132323534633966333730363730653132336261666363323433303339633636336261393863
32346334393463636465383738306163326464373961376436663264356165306463353861306361 61386637656232656161306264313230353161613936313632613066613930376339623530386438
37356134346135633137643634656432633366643761616433393239363831323335356639343337 63306335363031323532303937636432663165366137663339333635653166306538313433306664
37623330363333356466636637336563303465343738363638663837653534303364663935313463 30353536353163393139643032393363623930323834623139316532303363316239303531623165
36653333376233343637346365666364393237306531626165333966393663633165356339663765 34326263643935396239366133353565303039393333303736346434376237313533623034626238
66663361643533616539653833303562373834663932626539383363653338636362383633623534 63356538373238396162323263313262326234653230373866653335396530646439626437393438
36653666343835663530393665383863393133353261616139616362353062623137393565323634 37616565333632343766623065646139653261336438346330383539313235626166313863303530
35356163323432303435626336353866303836623064366464336161636162343862333761343030 62353138333866666331663861346632343232376234633965323138343763626434383163633263
64613165646362643366373730643665303261323635313632353439353736376565333662653437 30313634653535396632393932636236626361623530363563373266353534363431313436663034
38396438366539383765653635326265633535363738323835636563666663386435633331616239 37633763656133666637326138386364336365363735326161393562373364633637636633666539
36313166363138653531373061633966633337643530623333646537383231336639343932653634 61353135613465653031343035303334303532306533383936626565366434343464623766353661
32393335636534333963663035303236356436393637363030313031353832623432656233376430 39623231343033313662643837633735313666313038316162643232366566626333636231613838
64333563333433373334643530366164353765346138303730663561356335613239333136326237 36646630653265633631326535653463613232336265393061313732303833376637363362333134
63356566663033313363646664643639386366383765646230343632623061626334623564613338 62356531373363656335356365373462383263386364353539383938323763323437313530666137
34313633326565353839396164663536613561643232353736303336613864313330323638356364 34353962613930626663343064383235393333343061363039663535653564613331323662313035
30633335323438613636343964323431366364633031643235636330623935363266623939336631 37623466333863613737393738316663303238303164653265366433303864353466313866663762
63393733396332636335366539333939383831663039313933343336663539323435373963666131 37623863633163643139393934333764643261333835663639653664613166336635653236353065
33343638303537636134666236616566356234393031343461376439363133393834363565313065 39363063313264616332386562626130323664643839316334313461643162323130366432343663
63333638393236663538616436386164303732383539393261633135643930643435636637373736 32663637373061383636366663326163656637663366326436396639373332393330393030396262
64653333656235656161303166336233393864386263363330643264636263303563636463316364 62323162646236343764333466343466326530653136653937663866613131663136323133386461
65396231393531343265663234366530396665333830343434316433303361333539303734383934 62336665316232666630623235666566313561333563383133613539303032363736613831353562
35383936363435393231353532613534396231366630366461346235613436373537656335393966 30636433323631386363623062666530623364643437383764613532646331343237646638643665
35666661633364326336666238346261616334303936613864633936613130333030343334396235 66343334643061363764656532623836646231396664616332326436333831663636333763653634
30623136343934633636613062353230323961376639373033386132316132623932343432356266 34646637613961333063363635376137343533336263656661643234626563343035343131643863
31333037656630333761633236303136633235636138653133363430613963393738383032643737 61653031396361623436343336383730373563363666633266626131316538386335623532646533
36363037353630643137396661393736383035663963653465613437663865393565626438353264 31623837383336333263643834613936373835336163616530636661623161346463343565336533
61646330343730656539373866363666393636373962366131306264313364366530653035373031 39653039376437313037393435393634336666383634313534636632656533643433633966366530
61306461323038353261353430323133386135623433306564326237643334326264643932316434 36613139323831383331633232636130333836313831343336376466663532336263363634323837
61623066323935373761616463636537666133303863333161393361626661623632656637336639 38306635613861316234343232303161373531356339613661666434626335313231383439656361
36383538346633393265323130633037616364613934376337326566656237373363393738386366 31353730343965323934666466626439386536323434333266643161613230336133383531643734
36386335646432646234336137623663336637323461663538316232656130633863336330383363 65326133373134306439626138316361313865646663333936383731333336333437376661356639
34646530353539336432633165353039663338653139396365373664393030663164666432313265 39303462653464646231303965313437353161333931306335363864623165366565306331366563
63396563306138383166396366616638373631616637633330666463343035333633346437393664 39383031353866646336363836643735666264636562643838626230393339653362303861333431
64353736626432393632643263616139653131663264313466306664616437323739613936653839 64653930353964653339396562653033373463303431303362313861663064333763306638643839
36653366396336376430623962373361343762363465373133663739313536323263633164373230 66333461316230353433616361313961353637323062623431306635376435346238303962353638
35613466643839643831623138393137316661386234336131633763303731393663373364616131 66356662386631616230336337336366336335613935313535393030373761343465316539303436
36383834633738326234663765383662383832323465383534353834633461333265656539633238 33366136636261336537333964623033383733656666366233363361616365613531383866306538
64646665323938613735366165353361356236636163626535376131303464353365366234646438 37353866396535653166303133333736616537333565613062336330303636376361633537663962
65316531356239663838323130393061646562653464633230353337316133333036626161336432 36613532346330346161303461616365386133303362303739636563633362393837653733323333
66303438633139333964633766366262333235303262653733383934313638343336633566666338 31363264353762316564313362663563653862626164306533636335623631303139343161643863
31633132653738326439326439616630323636666361646634663334366566396234633065626162 34613462313732303830313738323563353338303164306137306535363531353534653061326361
38643565353738616232666330326365633264646637623836323761343866336635393436336331 36653837613264383537643634356537353737373166356366363664333361643038303965313633
33663830643934633163353438343436303030343531666335326236376564333466343163643430 36323839343634383762373636383732643936616661333133353036396464616635626663643230
35393031333834366335656431313033643936313839316431396333386135663761633562626163 35333239323034326435643335393239326230303833363338353865396366313736303836663762
39366438393532363430326432356135356532646162306333663163613031336136353132656538 36353536633630323734356239656339623432366463653365643163393030613466303066613435
31653762386538656663346263663531653063626463326534636337303639303561626334633935 64333934633136313361656435636531646264643138376532353239643537313765636237383332
65666139663461343466643861393762316330316431613765653239316537616434626535396139 33323363353630383431656437353435396638353438343162356538356636353364333839316633
35376434356533656336623839656138386565303266396532303665346264623034643664656137 63623433346437663932663437333338366161346238343166306635653833666564323834623662
62633064356566366438626331633933373630363164373434613233386535633532653130376436 64643633616330626234396564356433383535363733353135393230366630343665633736373031
34353336633966313365373439623633353364393838343335306665383361323766353431393662 63306563623464366230326166373462366361333563636431353736376632323835393363383037
31356533333834383832333031386365316461376563646561646333313063393532303162393231 32656632336335346131613537343665393461323834346564653263613031386366616432353131
61336165663938363437396564626430376362353736623232653430613464626234326234663335 65386461313235663263353561383163366130356631336438333837303234373362343430396462
37373633306533363830353662633038306139626136663839383631623230396333313937653733 64383733616166653465646333633666633138613038373561356634653330626236306631393166
39313163316161326263306530353465336363626530333966343934373866303664316536363466 37636333393762326336643339326232653964646161656161643134386264333764316336643636
33343766393561643864366665353239366336323335656665303735326633323432333938323862 62323032633462633339346665633461303362333232643837653834646463653733663831323233
66656230373937396465323731616133336533383966353564663364303538613362313139343865 35306261323332356531393466383932353239613639383938323731336564336133316237656237
64383233613038626437613162663232373666363062373531373331343237306135333230303636 35613932386132306630626631393434363231356531313338633632633966623965643764376239
31626537633637653961666638393330643932656234316363323339353930303738346336646266 32623033336161323164343364346465376166653432356166343537373630653230646566306463
63346234333833376563656264383834363630613932306262376666356663613831393732636532 35353066653337363136313937336436623266353234666361616265666161383265323936613265
64333638616364633965383034356232373065333232623961643239326565623063386339303064 30303962646436303130373666383062363261326363373761616261613366346438386138653832
64653162663239376335383732383838386631333837323238393366363836373463656639646261 62313065633664306564316638383565363134326662306434363262613435666138623639366533
32616238363463333339393138303333326461666663303238343839376632323539396235373766 62323762636363653161366238343862326364633130313037643838383538323134633031323732
66356464393739616138346235643564386664393130613336343235633531646530306236616361 61326537383730343463363266636332623936343465383466653765333666393133623062383563
61656465666566336132383035393636356134633131666438363661646364323764373961343864 32336138316466383930373966623364353531663533326335626334323530393635656530623865
33613963343961626665353733356432346439646638643939626562326364386533366135306433 37313437333235346438663532316336346261333331363635666166366330636234353966316132
34343961323537333233383633343635383436363232666166336131323262613135393532616161 32613932366561643864376138323233303333633935666561383130363939393063303663393566
38633635646563646563303262383461333439653562383564303261303033376337343831343431 61376331353962363962653738666237646136626163343961343931613861393730373530616461
35343632633138626364313433656364613439633531343136316436613231373233326362663736 62353032656636636237633935343334326637313931313232353632666236326264346330656139
33323664306430336235666238336631303735626630336139353764643366353931306437653039 35376366323732343161303464356231623431616630666131313831636236356532383733313338
34383433323662306164363462333934333463646136386564323764663862366235373632666662 65346664626563633639633266653636323532333338353261396538306364616164356337636534
30386266373830636664613332353265366164353035306232353230393838303363613666396539 62386165373263353935663037656464393235393732376362653136373730316138383630323434
66386663366439373566396334653335633662323230656132666631306432663836616462346264 32333864663861623033343665656633363639326364616466616137313264646236366435323337
63346338666337663062626532353835316135616661323563636662333238653933613530313765 31356266633737666235333761376432333138393931326136633338333836353163383539313335
30303864653037393131626631633338326235656632656339326463383061393635346333373730 36646466333566626336336663356530313936653239383265326538373136636162323132326539
65386631336462363436346166366130383235396664303631383065666566343461393838633739 65373939646663333962366263376631653661633164663766316463303163386236666366303439
63636334333462666131393430663335383466313762666134393062373238653730633864323137 37636432663661613064616137333665633161393733383132316138623062646136623630613535
66643639383265656338323063356463626531346561336164656364633733343731373833376261 31393439343930356437656539653535613264336333346132396463633734333164363065363232
33616663323837333266646635393564383439613630336566383336313036333933333230666230 38623438346632306161646633383534653534353164616532633934363036373338633234373934
34646334306666626138333233343332366237646165636538326264663635373438656431636435 64623933303336346663616166366262383033393633373963356565316461346564623832356639
35666334323035663933333764313564393536663335336561343734343662623939336531303235 37353561343430646361353937613236656232626565346437373236636636376334393262613666
64393333313962333737616639663234393833633332643430326163323865613632663463346635 65356634613165613831376366323732336434303864643435353835376533356539643030613464
35326632626363346536663563616334663366613734616562626165376335613165306531303932 62386635646633633462303163306632323238633938363638363431356637306430313061333632
65623031386563326665303536646531306235613034336263393436363536303565656138303931 63393333336361336161313064376466636135313061363238623965613338343738343030616436
30663237306161626130653663663365323030613635343563653465386561626361353532643737 35633334656362646137313366353564383337346263636164323461613761316464396538363463
36626466626234376462373732653936326363376639613563653361366339363538383431383136 30363461666362653938393637623531636136613538663437306463316562616133633237303035
61303134333665393039633263323238623539653233323732363163353762623730306366306134 32626161393332313331623363653730313763643335393436393265643834303330303836666661
65663661633331393137396661313530663638383236656333393638356164643537663935343063 32623633626563643661353936636335386465373038323466653562333332393433663034643164
34383039363832623663323661663530303534636635653631393536653837333766616161623839 32646234386438313138356530353536656532323730626164636332663663383337633137326461
38383830326266353362613232643036393365633261333933363931313830666537363338633337 64303939323336326630326561623031393634363965636265333033663732643265363638356536
66303166393430653263646338653539316234613432373763393664636631383737306236643431 32323434633262366361306334623835316237353964316438333161366431386633616431343236
33396234386562346165346239343838323133653461646165643538666231323561376166393231 33643436306362363362386631346237393235323366633033323532346366333437303336626139
39333534393961656234373235616332306639373764653164393232363535646239383432343963 33323637663838316635386536306261313135316231643031636536303237353261313638656137
36343134363631626434323335303136346536393266363735316437333165366538373535333866 31636231313763613465663038623462613466383965386665373133343466386563646131643035
36626537636465376533616130363564626238356162623539316133306663333763393033333663 32353430336536653834646638623963306338366663353265623437336433393865336663623637
63383462643938373262643435623132653730346564383537633537303034326366616661393062 62353330646464663532356336393366356137373064383261336632626361653435356361336133
31316532383035383632633535303564626238613438653265366261663033326463316366656266 31383838623637643334373537613763393564373730313465616433316339646163323765346138
65636462323832353565383334646239393636323635623230343537646338613861633532343962 32643837643331363234323661616234383863316262666532376236346362323731303634313765
36616432653936356266626533383433376663373838653533366631386262353337383236373166 36643364346561393834316262663932313034633261343663613965356663633466346461666136
33373139323765326135356431613235346431623931333362663463646630336332616337333535 32376137323066303339316163633732366439333135306564626231366562313662363966633465
34336130366564303136653933303233663538353561396430313937363536663961333431323435 32366135313830663331323132346536363063326338653730396662636532393233626566636565
35316537393462316334366163346663623933653861376637336338383837303233623434353238 39303337346261303738393163366361663565373661663438643934353633643836616430623036
34383866636361333061393630376431323165353036373435646566326461333737313038656135 31333234383964343337383631306537353232656664363665616665393365326135646139646431
31623466316339353463393165626236333763396434396638646461393434353132373030613633 61643663313466636263353933386339613932323565323866376664356332643430373566653666
32393032353730656562666431383236653461656566643332363034636134653737343537306136 65646437343234306333306535633835633130353732376333393234303331313662323332356632
65316437376265323439326234653363353336343631363630613533303837313535306666313461 39303963383061336239616439366165326537336631353330353664386435383763623431313235
63623339383432353739616664396666336638316131653133363066633461646336356636376534 35373330353339363461353138623733316436303137313564333865313032633033393133343265
34663730666436613733336439653031306561616263373235346461306335616166303637343462 31353866306538303630363136373832383339376231303363396338306534333639366663626466
38663364636536663764383164306436373563346562643038613065336366363939376136646332 65383833616163633763636561643135316166373730663236303034643864663632656636623430
65353261346434316534313766633139623937366265316130646138656535303031626230326463 66303466623635353239303163363630303166393335646331653033316338386138326634666537
32653530613139313534316132653531613438313339333163376665666539313661663430353336 32303433306562353838346530326362383935643339383634333263623664386265636235393533
32663930326561646536393232393730386464643364366130356464633934316261643435303734 30323139653236393330373465663463353230356463623434636161666262343437656164623961
39363666333362396266343331633266653539343862386535363736333363623035353866363335 32386535346639663138656534313863373830343464353438316337613562623833333236633135
64626339313631306266373338323163393632353433643036353762396162666562653831623235 31396266353564346464353135636131666664666637616562366165396433363061353132393330
39373332626536323866 36363165346363633665353262323964363931343133336435636433363138623666633962323536
30316334393736383235616465663536373938623732353934336662393437623337386263336365
37373035373234396130663634666264326433653164303331313965363831393033643737386435
30653935623166363435623932666637643264343764396334613331303437663333346636633539
33333331663163373435373437333661633033313566306165623362653764623361383264373331
36396462386231313834316635643136306435346666666235376636303662616366643832346339
64393336323663303237613839303739333438653032396432626130323363383961313533326638
65303837303762313239633238323665363634373161666461363665663437643032326330623730
32613431653634646437333637393864383030623932346262313563646266373731323163386338
39383731376135383431653763643931373438386133633837636231653530623566323832663265
34313065656264633635393633353632333138366436366234386262633030613739656130653062
36366633376163613735633938316230363031306634326531633938613465323533383730613761
64356530393761326266646165326131633864653565616464363162353635646434643934656631
38333835653861653634633361396561663864363331613966653663373838646262633732626366
64366434346166383339323830383537653365666536376635643031363636333830396537363561
66343966663062623064356237363933313165656631386461306563343762643237373437613839
62633034616366366565316264356665343764663162323264393665313261323032303164613230
66316137636363356337663462346637346435306337323164393166626339343337376661313738
33393761636239666230306633346462396561353333643262393561356439616338646466383537
65383037663364623361346161373264396364346537663034643930316135623030353865316630
38356537633761383238

View file

@ -1,6 +1,6 @@
# These are the variables contained in secrets.yml # These are the variables contained in secrets.yml
# Secrets are usually 32 characters or more, matching [a-Z0-9] # Secrets are usually 32 characters or more, matching [a-Z0-9]
---
postgres_passwords: postgres_passwords:
nextcloud: xxx nextcloud: xxx
passit: xxx passit: xxx
@ -9,6 +9,7 @@ postgres_passwords:
codimd: xxx codimd: xxx
mailu: xxx mailu: xxx
keycloak: xxx keycloak: xxx
hedgedoc: xxx
mastodon: xxx mastodon: xxx
rallly: xxx rallly: xxx
membersystem: xxx membersystem: xxx
@ -31,8 +32,8 @@ drone_secrets:
rpc_shared_secret: xxx rpc_shared_secret: xxx
restic_secrets: restic_secrets:
user_secret: xxx repository_password: xxx
samsapti marked this conversation as resolved
Review

Do we use this?

Do we use this?
Review

Actually no, we only used it with Decibyte's Restic server. I'll remove it.

Actually no, we only used it with Decibyte's Restic server. I'll remove it.
encryption_secret: xxx ssh_privkey: xxx
matrix_secrets: matrix_secrets:
registration_shared_secret: xxx registration_shared_secret: xxx

View file

@ -49,9 +49,10 @@ services:
restic: restic:
file: restic_backup.yml file: restic_backup.yml
user: "datacoop" user: "dc-user"
domain: "restic.cannedtuna.org" domain: "rynkeby.skovgaard.tel"
repository: "datacoop-hevonen" volume_folder: "{{ volume_root_folder }}/restic"
repository: "restic"
version: "1.6.0" version: "1.6.0"
samsapti marked this conversation as resolved Outdated

Can we derive the pubkey from the privkey in secrets? We have to update the key in two places now.

Can we derive the pubkey from the privkey in secrets? We have to update the key in two places now.

We probably could, I'll make the change.

We probably could, I'll make the change.
disabled_in_vagrant: true disabled_in_vagrant: true

View file

@ -1,5 +1,44 @@
# vim: ft=yaml.ansible # vim: ft=yaml.ansible
--- ---
- name: Create SSH directory
file:
path: "{{ services.restic.volume_folder }}/ssh"
samsapti marked this conversation as resolved Outdated

Shouldn't it be .ssh? Is {{ services.restic.volume_folder }} the $HOME dir of root?

Shouldn't it be `.ssh`? Is `{{ services.restic.volume_folder }}` the `$HOME` dir of root?

No, it evaluates to /docker-volumes/restic/ssh. It doesn't need to be in root's $HOME, and I also think it's better to place it in Restic's folder, since this is the only service that uses it. It also doesn't need to be hidden, since we can bind mount it to a different name inside the container (also this makes it visible with a simple ls).

No, it evaluates to `/docker-volumes/restic/ssh`. It doesn't need to be in root's `$HOME`, and I also think it's better to place it in Restic's folder, since this is the only service that uses it. It also doesn't need to be hidden, since we can bind mount it to a different name inside the container (also this makes it visible with a simple `ls`).
owner: root
samsapti marked this conversation as resolved
Review

It's probably correct seeing what most containers do, but we could confirm it's running as root.

It's probably correct seeing what most containers do, but we could confirm it's running as root.
Review

It's also possible with this location, since mode: '0700' denies read permission for everyone else.

It's also possible with this location, since `mode: '0700'` denies read permission for everyone else.
group: root
mode: '0700'
state: directory
- name: Copy private SSH key
copy:
dest: "{{ services.restic.volume_folder }}/ssh/id_ed25519"
owner: root
group: root
mode: '0600'
content: "{{ restic_secrets.ssh_privkey }}"
- name: Derive public SSH key
shell: >-
ssh-keygen -f {{ services.restic.volume_folder }}/ssh/id_ed25519 -y
> {{ services.restic.volume_folder }}/ssh/id_ed25519.pub
args:
creates: "{{ services.restic.volume_folder }}/ssh/id_ed25519.pub"
- name: Set file permissions on public SSH key
file:
path: "{{ services.restic.volume_folder }}/ssh/id_ed25519.pub"
owner: root
group: root
mode: '0644'
state: touch
- name: Create SSH config
template:
src: restic.ssh.config.j2
dest: "{{ services.restic.volume_folder }}/ssh/config"
owner: root
group: root
mode: '0600'
samsapti marked this conversation as resolved Outdated

Isn't sftp urls sftp://user@host/path/from/root?

Isn't sftp urls `sftp://user@host/path/from/root`?

No, the URL format is actually sftp://user@host[:port]//path/from/root (double slash) or sftp://user@host[:port]/relative/path/to/home, but Restic only requires the URL format in case of a specified port number or an IPv6 address. If not, it only wants the sftp: prefix, followed by the format you would use with scp, sftp:user@host:/path/to/repo.
https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#sftp

No, the URL format is actually `sftp://user@host[:port]//path/from/root` (double slash) or `sftp://user@host[:port]/relative/path/to/home`, but Restic only requires the URL format in case of a specified port number or an IPv6 address. If not, it only wants the `sftp:` prefix, followed by the format you would use with `scp`, `sftp:user@host:/path/to/repo`. https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#sftp
- name: Setup restic backup - name: Setup restic backup
docker_compose: docker_compose:
project_name: restic_backup project_name: restic_backup
@ -13,12 +52,12 @@
environment: environment:
RUN_ON_STARTUP: "false" RUN_ON_STARTUP: "false"
BACKUP_CRON: "0 30 3 * * *" BACKUP_CRON: "0 30 3 * * *"
RESTIC_REPOSITORY: "rest:https://{{ services.restic.user }}:{{ restic_secrets.user_password }}@{{ services.restic.domain }}/{{ services.restic.repository }}" RESTIC_REPOSITORY: "sftp:{{ services.restic.user }}@{{ services.restic.domain }}:{{ services.restic.repository }}"
RESTIC_PASSWORD: "{{ restic_secrets.repository_password }}" RESTIC_PASSWORD: "{{ restic_secrets.repository_password }}"
RESTIC_BACKUP_SOURCES: "/mnt/volumes" RESTIC_BACKUP_SOURCES: "/mnt/volumes"
RESTIC_BACKUP_ARGS: >- RESTIC_BACKUP_ARGS: >-
--tag datacoop-volumes --tag datacoop-volumes
--exclude='*.tmp' --exclude '*.tmp'
--verbose --verbose
RESTIC_FORGET_ARGS: >- RESTIC_FORGET_ARGS: >-
samsapti marked this conversation as resolved Outdated

Same comment as above regarding sftp urls.

Same comment as above regarding sftp urls.
--keep-last 10 --keep-last 10
@ -27,6 +66,7 @@
--keep-monthly 12 --keep-monthly 12
TZ: Europe/Copenhagen TZ: Europe/Copenhagen
volumes: volumes:
- "{{ services.restic.volume_folder }}/ssh:/run/secrets/.ssh:ro"
- /docker-volumes:/mnt/volumes:ro - /docker-volumes:/mnt/volumes:ro
restic-prune: restic-prune:
@ -34,6 +74,8 @@
environment: environment:
RUN_ON_STARTUP: "false" RUN_ON_STARTUP: "false"
PRUNE_CRON: "0 0 4 * * *" PRUNE_CRON: "0 0 4 * * *"
RESTIC_REPOSITORY: "rest:https://{{ services.restic.user }}:{{ restic_secrets.user_password }}@{{ services.restic.domain }}/{{ services.restic.repository }}" RESTIC_REPOSITORY: "sftp:{{ services.restic.user }}@{{ services.restic.domain }}:{{ services.restic.repository }}"
RESTIC_PASSWORD: "{{ restic_secrets.repository_password }}" RESTIC_PASSWORD: "{{ restic_secrets.repository_password }}"
TZ: Europe/copenhagen TZ: Europe/copenhagen
volumes:
- "{{ services.restic.volume_folder }}/ssh:/run/secrets/.ssh:ro"

View file

@ -0,0 +1,3 @@
Host {{ services.restic.domain }}
ServerAliveInterval 60
ServerAliveCountMax 240