Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
bilintsui committed Jan 15, 2021
2 parents 5ec82fd + 1b51a8d commit 9191cfd
Show file tree
Hide file tree
Showing 4 changed files with 353 additions and 120 deletions.
38 changes: 26 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@
## Requirements
* Linux
* Perl, and module JSON, File::Basename, POSIX
* curl

## Install Perl Module: JSON
* apt(like Debian, Ubuntu): apt install libjson-perl
* yum/dnf(like Fedora, RHEL, CentOS): yum install perl-JSON
* pacman(like ArchLinux): pacman -S perl-json
* Perl, and module Module::Load, File::Basename, POSIX, WWW::Curl::Easy, JSON
* (Optional)Perl module: Net::SMTP, Authen::SASL, MIME::Lite (Required when you enable mail notice.)

## Files
* ddnscd: Main program.
Expand All @@ -35,6 +30,14 @@ ddnscd <-v|--version>
"tick":600,
"lookup4":"https://api4.xmrx1999.com/ip.php",
"lookup6":"https://api6.xmrx1999.com/ip.php",
"smtp":
{
"host": "smtp.example.com",
"port": 25,
"ency": "PLAIN",
"user": "[email protected]",
"pass": "examplesmtppassword"
},
"deploys":
[
{
Expand All @@ -47,13 +50,15 @@ ddnscd <-v|--version>
"name": "1.ddns",
"automode": true,
"interface4": "",
"interface6": ""
"interface6": "",
"notice": ""
},
{
"name": "2.ddns",
"automode": true,
"interface4": "",
"interface6": ""
"interface6": "",
"notice": ""
}
]
},
Expand All @@ -67,13 +72,15 @@ ddnscd <-v|--version>
"name": "1.ddns",
"automode": true,
"interface4": "",
"interface6": ""
"interface6": "",
"notice": ""
},
{
"name": "2.ddns",
"automode": true,
"interface4": "",
"interface6": ""
"interface6": "",
"notice": ""
}
]
}
Expand All @@ -87,6 +94,12 @@ ddnscd <-v|--version>
* tick: Optional, required when runmode=simple/forking. Unit: second. Time of intervals between each run.
* lookup4: A URL which provides your public IP(IPv4), it should return IP only.
* lookup6: A URL which provides your public IP(IPv6), it should return IP only.
* smtp: Optional, only effects when Mail notice service enabled.
>* host: SMTP server address.
>* port: SMTP server port.
>* ency: Encryption type(case sensitive). PLAIN for SMTP(port usually 25), SSL for SMTPS(SSL, port usually 465), STARTTLS for SMTPS(STARTTLS, port usually 587).
>* user: SMTP username which user you want to send email from.
>* pass: SMTP password which user you want to send email from.
* deploys: Deploy Information Section.
>* root: Your root domain. (eg: if you want to deploy "ddns.example.com", use "example.com" here.)
>* username: Your account name. (In cloudflare, it should be your email address.)
Expand All @@ -95,4 +108,5 @@ ddnscd <-v|--version>
>>* name: Domain names which under your root domain. This name should without your root domain name. Use "@" or "" to refer your root domain.
>>* automode: Optional, use true/false, default true. Program will auto detect your existed DNS records and updated them(legacy method). If disabled, you can ask the program to update IPv4, IPv6 seperately or both through specific interface.
>>* interface4: Optional, only effects when automode=false. Define it if you want to update your IPv4 address. Use "" to use system default interface. Use interface name to Lookup your IPv4 address via specific interface.
>>* interface6: Optional, only effects when automode=false. Same with interface4 option, just the IPv6 version.
>>* interface6: Optional, only effects when automode=false. Same with interface4 option, just the IPv6 version.
>>* notice: Optional, when IP changed, send email to email addresses listed here. Seperate with comma when noticing multiple recipicents. Example: [email protected],[email protected]
20 changes: 16 additions & 4 deletions config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
"tick":600, # Optional, required when runmode=simple/forking. Unit: second. Time of intervals between each run.
"lookup4":"https://api4.xmrx1999.com/ip.php", # URL of IPv4 Lookup service.
"lookup6":"https://api6.xmrx1999.com/ip.php", # URL of IPv6 Lookup service.
"smtp": # Optional, configuration of Mail Notice Service.
{
"host": "smtp.example.com", # SMTP server address.
"port": 25, # SMTP server port.
"ency": "PLAIN", # Encryption type(case sensitive). PLAIN for SMTP(port usually 25), SSL for SMTPS(SSL, port usually 465), STARTTLS for SMTPS(STARTTLS, port usually 587).
"user": "[email protected]", # SMTP username which user you want to send email from.
"pass": "examplesmtppassword" # SMTP password which user you want to send email from.
},
"deploys": # Deploy Information Section.
[
{
Expand All @@ -18,13 +26,15 @@
"automode": true, # Optional, default true. When enabled, program will auto detect DNS record and update it which had already existed. You can't create a new DNS record when automode is enabled.
# You need to specify "interface4" or "interface6" or both if you want to create/update a DNS record when automode is disabled. Otherwise it will not create/update.
"interface4": "", # Optional, when automode is disabled, create/update an A record with an IPv4 address. Leave blank to use default interface.
"interface6": "" # Optional, when automode is disabled, create/update an AAAA record with an IPv6 address. Leave blank to use default interface.
"interface6": "", # Optional, when automode is disabled, create/update an AAAA record with an IPv6 address. Leave blank to use default interface.
"notice": "" # Optional, when IP changed, send email to email addresses listed here. Seperate with comma when noticing multiple recipicents. Example: [email protected],[email protected]
},
{
"name": "2.ddns",
"automode": true,
"interface4": "",
"interface6": ""
"interface6": "",
"notice": ""
}
]
},
Expand All @@ -38,13 +48,15 @@
"name": "1.ddns",
"automode": true,
"interface4": "",
"interface6": ""
"interface6": "",
"notice": ""
},
{
"name": "2.ddns",
"automode": true,
"interface4": "",
"interface6": ""
"interface6": "",
"notice": ""
}
]
}
Expand Down
Loading

0 comments on commit 9191cfd

Please sign in to comment.