Giter Club home page Giter Club logo

oink's Introduction

Oink!

A lightweight DDNS client for Porkbun

Oink! is an unofficial DDNS client for porkbun.com built in Go. Oink! only depends on Go's standard library.


How to install

You can install Oink! using an official package or by using make.

Get it from the Snap Store

Setup instructions for the snap package can be found on the Snap Store

On distributions supporting .deb files (Debian, Ubuntu, ...)

dpkg -i <oink_pkg>.deb

On Arch-based distros

Note: Also available in the AUR

pacman -U <oink_pkg>.pkg.tar.zst 

Using the Nix package manager

Jeremy Baxter maintains the oink package in nixpkgs. On any system with Nix, use this command to enter a temporary shell with Oink:

nix-shell -p oink

Alternatively on a NixOS system you can enable services.oink. Look up services.oink in man configuration.nix for more information.

Or you can build from source and install using make

Requires make and go

make
sudo make install

You may uninstall using sudo make uninstall to remove all configuration files and binaries

For distributions using init systems other than systemd alternative init scripts are provided in the init directory


How to setup

The setup process is simple:

  • If installed correctly you should find Oink!'s configuration file in /etc/oink_ddns/config.json. Open the file with your text editor of choice.
  • In the configuration file you should find the following contents that must be filled in:

⚠️ In case you do not already have an API key, you will need to request one at: https://porkbun.com/account/api

{
    "global": {
        "secretapikey": "<your secret api key here>",
        "apikey": "<your api key here>",
        "interval": 900,
        "ttl": 600
    },
    "domains": [
        {
            "domain": "<your domain here>",
            "subdomain": "<your subdomain here>"
        }
    ]
}

If you want to update more than one domain or subdomain, you can add new domains like so:

{
    "global": {
        "secretapikey": "<your secret api key here>",
        "apikey": "<your api key here>",
        "interval": 900,
        "ttl": 600
    },
    "domains": [
        {
            "secretapikey": "<override secret api key here>",
            "apikey": "<override api key here>",
            "domain": "<your domain here>",
            "subdomain": "<your subdomain here>",
            "ttl": 800
        },
        {
            "domain": "<your domain 2 here>",
            "subdomain": "<your subdomain 2 here>"
        }
    ]
}

Entries must at least contain the domain and subdomain fields.

  • Enable and start the service using systemd

⚠️ Make sure to enable API ACCESS in your porkbun domain's control panel

systemctl enable oink_ddns
systemctl start oink_ddns
  • You are done! Your domain DNS record should update automatically

oink's People

Contributors

jtbx avatar rlado avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

oink's Issues

FR: Run on systemd timer rather than as a daemon

It would be nice if there were an option to run Oink on a systemd timer launching only at update intervals rather than running as a daemon that calls sleep() on a loop.

Not running as a daemon would reduce the overall memory footprint on machines where it runs, requiring memory only when an update is being performed.

Thanks for making this handy DDNS tool!

openrc init script for alpine

I am using your excellent work on an alpine vm which uses openrc rather than systemd. Perhaps you'd like to include this working init script for others similarly (Gentoo, etc) situated:

#!/sbin/openrc-run

##/etc/init.d/oink_ddns

name="oink_ddns"
cfgfile="/etc/oink_ddns/config.json"
command="/usr/bin/oink"
pidfile="/run/oink_ddns/oink_ddns.pid"
command_background="yes"

start_pre() {
checkpath --directory --owner root:root --mode 0775
/run/oink_ddns
}

This file and:

rc-update add oink_ddns default

does the job

Debian <= 11 dkpg cannot handle .zst-compression

Installing the .deb package with any Debian version before 12 will result in the following error:

~$ sudo dpkg -i oink.deb
dpkg-deb: error: archive 'oink.deb' uses unknown compression for member 'control.tar.zst', giving up dpkg: error processing archive oink.deb (--install): dpkg-deb --control subprocess returned error exit status 2 Errors were encountered while processing: oink.deb

The fix is to compress with .xz

Snap Package fails to install files

Running on a very clean Debian 12 installation, snap appears to install the package and dependencies with no issues

root@debianTest:~# snap install --beta oink
2023-12-27T15:23:55-07:00 INFO Waiting for automatic snapd restart...
oink (beta) 1.0.1 from Ricard Lado (rlado) installed
root@debianTest:~# snap list
Name    Version   Rev    Tracking       Publisher   Notes
core22  20231123  1033   latest/stable  canonical✓  base
oink    1.0.1     14     latest/beta    rlado       -
snapd   2.60.4    20290  latest/stable  canonical✓  snapd

However there is no directory or config file created at /etc/oink_ddns/ and there is no service created for oink_ddns:

root@debianTest:~# systemctl status oink_ddns
Unit oink_ddns.service could not be found.

Critically, the snap directory for oink doesn't contain anything

root@debianTest:~# tree snap
snap
└── oink
    ├── 14
    ├── common
    └── current -> 14

5 directories, 0 files

Otherwise this is a very cool tool, I think a snap package for distribution is an excellent way to go!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.