Skip to content

Commit 41f1fda

Browse files
committed
Merge branch 'release/3.5.0'
2 parents 7e477f0 + 4cf7538 commit 41f1fda

File tree

7 files changed

+933
-185
lines changed

7 files changed

+933
-185
lines changed

README.md

+44-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,51 @@ It'll regularly check your IP address and update a selected Digital Ocean domain
1111
- At least one domain name added to your account.
1212
- At least a `cname` or an `A` record added to a domain that DODDNS will try to update.
1313

14-
# Docs
14+
## Installation / Usage
1515

16-
You can see installation instruction, usage and other things [in the documentation](https://atomescrochus.gitbook.io/doddns/).
16+
Using composer, you will need to run the following command to install DODDNS into the global space:
17+
18+
```
19+
composer global require jpmurray/doddns
20+
```
21+
22+
For DODDNS to work correctly you will have to make sure composer vendor's bin folder is added to your system's `$PATH`. You can test it by typing `doddns` in your terminal of choice: if it is installed correctly, you should be seeing commands usage instructions.
23+
24+
Next, you will have to add your DigitalOcean API token with the `token:add` command and then select which record you want to update with the `record:select` command.
25+
26+
Once it's done, you're good to go!
27+
28+
## Available commands
29+
30+
You can then use the doddns command to see a list of possible actions:
31+
32+
- `ip:last`: will output the last known IP that has been found / used and the timestamp of last update.
33+
- `ip:current`: will query ipcheck.doddns.com to get your current IP address.
34+
- `notifications:toggle`: turn desktop notification on or off (default is off).
35+
- `record:delete`: removes saved record from the config file.
36+
- `record:select`: Display a list of domains and records found with your DigitalOcean token to choose which to update with your current IP address.
37+
- `record:update`: updates the selected record in config file with current IP.
38+
- `token:add {token}`: will set your DigitalOcean personal access token, overwriting any existing value.
39+
40+
### Automatic updates
41+
42+
If you want DODDNS to update your selected domain record automatically with your current IP address, you will have to add entry to your cron tab like so:
43+
44+
```
45+
* * * * * php /path-to-doddns/doddns schedule:run >> /dev/null 2>&1.
46+
```
47+
48+
After that, DODDNS will try to update every hours by itself.
49+
50+
## Updating DODDNS
51+
52+
### Version 3.0.0 and after
53+
54+
Version 3.0.0 changed a lot in term of workflow. If you install DODDNS from before 3.0.0, it is suggested that you remove the doddns folder entirely from the .config folder located in your home directory then start back from scratch so everything is clean.
55+
56+
### Before 3.0.0
57+
58+
If you've pulled or downloaded a new version, be sure to run doddns setup and choose the upgrade option to make sure your local database is up to date! You can also forgo the menu to upgrade directly using `doddns setup -U`.
1759

1860
## PRs
1961
Any help is appreciated, please PR to the develop branch.

app/Helpers/DigitalOceanHelper.php

+6-11
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,24 @@
22

33
namespace App\Helpers;
44

5-
use DigitalOceanV2\Adapter\GuzzleHttpAdapter;
6-
use DigitalOceanV2\DigitalOceanV2;
5+
use DigitalOceanV2\Client;
76

8-
/**
9-
*
10-
*/
117
class DigitalOceanHelper
128
{
13-
149
private $adapter;
1510
private $digitalocean;
16-
11+
1712
public $domain;
1813
public $domainRecord;
1914

2015
protected $token;
21-
16+
2217
public function __construct($token)
2318
{
2419
$this->token = $token;
2520

26-
$this->adapter = new GuzzleHttpAdapter($this->token);
27-
$this->digitalocean = new DigitalOceanV2($this->adapter);
21+
$this->digitalocean = new Client();
22+
$this->digitalocean->authenticate($this->token);
2823
$this->domain = $this->digitalocean->domain();
2924
$this->domainRecord = $this->digitalocean->domainRecord();
3025

@@ -41,7 +36,7 @@ public function getDomains()
4136
public function getDomainRecords($domain)
4237
{
4338
return collect($this->domainRecord->getAll($domain))->filter(function ($record) {
44-
return $record->type == "CNAME" || $record->type == "A";
39+
return $record->type == 'CNAME' || $record->type == 'A';
4540
});
4641
}
4742
}

builds/doddns

134 KB
Binary file not shown.

changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## X (Next release)
44

5+
## 3.5.0
6+
7+
- Usage of the Digital Ocean API Client has changed, fixed its usage.
8+
59
## 3.4.2
610

711
- Box file was empty, didn't compile binary correctly.

composer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
],
2525
"require": {
2626
"php": "^7.3",
27-
"guzzlehttp/guzzle": "^7.0",
27+
"guzzlehttp/guzzle": "^7.2",
2828
"laravel-zero/framework": "^8.0",
2929
"nunomaduro/laravel-console-menu": "^3.1",
3030
"nunomaduro/laravel-desktop-notifier": "^2.2",
31-
"toin0u/digitalocean-v2": "~2.0",
31+
"toin0u/digitalocean-v2": "~4.3",
32+
"http-interop/http-factory-guzzle": "^1.0",
3233
"laminas/laminas-text": "^2.7"
3334
},
3435
"require-dev": {

0 commit comments

Comments
 (0)