Skip to content

Commit

Permalink
Add systemd and goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
avermeer-tc committed Apr 1, 2020
1 parent bfed790 commit f4d0a8a
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

# Test binary, build with `go test -c`
*.test
dist/
dist/*

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
*.out
26 changes: 26 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
env:
- GO111MODULE=on
- GOPROXY=https://gocenter.io
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
# tftp-proxy
A TFTP server that proxies request to an HTTP backend if a file is not found.

# How to build
# Building

go build

or for linux:

env GOOS=linux GOARCH=amd64 go build

# How to run
./tftp-proxy -url=http://example.com -dir=/var/lib/tftpboot &

or for linux:

scp tftp-proxy.service tftp-proxy destination-host:
ssh destination-host
sudo mv tftp-proxy.service /etc/systemd/system/
sudo mv tftp-proxy /usr/bin/tftp-proxy
sudo vi /etc/systemd/system/tftp-proxy.service
systemctl enable tftp-proxy
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module tftp-proxy

require github.com/pin/tftp v2.1.0+incompatible

go 1.13
8 changes: 8 additions & 0 deletions tftp-proxy.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=tftp-proxy

[Service]
ExecStart=/usr/bin/tftp-proxy -url=http://zerotouch.example.com

[Install]
WantedBy=multi-user.target

0 comments on commit f4d0a8a

Please sign in to comment.