Giter Site home page Giter Site logo

memos-litestream's Introduction

memos-litestream

English | 中文

Utilize litestream for the automatic backup and restoration of the SQLite database of memos to a B2/S3 Bucket. This initiative represents a restructured iteration of memos-on-fly-build. Feel free to employ this undertaking at your convenience.

To directly execute on fly.io, kindly refer to https://github.com/hu3rror/memos-on-fly ✈️

The Docker image is accessible not only on fly.io but also for local execution.

This endeavor is grounded in usememos/memos and litestream. Much appreciation! ✨

Prerequisites

Installation

RUN

The image supports linux/amd64, linux/arm64, linux/arm/v7

stable, latest, test are accessible docker image tags.

!!! Ensure to modify the environment variables before execution !!!

docker run -d ghcr.io/hu3rror/memos-litestream:stable \
--name memos \
-p 5230:5230 \
-v ~/.memos/:/var/opt/memos \
--env LITESTREAM_REPLICA_PATH=memos_prod.db \
--env LITESTREAM_REPLICA_BUCKET=xxxxxxxxx \
--env LITESTREAM_REPLICA_ENDPOINT=s3.us-west-000.backblazeb2.com \
--env LITESTREAM_ACCESS_KEY_ID=000000001a2b3c40000000001 \
--env LITESTREAM_SECRET_ACCESS_KEY=K000ABCDEFGHiJkLmNoPqRsTuVwXyZ0

or utilize docker-compose.yml in the repository.

Retain the default

  • LITESTREAM_REPLICA_PATH

Essential modifications before execution

  • LITESTREAM_REPLICA_BUCKET: Adjust to your S3/B2 bucket name
  • LITESTREAM_REPLICA_ENDPOINT: Adjust to your S3/B2 endpoint url
  • LITESTREAM_ACCESS_KEY_ID: Your S3/B2 access-key-id
  • LITESTREAM_SECRET_ACCESS_KEY: Your S3/B2 secret-access-key

For additional insights into litestream, please consult https://litestream.io/getting-started/

Notes

Your data is stored in ~/.memos by default.

In the event of accidental data deletion, restarting the docker container will trigger automatic downloading of the database file from your S3/B2 Bucket.

However, please note that this initiative does not facilitate the backup and restoration of your local resources (e.g., photos). It is recommended to use memos' built-in external resource libraries instead (Using local resources on a Cloud VM is not advisable.)

Development and build

git clone https://github.com/hu3rror/memos-litestream.git
cd memos-litestream
# modify as necessary
docker buildx build ./ --file ./Dockerfile --tag <your-tag>

memos-litestream's People

Contributors

hu3rror avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

memos-litestream's Issues

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.