/go-postgresql-dhcp-server

Simple dhcp server with reservation in postgres database

Primary LanguageGoGNU Affero General Public License v3.0AGPL-3.0

Docker Automated build

go-postgresql-dhcp-server

This project aim to launch a dhcp4 server with only reservation capacibility. A postgres database contain reservation info, all database entry will be allocated with an ip and other will be ignored.

Work in docker container

Initialisation

$ docker-compose up -d
$ make db-schema db-fixtures
$ make enter

Commands

You can now use commands

Get dependencies

# make deps

Build project

# make build

Run tests

# make test

Test in Vagrant environment

You must at least run postgres container and populate it with schema and datas

$ make build
$ vagrant up pxe_server
$ vagrant ssh pxe_server
$ sudo su
# /vagrant/bin/go-postgresql-dhcp-server

Default env variable are set in vagrantfile with provisions here

In another terminal:

$ vagrant destroy blank_server -f && vagrant up blank_server

Automation

You can automate project if you uncomment this line

Then run this commands

  • In docker
$ make watch-go
  • In vagrant
$ make watch-bin
  • In another terminal
$ vagrant rsync-auto

Source and documentation

License

AGPL