Skip to content

Releases: StafLoker/ddns-porkbun-script

v1.3.1

04 Jan 00:01
1682457
Compare
Choose a tag to compare

Version: 1.3.1

Fixes:

  • Install legacy Version
  • Parse of Truncate version

Full Changelog:

v1.3.0

02 Jan 21:24
f340195
Compare
Choose a tag to compare

Version: 1.3.0

New Features:

  • Update IPv6 records
  • Enable IPv6 records
  • Enable IPv4 records
  • Install script history

Full Changelog:

v1.2.1

21 Dec 23:43
661aa19
Compare
Choose a tag to compare

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

21 Dec 13:20
3382836
Compare
Choose a tag to compare

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

20 Dec 23:16
da918e4
Compare
Choose a tag to compare

Version: 1.1.0

Features

  1. Configurable Concurrency:

    • Users can now enable or disable concurrency through the data.json configuration file.
    • Concurrency is controlled by the "concurrency" field in data.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.
  2. Error Handling:

    • Enhanced error handling to ensure subdomain processing continues even if one subdomain encounters an issue.
  3. Robustness:

    • Validates required fields (API keys, data.json file) before execution.
    • Automatically exits with an error message if critical information is missing.

Fixed

  1. Api request of get_current_ip() from GET to POST

Full Changelog:

v1.0.2

20 Dec 22:09
4388413
Compare
Choose a tag to compare

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

14 Dec 09:44
26ca1c9
Compare
Choose a tag to compare

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 and data.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

13 Dec 15:24
d9b5674
Compare
Choose a tag to compare

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

  1. Install jq:
    jq is a lightweight and flexible command-line JSON processor, required to parse API responses.

    sudo apt install jq
  2. Create keys.env file:
    Store your API keys securely in an environment file. Replace pk and sk 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
  3. Configure your domain and subdomains:
    Update the data.json file to include your domain and subdomains. Example format:

    {
        "domain": "example.com",
        "subdomains": [
            "sub1",
            "sub2"
        ]
    }
  4. 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:

  1. Open crontab for editing:

    crontab -e
  2. 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
  3. Save and exit the crontab editor.


Security Notes

  • Environment File: Ensure the keys.env file is not accessible to other users on the system. Use chmod 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

Full Changelog: