Updated README with better instructions.

This commit is contained in:
Ian Lewis 2017-08-30 19:02:54 +09:00
parent 07a94bab65
commit 889d6de178
2 changed files with 32 additions and 10 deletions

View File

@ -15,6 +15,8 @@ You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
A bot should provide instructions when you submit a PR.
## Code reviews
All submissions, including submissions by project members, require review. We

View File

@ -1,19 +1,32 @@
# Cloud Dynamic DNS
This project contains a simple [Dynamic
DNS](https://en.wikipedia.org/wiki/Dynamic_DNS) client that can be used with cloud services. It simply gets your current IP address and sets it to DNS records in backing DNS services. It will do it's best to make sure that the DNS record is always there and set to the desired value, even if something or someone updates or deletes it. It is intended to be used where public internet IPs are assigned dynamically, such as home networks.
This project contains a simple [Dynamic DNS](https://en.wikipedia.org/wiki/Dynamic_DNS) client that can be used with cloud services. It simply gets your current IP address and sets it to DNS records in backing DNS services. It will do it's best to make sure that the DNS record is always there and set to the desired value, even if something or someone updates or deletes it. It is intended to be used where public internet IPs are assigned dynamically, such as home networks.
Currently cloud-dyndns-client only supports Google Cloud Platform. It is planned to add other DNS APIs as backends.
## Build
## Prerequisites
Building cloud-dyndns-client requires Go 1.8.
cloud-dyndns-client requires **Go 1.8**.
## Install
> You can install Go by following [these instructions](https://golang.org/doc/install).
`cloud-dyndns-client` is written in Go, so if you have Go installed you can install it with
`go get`:
```
go build .
go get github.com/IanLewis/cloud-dyndns-client/cmd/cloud-dyndns-client
```
## Google Cloud Platform setup
This will download the code, compile it, and leave an `embedmd` binary
in `$GOPATH/bin`.
## Usage
You need to set set up a DNS provider. Currently only Google Cloud Platform is supported.
### Google Cloud Platform
Set up the client to use GCP by first creating a service account.
@ -36,7 +49,9 @@ PROJECT=$(gcloud config list core/project --format='value(core.project)')
gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:$SA_EMAIL --role roles/dns.admin
```
4. Create a config.json for the client. Enter the domain name you want to update, the GCP project ID, and Cloud DNS managed zone name. Multiple domains can be added as part of the configuration.
### Configuration
Create a `config.json` for the client. Enter the domain name you want to update, the GCP project ID, and Cloud DNS managed zone name. Multiple domains can be added as part of the configuration.
```
{
@ -50,15 +65,16 @@ gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:$SA_EMAI
}
```
## Running the client
### Running the client
Start the app and provide the path to the config.json.
Start the app and provide the path to the `config.json`. You need to specify the service account key in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
```
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
./cloud-dyndns-client -config config.json
```
## Deploy the client to Kubernetes
### Deploy the client to Kubernetes
1. Create a secret for the json key file
@ -72,6 +88,10 @@ kubectl create secret generic cloud-dyndns-client-service-account --from-file=se
kubectl apply -f kubernetes/deploy.yaml
```
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md).
## Disclaimers
This is not an official Google product