{"id":20128650,"url":"https://github.com/hu3rror/memos-litestream","last_synced_at":"2025-04-09T15:51:06.192Z","repository":{"id":169225834,"uuid":"643883315","full_name":"hu3rror/memos-litestream","owner":"hu3rror","description":"✍️ Run memos with litestream.","archived":false,"fork":false,"pushed_at":"2025-03-23T14:14:33.000Z","size":161,"stargazers_count":31,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-23T15:25:16.046Z","etag":null,"topics":["backblaze-b2","docker","dockerfile","flyio","litestream","memos","s3","usememos"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hu3rror.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-22T11:02:55.000Z","updated_at":"2025-03-15T02:33:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"ada5d160-daa5-494c-b373-d52eb96341fc","html_url":"https://github.com/hu3rror/memos-litestream","commit_stats":null,"previous_names":["hu3rror/memos-litestream"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hu3rror%2Fmemos-litestream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hu3rror%2Fmemos-litestream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hu3rror%2Fmemos-litestream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hu3rror%2Fmemos-litestream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hu3rror","download_url":"https://codeload.github.com/hu3rror/memos-litestream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248063920,"owners_count":21041854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backblaze-b2","docker","dockerfile","flyio","litestream","memos","s3","usememos"],"created_at":"2024-11-13T20:28:38.178Z","updated_at":"2025-04-09T15:51:06.173Z","avatar_url":"https://github.com/hu3rror.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# memos-litestream\n\nEnglish | [中文](README_zh-CN.md)\n\nUtilize 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](https://github.com/hu3rror/memos-on-fly-build). Feel free to employ this undertaking at your convenience.\n\n\u003e To directly execute on fly.io, kindly refer to https://github.com/hu3rror/memos-on-fly ✈️\n\u003e\n\u003e The Docker image is accessible not only on fly.io but also for local execution.\n\nThis endeavor is grounded in [usememos/memos](https://github.com/usememos/memos) and [litestream](https://github.com/benbjohnson/litestream). Much appreciation! ✨\n\n## Prerequisites\n\n- Docker\n- [BackBlaze B2](https://www.backblaze.com/) / S3-compatible account (The default template is B2-based)\n  - To [Create a BackBlaze B2 bucket](https://litestream.io/guides/backblaze/#create-a-bucket) and acquire the _bucket-name_ / _endpoint-url_\n  - To [Create a BackBlaze B2 user](https://litestream.io/guides/backblaze/#create-a-user) and obtain the _access-key-id_ / _secret-access-key_\n\n## How to run\n\n\u003e This image supports linux/amd64, linux/arm64.\n\u003e\n\u003e `stable`, `latest`, `test` are available Docker image tags, which are consistent with the tags of the official Memos upstream images.\n\u003e\n\u003e `stable-memogram` is a unique image tag in this repository. It integrates the experimental feature of sending messages to Memos via a Telegram bot. Customize the `BOT_TOKEN` environment variable before running.\n\nThis repository's images offer various feature combinations:\n\n| Scheme | Memos | Litestream | Memogram |\n| :---: | :---: | :---: | :---: |\n| Scheme 1 | ✓ | ✓ | ✕ |\n| Scheme 2 | ✓ | ✓ | ✓ |\n| Scheme 3 | ✓ | ✕ | ✓ |\n| Scheme 4 | ✓ | ✕ | ✕ |\n\n### Scheme 1: Running Memos with Litestream Backup\n\n```shell\ndocker run -d \\\n--name memos \\\n-p 5230:5230 \\\n-v ~/.memos/:/var/opt/memos \\\n-e LITESTREAM_REPLICA_PATH=memos_prod.db \\\n-e LITESTREAM_REPLICA_BUCKET=your-bucket-name \\\n-e LITESTREAM_REPLICA_ENDPOINT=s3.us-west-000.backblazeb2.com \\\n-e LITESTREAM_ACCESS_KEY_ID=000000001a2b3c40000000001 \\\n-e LITESTREAM_SECRET_ACCESS_KEY=K000ABCDEFGHiJkLmNoPqRsTuVwXyZ0 \\\nghcr.io/hu3rror/memos-litestream:stable # Tag is `stable`\n```\n\n### Scheme 2: Running Memos with Litestream Backup and Enabling Telegram BOT\n\n```shell\ndocker run -d \\\n--name memos \\\n-p 5230:5230 \\\n-v ~/.memos/:/var/opt/memos \\\n-e LITESTREAM_REPLICA_PATH=memos_prod.db \\\n-e LITESTREAM_REPLICA_BUCKET=your-bucket-name \\\n-e LITESTREAM_REPLICA_ENDPOINT=s3.us-west-000.backblazeb2.com \\\n-e LITESTREAM_ACCESS_KEY_ID=000000001a2b3c40000000001 \\\n-e LITESTREAM_SECRET_ACCESS_KEY=K000ABCDEFGHiJkLmNoPqRsTuVwXyZ0 \\\n-e BOT_TOKEN=your-bot-token \\\nghcr.io/hu3rror/memos-litestream:stable-memogram # Tag is `stable-memogram`\n```\n\n### Scheme 3: Running Memos with Telegram BOT, but without Litestream Backup\n\n```shell\ndocker run -d \\\n--name memos \\\n-p 5230:5230 \\\n-v ~/.memos/:/var/opt/memos \\\n-e BOT_TOKEN=your-bot-token \\\nghcr.io/hu3rror/memos-litestream:stable-memogram # Tag is `stable-memogram`\n```\n\n### Scheme 4: Running Memos solely, without any other features\n\n```shell\ndocker run -d \\\n--name memos \\\n-p 5230:5230 \\\n-v ~/.memos/:/var/opt/memos \\\nghcr.io/hu3rror/memos-litestream:stable # Tag is `stable` or use official image `neosmemo/memos:stable`\n```\n\n### Environment Variable Explanation\n\n- `LITESTREAM_REPLICA_PATH`: Your database file path, keep it default.\n- `LITESTREAM_REPLICA_BUCKET`: Your S3/B2 bucket name.\n- `LITESTREAM_REPLICA_ENDPOINT`: Your S3/B2 endpoint URL.\n- `LITESTREAM_ACCESS_KEY_ID`: Your S3/B2 access key ID.\n- `LITESTREAM_SECRET_ACCESS_KEY`: Your S3/B2 access key secret.\n- `BOT_TOKEN`: Your Telegram BOT token, only for `stable-memogram` image. Official project: [usememos/telegram-integration](https://github.com/usememos/telegram-integration)\n\nAnd for more information about litestream, see [https://litestream.io/getting-started/](https://litestream.io/getting-started/)\n\n## Notes\n\nYour data is stored in `~/.memos` by default.\n\nIn the event of accidental data deletion, restarting the docker container will trigger automatic downloading of the database file from your S3/B2 Bucket.\n\nHowever, 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.)\n\n## Development and build\n\n```shell\ngit clone https://github.com/hu3rror/memos-litestream.git\ncd memos-litestream\n# modify as necessary\ndocker buildx build ./ --file ./Dockerfile --tag \u003cyour-tag\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhu3rror%2Fmemos-litestream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhu3rror%2Fmemos-litestream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhu3rror%2Fmemos-litestream/lists"}