Skip to content

Commit

Permalink
Rename project to doddns
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Alexander committed Aug 24, 2015
1 parent f347114 commit c939b38
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
doduc
=====
doddns
======

A dynamic DNS system for DigitalOcean

Expand All @@ -12,22 +12,21 @@ Existing clients seem to query third-party services like
[ifconfig.me](http://ifconfig.me/ip). Rather than relying on these services, I
wanted to use my own DigitalOcean droplet to serve the IPs.

doduc has two components. The first is a server, which runs on your DigitalOcean
doddns has two components. The first is a server, which runs on your DigitalOcean
droplet (or any other remote server). It runs on port 18768 and responds to all
HTTP requests with their source IP. The second is a client, which runs on your
local computer. It fetches your IP address from the server and updates your
DigitalOcean DNS for your chosen domain and subdomain with the address. Both the
server and client save output to a log file (`doduc-server.log` and
`doduc-client.log`, respectively).
server and client save output to a log file.

The server and client are designed to run continuously, so you will probably
want to run them in the background. On POSIX operating systems, you can run

doduc-[program] &
doddns-[program] &

In Windows PowerShell, you can run

Start-Process doduc-[program] -ArgumentList [comma-separated list of arguments] -WindowStyle Hidden
Start-Process doddns-[program] -ArgumentList [comma-separated list of arguments] -WindowStyle Hidden

Server
------
Expand All @@ -38,7 +37,7 @@ Server

### Usage

doduc-server [OPTIONS]
doddns-server [OPTIONS]

#### Flags

Expand All @@ -56,7 +55,7 @@ Client
Periodically update the `A` record for `SUBDOMAIN`.`DOMAIN` using the IP
returned from `SERVER`, using the DigitalOcean API token stored in `TOKEN`:

doduc-client [OPTIONS] [DOMAIN] [SUBDOMAIN] [SERVER] [TOKEN]
doddns-client [OPTIONS] [DOMAIN] [SUBDOMAIN] [SERVER] [TOKEN]

If you wish to use another server to get your external IP, the only requirement
is that it must respond to a GET HTTP request with a valid IP address (e.g.
Expand Down
5 changes: 4 additions & 1 deletion doduc-client/client.go → doddns-client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"log"
"net/http"
"os"
"path/filepath"
"strings"
"time"
)
Expand Down Expand Up @@ -97,7 +98,9 @@ func main() {
}
ts := TokenSource{AccessToken: string(token)}
client := godo.NewClient(oauth2.NewClient(oauth2.NoContext, ts))
logFile, err := os.OpenFile("doduc-client.log", os.O_APPEND|os.O_CREATE, 0666)
logFile, err := os.OpenFile(filepath.Base(strings.TrimSuffix(os.Args[0],
filepath.Ext(os.Args[0])))+".log",
os.O_APPEND|os.O_CREATE, 0666)
if err != nil {
log.Fatal("unable to open log file")
}
Expand Down
6 changes: 5 additions & 1 deletion doduc-server/server.go → doddns-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"net"
"net/http"
"os"
"path/filepath"
"strings"
)

// Handler responds a request with its IP address.
Expand All @@ -22,7 +24,9 @@ func Handler(w http.ResponseWriter, r *http.Request) {
func main() {
fport := flag.Uint("port", 18768, "the port to listen on")
flag.Parse()
logFile, err := os.OpenFile("doduc-server.log", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666)
logFile, err := os.OpenFile(filepath.Base(strings.TrimSuffix(os.Args[0],
filepath.Ext(os.Args[0])))+".log",
os.O_APPEND|os.O_CREATE, 0666)
if err != nil {
log.Fatal("unable to open log file")
}
Expand Down
4 changes: 0 additions & 4 deletions doduc-client/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions doduc-server/.gitignore

This file was deleted.

0 comments on commit c939b38

Please sign in to comment.