{"_id":"@backuphero.io/agent","_rev":"2-7c55bc072a0e87d8282218278c77f164","name":"@backuphero.io/agent","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@backuphero.io/agent","version":"0.1.0","_id":"@backuphero.io/agent@0.1.0","maintainers":[{"name":"backuphero.io","email":"admin@backuphero.io"}],"bin":{"backuphero-agent":"dist/index.js"},"dist":{"shasum":"e62176858d7e0f340cc77119693ddcb6e2c1a5c5","tarball":"https://registry.npmjs.org/@backuphero.io/agent/-/agent-0.1.0.tgz","fileCount":6,"integrity":"sha512-O7yKG/RqHLOURz1H2DtFuQkhH79myvi2QTxMZz4MwgpIljs/bo+bdehBZ93IjqxbgypoSDahFJZ7ip9A2IawGw==","signatures":[{"sig":"MEUCIQCz66xYTWnC/2EZgQUavxxXkl0ul3xZSrQqPx7M506ekwIgUP78iXvHXurAKRM/dQbN0bbdvqTn4HGKcSwnmxHZO2Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40053},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"gitHead":"45d4dc05621161db0db8c87766643d6cfebcd38d","scripts":{"dev":"tsx watch src/index.ts","lint":"eslint src/","build":"tsup src/index.ts --format cjs,esm --dts --clean","start":"node dist/index.js","type-check":"tsc --noEmit","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"backuphero.io","email":"admin@backuphero.io"},"_npmVersion":"10.8.2","description":"BackupHero Agent - Lightweight backup agent powered by restic","directories":{},"_nodeVersion":"22.8.0","dependencies":{"zod":"^3.24.1","chalk":"^5.3.0","dotenv":"^16.4.7","winston":"^3.17.0","commander":"^12.1.0","node-cron":"^3.0.3","socket.io-client":"^4.8.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.2","tsup":"^8.3.5","typescript":"^5.7.2","@types/node":"^22.10.5","@types/node-cron":"^3.0.11"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.1.0_1770200693648_0.6174763593265666","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@backuphero.io/agent","version":"0.2.0","description":"BackupHero Agent - Lightweight backup agent powered by restic","main":"dist/index.js","types":"dist/index.d.ts","bin":{"backuphero-agent":"dist/index.js"},"publishConfig":{"access":"public"},"scripts":{"dev":"tsx watch src/index.ts","build":"tsup src/index.ts --format cjs,esm --dts --clean","start":"node dist/index.js","type-check":"tsc --noEmit","lint":"eslint src/","prepublishOnly":"pnpm run build"},"dependencies":{"chalk":"^5.3.0","commander":"^12.1.0","dotenv":"^16.4.7","node-cron":"^3.0.3","socket.io-client":"^4.8.1","winston":"^3.17.0","zod":"^3.24.1"},"devDependencies":{"@types/node":"^22.10.5","@types/node-cron":"^3.0.11","tsup":"^8.3.5","tsx":"^4.19.2","typescript":"^5.7.2"},"engines":{"node":">=20.0.0"},"_id":"@backuphero.io/agent@0.2.0","gitHead":"a7d1f3d11239343323fc577402b0ff13464356ae","_nodeVersion":"22.8.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-+4bxSbWgKrWgEAM5kjAkViqvlIPqaWLdzDU/QJqTh5JUth0UBCgosdAM+kxjm/cJ3nkXF6JSompmX+Dzzd0BdQ==","shasum":"6235511eadd5ed7437182d7761a8522452790feb","tarball":"https://registry.npmjs.org/@backuphero.io/agent/-/agent-0.2.0.tgz","fileCount":6,"unpackedSize":82744,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG4kKWYWs60YtggQaiXNRNxh+rLZPsT06Y+izQbzfwz4AiEAriRSo0dLnjVlyjhX3wi8o06OYnnjJ1k6UYimFM/8/T0="}]},"_npmUser":{"name":"backuphero.io","email":"admin@backuphero.io"},"directories":{},"maintainers":[{"name":"backuphero.io","email":"admin@backuphero.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent_0.2.0_1771534053861_0.048630710933965426"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-04T10:24:53.547Z","modified":"2026-02-19T20:47:34.112Z","0.1.0":"2026-02-04T10:24:53.778Z","0.2.0":"2026-02-19T20:47:33.999Z"},"description":"BackupHero Agent - Lightweight backup agent powered by restic","maintainers":[{"name":"backuphero.io","email":"admin@backuphero.io"}],"readme":"# @backuphero.io/agent\n\nThe official BackupHero agent for automated server backups powered by [restic](https://restic.net/).\n\n## Features\n\n- Lightweight backup agent running on your servers\n- Powered by restic for efficient, encrypted backups\n- Supports file system, MySQL, PostgreSQL, and MongoDB backups\n- Automatic scheduling via cron expressions\n- Real-time status updates via WebSocket\n- S3-compatible storage support (AWS S3, Wasabi, Backblaze B2, MinIO, etc.)\n\n## Requirements\n\n- Node.js 20.x or higher\n- restic (installed automatically by the install script)\n- Linux, macOS, or Windows\n\n## Installation\n\n### Quick Install (Recommended)\n\nRun the install script as root:\n\n```bash\ncurl -sSL https://get.backuphero.io | sudo bash\n```\n\nWith options:\n\n```bash\ncurl -sSL https://get.backuphero.io | sudo bash -s -- --key YOUR_API_KEY\n```\n\n### Manual Install via npm\n\n```bash\nnpm install -g @backuphero.io/agent\n```\n\n### Install Specific Version\n\n```bash\nnpm install -g @backuphero.io/agent@0.1.0\n```\n\nOr via the install script:\n\n```bash\ncurl -sSL https://get.backuphero.io | sudo bash -s -- --version 0.1.0\n```\n\n## Configuration\n\nAfter installation, configure the agent with your API key from the BackupHero dashboard:\n\n```bash\nbackuphero-agent configure --key YOUR_API_KEY\n```\n\nWith custom server URL (for self-hosted):\n\n```bash\nbackuphero-agent configure \\\n  --key YOUR_API_KEY \\\n  --server wss://ws.your-domain.com \\\n  --config /etc/backuphero/backuphero.json\n```\n\n## Usage\n\n### Start the Agent\n\n```bash\nbackuphero-agent start --config /etc/backuphero/backuphero.json\n```\n\n### Check Status\n\n```bash\nbackuphero-agent status --config /etc/backuphero/backuphero.json\n```\n\n### Manual Backup\n\nTrigger a backup manually:\n\n```bash\nbackuphero-agent backup --job JOB_ID --config /etc/backuphero/backuphero.json\n```\n\n### Running as a Service\n\n#### systemd (Linux)\n\nThe install script creates a systemd service automatically. Manage it with:\n\n```bash\n# Start the service\nsudo systemctl start backuphero-agent\n\n# Enable auto-start on boot\nsudo systemctl enable backuphero-agent\n\n# Check status\nsudo systemctl status backuphero-agent\n\n# View logs\nsudo journalctl -u backuphero-agent -f\n```\n\n#### launchd (macOS)\n\n```bash\n# Load and start\nsudo launchctl load /Library/LaunchDaemons/io.backuphero.agent.plist\n\n# Stop and unload\nsudo launchctl unload /Library/LaunchDaemons/io.backuphero.agent.plist\n```\n\n## Configuration File\n\nThe agent stores its configuration in a JSON file (default: `./backuphero.json`):\n\n```json\n{\n  \"agentKey\": \"bhkey_...\",\n  \"serverUrl\": \"wss://ws.backuphero.io\",\n  \"resticPath\": \"restic\",\n  \"logLevel\": \"info\"\n}\n```\n\n## Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `BACKUPHERO_AGENT_KEY` | Agent API key | - |\n| `BACKUPHERO_SERVER_URL` | WebSocket server URL | `wss://ws.backuphero.io` |\n| `BACKUPHERO_CONFIG` | Path to config file | `./backuphero.json` |\n| `LOG_LEVEL` | Logging level (debug, info, warn, error) | `info` |\n\n## Backup Types\n\n### File System Backup\n\nBacks up directories and files using restic's efficient deduplication.\n\n### MySQL Backup\n\nUses `mysqldump` to create consistent database backups.\n\n### PostgreSQL Backup\n\nUses `pg_dump` for PostgreSQL database backups.\n\n### MongoDB Backup\n\nUses `mongodump` for MongoDB database backups.\n\n## Security\n\n- Agent keys are hashed before storage (SHA-256)\n- All backup data is encrypted by restic with AES-256\n- Communication with the server uses WebSocket over TLS\n- Credentials are stored encrypted in the configuration\n\n## Troubleshooting\n\n### Agent won't connect\n\n1. Verify your API key is correct\n2. Check network connectivity to the WebSocket server\n3. Ensure firewall allows outbound WebSocket connections\n\n### Backups failing\n\n1. Check restic is installed: `restic version`\n2. Verify storage credentials in the dashboard\n3. Check disk space on the backup target\n4. Review logs: `journalctl -u backuphero-agent -f`\n\n### View debug logs\n\n```bash\nbackuphero-agent start --config /etc/backuphero/backuphero.json\n```\n\nSet `logLevel: \"debug\"` in your config file for verbose output.\n\n## Uninstall\n\n```bash\n# Stop the service\nsudo systemctl stop backuphero-agent\nsudo systemctl disable backuphero-agent\n\n# Remove systemd service\nsudo rm /etc/systemd/system/backuphero-agent.service\nsudo systemctl daemon-reload\n\n# Uninstall package\nnpm uninstall -g @backuphero.io/agent\n\n# Remove configuration (optional)\nsudo rm -rf /etc/backuphero\n```\n\n## License\n\nMIT - see [LICENSE](LICENSE) for details.\n\n## Support\n\n- Documentation: https://docs.backuphero.io\n- Email: support@backuphero.io\n- GitHub Issues: https://github.com/backuphero/agent/issues\n","readmeFilename":"README.md"}