Coder Social home page Coder Social logo

Comments (6)

bketelsen avatar bketelsen commented on April 28, 2024 1

I like option 1 best - I just want to curl and download on a cron job

from ponzu.

nilslice avatar nilslice commented on April 28, 2024 1

@bketelsen - I have most of this implemented now as per option 1. The way it works is there is one new route registered at '/admin/backup' that requires a query string:
'?source={system,analytics,uploads}'

Unfortunately I ran out of time before I'm now traveling back to LA, so I can't wrap up and push until later tonight. Just wanted to let you know it's almost there to save you time implementing it yourself in case you were thinking about it.

from ponzu.

nilslice avatar nilslice commented on April 28, 2024 1

@bketelsen - this has been pushed to master. just adding a new release and will then close this issue.

from ponzu.

bketelsen avatar bketelsen commented on April 28, 2024 1

Thanks for this!

from ponzu.

nilslice avatar nilslice commented on April 28, 2024

I've put quite a bit of thought into how to implement this over the course of the build, but want to get a better idea of how other users would expect this to be done.

Currently, you can just cp the .db files and push those out to a backup machine or storage endpoint. But, I haven't tested it on any database of significant size (over 100MB or so).

There are a couple of ways I have considered this, but all have trade-offs in security, management/maintenance, or complexity. All of the following would implement the Bolt io.Writer approach:

  1. hardcode endpoint with basic auth
    • would allow easy programmatic remote backup
  2. hardcode endpoint with JWT/cookie auth (like /admin/* route auth)
    • all admin users could download in browser, or get their cookie and pass it in curl/wget or similar
    • also fairly easy remote backup, but JWT/cookie expire and would need to be renewed
  3. run-time generated endpoint (pseudo-random) displayed in config to admin user
    • just obscuring/hiding the security, probably not the best idea
  4. run-time password provided by admin user required in query string or form value of backup request
    • remote backups would need to hardcode password in routine, also not ideal

Any thoughts on these or other implementations?

p.s. since all routes are registered to the DefaultServeMux using just the stdlib net/http package, you can add any routes with custom handlers as long as they don't conflict with existing ones. These could be added in any package (content, addons, admin, etc)

from ponzu.

nilslice avatar nilslice commented on April 28, 2024

Documentation for backups is here: https://github.com/ponzu-cms/ponzu/wiki/Backups in case anyone finds this issue via search while looking for Ponzu backup info.

from ponzu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.