Releases: StafLoker/ddns-porkbun-script
v1.3.1
v1.3.0
Version: 1.3.0
New Features:
- Update IPv6 records
- Enable IPv6 records
- Enable IPv4 records
- Install script history
Full Changelog:
v1.2.1
Version: 1.2.1
New Features:
- Added interactive prompts to collect keys.env data if the file is missing.
- Enhanced data.json creation:
- Users can now input domain, subdomains interactively.
- Improved version validation:
- Ensures the provided version exists on GitHub before proceeding with the download.
- Verifies version format to avoid invalid inputs.
Full Changelog:
v1.2.0
Version: 1.2.0
New Features:
- Installation and Upgrade Script:
A new script has been added to simplify the installation and upgrade process for the DDNS Porkbun Script. Whether you're setting it up for the first time or updating to the latest version, this script ensures a seamless and hassle-free experience.
Full Changelog:
v1.1.0
Version: 1.1.0
Features
-
Configurable Concurrency:
- Users can now enable or disable concurrency through the
data.json
configuration file. - Concurrency is controlled by the
"concurrency"
field indata.json
.- Example:
{ "domain": "example.com", "concurrency": true, "subdomains": [ "sub1", "sub2" ] }
- If
"concurrency": true
, subdomains are processed in parallel. - If
"concurrency": false
, subdomains are processed sequentially.
- Example:
- Users can now enable or disable concurrency through the
-
Error Handling:
- Enhanced error handling to ensure subdomain processing continues even if one subdomain encounters an issue.
-
Robustness:
- Validates required fields (API keys,
data.json
file) before execution. - Automatically exits with an error message if critical information is missing.
- Validates required fields (API keys,
Fixed
- Api request of
get_current_ip()
from GET to POST
Full Changelog:
v1.0.2
Release v1.0.2
Changes:
- Improved the readability and maintainability of the codebase by restructuring logic and improving variable naming conventions.
- Optimized performance in critical sections of the application to enhance user experience and reduce server load.
Full Changelog:
v1.0.1
Release v1.0.1
Changes:
- Refactor README: Improved the README documentation, including clarifications on how to fix issues related to the loading of configuration files (
keys.env
anddata.json
). - Fix: Resolved an issue where the
current_ip
field for subdomains would not update when it was blank or set to "null."
Full Changelog:
v1.0.0
DDNS Porkbun Script
This script allows you to automatically update DNS records for your domain/subdomains on Porkbun using their API. It ensures your records are always in sync with your current public IP.
Prerequisites
-
Install
jq
:
jq
is a lightweight and flexible command-line JSON processor, required to parse API responses.sudo apt install jq
-
Create
keys.env
file:
Store your API keys securely in an environment file. Replacepk
andsk
with your actual API and Secret API keys from Porkbun.echo 'PORKBUN_API_KEY="pk"' > keys.env echo 'PORKBUN_SECRET_API_KEY="sk"' >> keys.env
Make sure to secure this file:
chmod 600 keys.env
-
Configure your domain and subdomains:
Update thedata.json
file to include your domain and subdomains. Example format:{ "domain": "example.com", "subdomains": [ "sub1", "sub2" ] }
-
Make the script executable:
Ensure the script has executable permissions:chmod +x ddns-porkbun-script.sh
Automating with Cron
To automate the script, use cron
to schedule periodic and system startup executions:
-
Open crontab for editing:
crontab -e
-
Add the following entries:
- Run every hour: Updates DNS records every hour.
- Run on system reboot: Ensures DNS updates upon system startup.
# Every 1 hour 0 * * * * /path/to/ddns-porkbun-script.sh # At system reboot @reboot /path/to/ddns-porkbun-script.sh
-
Save and exit the crontab editor.
Security Notes
- Environment File: Ensure the
keys.env
file is not accessible to other users on the system. Usechmod 600
to restrict permissions. - Avoid Hardcoding Keys: Use the
source
command to load environment variables securely.
Testing
To test the script manually, run:
./ddns-porkbun-script.sh
Verify that the DNS records on Porkbun are updated to match your current public IP.
Logging
Check logs
journalctl -t ddns-porkbun