diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b6007dd --- /dev/null +++ b/.drone.yml @@ -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 diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 0e0f061..0000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -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 / - 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 }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index e217661..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -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 ./... diff --git a/README.md b/README.md index 41cc780..e0f530d 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,62 @@ -![Test & Build](https://github.com/DataHearth/ddnsclient/actions/workflows/go.yml/badge.svg) -![Docker](https://github.com/DataHearth/ddnsclient/actions/workflows/docker-publish.yml/badge.svg) +# DDNSClient -# 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 -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 You have 2 options to run the DDNS client. -You can run it as: -- docker container: +You can run it as: + +- 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: -``` -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 + +or with a custom config path: + +```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: -``` -git clone https://github.com/datahearth/ddnsclient.git + +```bash +git clone https://gitea.antoine-langlois.net/DataHearth/ddnsclient.git cd ddnsclient go build -o ddnsclient cmd/main.go ./ddnsclient ``` + make sure the config is in the same directory with the name `ddnsclient.yaml` or set the `CONFIG_PATH` variable ## Supported providers Any provider using the standard for DDNS should be supported by default thanks to the generic configuration. 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 | -|------------ |------------------- |------------- |-------- | -| OVH | ovh | YES | YES | -| GOOGLE | google | YES | YES | -| DuckDNS | duckdns | YES | YES | -| No-IP | noip | YES | NO | -| DynDNS | dyndns | YES | NO | -| CloudFlare | cloudflare | NO | NO | +| Provider | Configuration key | Implemented | Tested | +| ---------- | ----------------- | ----------- | ------ | +| OVH | ovh | YES | YES | +| GOOGLE | google | YES | YES | +| DuckDNS | duckdns | YES | YES | +| No-IP | noip | YES | NO | +| DynDNS | dyndns | YES | NO | +| CloudFlare | cloudflare | NO | NO | -Note: +Note: For DDNS providers using basic authentication inside URL (e.g: `https://{username}:{password}@ddns.something.com/...`), remove the `username`and `password` part to get only the "classical" URL (e.g: `https://ddns.something.com/...`). Then fill the `username` and `password` fields in the provider configuration. ## Contributing -You can contribute to the project by submitting an issue and resolve issues by creating PRs. I'll look at them and validate your changes if they're correct as soon as possible. +You can contribute to the project by submitting an issue and resolve issues by creating PRs. I'll look at them and validate your changes if they're correct as soon as possible. ## TO-DO @@ -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) ## 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/ -- DuckDNS DDNS doc: https://www.duckdns.org/spec.jsp -- No-IP DDNS doc: https://www.noip.com/integrate/request -- DynDNS DDNS doc: https://help.dyn.com/remote-access-api/perform-update/ + +- Google DDNS doc: +- OVH DDNS doc: +- DuckDNS DDNS doc: /www.duckdns.org/spec.jsp> +- No-IP DDNS doc: +- DynDNS DDNS doc: