[{"data":1,"prerenderedAt":2988},["ShallowReactive",2],{"navigation_docs":3,"-run-updating-and-backups":613,"-run-updating-and-backups-surround":2985},[4,39,101,378,540,562,584,606],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":38},"Start","i-lucide-rocket","\u002Fstart","1.start",[10,14,18,22,26,30,34],{"title":11,"path":12,"stem":13},"Our approach","\u002Fstart\u002Four-approach","1.start\u002F0.our-approach",{"title":15,"path":16,"stem":17},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction",{"title":19,"path":20,"stem":21},"Concepts","\u002Fstart\u002Fconcepts","1.start\u002F2.concepts",{"title":23,"path":24,"stem":25},"Glossary","\u002Fstart\u002Fglossary","1.start\u002F3.glossary",{"title":27,"path":28,"stem":29},"Try it locally","\u002Fstart\u002Ftry-it-locally","1.start\u002F4.try-it-locally",{"title":31,"path":32,"stem":33},"Features","\u002Fstart\u002Ffeatures","1.start\u002F5.features",{"title":35,"path":36,"stem":37},"Questions","\u002Fstart\u002Ffaq","1.start\u002F6.faq",false,{"title":40,"icon":41,"path":42,"stem":43,"children":44,"page":38},"Run SHADE","i-lucide-server","\u002Frun","2.run",[45,49,53,57,61,65,69,73,77,81,85,89,93,97],{"title":46,"path":47,"stem":48},"Setting up an instance (Coolify)","\u002Frun\u002Fcoolify","2.run\u002F1.coolify",{"title":50,"path":51,"stem":52},"Console commands","\u002Frun\u002Fconsole","2.run\u002F10.console",{"title":54,"path":55,"stem":56},"Rotating APP_SECRET","\u002Frun\u002Frotating-app-secret","2.run\u002F11.rotating-app-secret",{"title":58,"path":59,"stem":60},"Checking an instance","\u002Frun\u002Fdoctor","2.run\u002F12.doctor",{"title":62,"path":63,"stem":64},"Self-hosting by hand","\u002Frun\u002Fown-server-by-hand","2.run\u002F13.own-server-by-hand",{"title":66,"path":67,"stem":68},"NixOS (experimental)","\u002Frun\u002Fnixos","2.run\u002F14.nixos",{"title":70,"path":71,"stem":72},"Self-hosting without Coolify","\u002Frun\u002Fown-server","2.run\u002F2.own-server",{"title":74,"path":75,"stem":76},"Hosting the site on a static host","\u002Frun\u002Fstatic-hosts","2.run\u002F3.static-hosts",{"title":78,"path":79,"stem":80},"Licence","\u002Frun\u002Flicence","2.run\u002F4.licence",{"title":82,"path":83,"stem":84},"Updating and backups","\u002Frun\u002Fupdating-and-backups","2.run\u002F5.updating-and-backups",{"title":86,"path":87,"stem":88},"Troubleshooting","\u002Frun\u002Ftroubleshooting","2.run\u002F6.troubleshooting",{"title":90,"path":91,"stem":92},"Logs, request ids, traces and metrics","\u002Frun\u002Flogs","2.run\u002F7.logs",{"title":94,"path":95,"stem":96},"Maintenance mode","\u002Frun\u002Fmaintenance-mode","2.run\u002F8.maintenance-mode",{"title":98,"path":99,"stem":100},"Usage limits","\u002Frun\u002Fusage-limits","2.run\u002F9.usage-limits",{"title":102,"icon":103,"path":104,"stem":105,"children":106},"Guide","i-lucide-book-open","\u002Fguide","3.guide",[107,109,147,192,210,280,310,364],{"title":102,"path":104,"stem":108},"3.guide\u002Findex",{"title":110,"icon":111,"path":112,"stem":113,"children":114,"page":38},"Content","i-lucide-file-text","\u002Fguide\u002Fcontent","3.guide\u002F1.content",[115,119,123,127,131,135,139,143],{"title":116,"path":117,"stem":118},"Collections and entries","\u002Fguide\u002Fcontent\u002Fcollections","3.guide\u002F1.content\u002F1.collections",{"title":120,"path":121,"stem":122},"Field types","\u002Fguide\u002Fcontent\u002Ffields","3.guide\u002F1.content\u002F2.fields",{"title":124,"path":125,"stem":126},"Drafts, publishing and version history","\u002Fguide\u002Fcontent\u002Fversions","3.guide\u002F1.content\u002F3.versions",{"title":128,"path":129,"stem":130},"Languages","\u002Fguide\u002Fcontent\u002Flanguages","3.guide\u002F1.content\u002F4.languages",{"title":132,"path":133,"stem":134},"Data sources","\u002Fguide\u002Fcontent\u002Fdata-sources","3.guide\u002F1.content\u002F5.data-sources",{"title":136,"path":137,"stem":138},"Media","\u002Fguide\u002Fcontent\u002Fmedia","3.guide\u002F1.content\u002F6.media",{"title":140,"path":141,"stem":142},"Search","\u002Fguide\u002Fcontent\u002Fsearch","3.guide\u002F1.content\u002F7.search",{"title":144,"path":145,"stem":146},"Trash","\u002Fguide\u002Fcontent\u002Ftrash","3.guide\u002F1.content\u002F8.trash",{"title":148,"icon":149,"path":150,"stem":151,"children":152,"page":38},"Website","i-lucide-globe","\u002Fguide\u002Fwebsite","3.guide\u002F2.website",[153,156,160,164,168,172,176,180,184,188],{"title":148,"path":154,"stem":155},"\u002Fguide\u002Fwebsite\u002Fwebsite","3.guide\u002F2.website\u002F1.website",{"title":157,"path":158,"stem":159},"Scroll scenes","\u002Fguide\u002Fwebsite\u002Fscroll-scenes","3.guide\u002F2.website\u002F10.scroll-scenes",{"title":161,"path":162,"stem":163},"Pages and posts","\u002Fguide\u002Fwebsite\u002Fpages","3.guide\u002F2.website\u002F2.pages",{"title":165,"path":166,"stem":167},"The visual editor","\u002Fguide\u002Fwebsite\u002Fvisual-editor","3.guide\u002F2.website\u002F3.visual-editor",{"title":169,"path":170,"stem":171},"Roles and locks","\u002Fguide\u002Fwebsite\u002Froles-and-locks","3.guide\u002F2.website\u002F4.roles-and-locks",{"title":173,"path":174,"stem":175},"Header and footer","\u002Fguide\u002Fwebsite\u002Fheader-and-footer","3.guide\u002F2.website\u002F5.header-and-footer",{"title":177,"path":178,"stem":179},"Theme","\u002Fguide\u002Fwebsite\u002Ftheme","3.guide\u002F2.website\u002F6.theme",{"title":181,"path":182,"stem":183},"Redirects","\u002Fguide\u002Fwebsite\u002Fredirects","3.guide\u002F2.website\u002F7.redirects",{"title":185,"path":186,"stem":187},"Site settings","\u002Fguide\u002Fwebsite\u002Fsite-settings","3.guide\u002F2.website\u002F8.site-settings",{"title":189,"path":190,"stem":191},"The site","\u002Fguide\u002Fwebsite\u002Fthe-site","3.guide\u002F2.website\u002F9.the-site",{"title":193,"icon":194,"path":195,"stem":196,"children":197,"page":38},"Publishing","i-lucide-send","\u002Fguide\u002Fpublishing","3.guide\u002F3.publishing",[198,202,206],{"title":199,"path":200,"stem":201},"Publishing and preview","\u002Fguide\u002Fpublishing\u002Fpublishing","3.guide\u002F3.publishing\u002F1.publishing",{"title":203,"path":204,"stem":205},"Builds","\u002Fguide\u002Fpublishing\u002Fbuilds","3.guide\u002F3.publishing\u002F2.builds",{"title":207,"path":208,"stem":209},"CDN caches","\u002Fguide\u002Fpublishing\u002Fcaches","3.guide\u002F3.publishing\u002F3.caches",{"title":211,"icon":212,"path":213,"stem":214,"children":215,"page":38},"People, security and privacy","i-lucide-shield","\u002Fguide\u002Fpeople-and-security","3.guide\u002F4.people-and-security",[216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276],{"title":217,"path":218,"stem":219},"People in SHADE","\u002Fguide\u002Fpeople-and-security\u002Fpeople-in-shade","3.guide\u002F4.people-and-security\u002F0.people-in-shade",{"title":221,"path":222,"stem":223},"Team and roles","\u002Fguide\u002Fpeople-and-security\u002Fteam","3.guide\u002F4.people-and-security\u002F1.team",{"title":225,"path":226,"stem":227},"Errors and security alerts","\u002Fguide\u002Fpeople-and-security\u002Ferrors","3.guide\u002F4.people-and-security\u002F10.errors",{"title":229,"path":230,"stem":231},"Exporting an instance","\u002Fguide\u002Fpeople-and-security\u002Fexporting","3.guide\u002F4.people-and-security\u002F11.exporting",{"title":233,"path":234,"stem":235},"Organisations","\u002Fguide\u002Fpeople-and-security\u002Forganisations","3.guide\u002F4.people-and-security\u002F12.organisations",{"title":237,"path":238,"stem":239},"Signing in through an identity provider (team)","\u002Fguide\u002Fpeople-and-security\u002Fidentity-providers","3.guide\u002F4.people-and-security\u002F13.identity-providers",{"title":241,"path":242,"stem":243},"System status","\u002Fguide\u002Fpeople-and-security\u002Fsystem-status","3.guide\u002F4.people-and-security\u002F14.system-status",{"title":245,"path":246,"stem":247},"Appearance","\u002Fguide\u002Fpeople-and-security\u002Fappearance","3.guide\u002F4.people-and-security\u002F15.appearance",{"title":249,"path":250,"stem":251},"Accounts and personal pages","\u002Fguide\u002Fpeople-and-security\u002Faccounts","3.guide\u002F4.people-and-security\u002F2.accounts",{"title":253,"path":254,"stem":255},"Signing in (team)","\u002Fguide\u002Fpeople-and-security\u002Fsign-in","3.guide\u002F4.people-and-security\u002F3.sign-in",{"title":257,"path":258,"stem":259},"API tokens","\u002Fguide\u002Fpeople-and-security\u002Fapi-tokens","3.guide\u002F4.people-and-security\u002F4.api-tokens",{"title":261,"path":262,"stem":263},"Audit log","\u002Fguide\u002Fpeople-and-security\u002Faudit","3.guide\u002F4.people-and-security\u002F5.audit",{"title":265,"path":266,"stem":267},"Request protection","\u002Fguide\u002Fpeople-and-security\u002Fprotection","3.guide\u002F4.people-and-security\u002F6.protection",{"title":269,"path":270,"stem":271},"Personal data per person","\u002Fguide\u002Fpeople-and-security\u002Fprivacy","3.guide\u002F4.people-and-security\u002F7.privacy",{"title":273,"path":274,"stem":275},"Data retention","\u002Fguide\u002Fpeople-and-security\u002Fretention","3.guide\u002F4.people-and-security\u002F8.retention",{"title":277,"path":278,"stem":279},"Consent banner","\u002Fguide\u002Fpeople-and-security\u002Fconsent","3.guide\u002F4.people-and-security\u002F9.consent",{"title":281,"icon":282,"path":283,"stem":284,"children":285,"page":38},"Services","i-lucide-plug","\u002Fguide\u002Fservices","3.guide\u002F5.services",[286,290,294,298,302,306],{"title":287,"path":288,"stem":289},"Email","\u002Fguide\u002Fservices\u002Femail","3.guide\u002F5.services\u002F1.email",{"title":291,"path":292,"stem":293},"Opening hours","\u002Fguide\u002Fservices\u002Fopening-hours","3.guide\u002F5.services\u002F4.opening-hours",{"title":295,"path":296,"stem":297},"Webhooks","\u002Fguide\u002Fservices\u002Fwebhooks","3.guide\u002F5.services\u002F5.webhooks",{"title":299,"path":300,"stem":301},"Locations","\u002Fguide\u002Fservices\u002Flocations","3.guide\u002F5.services\u002F6.locations",{"title":303,"path":304,"stem":305},"VAT rates","\u002Fguide\u002Fservices\u002Fvat-rates","3.guide\u002F5.services\u002F7.vat-rates",{"title":307,"path":308,"stem":309},"Channels","\u002Fguide\u002Fservices\u002Fchannels","3.guide\u002F5.services\u002F8.channels",{"title":311,"icon":312,"path":313,"stem":314,"children":315,"page":38},"InstalledModules","i-lucide-puzzle","\u002Fguide\u002Fmodules","3.guide\u002F6.modules",[316,320,324,328,332,336,340,344,348,352,356,360],{"title":317,"path":318,"stem":319},"Modules","\u002Fguide\u002Fmodules\u002Fmanaging","3.guide\u002F6.modules\u002F1.managing",{"title":321,"path":322,"stem":323},"Dutch services (module)","\u002Fguide\u002Fmodules\u002Fnl","3.guide\u002F6.modules\u002F10.nl",{"title":325,"path":326,"stem":327},"Editorial (module)","\u002Fguide\u002Fmodules\u002Feditorial","3.guide\u002F6.modules\u002F11.editorial",{"title":329,"path":330,"stem":331},"Appointments (module)","\u002Fguide\u002Fmodules\u002Fappointments","3.guide\u002F6.modules\u002F2.appointments",{"title":333,"path":334,"stem":335},"Shop (the commerce module)","\u002Fguide\u002Fmodules\u002Fshop","3.guide\u002F6.modules\u002F3.shop",{"title":337,"path":338,"stem":339},"Untrusted modules","\u002Fguide\u002Fmodules\u002Funtrusted","3.guide\u002F6.modules\u002F4.untrusted",{"title":341,"path":342,"stem":343},"Analytics (module)","\u002Fguide\u002Fmodules\u002Fanalytics","3.guide\u002F6.modules\u002F5.analytics",{"title":345,"path":346,"stem":347},"Error forwarding (module)","\u002Fguide\u002Fmodules\u002Ferror-forwarding","3.guide\u002F6.modules\u002F6.error-forwarding",{"title":349,"path":350,"stem":351},"Client programs","\u002Fguide\u002Fmodules\u002Fprograms","3.guide\u002F6.modules\u002F7.programs",{"title":353,"path":354,"stem":355},"Import and export (module)","\u002Fguide\u002Fmodules\u002Fimport","3.guide\u002F6.modules\u002F8.import",{"title":357,"path":358,"stem":359},"Payments (module)","\u002Fguide\u002Fmodules\u002Fpayments","3.guide\u002F6.modules\u002F8.payments",{"title":361,"path":362,"stem":363},"Forms (module)","\u002Fguide\u002Fmodules\u002Fforms","3.guide\u002F6.modules\u002F9.forms",{"title":365,"icon":366,"path":367,"stem":368,"children":369,"page":38},"AI assistants","i-lucide-bot","\u002Fguide\u002Fai","3.guide\u002F7.ai",[370,374],{"title":371,"path":372,"stem":373},"AI assistants (MCP)","\u002Fguide\u002Fai\u002Fassistants","3.guide\u002F7.ai\u002F1.assistants",{"title":375,"path":376,"stem":377},"Connecting an AI assistant","\u002Fguide\u002Fai\u002Fconnecting","3.guide\u002F7.ai\u002F2.connecting",{"title":379,"icon":380,"path":381,"stem":382,"children":383,"page":38},"Developers","i-lucide-code","\u002Fdevelopers","4.developers",[384,388,392,396,400,404,408,412,416,420,424,428,432,435,489,493,497,501,536],{"title":385,"path":386,"stem":387},"Architecture","\u002Fdevelopers\u002Farchitecture","4.developers\u002F1.architecture",{"title":389,"path":390,"stem":391},"Capabilities","\u002Fdevelopers\u002Fcapabilities","4.developers\u002F10.capabilities",{"title":393,"path":394,"stem":395},"Trust","\u002Fdevelopers\u002Ftrust","4.developers\u002F11.trust",{"title":397,"path":398,"stem":399},"Redis and the ports","\u002Fdevelopers\u002Fredis","4.developers\u002F12.redis",{"title":401,"path":402,"stem":403},"The worker container role","\u002Fdevelopers\u002Fworker","4.developers\u002F13.worker",{"title":405,"path":406,"stem":407},"kv: a module's own key-value storage","\u002Fdevelopers\u002Fkv","4.developers\u002F14.kv",{"title":409,"path":410,"stem":411},"Processes: long-running work on the worker","\u002Fdevelopers\u002Fprocesses","4.developers\u002F15.processes",{"title":413,"path":414,"stem":415},"Network: a module's outgoing calls","\u002Fdevelopers\u002Fnetwork","4.developers\u002F16.network",{"title":417,"path":418,"stem":419},"Realtime","\u002Fdevelopers\u002Frealtime","4.developers\u002F17.realtime",{"title":421,"path":422,"stem":423},"Private files","\u002Fdevelopers\u002Ffiles","4.developers\u002F18.files",{"title":425,"path":426,"stem":427},"Notify","\u002Fdevelopers\u002Fnotify","4.developers\u002F19.notify",{"title":429,"path":430,"stem":431},"Collections","\u002Fdevelopers\u002Fcollections","4.developers\u002F2.collections",{"title":337,"path":433,"stem":434},"\u002Fdevelopers\u002Funtrusted","4.developers\u002F20.untrusted",{"title":436,"icon":312,"path":437,"stem":438,"children":439},"Writing a plugin","\u002Fdevelopers\u002Fmodules","4.developers\u002F3.modules\u002Findex",[440,442,446,450,454,458,462,466,470,473,477,481,485],{"title":441,"path":437,"stem":438},"Writing a module",{"title":443,"path":444,"stem":445},"Module SDK and tooling","\u002Fdevelopers\u002Fmodules\u002Fsdk-and-tooling","4.developers\u002F3.modules\u002F1.sdk-and-tooling",{"title":447,"path":448,"stem":449},"Connecting accounts with OAuth2","\u002Fdevelopers\u002Fmodules\u002Foauth","4.developers\u002F3.modules\u002F10.oauth",{"title":451,"path":452,"stem":453},"Calls between modules","\u002Fdevelopers\u002Fmodules\u002Fcalls-between-modules","4.developers\u002F3.modules\u002F11.calls-between-modules",{"title":455,"path":456,"stem":457},"Experimental parts","\u002Fdevelopers\u002Fmodules\u002Fexperimental-parts","4.developers\u002F3.modules\u002F12.experimental-parts",{"title":459,"path":460,"stem":461},"The manifest","\u002Fdevelopers\u002Fmodules\u002Fmanifest","4.developers\u002F3.modules\u002F2.manifest",{"title":463,"path":464,"stem":465},"Routes","\u002Fdevelopers\u002Fmodules\u002Froutes","4.developers\u002F3.modules\u002F3.routes",{"title":467,"path":468,"stem":469},"Admin screens and the site part","\u002Fdevelopers\u002Fmodules\u002Fadmin-and-site","4.developers\u002F3.modules\u002F4.admin-and-site",{"title":110,"path":471,"stem":472},"\u002Fdevelopers\u002Fmodules\u002Fcontent","4.developers\u002F3.modules\u002F5.content",{"title":474,"path":475,"stem":476},"Background work and services","\u002Fdevelopers\u002Fmodules\u002Fbackground-and-services","4.developers\u002F3.modules\u002F6.background-and-services",{"title":478,"path":479,"stem":480},"SDK reference","\u002Fdevelopers\u002Fmodules\u002Fsdk-reference","4.developers\u002F3.modules\u002F7.sdk-reference",{"title":482,"path":483,"stem":484},"The website module's SDK","\u002Fdevelopers\u002Fmodules\u002Fwebsite-sdk","4.developers\u002F3.modules\u002F8.website-sdk",{"title":486,"path":487,"stem":488},"Incoming webhooks","\u002Fdevelopers\u002Fmodules\u002Fincoming-webhooks","4.developers\u002F3.modules\u002F9.incoming-webhooks",{"title":490,"path":491,"stem":492},"Core and the website module","\u002Fdevelopers\u002Fcore-and-website-module","4.developers\u002F4.core-and-website-module",{"title":494,"path":495,"stem":496},"The API","\u002Fdevelopers\u002Fapi","4.developers\u002F6.api",{"title":498,"path":499,"stem":500},"API reference","\u002Fdevelopers\u002Fapi-reference","4.developers\u002F6.api-reference",{"title":502,"icon":503,"path":504,"stem":505,"children":506},"Sites in other frameworks","i-lucide-layout-template","\u002Fdevelopers\u002Fframeworks","4.developers\u002F7.frameworks\u002Findex",[507,508,512,516,520,524,528,532],{"title":502,"path":504,"stem":505},{"title":509,"path":510,"stem":511},"Accounts: sign-in and modules' routes","\u002Fdevelopers\u002Fframeworks\u002Faccounts","4.developers\u002F7.frameworks\u002F1.accounts",{"title":513,"path":514,"stem":515},"`@shadestack\u002Ftree`","\u002Fdevelopers\u002Fframeworks\u002Ftree","4.developers\u002F7.frameworks\u002F2.tree",{"title":517,"path":518,"stem":519},"Expressions and styles","\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles","4.developers\u002F7.frameworks\u002F3.expressions-and-styles",{"title":521,"path":522,"stem":523},"`@shadestack\u002Frender`","\u002Fdevelopers\u002Fframeworks\u002Frender","4.developers\u002F7.frameworks\u002F4.render",{"title":525,"path":526,"stem":527},"`@shadestack\u002Finteractions`","\u002Fdevelopers\u002Fframeworks\u002Finteractions","4.developers\u002F7.frameworks\u002F5.interactions",{"title":529,"path":530,"stem":531},"`@shadestack\u002Fa11y`","\u002Fdevelopers\u002Fframeworks\u002Fa11y","4.developers\u002F7.frameworks\u002F6.a11y",{"title":533,"path":534,"stem":535},"Your own page for SHADE's links","\u002Fdevelopers\u002Fframeworks\u002Flinks","4.developers\u002F7.frameworks\u002F7.links",{"title":537,"path":538,"stem":539},"Build a client module","\u002Fdevelopers\u002Fclient-module","4.developers\u002F9.client-module",{"title":541,"icon":542,"path":543,"stem":544,"children":545,"page":38},"Security","i-lucide-shield-check","\u002Fsecurity","5.security",[546,550,554,558],{"title":547,"path":548,"stem":549},"Reporting a vulnerability","\u002Fsecurity\u002Freporting","5.security\u002F0.reporting",{"title":551,"path":552,"stem":553},"Security testing","\u002Fsecurity\u002Ftesting","5.security\u002F1.testing",{"title":555,"path":556,"stem":557},"Hardening a production instance","\u002Fsecurity\u002Fhardening","5.security\u002F2.hardening",{"title":559,"path":560,"stem":561},"Manual testing with Kali Linux","\u002Fsecurity\u002Fmanual-testing","5.security\u002F3.manual-testing",{"title":563,"icon":564,"path":565,"stem":566,"children":567,"page":38},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","6.contributing",[568,572,576,580],{"title":569,"path":570,"stem":571},"Reading the code","\u002Fcontributing\u002Freading-the-code","6.contributing\u002F1.reading-the-code",{"title":573,"path":574,"stem":575},"Docs site","\u002Fcontributing\u002Fdocs-site","6.contributing\u002F2.docs-site",{"title":577,"path":578,"stem":579},"Releases","\u002Fcontributing\u002Freleases","6.contributing\u002F3.releases",{"title":581,"path":582,"stem":583},"Load tests","\u002Fcontributing\u002Fload-tests","6.contributing\u002F4.load-tests",{"title":585,"icon":586,"path":587,"stem":588,"children":589,"page":38},"Project","i-lucide-map","\u002Fproject","7.project",[590,594,598,602],{"title":591,"path":592,"stem":593},"Roadmap","\u002Fproject\u002Froadmap","7.project\u002F1.roadmap",{"title":595,"path":596,"stem":597},"Known issues","\u002Fproject\u002Fknown-issues","7.project\u002F2.known-issues",{"title":599,"path":600,"stem":601},"Changelog","\u002Fproject\u002Fchangelog","7.project\u002F3.changelog",{"title":603,"path":604,"stem":605},"Decisions","\u002Fproject\u002Fdecisions","7.project\u002F4.decisions",{"title":607,"path":608,"stem":609,"children":610,"icon":612},"Community","\u002Fcommunity","8.community\u002Findex",[611],{"title":607,"path":608,"stem":609},"i-lucide-users",{"id":614,"title":82,"body":615,"description":994,"extension":2979,"links":2980,"meta":2981,"navigation":2982,"path":83,"seo":2983,"stem":84,"__hash__":2984},"docs\u002F2.run\u002F5.updating-and-backups.md",{"type":616,"value":617,"toc":2964},"minimark",[618,622,627,719,722,792,796,802,809,833,842,966,969,973,988,1057,1068,1086,1097,1111,1134,1155,1167,1181,1206,1212,1266,1270,1348,1446,1455,1475,2010,2013,2040,2142,2157,2161,2164,2350,2362,2412,2415,2463,2480,2484,2576,2587,2594,2598,2608,2640,2643,2665,2675,2679,2694,2697,2796,2810,2814,2821,2870,2874,2880,2886,2903,2940,2952,2960],[619,620,621],"p",{},"How an instance stays current, and what to keep so it can be restored or handed over.",[623,624,626],"h2",{"id":625},"what-to-back-up","What to back up",[628,629,630,646],"table",{},[631,632,633],"thead",{},[634,635,636,640,643],"tr",{},[637,638,639],"th",{},"What",[637,641,642],{},"Where",[637,644,645],{},"Why",[647,648,649,661,684,701],"tbody",{},[634,650,651,655,658],{},[652,653,654],"td",{},"The database",[652,656,657],{},"Postgres",[652,659,660],{},"Everything SHADE keeps: content, versions, accounts, settings, the audit log, private files, installed modules' tables",[634,662,663,669,676],{},[652,664,665],{},[666,667,668],"code",{},"APP_SECRET",[652,670,671,672,675],{},"the API's environment; with the deployment template, the ",[666,673,674],{},"secrets"," volume",[652,677,678,679,683],{},"Stored secrets (payment and email keys, a module's secret settings) are encrypted with it: without it they cannot be read and must be entered again. After ",[680,681,682],"a",{"href":55},"rotating it",", keep the old one too, for the backups made before",[634,685,686,689,698],{},[652,687,688],{},"The backup key",[652,690,691,694,695,675],{},[666,692,693],{},"SHADE_BACKUP_KEY",", with the deployment template the ",[666,696,697],{},"secrets-backup",[652,699,700],{},"Opens the built-in backups' files. Keep a copy apart from the server and never in the bucket: without it a backup cannot be opened",[634,702,703,706,712],{},[652,704,705],{},"The data volume",[652,707,708,711],{},[666,709,710],{},"\u002Fapp\u002Fdata"," in the API's container",[652,713,714,715,718],{},"Uploaded media (with ",[666,716,717],{},"STORAGE_DRIVER=local",") and the installed module packages. With S3, the media are in the bucket instead",[619,720,721],{},"Redis needs no backup: it holds only work in flight (leases, the queue, messages between containers, rate-limit\ncounters, the cache), and everything in it is rebuilt after a restart.",[723,724,725,750,784],"ul",{},[726,727,728,732,733,736,737,741,742,744,745,749],"li",{},[729,730,731],"strong",{},"On Coolify",": set the built-in backups' target with ",[666,734,735],{},"node console\u002Fbackup-target.mjs set"," in the admin container, to\nstorage the client owns (",[680,738,740],{"href":739},"#setting-the-target","Setting the target","), and keep copies of ",[666,743,668],{}," and the backup\nkey apart from the server (",[680,746,748],{"href":747},"\u002Frun\u002Fcoolify#the-template-as-one-docker-compose-resource","Setting up an instance",").",[726,751,752,755,756,759,760,763,764,766,767,770,771,775,776,779,780,770,782,749],{},[729,753,754],{},"On your own server",": switch on the built-in backups below, and back up ",[666,757,758],{},"\u002Fetc\u002Fshade"," whole: ",[666,761,762],{},"shade.env"," with\n",[666,765,668],{},", the passwords, and Caddy's certificates in ",[666,768,769],{},"caddy-data\u002F"," (",[680,772,774],{"href":773},"\u002Frun\u002Fown-server#backing-up","Self-hosting without\nCoolify","). Set up by hand: the database with ",[666,777,778],{},"pg_dump",", the data volume, and the\nenvironment file with ",[666,781,668],{},[680,783,62],{"href":63},[726,785,786,787,789,790,749],{},"Keep the backups and ",[666,788,668],{}," where the client and the operator can reach them, and nowhere else\n(",[680,791,555],{"href":556},[623,793,795],{"id":794},"built-in-backups","Built-in backups",[619,797,798,799,801],{},"SHADE can take backups itself, and send them to a bucket you own. They are off until you give a target. On any server\nthey are the first choice; your own backups (",[666,800,778],{},", or Coolify's scheduled Postgres backups for a Postgres you added\nyourself) stay a good second line.",[619,803,804,805,808],{},"Once ",[666,806,807],{},"SHADE_BACKUP_URL"," is set, the worker takes a backup every night at 03:00 (in the site's time zone), one at a time across\nworkers. Each backup is a folder in the bucket with these files:",[723,810,811,817,823,830],{},[726,812,813,814,816],{},"the database, from ",[666,815,778],{}," (its custom format), so private files, module data and modules' tables come with it;",[726,818,819,820,822],{},"the uploaded media, as a tar, when ",[666,821,717],{},";",[726,824,825,826,829],{},"with ",[666,827,828],{},"STORAGE_DRIVER=s3",", the list of media keys the database points at (every original and its variants, one a line). The media\nbucket is yours and is not copied: switch on its versioning. The list lets a restore say which of those keys the bucket lacks now;",[726,831,832],{},"a manifest: when it was taken, SHADE's version, the migrations applied, the number of rows of each table and a SHA-256 of each file.",[619,834,835,836,838,839,841],{},"Everything is encrypted on the worker before it leaves, with ",[666,837,693],{},", and sent as it is made: nothing is written to the disk,\nand the worker never holds a whole dump in memory. A bucket's owner or a thief of its keys sees sizes and times, nothing else.\n",[666,840,668],{}," and the environment are never in a backup.",[628,843,844,854],{},[631,845,846],{},[634,847,848,851],{},[637,849,850],{},"Setting",[637,852,853],{},"What it does",[647,855,856,872,899,913,933,950],{},[634,857,858,862],{},[652,859,860],{},[666,861,807],{},[652,863,864,867,868,871],{},[666,865,866],{},"s3:\u002F\u002F\u003Cbucket>"," or ",[666,869,870],{},"s3:\u002F\u002F\u003Cbucket>\u002F\u003Cprefix>",". Empty: no built-in backups",[634,873,874,878],{},[652,875,876],{},[666,877,693],{},[652,879,880,881,884,885,887,888,890,891,894,895,898],{},"32 random bytes in base64 (",[666,882,883],{},"openssl rand -base64 32","). The deployment template generates it on the first start when it is not set. Keep a copy with ",[666,886,668],{},", apart from the server and never in the bucket: without the key a backup cannot be opened, and without ",[666,889,668],{}," its stored secrets cannot. An admin confirms the copy, signed in themselves (",[666,892,893],{},"POST \u002Fapi\u002Fbackups\u002Fkept-copy","); until then the doctor's ",[666,896,897],{},"kept-copy"," check warns",[634,900,901,910],{},[652,902,903,906,907],{},[666,904,905],{},"SHADE_BACKUP_S3_ACCESS_KEY_ID",", ",[666,908,909],{},"SHADE_BACKUP_S3_SECRET_ACCESS_KEY",[652,911,912],{},"A key of its own for the bucket, apart from the media's",[634,914,915,926],{},[652,916,917,906,920,906,923],{},[666,918,919],{},"SHADE_BACKUP_S3_REGION",[666,921,922],{},"SHADE_BACKUP_S3_ENDPOINT",[666,924,925],{},"SHADE_BACKUP_S3_FORCE_PATH_STYLE",[652,927,928,929,932],{},"As ",[666,930,931],{},"STORAGE_S3_*",": the endpoint for Scaleway, Hetzner, R2 or RustFS; AWS needs only the region",[634,934,935,943],{},[652,936,937,906,940],{},[666,938,939],{},"SHADE_BACKUP_CRON",[666,941,942],{},"SHADE_BACKUP_TIME_ZONE",[652,944,945,946,949],{},"When to run, as a five-field cron expression (default ",[666,947,948],{},"0 3 * * *","), in the site's time zone unless one is given",[634,951,952,963],{},[652,953,954,906,957,906,960],{},[666,955,956],{},"SHADE_BACKUP_KEEP_DAILY",[666,958,959],{},"_WEEKLY",[666,961,962],{},"_MONTHLY",[652,964,965],{},"How many are kept: the newest of each of the last 7 days, 4 weeks and 6 months (the defaults). Older ones are deleted, only after a newer good one exists",[619,967,968],{},"The bucket should be in the EU and have object lock switched on where the host offers it, so a stolen key cannot delete\nthe backups.",[970,971,740],"h3",{"id":972},"setting-the-target",[619,974,975,976,979,980,983,984,987],{},"In the ",[680,977,978],{"href":747},"deployment template",", set the bucket and its keys once\nwith a console command in the admin container. On Coolify, open the admin service's ",[729,981,982],{},"Terminal","; on a server of your\nown, ",[666,985,986],{},"docker compose exec admin sh",":",[989,990,995],"pre",{"className":991,"code":992,"language":993,"meta":994,"style":994},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","node console\u002Fbackup-target.mjs set --url s3:\u002F\u002Fvoorbeeld-backups\u002Fshade --access-key-id \u003Ckey id> \\\n  --endpoint https:\u002F\u002Fs3.nl-ams.scw.cloud --region nl-ams\n","bash","",[666,996,997,1042],{"__ignoreMap":994},[998,999,1002,1006,1010,1013,1016,1019,1022,1026,1029,1032,1036,1039],"span",{"class":1000,"line":1001},"line",1,[998,1003,1005],{"class":1004},"sBMFI","node",[998,1007,1009],{"class":1008},"sfazB"," console\u002Fbackup-target.mjs",[998,1011,1012],{"class":1008}," set",[998,1014,1015],{"class":1008}," --url",[998,1017,1018],{"class":1008}," s3:\u002F\u002Fvoorbeeld-backups\u002Fshade",[998,1020,1021],{"class":1008}," --access-key-id",[998,1023,1025],{"class":1024},"sMK4o"," \u003C",[998,1027,1028],{"class":1008},"key",[998,1030,1031],{"class":1008}," i",[998,1033,1035],{"class":1034},"sTEyZ","d",[998,1037,1038],{"class":1024},">",[998,1040,1041],{"class":1034}," \\\n",[998,1043,1045,1048,1051,1054],{"class":1000,"line":1044},2,[998,1046,1047],{"class":1008},"  --endpoint",[998,1049,1050],{"class":1008}," https:\u002F\u002Fs3.nl-ams.scw.cloud",[998,1052,1053],{"class":1008}," --region",[998,1055,1056],{"class":1008}," nl-ams\n",[619,1058,1059,1060,1063,1064,1067],{},"It asks for the secret access key without showing it (or reads it from the first line of stdin with ",[666,1061,1062],{},"--secret-stdin",",\nnever from a flag), checks the settings as the API does, asks the bucket for its backups, and only then saves them.\nAdd ",[666,1065,1066],{},"--path-style"," for a service that needs path-style addresses (MinIO, RustFS). Then restart the admin and the\nworker: they read the target when they start.",[619,1069,1070,1071,1074,1075,1077,1078,1081,1082,1085],{},"The command writes one file, ",[666,1072,1073],{},"backup-target.json",", into the ",[666,1076,697],{}," volume, beside the generated backup key.\nOnly the admin and the worker mount that volume, so the public container never holds the bucket's keys, not even on\nCoolify, which gives every container every variable. The file is replaced whole, readable only by the image's user,\nand the change is in the audit log as made from the console, with the bucket's address and never a key.\n",[666,1079,1080],{},"node console\u002Fbackup-target.mjs show"," says where each setting comes from, and ",[666,1083,1084],{},"clear"," removes the file (backups stop at\nthe next restart).",[619,1087,1088,1089,1092,1093,1096],{},"The variables in the table still work, and a variable you set wins over its line in the file, as a set secret wins\nover a generated one. Without the template (separate containers, or your own setup), set them on the worker and the\nadmin container. The doctor's ",[666,1090,1091],{},"backup-target"," check and the Backups card say whether the target comes from the file,\nthe environment or both. The public container ignores every ",[666,1094,1095],{},"SHADE_BACKUP_*"," variable: it takes no backups, so a target\ngiven to it changes nothing.",[619,1098,1099,1102,1103,1106,1107,1110],{},[729,1100,1101],{},"Telling you when it stops."," If no good backup is younger than 26 hours, SHADE raises a security alert, ",[666,1104,1105],{},"Backups are not running",":\nlisted under Errors and emailed to the admins like the other alerts (Settings switches it off). A failed run is in the error log with its\nreason. ",[666,1108,1109],{},"GET \u002Fapi\u002Fhealth\u002Fbackups"," (admins) gives when the last backup and the last good one were.",[619,1112,1113,1116,1117,1120,1121,1124,1125,1129,1130,1133],{},[729,1114,1115],{},"Rehearsing a restore."," A backup nobody has restored is a hope, so once a week the worker restores the latest one into a scratch\ndatabase and checks it: every part is read against its hash and every encrypted frame, the migrations it lists, the rows of every table,\nand a sample of private files read back with the hash they had. Then it empties the scratch database. Nothing in it is served. The\ndeployment template ships a small second Postgres for it (",[666,1118,1119],{},"postgres-rehearsal",") and sets ",[666,1122,1123],{},"SHADE_BACKUP_REHEARSAL_DATABASE_URL","; on\nyour own setup give it an empty database of its own, on this server or another. The ",[680,1126,1128],{"href":1127},"\u002Frun\u002Fcoolify#the-small-profile","small\nprofile"," has none, so it never rehearses on its own: restore a backup by hand now and then. SHADE refuses the instance's own database, and\nnever empties a scratch database that held something when the rehearsal began, unless a rehearsal of its own filled it: each one\nmarks the scratch database first (an empty schema ",[666,1131,1132],{},"shade_rehearsal","), so the copy left by a rehearsal that was cut off (the\nworker stopped while it restored) is emptied by the next one rather than kept. Until then that copy of your data sits in the\nscratch database. A rehearsal that fails raises the same alert.",[619,1135,1136,1139,1140,1143,1144,1147,1148,1151,1152,1154],{},[729,1137,1138],{},"Before an update's migrations."," The admin container (it applies migrations) takes a backup first, named after the last migration\nthe database held (",[666,1141,1142],{},"backup-\u003Ctime>-from-0038","). When only a module's migrations are new (a module updated), it takes one before\nthose (",[666,1145,1146],{},"backup-\u003Ctime>-plugins","). It takes one backup per start at most. If that backup fails, the migrations are not applied and the\ncontainer stops with the reason; ",[666,1149,1150],{},"SHADE_BACKUP_BEFORE_MIGRATE=false"," migrates without one. A new instance, or a module installed for\nthe first time, has nothing to back up and skips it. Give the admin container the same ",[666,1153,1095],{}," settings as the worker (in the\ndeployment template both read the same file).",[619,1156,1157,1160,1161,906,1163,1166],{},[729,1158,1159],{},"In the admin."," Settings has a Backups card for admins: when the last good backup and rehearsal were, the recent runs and how each\nended, and the two things you can change there, when backups run and how many are kept. What you save replaces the environment's\nvalues (",[666,1162,939],{},[666,1164,1165],{},"SHADE_BACKUP_KEEP_*","). The target and the keys stay on the server: the card shows the bucket's\naddress and whether it was set with the command or in the environment, never a key.",[619,1168,1169,1172,1173,1176,1177,1180],{},[729,1170,1171],{},"Back up now."," The same card has a ",[729,1174,1175],{},"Back up now"," button for admins. The admin container has no worker, so the button queues a job;\nthe worker takes the backup as the system, under the same lock as the nightly one, so the two never run at once. The backup is named\n",[666,1178,1179],{},"backup-\u003Ctime>-manual",", is marked in the runs list and is audited (who asked, and the backup itself). The button waits while a backup\nis running or already asked for.",[619,1182,1183,1186,1187,1190,1191,1194,1195,1197,1198,1201,1202,1205],{},[729,1184,1185],{},"Downloading a backup."," Admins can take a copy of their own from the same card (decision 0007 point 10): ",[729,1188,1189],{},"Download"," beside each good backup\nstill in the bucket. It asks them to sign in again with their password and a two-factor code or a passkey, then the browser saves one\n",[666,1192,1193],{},".tar"," file: a README on restoring it, the manifest and every part exactly as they are in the bucket, still encrypted. SHADE streams it\nfrom the bucket and checks each part's size and hash on the way; a part that does not match ends the download as failed. The bucket's\nkeys never leave the server, and the backup key is never in the admin: without ",[666,1196,693],{}," the file cannot be opened, so hand\nthe key over yourself, apart from the file. Every download is in the audit log as ",[666,1199,1200],{},"data.taken"," (who, which backup, its size, the address as a keyed\nhash) and emailed to every admin, so email must be set up first: until then a download is refused. One download runs at a time, and at most five a day; one that stops part way counts. Only admins\nhave the permission (",[666,1203,1204],{},"backups.download","); a custom role can never be given it.",[619,1207,1208,1211],{},[729,1209,1210],{},"Client programs."," A backup holds SHADE's own data only: the database and the media. The client's programs keep\ntheir data in volumes of their own, and the built-in backup does not copy them. Cover those volumes with your own backups\n(Coolify's volume backups, or a copy of the Docker volume). A service's personal data is still covered by erasures: when you do the\nerasures again after a restore, SHADE asks the services too.",[619,1213,1214,1217,1218,1222,1223,1225,1226,1229,1230,1233,1234,1237,1238,1241,1242,770,1245,1248,1249,770,1252,1255,1256,906,1259,906,1262,1265],{},[729,1215,1216],{},"The database's roles."," SHADE connects as three roles, none a superuser (",[680,1219,1221],{"href":1220},"\u002Frun\u002Fown-server#the-databases-roles","The database's\nroles","). The worker's ",[666,1224,778],{}," and the backup's snapshot run as ",[666,1227,1228],{},"shade_backup","\n(",[666,1231,1232],{},"DATABASE_BACKUP_URL","), which reads every row and cannot write; the console's ",[666,1235,1236],{},"migrate"," and ",[666,1239,1240],{},"restore"," run as the owner,\n",[666,1243,1244],{},"shade",[666,1246,1247],{},"DATABASE_OWNER_URL","); everything else runs as ",[666,1250,1251],{},"shade_app",[666,1253,1254],{},"DATABASE_URL","). The deployment template generates their\npasswords on the first start (",[666,1257,1258],{},"SHADE_DB_PASSWORD",[666,1260,1261],{},"SHADE_DB_OWNER_PASSWORD",[666,1263,1264],{},"SHADE_DB_BACKUP_PASSWORD","). A database made before\nthe three roles cannot be converted: set the instance up again with a fresh database, and restore a backup into it.",[623,1267,1269],{"id":1268},"restoring","Restoring",[619,1271,1272,1275,1276,906,1279,906,1282,1285,1286,1289,1290,1293,1294,906,1296,1298,1299,906,1301,906,1303,906,1306,1309,1310,1237,1313,1315,1316,1318,1319,1321,1322,1325,1326,1328,1329,1332,1333,1336,1337,1339,1340,1343,1344,1347],{},[729,1273,1274],{},"From a built-in backup",", with the restore command (",[666,1277,1278],{},"list",[666,1280,1281],{},"check \u003Cbackup>",[666,1283,1284],{},"restore \u003Cbackup> [--replace]","). Run it where the API runs (",[666,1287,1288],{},"node console\u002Frestore.mjs \u003Ccommand>"," in the image, or\n",[666,1291,1292],{},"pnpm --filter @shadestack\u002Fapi restore"," in a checkout), with the worker's settings (",[666,1295,807],{},[666,1297,693],{},",\nthe bucket's keys, ",[666,1300,1247],{},[666,1302,1254],{},[666,1304,1305],{},"REDIS_URL",[666,1307,1308],{},"STORAGE_LOCAL_ROOT","). The restore changes the schema, so it\nruns as the owner. In the deployment template, run it in the admin container: it reads the owner's address, the backup key and the\ntarget from its ",[666,1311,1312],{},"secrets-owner",[666,1314,697],{}," volumes. On a new server, set the target there first\nwith ",[666,1317,735],{}," (see ",[680,1320,740],{"href":739},"); add ",[666,1323,1324],{},"--no-audit"," while the\ndatabase is still empty, as it has no audit log to record the change in yet. Give it the old backup key as\n",[666,1327,693],{},". Run it ",[729,1330,1331],{},"with the instance closed",": set ",[666,1334,1335],{},"SHADE_MAINTENANCE=true"," on the admin and public\ncontainers and start them again (visitors get SHADE's \"back soon\" answer, see ",[680,1338,94],{"href":95},"), and stop the worker. ",[666,1341,1342],{},"--replace","\nrefuses while a worker wrote its heartbeat in the last two minutes, and when Redis can't be asked about it: if Redis is down and you\nstopped every worker yourself, add ",[666,1345,1346],{},"--worker-stopped",".",[1349,1350,1351,1356,1361,1378,1388,1401,1419,1443],"ol",{},[726,1352,1353,1355],{},[666,1354,1278],{}," shows the backups in the bucket, newest first, with their time, SHADE's version and size.",[726,1357,1358,1360],{},[666,1359,1281],{}," reads one through: every part's size and SHA-256 against the manifest, and every encrypted frame. It changes nothing.",[726,1362,1363,1366,1367,1369,1370,1373,1374,1377],{},[666,1364,1365],{},"restore \u003Cbackup>"," restores into ",[666,1368,1247],{},"'s database, which must be an empty database (a new Postgres, or one you emptied). It checks the backup first, so a\ndamaged or changed one is refused before anything is written; restores the database with ",[666,1371,1372],{},"pg_restore","; restores the uploads into the data volume when\nthe backup holds media and the instance stores them locally; and compares what came back with the manifest: the migrations, the rows of every table and a sample of\nprivate files. It says ",[666,1375,1376],{},"Restored …"," when they all match; a difference ends it with exit code 2 and lists what differs.",[726,1379,1380,1381,1383,1384,1387],{},"A database that is not empty is refused. ",[666,1382,1342],{}," empties it first, after you type the instance's address (the host of ",[666,1385,1386],{},"SHADE_API_URL",") back; the backup is\nchecked before that, so a bad backup never costs you the database you have.",[726,1389,1390,1393,1394,1396,1397,1400],{},[729,1391,1392],{},"Do the erasures again."," A backup does not hold what happened after it. With ",[666,1395,1342],{}," the command lists the erasures of personal data (",[666,1398,1399],{},"privacy.erase",") the old database\nrecorded after the backup was taken; into an empty database it cannot know them, so check your own records. Do them again before the instance is used: a restore must not bring back someone who asked to be forgotten.",[726,1402,1403,1404,1407,1408,1411,1412,1414,1415,1418],{},"The restore leaves ",[729,1405,1406],{},"maintenance mode on"," in the restored database, and says so. Remove ",[666,1409,1410],{},"SHADE_MAINTENANCE"," and start every container with the same ",[666,1413,668],{},"\nand the same addresses (a new template instance generates its own secret: put the old one in place first, as step 1 of \"From your own backups\" below says). The admin applies any newer migrations on start (and, where backups are set up, takes a backup first). The instance starts closed:\nsign in as an admin, do the erasures again, check, and switch maintenance mode off (Settings, or ",[666,1416,1417],{},"node console\u002Fmaintenance.mjs off",").\nIt also clears what modules keep in their cache in Redis (the website's navigation, footer and links, for example), so nothing read from the old data comes back. When\nRedis can't be reached it says so: empty Redis before you start the containers, or those values may show the old data for up to a day.",[726,1420,1421,1424,1425,1427,1428,1431,1432,1435,1436,1439,1440,1442],{},[729,1422,1423],{},"From a downloaded file"," (the admin's ",[729,1426,1189],{},"), use ",[666,1429,1430],{},"--from \u003Cfile>"," instead of the backup's name: ",[666,1433,1434],{},"check --from \u003Cfile>","\nand ",[666,1437,1438],{},"restore --from \u003Cfile> [--replace]",". The command then needs ",[666,1441,693],{}," and none of the bucket's settings, so a\nclient who leaves can restore on a server of their own. Every part's hash and encrypted frame are checked as from the bucket; a\nfile that is not a backup, or one that was cut short, is refused before anything is changed. The file's README says the same.",[726,1444,1445],{},"With S3 media, point the API at the same bucket: a backup does not copy it (the bucket's versioning keeps older versions). The command looks in the bucket\n(a read-only listing, nothing is written or deleted) and says which of the media keys the backup recorded are missing from it now. Rebuild the site once, from the admin's Builds screen or the build hook.",[619,1447,1448,1449,1451,1452,1454],{},"The key is the one the backups were made with: keep ",[666,1450,693],{}," with ",[666,1453,668],{},", in a place the bucket is not. Without it a backup cannot be opened.",[619,1456,1457,1460,1461,1463,1464,1467,1468,1471,1472,1474],{},[729,1458,1459],{},"From your own backups"," (Coolify's scheduled Postgres backups, or ",[666,1462,778],{},"). The order matters: the secret comes\nfirst, then the database, and nothing of the API starts until the instance is closed. With the template, run the\n",[666,1465,1466],{},"docker compose"," commands from its folder (on Coolify, ",[666,1469,1470],{},"\u002Fdata\u002Fcoolify\u002Fservices\u002F\u003Cresource uuid>\u002F",", where the ",[666,1473,778],{},"\nbelow works as written too).",[1349,1476,1477,1634,1852,1885,1981,2007],{},[726,1478,1479,1485,1486,1488,1489,1491,1492,1495,1496,1620,1622,1623,1625,1626,1629,1630,1633],{},[729,1480,1481,1482,1484],{},"Put ",[666,1483,668],{}," in place."," The sealed values in the backup (providers' keys, two-factor secrets) open only with the ",[666,1487,668],{}," they were sealed with. A new\ntemplate instance generates a secret of its own on its first start, which opens nothing the old one sealed, and\nPostgres in the template starts the ",[666,1490,674],{}," service first, so this step comes before anything starts. Read the old\nvalue on the old server without printing it into a log or a chat:\n",[666,1493,1494],{},"docker exec \u003Cthe admin container> cat \u002Fapp\u002Fsecrets\u002Fapp\u002FAPP_SECRET",". Then use one of two routes:",[723,1497,1498,1507],{},[726,1499,1500,1503,1504,1506],{},[729,1501,1502],{},"The environment."," Set the old value as ",[666,1505,668],{}," in the new resource's environment. This works at any time,\nand a value set there wins over any generated file. Keep it set: removing it later brings back a generated one.",[726,1508,1509,1512,1513,1603,1606,1607,1609,1610,1612,1613,1615,1616,1619],{},[729,1510,1511],{},"The secrets file",", only before the new instance's first start. On Coolify the volume does not exist before the\nfirst deploy, so make it, and give the file the owner the containers read it as:",[989,1514,1516],{"className":991,"code":1515,"language":993,"meta":994,"style":994},"docker volume create \u003Cproject>_secrets\ncd \u002Fvar\u002Flib\u002Fdocker\u002Fvolumes\u002F\u003Cproject>_secrets\u002F_data   # write the old value into APP_SECRET here, then:\nchown 1000:1000 . APP_SECRET && chmod 750 . && chmod 400 APP_SECRET\n",[666,1517,1518,1541,1566],{"__ignoreMap":994},[998,1519,1520,1523,1525,1528,1530,1533,1536,1538],{"class":1000,"line":1001},[998,1521,1522],{"class":1004},"docker",[998,1524,675],{"class":1008},[998,1526,1527],{"class":1008}," create",[998,1529,1025],{"class":1024},[998,1531,1532],{"class":1008},"projec",[998,1534,1535],{"class":1034},"t",[998,1537,1038],{"class":1024},[998,1539,1540],{"class":1008},"_secrets\n",[998,1542,1543,1547,1550,1553,1555,1557,1559,1562],{"class":1000,"line":1044},[998,1544,1546],{"class":1545},"s2Zo4","cd",[998,1548,1549],{"class":1008}," \u002Fvar\u002Flib\u002Fdocker\u002Fvolumes\u002F",[998,1551,1552],{"class":1024},"\u003C",[998,1554,1532],{"class":1008},[998,1556,1535],{"class":1034},[998,1558,1038],{"class":1024},[998,1560,1561],{"class":1008},"_secrets\u002F_data",[998,1563,1565],{"class":1564},"sHwdD","   # write the old value into APP_SECRET here, then:\n",[998,1567,1569,1572,1575,1578,1581,1584,1587,1591,1593,1595,1597,1600],{"class":1000,"line":1568},3,[998,1570,1571],{"class":1004},"chown",[998,1573,1574],{"class":1008}," 1000:1000",[998,1576,1577],{"class":1008}," .",[998,1579,1580],{"class":1008}," APP_SECRET",[998,1582,1583],{"class":1024}," &&",[998,1585,1586],{"class":1004}," chmod",[998,1588,1590],{"class":1589},"sbssI"," 750",[998,1592,1577],{"class":1008},[998,1594,1583],{"class":1024},[998,1596,1586],{"class":1004},[998,1598,1599],{"class":1589}," 400",[998,1601,1602],{"class":1008}," APP_SECRET\n",[1604,1605],"br",{},"The ",[666,1608,674],{}," service then reuses the file. Compose warns that the volume \"already exists but was not created by\nDocker Compose\"; that is harmless. Without the ",[666,1611,1571],{}," the ",[666,1614,674],{}," service stops with ",[666,1617,1618],{},"APP_SECRET in SHADE_SECRETS_DIR cannot be read: EACCES",", and nothing else starts.",[1604,1621],{},"A backup made before ",[666,1624,668],{}," was ",[680,1627,1628],{"href":55},"rotated"," needs the old one in ",[666,1631,1632],{},"APP_SECRET_PREVIOUS","\ntoo, as step 5 says.",[726,1635,1636,1639,1640,1642,1643,1719,1721,1722,1725,1726,1784,1786,1787,1791,1792,1794,1795,1842,1844,1847,1848,1851],{},[729,1637,1638],{},"Restore the database into an empty Postgres."," On a new template instance, start only Postgres (it runs ",[666,1641,674],{},"\nfirst), then restore:",[989,1644,1646],{"className":991,"code":1645,"language":993,"meta":994,"style":994},"docker compose up -d postgres\ndocker compose exec -T postgres pg_restore --no-owner --no-privileges --exit-on-error -U shade -d shade \u003C shade-\u003Cdate>.dump\n",[666,1647,1648,1664],{"__ignoreMap":994},[998,1649,1650,1652,1655,1658,1661],{"class":1000,"line":1001},[998,1651,1522],{"class":1004},[998,1653,1654],{"class":1008}," compose",[998,1656,1657],{"class":1008}," up",[998,1659,1660],{"class":1008}," -d",[998,1662,1663],{"class":1008}," postgres\n",[998,1665,1666,1668,1670,1673,1676,1679,1682,1685,1688,1691,1694,1697,1699,1701,1703,1706,1708,1711,1714,1716],{"class":1000,"line":1044},[998,1667,1522],{"class":1004},[998,1669,1654],{"class":1008},[998,1671,1672],{"class":1008}," exec",[998,1674,1675],{"class":1008}," -T",[998,1677,1678],{"class":1008}," postgres",[998,1680,1681],{"class":1008}," pg_restore",[998,1683,1684],{"class":1008}," --no-owner",[998,1686,1687],{"class":1008}," --no-privileges",[998,1689,1690],{"class":1008}," --exit-on-error",[998,1692,1693],{"class":1008}," -U",[998,1695,1696],{"class":1008}," shade",[998,1698,1660],{"class":1008},[998,1700,1696],{"class":1008},[998,1702,1025],{"class":1024},[998,1704,1705],{"class":1008}," shade-",[998,1707,1552],{"class":1024},[998,1709,1710],{"class":1008},"dat",[998,1712,1713],{"class":1034},"e",[998,1715,1038],{"class":1024},[998,1717,1718],{"class":1008},".dump\n",[1604,1720],{},"On an instance that has already started (any deployed Coolify resource), the database is not empty: the restore\nwould fail with ",[666,1723,1724],{},"schema \"drizzle\" already exists",". Stop the API containers and drop the database:",[989,1727,1729],{"className":991,"code":1728,"language":993,"meta":994,"style":994},"docker compose stop admin public worker\ndocker compose exec -T postgres psql -U postgres -d postgres -c 'DROP DATABASE shade'\n",[666,1730,1731,1749],{"__ignoreMap":994},[998,1732,1733,1735,1737,1740,1743,1746],{"class":1000,"line":1001},[998,1734,1522],{"class":1004},[998,1736,1654],{"class":1008},[998,1738,1739],{"class":1008}," stop",[998,1741,1742],{"class":1008}," admin",[998,1744,1745],{"class":1008}," public",[998,1747,1748],{"class":1008}," worker\n",[998,1750,1751,1753,1755,1757,1759,1761,1764,1766,1768,1770,1772,1775,1778,1781],{"class":1000,"line":1044},[998,1752,1522],{"class":1004},[998,1754,1654],{"class":1008},[998,1756,1672],{"class":1008},[998,1758,1675],{"class":1008},[998,1760,1678],{"class":1008},[998,1762,1763],{"class":1008}," psql",[998,1765,1693],{"class":1008},[998,1767,1678],{"class":1008},[998,1769,1660],{"class":1008},[998,1771,1678],{"class":1008},[998,1773,1774],{"class":1008}," -c",[998,1776,1777],{"class":1024}," '",[998,1779,1780],{"class":1008},"DROP DATABASE shade",[998,1782,1783],{"class":1024},"'\n",[1604,1785],{},"Then make it again, empty and with the owner's default privileges, as ",[680,1788,1790],{"href":1789},"#an-empty-database","An empty database"," shows\nwith ",[666,1793,1244],{}," as the name, and restore into it:",[989,1796,1798],{"className":991,"code":1797,"language":993,"meta":994,"style":994},"docker compose exec -T postgres pg_restore --no-owner --no-privileges --exit-on-error -U shade -d shade \u003C shade-\u003Cdate>.dump\n",[666,1799,1800],{"__ignoreMap":994},[998,1801,1802,1804,1806,1808,1810,1812,1814,1816,1818,1820,1822,1824,1826,1828,1830,1832,1834,1836,1838,1840],{"class":1000,"line":1001},[998,1803,1522],{"class":1004},[998,1805,1654],{"class":1008},[998,1807,1672],{"class":1008},[998,1809,1675],{"class":1008},[998,1811,1678],{"class":1008},[998,1813,1681],{"class":1008},[998,1815,1684],{"class":1008},[998,1817,1687],{"class":1008},[998,1819,1690],{"class":1008},[998,1821,1693],{"class":1008},[998,1823,1696],{"class":1008},[998,1825,1660],{"class":1008},[998,1827,1696],{"class":1008},[998,1829,1025],{"class":1024},[998,1831,1705],{"class":1008},[998,1833,1552],{"class":1024},[998,1835,1710],{"class":1008},[998,1837,1713],{"class":1034},[998,1839,1038],{"class":1024},[998,1841,1718],{"class":1008},[1604,1843],{},[666,1845,1846],{},"-T"," matters: without it ",[666,1849,1850],{},"docker compose exec"," allocates a terminal and the dump on standard input is lost.",[726,1853,1854,1857,1858,1860,1861,987,1863,1878,1880,1881,1884],{},[729,1855,1856],{},"Close the instance before the API starts."," A restore by hand does not switch maintenance mode on, and a copy that\nkeeps the same addresses runs at once: its worker runs the schedules and build hooks, and sends whatever email was\nqueued when the dump was taken. Switch maintenance on in the restored database first. It needs only ",[666,1859,1254],{},", as ",[666,1862,1251],{},[989,1864,1866],{"className":991,"code":1865,"language":993,"meta":994,"style":994},"node console\u002Fmaintenance.mjs on\n",[666,1867,1868],{"__ignoreMap":994},[998,1869,1870,1872,1875],{"class":1000,"line":1001},[998,1871,1005],{"class":1004},[998,1873,1874],{"class":1008}," console\u002Fmaintenance.mjs",[998,1876,1877],{"class":1008}," on\n",[1604,1879],{},"Run it in a container of the image (",[666,1882,1883],{},"docker compose run --rm --no-deps admin node console\u002Fmaintenance.mjs on"," with\nthe template). Switch maintenance off again once you have checked the copy.",[726,1886,1887,1890,1891,1894,1895,987,1898,1940,1942,1943,1946,1947],{},[729,1888,1889],{},"Restore the data volume",", or point the API at the same bucket. Only ",[666,1892,1893],{},"uploads\u002F"," in the volume matters: the packages\nof installed modules are in the database and unpack again at every start. With the volume on the old server, and its\nname from ",[666,1896,1897],{},"docker volume ls",[989,1899,1901],{"className":991,"code":1900,"language":993,"meta":994,"style":994},"tar --numeric-owner -C \u002Fvar\u002Flib\u002Fdocker\u002Fvolumes\u002F\u003Cold volume>\u002F_data -cf data.tar .\n",[666,1902,1903],{"__ignoreMap":994},[998,1904,1905,1908,1911,1914,1916,1918,1921,1924,1926,1928,1931,1934,1937],{"class":1000,"line":1001},[998,1906,1907],{"class":1004},"tar",[998,1909,1910],{"class":1008}," --numeric-owner",[998,1912,1913],{"class":1008}," -C",[998,1915,1549],{"class":1008},[998,1917,1552],{"class":1024},[998,1919,1920],{"class":1008},"old",[998,1922,1923],{"class":1008}," volum",[998,1925,1713],{"class":1034},[998,1927,1038],{"class":1024},[998,1929,1930],{"class":1008},"\u002F_data",[998,1932,1933],{"class":1008}," -cf",[998,1935,1936],{"class":1008}," data.tar",[998,1938,1939],{"class":1008}," .\n",[1604,1941],{},"Copy ",[666,1944,1945],{},"data.tar"," to the new server, then unpack it there as root; the folder belongs to uid 1000:",[989,1948,1950],{"className":991,"code":1949,"language":993,"meta":994,"style":994},"tar --numeric-owner -xpf data.tar -C \u002Fvar\u002Flib\u002Fdocker\u002Fvolumes\u002F\u003Cnew volume>\u002F_data\n",[666,1951,1952],{"__ignoreMap":994},[998,1953,1954,1956,1958,1961,1963,1965,1967,1969,1972,1974,1976,1978],{"class":1000,"line":1001},[998,1955,1907],{"class":1004},[998,1957,1910],{"class":1008},[998,1959,1960],{"class":1008}," -xpf",[998,1962,1936],{"class":1008},[998,1964,1913],{"class":1008},[998,1966,1549],{"class":1008},[998,1968,1552],{"class":1024},[998,1970,1971],{"class":1008},"new",[998,1973,1923],{"class":1008},[998,1975,1713],{"class":1034},[998,1977,1038],{"class":1024},[998,1979,1980],{"class":1008},"\u002F_data\n",[726,1982,1983,1986,1987,1989,1990,1993,1994,1997,1998,2000,2001,2003,2004,1347],{},[729,1984,1985],{},"Start the API containers"," with the same ",[666,1988,668],{}," and the same addresses. They apply any newer migrations on\nstart. On Coolify, start them with ",[729,1991,1992],{},"Redeploy",", so they take the environment as it is now; ",[666,1995,1996],{},"docker compose start","\nkeeps the environment the containers were created with. For a drill, stop the worker again after the redeploy (on\na new template instance, leave it out). A backup made before ",[666,1999,668],{}," was\nrotated needs the old secret in ",[666,2002,1632],{},", then ",[666,2005,2006],{},"node console\u002Frotate-secrets.mjs",[726,2008,2009],{},"Rebuild the site once, from the admin's Builds screen or the build hook.",[623,2011,1790],{"id":2012},"an-empty-database",[619,2014,2015,2016,2018,2019,2022,2023,2025,2026,2028,2029,2032,2033,2035,2036,2039],{},"A restore by hand, and the restore drill, need an empty database for SHADE. The owner ",[666,2017,1244],{}," may not create databases,\nso the bootstrap user ",[666,2020,2021],{},"postgres"," makes it, owned by ",[666,2024,1244],{},", and gives it the owner's default privileges, as the init\nscript does for the instance's first database. Default privileges belong to one database: without them ",[666,2027,1251],{},"\ncould not read or write the tables the restore makes. With the template, and ",[666,2030,2031],{},"\u003Cname>"," the database's name (",[666,2034,1244],{}," for\nthe instance's own, ",[666,2037,2038],{},"shade_drill"," for a drill):",[989,2041,2043],{"className":991,"code":2042,"language":993,"meta":994,"style":994},"docker compose exec -T postgres psql -U postgres -d postgres -c 'CREATE DATABASE \u003Cname> OWNER shade'\ndocker compose exec -T postgres psql -U postgres -d \u003Cname> -c \"\n  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT USAGE ON SCHEMAS TO shade_app, shade_backup;\n  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO shade_app;\n  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT USAGE, SELECT ON SEQUENCES TO shade_app;\n  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT SELECT ON TABLES TO shade_backup;\n  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT SELECT ON SEQUENCES TO shade_backup;\"\n",[666,2044,2045,2076,2110,2115,2121,2127,2133],{"__ignoreMap":994},[998,2046,2047,2049,2051,2053,2055,2057,2059,2061,2063,2065,2067,2069,2071,2074],{"class":1000,"line":1001},[998,2048,1522],{"class":1004},[998,2050,1654],{"class":1008},[998,2052,1672],{"class":1008},[998,2054,1675],{"class":1008},[998,2056,1678],{"class":1008},[998,2058,1763],{"class":1008},[998,2060,1693],{"class":1008},[998,2062,1678],{"class":1008},[998,2064,1660],{"class":1008},[998,2066,1678],{"class":1008},[998,2068,1774],{"class":1008},[998,2070,1777],{"class":1024},[998,2072,2073],{"class":1008},"CREATE DATABASE \u003Cname> OWNER shade",[998,2075,1783],{"class":1024},[998,2077,2078,2080,2082,2084,2086,2088,2090,2092,2094,2096,2098,2101,2103,2105,2107],{"class":1000,"line":1044},[998,2079,1522],{"class":1004},[998,2081,1654],{"class":1008},[998,2083,1672],{"class":1008},[998,2085,1675],{"class":1008},[998,2087,1678],{"class":1008},[998,2089,1763],{"class":1008},[998,2091,1693],{"class":1008},[998,2093,1678],{"class":1008},[998,2095,1660],{"class":1008},[998,2097,1025],{"class":1024},[998,2099,2100],{"class":1008},"nam",[998,2102,1713],{"class":1034},[998,2104,1038],{"class":1024},[998,2106,1774],{"class":1008},[998,2108,2109],{"class":1024}," \"\n",[998,2111,2112],{"class":1000,"line":1568},[998,2113,2114],{"class":1008},"  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT USAGE ON SCHEMAS TO shade_app, shade_backup;\n",[998,2116,2118],{"class":1000,"line":2117},4,[998,2119,2120],{"class":1008},"  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO shade_app;\n",[998,2122,2124],{"class":1000,"line":2123},5,[998,2125,2126],{"class":1008},"  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT USAGE, SELECT ON SEQUENCES TO shade_app;\n",[998,2128,2130],{"class":1000,"line":2129},6,[998,2131,2132],{"class":1008},"  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT SELECT ON TABLES TO shade_backup;\n",[998,2134,2136,2139],{"class":1000,"line":2135},7,[998,2137,2138],{"class":1008},"  ALTER DEFAULT PRIVILEGES FOR ROLE shade GRANT SELECT ON SEQUENCES TO shade_backup;",[998,2140,2141],{"class":1024},"\"\n",[619,2143,2144,2145,2148,2149,2152,2153,2156],{},"These are the lines ",[666,2146,2147],{},"databaseRolesSql"," writes after ",[666,2150,2151],{},"\\connect"," (SHADE's ",[666,2154,2155],{},"shade\u002Fkernel\u002Fdb\u002Froles.ts","); the deployment\ntemplate's init script holds the same.",[623,2158,2160],{"id":2159},"restore-drill","Restore drill",[619,2162,2163],{},"The weekly rehearsal restores the database part and compares rows. A drill goes further: it brings a whole copy of the instance\nback on the side, starts SHADE on it and looks at it as a person would, while the instance keeps running. Do one when you set an\ninstance up, after a major update of SHADE or Postgres, and at least once a year. It takes about half an hour.",[1349,2165,2166,2175,2187,2252,2299,2341],{},[726,2167,2168,2171,2172,2174],{},[729,2169,2170],{},"Take a backup."," On the Backups card, press ",[729,2173,1175],{}," and wait until the run says it ended well. Without built-in\nbackups, make a dump yourself (see the last step).",[726,2176,2177,2180,2181,2183,2184,2186],{},[729,2178,2179],{},"Make an empty database for the copy",", on the same Postgres or another one, as ",[680,2182,1790],{"href":1789},"\nshows with ",[666,2185,2038],{}," as the name.",[726,2188,2189,2192,2193,1237,2195,2197,2198,1237,2200,2202,2203,2245,2247,2248,2251],{},[729,2190,2191],{},"Restore into it",", never into the instance's own database. Run the restore command in a container of the image with the\nadmin's environment, but with ",[666,2194,1247],{},[666,2196,1254],{}," pointing at ",[666,2199,2038],{},[666,2201,1308],{}," at an\nempty folder of its own:",[989,2204,2206],{"className":991,"code":2205,"language":993,"meta":994,"style":994},"node console\u002Frestore.mjs check \u003Cbackup>\nnode console\u002Frestore.mjs restore \u003Cbackup>\n",[666,2207,2208,2228],{"__ignoreMap":994},[998,2209,2210,2212,2215,2218,2220,2223,2225],{"class":1000,"line":1001},[998,2211,1005],{"class":1004},[998,2213,2214],{"class":1008}," console\u002Frestore.mjs",[998,2216,2217],{"class":1008}," check",[998,2219,1025],{"class":1024},[998,2221,2222],{"class":1008},"backu",[998,2224,619],{"class":1034},[998,2226,2227],{"class":1024},">\n",[998,2229,2230,2232,2234,2237,2239,2241,2243],{"class":1000,"line":1044},[998,2231,1005],{"class":1004},[998,2233,2214],{"class":1008},[998,2235,2236],{"class":1008}," restore",[998,2238,1025],{"class":1024},[998,2240,2222],{"class":1008},[998,2242,619],{"class":1034},[998,2244,2227],{"class":1024},[1604,2246],{},"It must end with ",[666,2249,2250],{},"Restored \u003Cbackup>: … tables, the migrations and the sample of private files match the backup."," and exit\ncode 0. It leaves maintenance mode on in the copy.",[726,2253,2254,2257,2258,2261,2262,2264,2265,2267,2268,2271,2272,2275,2276,2278,2279,2281,2282,2284,2285,2288,2289,2292,2293,2295,2296,2298],{},[729,2255,2256],{},"Start SHADE on the copy",": one container with ",[666,2259,2260],{},"SHADE_API_ROLE=all",", the instance's own ",[666,2263,668],{}," (a template instance keeps it in its ",[666,2266,674],{}," volume: read it as step 1 of \"From your own backups\" under ",[680,2269,1269],{"href":2270},"#restoring"," says) and ",[666,2273,2274],{},"SHADE_TRUSTED_MODULE_KEYS"," as\nthe instance, ",[666,2277,1254],{}," (as ",[666,2280,1251],{},") and ",[666,2283,1308],{}," of the copy, its own ",[666,2286,2287],{},"REDIS_PREFIX",", an empty folder for\n",[666,2290,2291],{},"MODULE_PACKAGES_DIR"," (the installed module packages are in the database and unpack again), and an address only you reach.\nLeave ",[666,2294,807],{}," out and don't mount the ",[666,2297,697],{}," volume, which holds the target, so the copy takes no\nbackups into the instance's bucket.",[726,2300,2301,987,2304],{},[729,2302,2303],{},"Check it",[723,2305,2306,2313,2316,2323,2326,2333,2338],{},[726,2307,2308,2309,2312],{},"an admin signs in, and the admin says maintenance mode is on, switched on by ",[666,2310,2311],{},"system: restore",". Switch it off;",[726,2314,2315],{},"the Modules page lists every module as on and running;",[726,2317,2318,2319,2322],{},"the site's pages come back: ",[666,2320,2321],{},"GET \u002Fapi\u002Fv1\u002Fcontent\u002Fwebsite\u002Fpages"," with the site's read token lists them, or build the site\nagainst the copy;",[726,2324,2325],{},"module data is there: an order under Orders, a booking, a form submission in the form's inbox;",[726,2327,2328,2329,2332],{},"an uploaded image opens at its ",[666,2330,2331],{},"\u002Fuploads\u002F…"," address;",[726,2334,2335,2336,822],{},"the Email page shows the settings as set up. If it asks to enter the secret again, the copy runs with another ",[666,2337,668],{},[726,2339,2340],{},"a visitor with an account signs in on the site.",[726,2342,2343,2346,2347,2349],{},[729,2344,2345],{},"Clean up."," Stop the container, drop ",[666,2348,2038],{}," and delete the media folder: the copy holds the instance's personal data.\nWrite down the date, the backup's name and what you checked.",[619,2351,2352,2355,2356,2358,2359,2361],{},[729,2353,2354],{},"The database by hand."," Where the host's own backups or a ",[666,2357,778],{}," are the main line, the drill is the same with your own dump.\nMake it as the owner ",[666,2360,1244],{},", in the custom format, and keep the file off the server:",[989,2363,2365],{"className":991,"code":2364,"language":993,"meta":994,"style":994},"docker compose exec -T postgres pg_dump -U shade -d shade --format=custom > shade-$(date +%F).dump\n",[666,2366,2367],{"__ignoreMap":994},[998,2368,2369,2371,2373,2375,2377,2379,2382,2384,2386,2388,2390,2393,2396,2398,2401,2404,2407,2410],{"class":1000,"line":1001},[998,2370,1522],{"class":1004},[998,2372,1654],{"class":1008},[998,2374,1672],{"class":1008},[998,2376,1675],{"class":1008},[998,2378,1678],{"class":1008},[998,2380,2381],{"class":1008}," pg_dump",[998,2383,1693],{"class":1008},[998,2385,1696],{"class":1008},[998,2387,1660],{"class":1008},[998,2389,1696],{"class":1008},[998,2391,2392],{"class":1008}," --format=custom",[998,2394,2395],{"class":1024}," >",[998,2397,1705],{"class":1008},[998,2399,2400],{"class":1024},"$(",[998,2402,2403],{"class":1004},"date",[998,2405,2406],{"class":1008}," +%F",[998,2408,2409],{"class":1024},")",[998,2411,1718],{"class":1008},[619,2413,2414],{},"Restore it into the empty database with",[989,2416,2418],{"className":991,"code":2417,"language":993,"meta":994,"style":994},"docker compose exec -T postgres pg_restore --no-owner --no-privileges --exit-on-error -U shade -d shade_drill \u003C shade-\u003Cdate>.dump\n",[666,2419,2420],{"__ignoreMap":994},[998,2421,2422,2424,2426,2428,2430,2432,2434,2436,2438,2440,2442,2444,2446,2449,2451,2453,2455,2457,2459,2461],{"class":1000,"line":1001},[998,2423,1522],{"class":1004},[998,2425,1654],{"class":1008},[998,2427,1672],{"class":1008},[998,2429,1675],{"class":1008},[998,2431,1678],{"class":1008},[998,2433,1681],{"class":1008},[998,2435,1684],{"class":1008},[998,2437,1687],{"class":1008},[998,2439,1690],{"class":1008},[998,2441,1693],{"class":1008},[998,2443,1696],{"class":1008},[998,2445,1660],{"class":1008},[998,2447,2448],{"class":1008}," shade_drill",[998,2450,1025],{"class":1024},[998,2452,1705],{"class":1008},[998,2454,1552],{"class":1024},[998,2456,1710],{"class":1008},[998,2458,1713],{"class":1034},[998,2460,1038],{"class":1024},[998,2462,1718],{"class":1008},[619,2464,2465,2466,2468,2469,2472,2473,2475,2476,2479],{},"and copy the data volume's ",[666,2467,1893],{}," folder into the copy's media folder: nothing else in the volume matters, as the\nmodule packages unpack again from the database (",[680,2470,2471],{"href":2270},"the commands","). A restore by hand does not switch\nmaintenance mode on. Switch it on against ",[666,2474,2038],{}," before the copy starts with ",[666,2477,2478],{},"docker compose run --rm --no-deps -e DATABASE_URL=postgres:\u002F\u002Fshade_app@postgres:5432\u002Fshade_drill -e DATABASE_OWNER_URL=postgres:\u002F\u002Fshade@postgres:5432\u002Fshade_drill admin node console\u002Fmaintenance.mjs on",", and leave the\nworker out, or it runs schedules and sends queued email from the copy. Then go on from step 4.",[623,2481,2483],{"id":2482},"updating-shade","Updating SHADE",[723,2485,2486,2498,2518,2534,2561,2566],{},[726,2487,2488,2490,2491,2493,2494,2497],{},[729,2489,731],{},": push to the tracked branch, or press ",[729,2492,1992],{},". The API container with the admin role applies new\nmigrations when it starts (",[666,2495,2496],{},"MIGRATE_ON_START=true","), SHADE's and then its modules'; the public and worker containers\nnever migrate: they wait, not ready, until the database holds both.",[726,2499,2500,2502,2503,2506,2507,2510,2511,2513,2514,2517],{},[729,2501,754],{},": ",[666,2504,2505],{},"sudo shade update --version \u003Cversion>"," pulls the image and the versions it pins, and\nrestarts the admin, then public, then the worker, each healthy before the next (",[680,2508,774],{"href":2509},"\u002Frun\u002Fown-server#updating","). Set up by hand: update the checkout or the image, then restart the admin role\nfirst, or run the ",[666,2512,1236],{}," console command (",[680,2515,50],{"href":2516},"\u002Frun\u002Fconsole#migrate","), before the other roles.",[726,2519,2520,2523,2524,1237,2527,2530,2531,749],{},[729,2521,2522],{},"On Coolify, the gap",": a redeploy of the compose template recreates every changed container at once, and Coolify does\nnot roll a compose resource. Expect 10 to 60 seconds, longer when a migration is slow, in which visitors and the team get\nthe proxy's own \"not found\" page rather than SHADE's. Plan it for a quiet hour. ",[666,2525,2526],{},"public",[666,2528,2529],{},"worker"," wait for the new\nadmin's health, so they come back after it. For updates without a gap you need the server of your own\n(",[680,2532,70],{"href":2533},"\u002Frun\u002Fown-server#what-is-without-a-gap-and-what-is-not",[726,2535,2536,2539,2540,2543,2544,2547,2548,2551,2552,2555,2556,2560],{},[729,2537,2538],{},"On Coolify, a release that needs maintenance",": the changelog marks it. Take a backup, switch\n",[680,2541,2542],{"href":95},"maintenance mode"," on (Settings, or ",[666,2545,2546],{},"node console\u002Fmaintenance.mjs on"," in the admin container)\nbefore you redeploy, and off again once the admin's ",[666,2549,2550],{},"\u002Fhealth"," answers and the Modules screen shows what it should.\n",[666,2553,2554],{},"shade update --maintenance"," does this only on a server of your own, and nothing does it for you on Coolify. The other\nreleases only add to the database\n(",[680,2557,2559],{"href":2558},"\u002Frun\u002Fown-server#migrations-only-add","Migrations only add","), so the redeploy needs no maintenance beyond the restart\nitself.",[726,2562,2563,2565],{},[729,2564,189],{},": after an update that changes SHADE's version or a module's, the admin container asks for one rebuild\nof the site and every other frontend with a build hook when it starts, as publishing does (held while the instance\nis in maintenance). A site that builds on its own server and not from a build hook still needs a redeploy.",[726,2567,2568,2570,2571,2575],{},[729,2569,317],{},": an installed module package keeps working as long as it was made for the instance's SHADE version. One\nmade for another version is left out when the API starts: the Modules screen shows it as ",[2572,2573,2574],"em",{},"Not running",", with why.\nInstall its new build there.",[619,2577,2578,2579,2582,2583,2586],{},"Each start of the admin container that applied a migration, or runs another SHADE or module version than before,\nis written down in the database's ",[666,2580,2581],{},"upgrade_history"," table: the versions before and after, the migrations applied,\nwhich container ran it, the backup taken before its migrations, and when. It is part of every backup. Admins see it\nunder ",[729,2584,2585],{},"Settings → Updates",": each update with its versions, the modules that changed, how many database changes it\nmade and the backup taken before them.",[619,2588,2589,2590,2593],{},"Read the ",[680,2591,2592],{"href":600},"changelog"," before updating: it says which changes need something of the\noperator, before or after.",[970,2595,2597],{"id":2596},"previewing-an-update","Previewing an update",[619,2599,2600,2601,906,2604,2607],{},"Each release has a ",[729,2602,2603],{},"release file",[666,2605,2606],{},"shade-\u003Cversion>.release.json",", attached to it on GitHub: the release's database\nchanges, each with a line saying what it does, and the steps an operator takes for each release. Preview what\nupdating means for this instance before you update:",[723,2609,2610,2623],{},[726,2611,2612,2615,2616,2618,2619,2622],{},[729,2613,2614],{},"In the admin",": under ",[729,2617,2585],{},", choose ",[729,2620,2621],{},"Choose a release file"," and pick the file. Only\nadmins can.",[726,2624,2625,2502,2628,2631,2632,2635,2636,2639],{},[729,2626,2627],{},"On the server",[666,2629,2630],{},"pnpm --filter @shadestack\u002Fapi update-preview shade-\u003Cversion>.release.json"," (in the image:\n",[666,2633,2634],{},"node console\u002Fupdate-preview.mjs \u003Cfile>","). Add ",[666,2637,2638],{},"--json"," for the preview as JSON. Without a file it previews\nthis image's own release against the database, which is how to check after pulling an image and before\nrestarting. It exits with 0 when the update is ready, 2 when it isn't.",[619,2641,2642],{},"The preview lists:",[723,2644,2645,2648,2651,2658],{},[726,2646,2647],{},"the steps for every release between the version running and the file's, oldest first; a step for a module only\nshows when that module is installed;",[726,2649,2650],{},"the database changes it will make, those this database doesn't have yet;",[726,2652,2653,2654,2657],{},"the installed modules that won't run after it, and why: made for other SHADE versions, or built on one that is\nleft out; a module with an update staged for that SHADE (",[680,2655,317],{"href":2656},"\u002Fguide\u002Fmodules\u002Fmanaging#trusted-modules",")\ncounts as that update;",[726,2659,2660,2661,749],{},"the background tasks not done yet, which an update may need first (",[680,2662,2664],{"href":2663},"#background-tasks","below",[619,2666,2667,2668,2671,2672,749],{},"It says ",[729,2669,2670],{},"Ready"," when no module is left out and nothing blocks. The preview changes nothing and runs\nnothing. The file is checked before it is read, and anything that isn't a release file, or is larger than 512 KB,\nis refused. An admin's preview is in the audit log (",[666,2673,2674],{},"upgrades.preview",[970,2676,2678],{"id":2677},"knowing-when-there-is-a-new-version","Knowing when there is a new version",[619,2680,2681,2682,2685,2686,2689,2690,2693],{},"SHADE asks nobody about newer versions unless you set an ",[729,2683,2684],{},"update feed",": off by default, with no default address.\nSet ",[666,2687,2688],{},"SHADE_UPDATE_FEED_URL"," on the admin container to the https address of a feed you choose, and ",[729,2691,2692],{},"Settings →\nUpdates"," says when it lists a version newer than the one running, with a link to its release notes. It only tells:\nnothing is downloaded or installed, and updating stays your step.",[619,2695,2696],{},"The feed is a small JSON file:",[989,2698,2702],{"className":2699,"code":2700,"language":2701,"meta":994,"style":994},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{ \"format\": 1, \"releases\": [{ \"version\": \"0.2.0\", \"date\": \"2026-12-01\", \"notes\": \"https:\u002F\u002Fexample.org\u002Freleases\u002F0.2.0\" }] }\n","json",[666,2703,2704],{"__ignoreMap":994},[998,2705,2706,2709,2712,2716,2719,2721,2724,2727,2729,2732,2734,2736,2739,2741,2744,2746,2748,2750,2753,2755,2757,2759,2761,2763,2765,2767,2770,2772,2774,2776,2779,2781,2783,2785,2788,2790,2793],{"class":1000,"line":1001},[998,2707,2708],{"class":1024},"{",[998,2710,2711],{"class":1024}," \"",[998,2713,2715],{"class":2714},"spNyl","format",[998,2717,2718],{"class":1024},"\"",[998,2720,987],{"class":1024},[998,2722,2723],{"class":1589}," 1",[998,2725,2726],{"class":1024},",",[998,2728,2711],{"class":1024},[998,2730,2731],{"class":2714},"releases",[998,2733,2718],{"class":1024},[998,2735,987],{"class":1024},[998,2737,2738],{"class":1024}," [{",[998,2740,2711],{"class":1024},[998,2742,2743],{"class":1004},"version",[998,2745,2718],{"class":1024},[998,2747,987],{"class":1024},[998,2749,2711],{"class":1024},[998,2751,2752],{"class":1008},"0.2.0",[998,2754,2718],{"class":1024},[998,2756,2726],{"class":1024},[998,2758,2711],{"class":1024},[998,2760,2403],{"class":1004},[998,2762,2718],{"class":1024},[998,2764,987],{"class":1024},[998,2766,2711],{"class":1024},[998,2768,2769],{"class":1008},"2026-12-01",[998,2771,2718],{"class":1024},[998,2773,2726],{"class":1024},[998,2775,2711],{"class":1024},[998,2777,2778],{"class":1004},"notes",[998,2780,2718],{"class":1024},[998,2782,987],{"class":1024},[998,2784,2711],{"class":1024},[998,2786,2787],{"class":1008},"https:\u002F\u002Fexample.org\u002Freleases\u002F0.2.0",[998,2789,2718],{"class":1024},[998,2791,2792],{"class":1024}," }]",[998,2794,2795],{"class":1024}," }\n",[619,2797,2798,1237,2800,2802,2803,2806,2807,1347],{},[666,2799,2403],{},[666,2801,2778],{}," are optional, and pre-releases are left out. SHADE asks the feed with a plain GET at most every six\nhours per container, when an admin opens Settings, sending nothing about the instance. The host of the feed still sees\nthe instance's address and when it asked. Only https and public addresses are called, the answer waits 5 seconds at\nmost and may be 64 KB at most, and one that isn't the format is refused: the card then says the feed could not be read.\nA feed that keeps failing shows under ",[2572,2804,2805],{},"Outside services"," on the ",[680,2808,2809],{"href":318},"Modules page",[970,2811,2813],{"id":2812},"background-tasks","Background tasks",[619,2815,2816,2817,2820],{},"An update that changes how data is stored does it in two steps, so the instance stays available: it adds the new\ncolumn or table, and copies the data in the background while it keeps working. A later update removes what is no\nlonger used. The copy is a ",[729,2818,2819],{},"background task",", and modules can have them too.",[723,2822,2823,2826,2845,2851,2861],{},[726,2824,2825],{},"The worker starts a new task, or a new version of one, when it starts after the update. It does the work in small\nbatches, with a short pause between them, and goes on where it stopped after a restart.",[726,2827,2828,2829,2832,2833,2836,2837,2840,2841,2844],{},"Admins see each task under ",[729,2830,2831],{},"Settings → Background tasks",": whether it is waiting, running, done, failed or paused,\nhow many rows it did of how many, and the last error. ",[729,2834,2835],{},"Pause"," stops it after the batch it is doing, ",[729,2838,2839],{},"Resume","\ngoes on from there, and ",[729,2842,2843],{},"Retry"," tries a failed task again from where it stopped. Each is in the audit log.",[726,2846,2847,2848,2850],{},"A task that fails tries again a few times on its own first. Once it has failed it also shows on the ",[729,2849,317],{},"\nscreen among the parts of SHADE that need attention.",[726,2852,2853,2856,2857,2860],{},[729,2854,2855],{},"Before an update whose changelog says it removes what a background task copied",", check under Settings →\nBackground tasks that the tasks it names are ",[729,2858,2859],{},"Done",". If one is not, wait, or retry it and fix what its error says,\nbefore you update.",[726,2862,2863,2866,2867,2869],{},[729,2864,2865],{},"A module update does this check itself."," A module version that removes what one of its background tasks copied\nnames that task, and installing it is refused until the task is done; the version you have keeps running. If a\nmodule is still left out for it at start, the Modules screen says so (",[2572,2868,2574],{},"): wait for the task, or install\nthe version you had before.",[623,2871,2873],{"id":2872},"handing-an-instance-over","Handing an instance over",[619,2875,2876,2877,2879],{},"A developer who takes an instance over needs the repository access, the server (or the Coolify project), ",[666,2878,668],{},"\nand the backups. Nothing else is needed: SHADE has no licence keys and calls no outside service of its own.",[619,2881,2882,2885],{},[729,2883,2884],{},"A client who leaves"," can be handed the latest built-in backup with one command, run where the API runs:",[989,2887,2889],{"className":991,"code":2888,"language":993,"meta":994,"style":994},"node console\u002Frestore.mjs handover .\u002Fhandover\n",[666,2890,2891],{"__ignoreMap":994},[998,2892,2893,2895,2897,2900],{"class":1000,"line":1001},[998,2894,1005],{"class":1004},[998,2896,2214],{"class":1008},[998,2898,2899],{"class":1008}," handover",[998,2901,2902],{"class":1008}," .\u002Fhandover\n",[619,2904,2905,2906,2909,2910,2912,2913,2915,2916,2918,2919,2922,2923,1237,2925,2927,2928,2930,2931,2936,2937,2939],{},"It copies the latest backup that opens into the new or empty folder, byte for byte and still encrypted (each file is checked against the\nmanifest's size and hash as it is written), and writes a ",[666,2907,2908],{},"README.md"," that says how to restore it. It prints where the key is\n(",[666,2911,693],{}," of the admin and the worker, set in their environment or generated in their ",[666,2914,697],{}," volume,\nwith ",[666,2917,668],{}," beside it) and never the key itself: only\n",[666,2920,2921],{},"--show-secrets"," prints ",[666,2924,693],{},[666,2926,668],{},", and ",[666,2929,1632],{}," while it is set (backups taken\nbefore ",[680,2932,2933,2934],{"href":55},"rotating ",[666,2935,668],{}," need it). Hand the key and ",[666,2938,668],{}," over apart from the folder, by another route\n(a password manager, not the same message): the folder with the key opens everything in it.",[619,2941,2942,2943,2947,2948,2951],{},"The client's admins can also download a backup themselves from the Backups card (see ",[680,2944,2946],{"href":2945},"#built-in-backups","Downloading a backup",") and\nrestore it on a server of their own with ",[666,2949,2950],{},"restore --from \u003Cfile>","; you still hand over the key.",[619,2953,2954,2955,2957,2958,749],{},"A backup brings the instance back, but only SHADE can open it. For the client's next system, an admin also exports the\ninstance from Settings: one readable ",[666,2956,1193],{}," of JSON and NDJSON with every entry, the media originals,\nthe team, users and the settings, which needs no SHADE and no key (see ",[680,2959,229],{"href":230},[2961,2962,2963],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":994,"searchDepth":1044,"depth":1044,"links":2965},[2966,2967,2970,2971,2972,2973,2978],{"id":625,"depth":1044,"text":626},{"id":794,"depth":1044,"text":795,"children":2968},[2969],{"id":972,"depth":1568,"text":740},{"id":1268,"depth":1044,"text":1269},{"id":2012,"depth":1044,"text":1790},{"id":2159,"depth":1044,"text":2160},{"id":2482,"depth":1044,"text":2483,"children":2974},[2975,2976,2977],{"id":2596,"depth":1568,"text":2597},{"id":2677,"depth":1568,"text":2678},{"id":2812,"depth":1568,"text":2813},{"id":2872,"depth":1044,"text":2873},"md",null,{},true,{"title":82,"description":994},"DHIogCObcvmn6rW-psbogmzvIg0ILFOkDViGVC72MnI",[2986,2987],{"title":78,"path":79,"stem":80,"description":994,"children":-1},{"title":86,"path":87,"stem":88,"description":994,"children":-1},1796500150683]