add drone CI/CD and update readme
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
8415836cb0
commit
236c82e272
|
@ -0,0 +1,42 @@
|
||||||
|
name: default
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: golang:1.15-alpine
|
||||||
|
commands:
|
||||||
|
- go build -v ./...
|
||||||
|
|
||||||
|
- name: deploy:gitea-registry
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: gitea.antoine-langlois.net
|
||||||
|
username:
|
||||||
|
from_secret: GITEA_REGISTRY_USERNAME
|
||||||
|
password:
|
||||||
|
from_secret: GITEA_REGISTRY_PASSWORD
|
||||||
|
repo: DataHearth/ddnsclient
|
||||||
|
auto_tag: true
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
include:
|
||||||
|
- tag
|
||||||
|
depends_on:
|
||||||
|
- build
|
||||||
|
|
||||||
|
- name: deploy:docker-registry
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: DOCKER_REGISTRY_USERNAME
|
||||||
|
password:
|
||||||
|
from_secret: DOCKER_REGISTRY_PASSWORD
|
||||||
|
repo: datahearth/ddnsclient
|
||||||
|
auto_tag: true
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
include:
|
||||||
|
- tag
|
||||||
|
depends_on:
|
||||||
|
- build
|
|
@ -1,55 +0,0 @@
|
||||||
name: Docker
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
# Publish semver tags as releases.
|
|
||||||
tags: [ 'v*.*.*' ]
|
|
||||||
|
|
||||||
env:
|
|
||||||
# Use docker.io for Docker Hub if empty
|
|
||||||
REGISTRY: ghcr.io
|
|
||||||
# github.repository as <account>/<repo>
|
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: self-hosted
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
# Login against a Docker registry except on PR
|
|
||||||
# https://github.com/docker/login-action
|
|
||||||
- name: Log into registry ${{ env.REGISTRY }}
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
# Extract metadata (tags, labels) for Docker
|
|
||||||
# https://github.com/docker/metadata-action
|
|
||||||
- name: Extract Docker metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v3
|
|
||||||
with:
|
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
|
|
||||||
# Build and push Docker image with Buildx (don't push on PR)
|
|
||||||
# https://github.com/docker/build-push-action
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
|
@ -1,25 +0,0 @@
|
||||||
name: Go
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build:
|
|
||||||
runs-on: self-hosted
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: 1.15
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: go build -v ./...
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: go test -v ./...
|
|
40
README.md
40
README.md
|
@ -1,32 +1,39 @@
|
||||||
![Test & Build](https://github.com/DataHearth/ddnsclient/actions/workflows/go.yml/badge.svg)
|
# DDNSClient
|
||||||
![Docker](https://github.com/DataHearth/ddnsclient/actions/workflows/docker-publish.yml/badge.svg)
|
|
||||||
|
|
||||||
# DDNS Client
|
[![License](https://img.shields.io/badge/license-MIT-blue)](https://gitea.antoine-langlois.net/DataHearth/ddnsclient/src/branch/main/LICENSE)
|
||||||
|
![Docker](https://img.shields.io/docker/v/datahearth/ddnsclient)
|
||||||
|
[![Build Status](https://drone.antoine-langlois.net/api/badges/DataHearth/ddnsclient/status.svg)](https://drone.antoine-langlois.net/DataHearth/ddnsclient)
|
||||||
|
|
||||||
## How to install DDNS-CLIENT as dependency
|
## How to install DDNS-CLIENT as dependency
|
||||||
|
|
||||||
Simply run the command `go get github.com/datahearth/ddnsclient`
|
Simply run the command `go get gitea.antoine-langlois.net/DataHearth/ddnsclient`
|
||||||
|
|
||||||
## Run the client
|
## Run the client
|
||||||
|
|
||||||
You have 2 options to run the DDNS client.
|
You have 2 options to run the DDNS client.
|
||||||
You can run it as:
|
You can run it as:
|
||||||
|
|
||||||
- docker container:
|
- docker container:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -v /path/to/config/ddnsclient.yaml:/ddnsclient.yaml --name ddnsclient datahearth/ddnsclient:latest
|
||||||
```
|
```
|
||||||
docker run -v /path/to/config/ddnsclient.yaml:/ddnsclient.yaml --name ddnsclient ghcr.io/datahearth/ddnsclient:latest
|
|
||||||
```
|
|
||||||
or with a custom config path:
|
or with a custom config path:
|
||||||
```
|
|
||||||
docker run -e CONFIG_PATH=/path/inside/container/custom.yaml -v /path/to/config/ddnsclient.yaml:/path/inside/container/custom.yaml --name ddnsclient ghcr.io/datahearth/ddnsclient:latest
|
```bash
|
||||||
|
docker run -e CONFIG_PATH=/path/inside/container/custom.yaml -v /path/to/config/ddnsclient.yaml:/path/inside/container/custom.yaml --name ddnsclient datahearth/ddnsclient:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
- binary executable:
|
- binary executable:
|
||||||
```
|
|
||||||
git clone https://github.com/datahearth/ddnsclient.git
|
```bash
|
||||||
|
git clone https://gitea.antoine-langlois.net/DataHearth/ddnsclient.git
|
||||||
cd ddnsclient
|
cd ddnsclient
|
||||||
go build -o ddnsclient cmd/main.go
|
go build -o ddnsclient cmd/main.go
|
||||||
./ddnsclient
|
./ddnsclient
|
||||||
```
|
```
|
||||||
|
|
||||||
make sure the config is in the same directory with the name `ddnsclient.yaml` or set the `CONFIG_PATH` variable
|
make sure the config is in the same directory with the name `ddnsclient.yaml` or set the `CONFIG_PATH` variable
|
||||||
|
|
||||||
## Supported providers
|
## Supported providers
|
||||||
|
@ -36,7 +43,7 @@ You just need to get your credentials (obviously) and the update URL.
|
||||||
If you face any kind of issue, feel free to open an issue and ping me in it. If necessary, a branch will be open to fix the problem.
|
If you face any kind of issue, feel free to open an issue and ping me in it. If necessary, a branch will be open to fix the problem.
|
||||||
|
|
||||||
| Provider | Configuration key | Implemented | Tested |
|
| Provider | Configuration key | Implemented | Tested |
|
||||||
|------------ |------------------- |------------- |-------- |
|
| ---------- | ----------------- | ----------- | ------ |
|
||||||
| OVH | ovh | YES | YES |
|
| OVH | ovh | YES | YES |
|
||||||
| GOOGLE | google | YES | YES |
|
| GOOGLE | google | YES | YES |
|
||||||
| DuckDNS | duckdns | YES | YES |
|
| DuckDNS | duckdns | YES | YES |
|
||||||
|
@ -57,8 +64,9 @@ You can contribute to the project by submitting an issue and resolve issues by c
|
||||||
- Add more DDNS provider (see the table above)
|
- Add more DDNS provider (see the table above)
|
||||||
|
|
||||||
## Useful links
|
## Useful links
|
||||||
- Google DDNS doc: https://support.google.com/domains/answer/6147083?hl=en#zippy=%2Cusing-the-api-to-update-your-dynamic-dns-record
|
|
||||||
- OVH DDNS doc: https://docs.ovh.com/us/en/domains/hosting_dynhost/
|
- Google DDNS doc: <https://support.google.com/domains/answer/6147083?hl=en#zippy=%2Cusing-the-api-to-update-your-dynamic-dns-record>
|
||||||
- DuckDNS DDNS doc: https://www.duckdns.org/spec.jsp
|
- OVH DDNS doc: <https://docs.ovh.com/us/en/domains/hosting_dynhost/>
|
||||||
- No-IP DDNS doc: https://www.noip.com/integrate/request
|
- DuckDNS DDNS doc: <https:/>/www.duckdns.org/spec.jsp>
|
||||||
- DynDNS DDNS doc: https://help.dyn.com/remote-access-api/perform-update/
|
- No-IP DDNS doc: <https://www.noip.com/integrate/request>
|
||||||
|
- DynDNS DDNS doc: <https://help.dyn.com/remote-access-api/perform-update/>
|
||||||
|
|
Loading…
Reference in New Issue