GitXplorerGitXplorer
i

vercel-ddns

public
16 stars
3 forks
1 issues

Commits

List of commits on branch master.
Unverified
828d46895684741953f1904ef9d7b6f9b90967bc

Docker + CRON

iiam-medvedev committed 8 months ago
Unverified
2135bfb951e097a633d442c77241f86dff0e443b

Refactor

iiam-medvedev committed 10 months ago
Verified
7f3b18966a43af84dd5d681c90e7351439fcd7cf

Update README.md

iiam-medvedev committed 4 years ago
Unverified
a154ee35a56ef5483fb72bf397842274b304fe66

init

iiam-medvedev committed 4 years ago

README

The README file for this repository.

Vercel Dynamic DNS

Simple script for exposing a local server with Vercel DNS. It runs on CRON, checking the current IP address and updating DNS records for your domain.

Installation

  1. Ensure that you have jq installed
  2. Download dns-sync.sh
  3. Move dns.config.example to dns.config
  4. Edit the configuration variables as required
  5. Open the cron settings using the command crontab -e
  6. Add the following line to the cron job: */15 * * * * /path-to/vercel-ddns/dns-sync.sh

Usage example

# Creating
āžœ  ./dns-sync.sh
Updating IP: x.x.x.x
Record for SUBDOMAIN does not exist. Creating...
šŸŽ‰ Done!

# Updating
āžœ  ./dns-sync.sh
Updating IP: x.x.x.x
Record for SUBDOMAIN already exists (id: rec_xxxxxxxxxxxxxxxxxxxxxxxx). Updating...
šŸŽ‰ Done!

Docker

There is a dockerized version of vercel-ddns with CRON.

Create 3 files in your directory:

  1. Dockerfile.
  2. start.sh - docker entry point
  3. dns.config - configuration for vercel-ddns.

Dockerfile:

FROM alpine:latest

WORKDIR /root

# Installing dependencies
RUN apk --no-cache add dcron curl jq bash
SHELL ["/bin/bash", "-c"]

# Cloning config and start file
COPY dns.config /root/dns.config
COPY start.sh /root/start.sh

# Cloning app
RUN curl -o /root/dns-sync.sh https://raw.githubusercontent.com/iam-medvedev/vercel-ddns/master/dns-sync.sh
RUN chmod +x /root/dns-sync.sh

# Setting up cron
RUN echo "*/30 * * * * /root/dns-sync.sh >> /var/log/dns-sync.log 2>&1" >> /etc/crontabs/root

# Starting
CMD ["bash", "/root/start.sh"]

start.sh:

# Performs the first sync and starts CRON
bash /root/dns-sync.sh && crond -f