A EUI-64 address calculator implemented in Go, HTMX, and Templ.
4.8K
A EUI-64 address calculator implemented in Go, HTMX, and Templ.
This project was inspired by ThePrincelle's EUI64-Calculator
This project provides a simple tool for calculating an EUI-64 IPv6 address using a MAC addresses and IPv6 Prefix.
xx-xx-xx-xx-xx-xx.Calculate to see the results.docker run -d --name eui64-calculator nickfedor/eui64-calculator:latest
Running the Basic Template:
docker compose -f ./Docker/compose.yaml up -d
Traefik Reverse Proxy example
go install github.com/a-h/templ/cmd/templ@latestClone the repository:
git clone https://github.com/nicholas-fedor/eui64-calculator.git
Enter the repository:
cd eui64-calculator
Install Dependencies:
go mod download
Generate Templates:
templ generate
Run the Server:
go run ./cmd/server/main.go
The application will be accessible at http://localhost:8080/
.
├── .github
│ ├── workflows
│ │ ├── create-manifests.yaml
│ │ ├── lint-go.yaml
│ │ ├── build.yaml
│ │ ├── clean-cache.yaml
│ │ ├── pull-request.yaml
│ │ ├── release.yaml
│ │ ├── security.yaml
│ │ └── test.yaml
│ ├── ISSUE_TEMPLATE
│ │ ├── bug_report.yaml
│ │ ├── config.yaml
│ │ └── feature_request.yaml
│ ├── assets
│ │ ├── eui64-calculator_screenshot.png
│ │ └── eui64-calculator_social-preview_1280x640.png
│ └── renovate.json
├── build
│ ├── docker
│ │ ├── Dockerfile
│ │ └── .dockerignore
│ ├── golangci-lint
│ │ └── golangci.yaml
│ └── goreleaser
│ └── goreleaser.yaml
├── cmd
│ └── server
│ ├── static
│ │ ├── favicon.ico
│ │ └── styles.css
│ ├── main.go
│ └── main_test.go
├── internal
│ ├── ui
│ │ ├── doc.go
│ │ ├── generate.go
│ │ ├── home.templ
│ │ ├── layout.templ
│ │ ├── result.templ
│ │ └── ui_test.go
│ ├── eui64
│ │ ├── eui64.go
│ │ └── eui64_test.go
│ ├── handlers
│ │ ├── handlers.go
│ │ └── handlers_test.go
│ └── validators
│ ├── ipv6_prefix_validator.go
│ ├── ipv6_prefix_validator_test.go
│ ├── mac_validator.go
│ └── mac_validator_test.go
├── .all-contributorsrc
├── .circleci
│ └── config.yml
├── .codacy.yml
├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── examples
│ ├── Traefik
│ │ ├── .env
│ │ ├── README.md
│ │ ├── docker-compose.yaml
│ │ └── traefik.yaml
│ └── docker-compose.yaml
├── go.mod
└── go.sum
If you're using VSCode, I've included an extensions.json file with recommended extensions.
Installing the Templ CLI
go install github.com/a-h/templ/cmd/templ@latest
Rebuilding .templ.go files after updates to .templ files (run from the project's root directory)
Linux:
rm ./ui/*_templ.go && templ generate
Windows:
del ui\*_templ.go && templ generate
Unit Tests:
go test ./...
Docker Test Stage:
The Dockerfile includes a test stage to ensure all tests pass before building the production image.
Rebuilding the Docker image:
docker build -f docker/Dockerfile-dev -t eui64-calculator-dev .
Running the image locally:
docker run -it -p 8080:8080 eui64-calculator-dev
The Dockerfile uses gcr.io/distroless/static-debian12 as the final runtime image for the application. This results in a minimal container image without a shell or other features typical of other container images.
I opted to hardcode Gin's release mode to avoid redundant environment variables. This can be easily commented out in the cmd/server/main.go file.
This was a weekend project and there's plenty of opportunity for improvement.
If you feel like contributing, please:
git checkout -b feature/AmazingFeaturegit commit -m "Add some AmazingFeature"git push origin feature/AmazingFeatureThis project is licensed under the GNU GPLv3 license - see the LICENSE file for details.
Content type
Image
Digest
sha256:0579cf5d4…
Size
4.1 MB
Last updated
about 2 months ago
docker pull nickfedor/eui64-calculator:riscv64-latest