Daily encrypted backups for MongoDB & PostgreSQL to any S3-compatible storage. Self-hosted, zero plaintext uploads.
Repo sunjay-dev/safora, read from GitHub 1 min ago. sunjay-dev has not joined Take My Repo.
sunjay-dev/safora is a public repo on GitHub by sunjay-dev. Daily encrypted backups for MongoDB & PostgreSQL to any S3-compatible storage. Self-hosted, zero plaintext uploads. It declares the MIT license on GitHub. It is written mainly in TypeScript, has 0 stars and last changed on 2026-11-16. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-21.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
Daily, encrypted MongoDB Atlas and PostgreSQL backups delivered to S3-compatible storage (AWS S3, Cloudflare R2, MinIO, etc.) and/or a local folder,
run from GitHub Actions or a local machine. A Node.js + TypeScript orchestrator runs the pipeline: mongodump creates a single cluster archive or
psql enumerates non-template databases and pg_dump creates an archive per database, age-encryption encrypts each in-process, and each selected
destination stores and verifies it (S3 through the AWS SDK for JavaScript v3, no AWS CLI subprocess). Expired backups are pruned automatically per
destination.
Keep this repository private. The archive is encrypted client-side before it leaves the runner — storage providers and anyone with access to the bucket only ever sees ciphertext.
GitHub Actions (cron 00:00 UTC = 05:00 PKT, or manual dispatch)
├── Job 1: backup (MongoDB)
│ └── Node.js orchestrator — src/main.ts (ENGINE=mongodb)
│ ├── mongodump (MongoDB Database Tools) → single gzipped archive, point-in-time via --oplog
│ │ └── URI supplied via a chmod-600 temp config file — never a command-line argument
│ ├── age encryption (in-process via age-encryption; recipient = AGE_RECIPIENT public key)
│ └── destinations (s3, local), attempted in listed order (src/destinations/)
│ ├── s3: AWS SDK v3 → multipart upload to S3-compatible storage → HeadObject verification (size must match)
│ │ └── retention: delete backups/ objects older than RETENTION_DAYS
│ └── local: copy to <object-key>.part → SHA-256 verification → rename
│ └── retention: delete expired archives under LOCAL_BACKUP_DIR by mtime
└── Job 2: postgres (PostgreSQL)
└── Node.js orchestrator — src/main.ts (ENGINE=postgres)
├── psql (PostgreSQL Client Tools) → enumerates connectable non-template databases
└── for each database:
├── pg_dump (PostgreSQL Client Tools) → custom-format archive (-Fc) validated with pg_restore --list
│ └── URI connection args without password; password via chmod-600 temp PGPASSFILE (database wildcard)
├── age encryption (in-process via age-encryption; recipient = AGE_RECIPIENT public key)
└── destinations (s3, local), attempted in listed order (same downstream pipeline)
Objects land at:
s3://<S3_BUCKET>/backups/mongodb/<YYYY-MM-DD_HH-MM-SS>/mongodb.archive.gz.age (or <database>.archive.gz.age when MONGODB_DB_BLOCKLIST is set)s3://<S3_BUCKET>/backups/postgres/<YYYY-MM-DD_HH-MM-SS>/<database>.dump.ageEach carrying its SHA-256 as x-amz-meta-sha-256 metadata. The local destination mirrors the same object key under LOCAL_BACKUP_DIR.
safora/
├── .github/workflows/backup.yml # scheduler: daily 00:00 UTC + manual dispatch (parallel MongoDB & PostgreSQL jobs)
├── src/
│ ├── main.ts # pipeline orchestration + top-level error handling
│ ├── config/
│ │ ├── env.config.ts # Zod schema: engine selection, required secrets, tunables with defaults
│ │ └── env.config.test.ts # config loading, ENGINE validation, and environment matrix tests
│ ├── destinations/
│ │ ├── destination.ts # Destination contract: identifier + delivery + prune
│ │ ├── deliver.ts # sequential fan-out, failure collection, per-destination outcomes
│ │ ├── index.ts # destination list built from DESTINATIONS
│ │ ├── local.ts # local-folder implementation: atomic copy + mtime retention
│ │ └── s3.ts # S3 implementation: client + upload + retention
│ ├── logging.ts # log + fail + URI & password redaction
│ ├── summary.ts # per-destination summary: GitHub step summary or stdout
│ ├── tools.ts # preflight tool checks (mongodump for MongoDB; psql, pg_dump, and pg_restore for PostgreSQL)
│ ├── lib/
│ │ ├── exec.ts # execFile wrapper + child-output extraction
│ │ ├── format.ts # object-key assembly, sizes
│ │ ├── format.test.ts # archive object-key layout tests
│ │ ├── hash.ts # SHA-256 of files
│ │ ├── postgres.ts # URI split, PGPASSFILE lifecycle, psql enumeration args, pg_dump/pg_restore args
│ │ └── postgres.test.ts # URI-split matrix + security invariant tests
│ ├── steps/
│ │ ├── dump.ts # dump step branching on ENGINE: mongodump or psql enumeration + pg_dump per database + verify
│ │ └── encrypt.ts # in-process age encryption
│ └── storage/
│ ├── client.ts # S3-compatible S3Client factory
│ ├── retention-policy.ts # shared retention selection (pure)
│ ├── retention-policy.test.ts # cutoff, current-key, empty-input tests
│ ├── retention.ts # prune objects older than RETENTION_DAYS
│ └── upload.ts # multipart upload + verification
├── docs/
│ ├── adr/ # architecture decision records (e.g. ADR-0004 for S3-compatible storage)
│ └── restore-checklist.md # do this once against a scratch cluster / database
├── .env.example # local-run template (gitignored as .env)
├── .gitignore
├── .prettierrc / .prettierignore # Prettier config (150-col); pnpm format to apply
├── package.json
├── tsconfig.json
├── tsconfig.test.json # typechecks source + tests without emitting
└── README.md
safora and push these files.age-keygen -o key.txt:
# public key: age1... line → GitHub secret AGE_RECIPIENTAGE-SECRET-KEY-1... private line → store offline (password manager / offline media). If you lose it, every backup is unrecoverable.
Never commit it.safora) with your chosen storage provider:
us-east-1). Configure IAM least-privilege credentials or OIDC role with s3:PutObject,
s3:GetObject, s3:ListBucket, and s3:DeleteObject.safora; then under R2 → Manage R2 API Tokens → Create API Token → permission Object Read &
Write, scope apply to specific bucket only → safora. Note the Access Key ID, Secret Access Key, and Account ID.MONGODB_URI: connection string for MongoDB Atlas backup user.POSTGRESQL_URI: connection URI for PostgreSQL backup role.AGE_RECIPIENT: public key (age1...).S3_ENDPOINT: endpoint URL with protocol (required for Cloudflare R2 and MinIO, e.g. https://<ACCOUNT_ID>.r2.cloudflarestorage.com; omit for
standard AWS regional endpoints).S3_ACCESS_KEY_ID: access key ID (required when using static credentials; omit when using ambient AWS IAM roles or GitHub Actions OIDC).S3_SECRET_ACCESS_KEY: secret access key (required when using static credentials; omit when using ambient AWS IAM roles or GitHub Actions OIDC).S3_BUCKET: bucket name (e.g. mongodb-backups; required when destination includes s3).S3_REGION: region (e.g. auto for Cloudflare R2, or AWS region such as us-east-1; optional, omitted to delegate region resolution to the AWS
SDK).S3_FORCE_PATH_STYLE: set to true if your provider requires path-style addressing (e.g. MinIO, LocalStack; defaults to false).DESTINATIONS: comma-separated destinations to deliver to (s3, local). Unset or blank defaults to s3.RETENTION_DAYS (30), LOG_LEVEL (info), BACKUP_PREFIX (backups/), DUMP_TIMEOUT_MS (1200000),
TOOL_CHECK_TIMEOUT_MS (30000), and MAX_BUFFER (10485760). In CI, ENGINE is set automatically per job (mongodb for the MongoDB job,
postgres for the PostgreSQL job). See .env.example for details.MONGODB_DB_BLOCKLIST, PG_DB_BLOCKLIST, or DB_BLOCKLIST..github/workflows/backup.yml
provides backward compatibility fallbacks:
S3_ENDPOINT falls back to secrets.R2_ENDPOINTS3_ACCESS_KEY_ID falls back to secrets.R2_ACCESS_KEY_IDS3_SECRET_ACCESS_KEY falls back to secrets.R2_SECRET_ACCESS_KEYS3_BUCKET falls back to vars.R2_BUCKET Existing repositories continue running without interruption while allowing gradual migration to
canonical S3_* names.backup role. Network Access: GitHub-hosted runners use rotating IPs, so either
allow 0.0.0.0/0 (acceptable here because the user is limited to the backup role and the SRV string is SCRAM-protected) or self-host a runner with
a static IP you can allowlist. Take the SRV connection string for that user → secret MONGODB_URI.CREATE ROLE backup WITH LOGIN PASSWORD '<strong-password>'; GRANT pg_read_all_data TO backup;
pg_read_all_data role (PostgreSQL 14+) grants read-only access across all tables, views, and schemas without superuser
privileges.postgres):
postgresql://backup:<strong-password>@<vps-host>:5432/postgres?sslmode=require
POSTGRESQL_URI verbatim — any supported sslmode query parameter is honored as passed and the string is never silently
rewritten. The path names the maintenance database used to enumerate all connectable, non-template databases; each enumerated database is backed
up into its own archive.
Warning on libpq default
sslmode=prefer: PostgreSQL's libpq defaults tosslmode=preferwhensslmodeis omitted from the URI. Withsslmode=prefer, libpq first attempts an encrypted connection, but silently falls back to an unencrypted, plaintext connection if the server does not enforce TLS. When backing up an endpoint that is publicly reachable over the internet, you should explicitly setsslmode=requirein the URI to prevent any unencrypted fallback. If certificate verification is configured, usesslmode=verify-full(orverify-ca) to prevent man-in-the-middle attacks by verifying the server certificate.
POSTGRESQL_URI.backup (MongoDB) and postgres jobs will run in parallel.With static IAM credentials:
S3_BUCKET=my-backup-bucket S3_REGION=us-east-1 S3_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE S3_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY # S3_ENDPOINT is omitted for native AWS regional endpoints # S3_FORCE_PATH_STYLE defaults to false
With ambient credentials (IAM role, ECS task role, or GitHub Actions OIDC):
S3_BUCKET=my-backup-bucket S3_REGION=us-east-1 # S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY are omitted. # The AWS SDK resolves credentials ambiently from the environment or instance profile.
S3_BUCKET=safora S3_ENDPOINT=https://<ACCOUNT_ID>.r2.cloudflarestorage.com S3_REGION=auto S3_ACCESS_KEY_ID=<R2_TOKEN_ACCESS_KEY_ID> S3_SECRET_ACCESS_KEY=<R2_TOKEN_SECRET_ACCESS_KEY>
For EU-jurisdiction buckets, use https://<ACCOUNT_ID>.eu.r2.cloudflarestorage.com.
S3_BUCKET=backups S3_ENDPOINT=https://minio.example.com S3_REGION=us-east-1 S3_ACCESS_KEY_ID=minioadmin S3_SECRET_ACCESS_KEY=minioadmin S3_FORCE_PATH_STYLE=true
backup) and PostgreSQL (postgres) jobs run concurrently.Requires Node.js 22.12 or later and pnpm (or corepack enable, which reads the pinned version from package.json).
The CLI tools for your chosen engine (mongodump for MongoDB; psql, pg_dump, and pg_restore for PostgreSQL) must also be available on your
PATH.
On Windows, install the command-line tools before running a backup:
mongodump and mongorestore): download the Windows x86_64 ZIP from the
MongoDB Database Tools Download Center. Extract it and add its bin folder to your PATH.
Open a new terminal and confirm the install with mongodump --version.psql, pg_dump, and pg_restore): download the Windows installer for PostgreSQL 17 from the
PostgreSQL Windows Downloads (or the command-line binaries zip from EnterpriseDB). During setup with
the installer, you can uncheck the server components and install only "Command Line Tools". Add the installation's bin directory (typically
C:\Program Files\PostgreSQL\17\bin) to your system PATH. Open a new terminal and confirm the install:
psql --version
pg_dump --version
pg_restore --version
winget install PostgreSQL.PostgreSQL.17
bin directory is added to your PATH.Copy .env.example to .env and fill in the values for your run.
ENGINE=mongodb (or omit ENGINE) and provide MONGODB_URI.ENGINE=postgres and provide POSTGRESQL_URI.For a run with only the local destination, set DESTINATIONS=local and choose LOCAL_BACKUP_DIR; S3 credentials are needed only when DESTINATIONS
includes s3. The backup:local command loads .env when present, builds the pipeline, and runs it. This command is the same in PowerShell, Command
Prompt, and bash:
pnpm install
pnpm run backup:local
pnpm run backup remains the CI-shaped command and does not load .env. Selecting local in GitHub Actions writes an archive that disappears when
the workflow finishes, so that destination is generally meaningless in CI.
Logs are structured JSON (pino), one object per line — greppable in CI and easy to ship elsewhere. Set LOG_LEVEL (default info) to adjust
verbosity. For readable local output, pipe through pino-pretty:
pnpm run backup | pnpm dlx pino-prettyFor MongoDB:
# AWS S3 aws s3 cp s3://<S3_BUCKET>/backups/mongodb/<TIMESTAMP>/mongodb.archive.gz.age backup.archive.gz.age # Cloudflare R2 / MinIO (custom endpoint) aws s3 cp s3://<S3_BUCKET>/backups/mongodb/<TIMESTAMP>/mongodb.archive.gz.age backup.archive.gz.age \ --endpoint-url <S3_ENDPOINT> age -d -i key.txt -o dump.archive.gz backup.archive.gz.age
For PostgreSQL (per-database archive):
# AWS S3 aws s3 cp s3://<S3_BUCKET>/backups/postgres/<TIMESTAMP>/<DATABASE>.dump.age postgres-<DATABASE>.dump.age # Cloudflare R2 / MinIO (custom endpoint) aws s3 cp s3://<S3_BUCKET>/backups/postgres/<TIMESTAMP>/<DATABASE>.dump.age postgres-<DATABASE>.dump.age \ --endpoint-url <S3_ENDPOINT> age -d -i key.txt -o postgres-<DATABASE>.dump postgres-<DATABASE>.dump.age pg_restore --list postgres-<DATABASE>.dump
A successful age -d proves the archive decrypts with your key (and pg_restore --list verifies the decrypted PostgreSQL custom-format archive table
of contents). The full download → verify → restore procedure lives in docs/restore-checklist.md.
age-encryption, X25519) — a compromise of S3 storage or the API token exposes ciphertext
only.MONGODB_URI reaches mongodump through a temporary chmod-600 config file, deleted immediately after the dump.POSTGRESQL_URI is split so that connection arguments carry only the stripped URI; the password is provided through a temporary chmod-600
PGPASSFILE with a database wildcard covering all enumerated databases, deleted immediately after the run.MONGODB_URI, POSTGRESQL_URI, and extracted passwords from every line before it
is written, and error messages are sanitized before they are thrown.backup role; PostgreSQL role limited to
pg_read_all_data; workflow granted only contents: read.backups/ makes a decent second line of defense.mongodump.conf and .pgpass) are protected with chmod 600 on POSIX systems. Windows does not enforce those Unix
permission bits through this call, so this protection is largely a no-op there; keep the local account and temporary folder private.-Fc) per non-template database. Cluster-wide global objects (roles, users, tablespaces) are
not included (avoiding superuser credentials in CI; ADR-0003); roles must be recreated manually before restore as documented in
docs/restore-checklist.md.sunjay-dev/safora is a public repo on GitHub by sunjay-dev. Daily encrypted backups for MongoDB & PostgreSQL to any S3-compatible storage. Self-hosted, zero plaintext uploads.
It declares the MIT license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-16. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
:rocket: The Ultimate Image Uploader for Efficient Creators. Supports Obsidian, Typora, VS Code etc. and 60+ image hosting services (S3, GitHub, Cloudflare R2, Imgur, Aliyun OSS...). Paste, upload, done.

A collection of inspiring lists, manuals, cheatsheets, blogs, hacks, one-liners, cli/web tools and more.
"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
Stop renting your intelligence. Own it with AnythingLLM. Everything you need for a powerful local-first agent experience
Automate WhatsApp messages with Puppeteer. Send fun messages programmatically!
UniRide is a university-based carpooling website that connects students for shared rides. Users can create, join, or cancel rides in real-time, view ride history, and receive instant updates.
Simple and efficient translator website that allows users to translate text between different languages.
A web-based 3D solar system viewer built with React and Three.js. Users can explore planets in real-time, view detailed facts, and enjoy a 3d experience.
A simple and fast image format converter CLI tool built with Node.js and Sharp. Supports multiple formats like PNG, JPEG, and WebP with customizable options and batch processing.
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/sunjay-dev/saforaTake My Repo has not tested this on your machine. Requirements come from the project's own documentation.