Skip to content

Commit

Permalink
v1.0-hotfix (#2)
Browse files Browse the repository at this point in the history
* [Bug] Script Path Fix
`cloudflare-ddns` needs to be imported using absolute path, fixed.

* [Doc] Documentation Update
README - Usage Section.
  • Loading branch information
MijazzChan authored Feb 5, 2022
1 parent 153720b commit 06cf087
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 8 deletions.
74 changes: 67 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
# Cloudflare DDNS Script for EdgeOS

It's originally designed for my Ubiquiti ER-X router to support dynamic domain update on Cloudflare.
Designed for my Ubiquiti ER-X router to support dynamic domain update (ddns) on Cloudflare.

`cron` or `ppp-up` the script to achieve ddns.
## Usage

## Scripts Usage
### 1 - Download

+ Alter specific section of `cfddns.sh`.
> Suppose you have already ssh into your EdgeOS based router, in my case, Ubiquiti ER-X.
+ `chmod +x ./cfddns.sh`
#### 1.1 Using Github Raw

+ try execute `./cfddns.sh`
```bash
cd /config/scripts/ && pwd
# /config/scripts/

curl -LS -o /config/scripts/cloudflare-ddns-edgeos.tar.gz https://github.com/MijazzChan/cloudflare-ddns-edgeos/raw/releases/cloudflare-ddns-edgeos.tar.gz
```

#### 1.2 Trouble with GFW?

```bash
cd /config/scripts/ && pwd
# /config/scripts/

curl -LS -o /config/scripts/cloudflare-ddns-edgeos.tar.gz https://cdn.jsdelivr.net/gh/MijazzChan/cloudflare-ddns-edgeos@releases/cloudflare-ddns-edgeos.tar.gz
```

### 2 - Deploy

+ `tar -xvf /config/scripts/cloudflare-ddns-edgeos.tar.gz`

+ Alter variables in `/config/scripts/cloudflare-ddns-edgeos/cfddns.sh`.

+ `+x` to files using `chmod +x /config/scripts/cloudflare-ddns-edgeos/cfddns.sh`

### 3 - Test

Before you set it as a scheduled task, execute it first.
```bash
/config/scripts/cloudflare-ddns-edgeos/cfddns.sh
```
If it updates your domain record **both successfully and correctly**, proceed to next step.

**Otherwise**, feel free to [open a issue](https://github.com/MijazzChan/cloudflare-ddns-edgeos/issues/new)

## Using `edgeos`'s task-scheduler to cron
### 4 - Using `task-scheduler` to `cron` it

```bash
configure
Expand All @@ -25,3 +57,31 @@ save
exit
```

## About

EdgeOS somehow didn't support ddns on cloudflare, at least not an option in their web-ui. You need to configure it under cli.

Besides, it communicates with cloudflare through v1 api (currently v4 is actively supported & maintained by cf).

Thus...this project.


## Release/Feature History

### v1.0-hotfix

+ Fix script import error. (MUST use absolute path to import `cloudflare-ddns`)

+ Update usage documentation.

### v1.0

+ Initial release, test passed on er-x.

## License

Copyright © 2022 MijazzChan <mijazz@qq.com>

This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
3 changes: 2 additions & 1 deletion cfddns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@


# Import utility function here
. ./cloudflare-ddns
# You `cloudflare-ddns` file ABSOLUTE PATH here!
. /config/scripts/cloudflare-ddns-edgeos/cloudflare-ddns

########
# Alter here
Expand Down

0 comments on commit 06cf087

Please sign in to comment.