{"id":22951331,"url":"https://github.com/stafloker/ddns-porkbun-script","last_synced_at":"2026-01-16T06:32:12.268Z","repository":{"id":267973103,"uuid":"902923900","full_name":"StafLoker/ddns-porkbun-script","owner":"StafLoker","description":"DDNS Porkbun shell script","archived":false,"fork":false,"pushed_at":"2025-02-24T11:19:08.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T11:40:56.574Z","etag":null,"topics":["ddns","ddns-client","ddns-updater","script","shell","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/StafLoker.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-12-13T14:50:22.000Z","updated_at":"2025-02-24T11:19:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"10fd5ee0-38db-446a-baf8-cc855afcd71b","html_url":"https://github.com/StafLoker/ddns-porkbun-script","commit_stats":null,"previous_names":["stafloker/ddns-porkbun-script"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StafLoker%2Fddns-porkbun-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StafLoker%2Fddns-porkbun-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StafLoker%2Fddns-porkbun-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StafLoker%2Fddns-porkbun-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StafLoker","download_url":"https://codeload.github.com/StafLoker/ddns-porkbun-script/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246724803,"owners_count":20823544,"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":["ddns","ddns-client","ddns-updater","script","shell","shell-script"],"created_at":"2024-12-14T15:14:43.553Z","updated_at":"2026-01-16T06:32:12.255Z","avatar_url":"https://github.com/StafLoker.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n   \u003ch1\u003e\u003cb\u003eDDNS Porkbun Script\u003c/b\u003e\u003c/h1\u003e\n   \u003cp\u003e\u003ci\u003e~ Still online ~\u003c/i\u003e\u003c/p\u003e\n   \u003cp align=\"center\"\u003e\n       · \u003ca href=\"https://github.com/StafLoker/ddns-porkbun-script/releases\"\u003eReleases\u003c/a\u003e ·\n   \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n   \u003ca href=\"https://github.com/StafLoker/ddns-porkbun-script/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release-pre/StafLoker/ddns-porkbun-script.svg?style=flat\" alt=\"latest version\"/\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/StafLoker/ddns-porkbun-script/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/StafLoker/ddns-porkbun-script.svg?style=flat\" alt=\"license\"/\u003e\u003c/a\u003e\n\n   \u003cp\u003eThis script automatically updates DNS records for your domain/subdomains on Porkbun using their API. It ensures your records are always in sync with your current public IP addresses (both IPv4 and IPv6).\u003c/p\u003e\n\u003c/div\u003e\n\n## Alerts\n\n\u003e [!IMPORTANT]\n\u003e Impossible migrate from `1.x.x` to `2.x.x`.\n\u003e Please remove completely version `1.x.x` and install `2.x.x`.\n\n---\n\n## **Quick Install \u0026 Upgrade**\n\n```bash\nsudo bash -c \"$(curl -fsSL https://raw.githubusercontent.com/StafLoker/ddns-porkbun-script/main/install.sh)\"\n```\n\n---\n\n## **Configuration**\n\nThe script uses YAML configuration with the following structure:\n\n```yaml\ndomain: example.com\nconcurrency: true\nipv4:\n  enable: true\n  subdomains:\n    - sub1\n    - sub2\n    - www\nipv6:\n  enable: false\n  subdomains:\n    - sub3\n    - sub4\n```\n\n### **Configuration Options:**\n\n- **`domain`**: Your main domain (e.g., `example.com`)\n- **`concurrency`**: Enable parallel processing of subdomains (`true`/`false`)\n- **`ipv4.enable`**: Enable IPv4 record updates (`true`/`false`)\n- **`ipv4.subdomains`**: List of subdomains for A records\n- **`ipv6.enable`**: Enable IPv6 record updates (`true`/`false`)\n- **`ipv6.subdomains`**: List of subdomains for AAAA records\n\n---\n\n## **File Locations**\n\nAfter installation, files are organized in standard Linux locations:\n\n| File/Directory  | Location                                   | Purpose                       |\n| --------------- | ------------------------------------------ | ----------------------------- |\n| Configuration   | `/etc/ddns-porkbun/config.yaml`            | DDNS settings                 |\n| API Keys        | `/etc/ddns-porkbun/.env`                   | Porkbun API credentials       |\n| Scripts         | `/opt/ddns-porkbun/`                       | Main script and documentation |\n| Logs            | `/var/log/ddns-porkbun.log`                | Service logs with rotation    |\n| Systemd Service | `/etc/systemd/system/ddns-porkbun.service` | Service definition            |\n| Systemd Timer   | `/etc/systemd/system/ddns-porkbun.timer`   | Scheduling                    |\n| Executable      | `/usr/local/bin/ddns-porkbun`              | Symlink to main script        |\n\n---\n\n## **Management Commands**\n\n### **Service Management:**\n\n```bash\n# Check service status\nsudo systemctl status ddns-porkbun.service\n\n# Check timer status\nsudo systemctl status ddns-porkbun.timer\n\n# View next scheduled runs\nsystemctl list-timers ddns-porkbun.timer\n\n# Run manual update\nsudo systemctl start ddns-porkbun.service\n```\n\n### **Logs:**\n\n```bash\n# View recent logs\nsudo tail -f /var/log/ddns-porkbun.log\n\n# View systemd logs\nsudo journalctl -u ddns-porkbun.service -f\n\n# View all ddns-porkbun logs\nsudo journalctl -t ddns-porkbun\n```\n\n### **Configuration:**\n\n```bash\n# Edit main configuration\nsudo vim /etc/ddns-porkbun/config.yaml\n\n# Edit API keys\nsudo vim /etc/ddns-porkbun/.env\n\n# Restart after config changes\nsudo systemctl restart ddns-porkbun.timer\n```\n\n---\n\n## **Security Features**\n\n- **Dedicated system user**: Runs as `ddns-porkbun` user with minimal privileges\n- **Secure file permissions**:\n  - API keys file (`.env`): `600` (owner read-only)\n  - Configuration file: `640` (owner read/write, group read)\n- **Systemd hardening**:\n  - `NoNewPrivileges=true`\n  - `PrivateTmp=true`\n  - `ProtectSystem=strict`\n  - `ProtectHome=true`\n- **Log rotation**: Automatic cleanup with 14-day retention\n\n---\n\n## **Prerequisites**\n\n### **Porkbun API Setup:**\n\n1. Go to [Porkbun API Settings](https://porkbun.com/account/api)\n2. Enable API access for your domain\n3. Generate API Key and Secret API Key\n4. Note down both keys for the installation process\n\n### **System Requirements:**\n\n- Linux system with systemd\n- Root/sudo access for installation\n- Internet connectivity for API calls\n- **Automatic dependency installation**: The installer automatically detects and installs missing dependencies:\n  - `curl`, `wget`, `jq`, `sed`, `tar`\n  - **`yq` (mikefarah/yq)**: Automatically downloaded and installed with architecture detection\n    - Supports: x86_64, aarch64/arm64, armv7l/armv6l, i386/i686\n\n---\n\n## **Troubleshooting**\n\n### **Common Issues:**\n\n1. **Permission denied errors:**\n\n   ```bash\n   # Fix file permissions\n   sudo chown -R ddns-porkbun:ddns-porkbun /etc/ddns-porkbun\n   sudo chmod 600 /etc/ddns-porkbun/.env\n   sudo chmod 640 /etc/ddns-porkbun/config.yaml\n   ```\n\n2. **API authentication failures:**\n   - Verify API keys in `/etc/ddns-porkbun/.env`\n   - Ensure API access is enabled for your domain in Porkbun\n   - Check that domain is correctly spelled in config\n\n3. **Service not starting:**\n\n   ```bash\n   # Check service status\n   sudo systemctl status ddns-porkbun.service\n\n   # View detailed logs\n   sudo journalctl -u ddns-porkbun.service -n 50\n   ```\n\n4. **yq version conflicts:**\n   - The installer automatically handles yq installation\n   - If you have issues, remove existing yq: `sudo apt remove yq \u0026\u0026 sudo pip3 uninstall yq`\n   - Then reinstall using the manual yq installation steps above\n\n### **Debug Mode:**\n\nRun the script manually to see detailed output:\n\n```bash\nsudo -u ddns-porkbun /usr/local/bin/ddns-porkbun\n```\n\n---\n\n## **Uninstall**\n\nTo completely remove the DDNS service:\n\n```bash\n# Stop and disable services\nsudo systemctl stop ddns-porkbun.timer ddns-porkbun.service\nsudo systemctl disable ddns-porkbun.timer ddns-porkbun.service\n\n# Remove systemd files\nsudo rm -f /etc/systemd/system/ddns-porkbun.{service,timer}\nsudo systemctl daemon-reload\n\n# Remove user and files\nsudo userdel ddns-porkbun\nsudo rm -rf /etc/ddns-porkbun /opt/ddns-porkbun /var/log/ddns-porkbun.log\nsudo rm -f /usr/local/bin/ddns-porkbun /etc/logrotate.d/ddns-porkbun\n\n# Optionally remove yq if not needed elsewhere\nsudo rm -f /usr/local/bin/yq\n```\n\n---\n\n## **License**\n\nThis project is released under the MIT License. See the [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstafloker%2Fddns-porkbun-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstafloker%2Fddns-porkbun-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstafloker%2Fddns-porkbun-script/lists"}