{"id":29182604,"url":"https://github.com/nsavinda/arcana-db-backup","last_synced_at":"2026-04-21T05:32:05.178Z","repository":{"id":302216949,"uuid":"1009663252","full_name":"nsavinda/arcana-db-backup","owner":"nsavinda","description":"Secure Database Backup Tool with Hybrid Encryption (AES-256 + RSA), compression, and support for S3-compatible cloud storage. ","archived":false,"fork":false,"pushed_at":"2025-07-01T06:26:04.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-01T07:24:01.856Z","etag":null,"topics":["backup","database","golang","postgres","s3-bucket"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nsavinda.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,"zenodo":null}},"created_at":"2025-06-27T13:56:35.000Z","updated_at":"2025-07-01T06:26:07.000Z","dependencies_parsed_at":"2025-07-01T07:34:13.546Z","dependency_job_id":null,"html_url":"https://github.com/nsavinda/arcana-db-backup","commit_stats":null,"previous_names":["nsavinda/arcana-db-backup"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nsavinda/arcana-db-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsavinda%2Farcana-db-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsavinda%2Farcana-db-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsavinda%2Farcana-db-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsavinda%2Farcana-db-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nsavinda","download_url":"https://codeload.github.com/nsavinda/arcana-db-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsavinda%2Farcana-db-backup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263029213,"owners_count":23402354,"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":["backup","database","golang","postgres","s3-bucket"],"created_at":"2025-07-01T20:07:00.705Z","updated_at":"2026-04-21T05:32:05.170Z","avatar_url":"https://github.com/nsavinda.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arcana DB Backup Tool\n\nA modular, secure Go-based tool for **database backup, encryption, and compression** with easy restore and cloud upload options.\n\n\u003c!-- Image --\u003e\n![Arcana DB Backup Tool](https://raw.githubusercontent.com/nsavinda/database-backup-tool/main/Arcana-Backup.png)\n\n## Features\n\n- **Database backup:** Dumps your database to a file  \n- **Currently supports:** PostgreSQL (via `pg_dump`)\n- **Encryption:** AES-256 (symmetric) + RSA (asymmetric hybrid)\n- **Compression:** gzip for efficient storage\n- **Easy restore:** Decrypt and decompress backups using your RSA private key\n\n---\n\n## Prerequisites\n\n- Go 1.24+\n- [OpenSSL](https://www.openssl.org/) for key generation\n- `pg_dump` (PostgreSQL backup utility)\n- A PostgreSQL database you want to back up\n\n---\n\n## Getting Started\n\n### Installation\n\nDownload the latest release from [GitHub Releases](https://github.com/nsavinda/arcana-db-backup/releases) or build it from source by following the steps below.\n\n\n\n### 1. **Clone the repository**\n\n```bash\ngit clone https://github.com/nsavinda/database-backup-tool.git\ncd database-backup-tool\n```\n\n### 2. **Generate RSA Keypair**\n\nGenerate a 4096-bit RSA keypair for encryption:\n\n```bash\nmake keygen\n# Produces: private.pem (private key), public.pem (public key)\n```\n\nor manually using OpenSSL:\n\n```bash\nopenssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:4096\nopenssl rsa -in private.pem -pubout -out public.pem\n```\n\n**Keep your `private.pem` safe!**\nYour public key (`public.pem`) is used for encryption.\n\n---\n\n### 3. **Configure**\n\nEdit `/etc/arcanadbbackup/config.yaml` or create a custom config file:\n\n```yaml\ndatabase:\n  host: localhost\n  port: 5432\n  user: postgres\n  password: postgres\n  dbname: postgres\n\nbackup_config:\n  public_key: ~/.ssh/public.pem\n  destination: ./backup\n  keep_local: false\n\nstorage:\n  provider: s3\n  bucket: my-bucket\n  region: us-east-1\n  access_key: \n  secret_key: \n  endpoint: https://nyc3.digitaloceanspaces.com  # Use S3 endpoint or DigitalOcean Spaces endpoint\n```\n\n---\n\n### 4. **Build and Run**\n\nBuild:\n\n```bash\nmake build\n```\n\nOr run directly:\n\n```bash\nmake run\n```\n\nThis will:\n\n* Dump your PostgreSQL database to a file\n* Compress and encrypt the dump (`.sql.gz` → `.enc`)\n* Encrypt the AES key (`.enc.key`)\n* Output the names of the resulting files\n\n---\n\n### 5. **Decrypt and Restore**\n\nTo decrypt a backup:\n\n```bash\n./backup-service decrypt -i private.pem \u003cbackupfile.sql.gz.enc\u003e\n```\n\nThis produces `\u003cbackupfile.sql.gz.decrypted.sql\u003e`.\n\n\nTo restore to PostgreSQL:\n\n```bash\npsql -U youruser -d yourdb -f \u003cbackupfile.sql\u003e\n```\n\n---\n\n## Security Notes\n\n* Never share your private key (`private.pem`).\n* Store your backups and keys in secure, access-controlled storage.\n* **Backups are encrypted**—only holders of your private key can restore them.\n* Rotate keys and credentials regularly.\n\n---\n\n## Customization\n\n* The codebase is modular:\n\n  * `config` – loads configuration\n  * `database` – handles PostgreSQL backup\n  * `encryption` – handles hybrid encryption and compression\n  * `storage` – (optional) handles S3/Spaces uploads\n\n* You can extend it to support other databases or storage providers.\n---\n\n## Author\n\n[Nirmal Savinda](https://github.com/nsavinda)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsavinda%2Farcana-db-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsavinda%2Farcana-db-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsavinda%2Farcana-db-backup/lists"}