{"id":24110408,"url":"https://github.com/kometen/backup-db","last_synced_at":"2025-10-16T16:01:57.752Z","repository":{"id":259193759,"uuid":"867334652","full_name":"kometen/backup-db","owner":"kometen","description":"Read secrets from Azure Key Vault and backup a PostgreSQL database","archived":false,"fork":false,"pushed_at":"2024-12-06T08:42:21.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T01:14:57.619Z","etag":null,"topics":["1password-cli","azure-key-vault","pgdump"],"latest_commit_sha":null,"homepage":"https://github.com/kometen/backup-db","language":"Rust","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/kometen.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":"2024-10-03T21:38:11.000Z","updated_at":"2024-12-07T08:43:09.000Z","dependencies_parsed_at":"2024-12-06T08:27:22.990Z","dependency_job_id":"cdddaf6b-09fd-46c7-92cb-c50a7c09dc0f","html_url":"https://github.com/kometen/backup-db","commit_stats":null,"previous_names":["kometen/backup_db","kometen/backup-db"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kometen%2Fbackup-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kometen%2Fbackup-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kometen%2Fbackup-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kometen%2Fbackup-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kometen","download_url":"https://codeload.github.com/kometen/backup-db/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241104322,"owners_count":19910413,"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":["1password-cli","azure-key-vault","pgdump"],"created_at":"2025-01-11T01:15:00.933Z","updated_at":"2025-10-16T16:01:52.706Z","avatar_url":"https://github.com/kometen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# backup_db\n\nA wrapper around pg_dump so information about host to connect to, database, password is retrieved from Azure Key Vault\nand URL to Azure Key Vault from 1password thus avoiding storing passwords in cleartext locally.\n\nRequires 1password  and Azure command line utilities installed locally, an Azure-subscription, a PostgreSQL-client.\nLog in with `az login`.\n\nSome settings can be set in a `.env` file like this:\n\n```\nBUFFER_SIZE=16384\nCOMPRESSION_METHOD=lz4\nFILE_PREFIX=production\nFOLDER=backup\n```\n\nAdd the following secrets to Azure Key Vault:\n\n```\ndb-host\ndb-name\ndb-pwd\ndb-user\ndb-domain\n```\n\nAdd an entry in 1password that can be accessed by the program. The path is formatted in Rust.\n\n```\nlet op_path = format!(\"op://Production/AzureKeyVault{}/url\", key);\n```\n\nAn example of a path can be `op://Production/AzureKeyVaultInvoice/url`. The path can be changed to suit your own\nrequirement with the format `op://[vault-name]/[password-item]/[value]` in 1password.\n\nClone the repository, test, build and run with\n\n```\ncargo test\ncargo build [--release]\n./target/release/backup_db -n invoice\n```\n\nInstall via brew tap.\n\n```\nbrew tap kometen/backup-db\nbrew install backup-db\n```\n\nBuild and run the container-image.\n\n```\ndocker build -t backup_db:dev .\ndocker run --user backup_db_user backup_db:dev\n```\n\nThe container will not inherit the environment from the shell so running from the container will not work.\n\nBased on an example from https://github.com/Azure/azure-sdk-for-rust/blob/main/sdk/security_keyvault/examples/get_secret.rs\nand guidance from both ChatGPT and Claude. Used the editor zed at `https://github.com/zed-industries/zed`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkometen%2Fbackup-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkometen%2Fbackup-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkometen%2Fbackup-db/lists"}