Skip to content

Commit f4d0a8a

Browse files
committed
Add systemd and goreleaser
1 parent bfed790 commit f4d0a8a

File tree

5 files changed

+54
-2
lines changed

5 files changed

+54
-2
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
# Test binary, build with `go test -c`
99
*.test
10+
dist/
11+
dist/*
1012

1113
# Output of the go coverage tool, specifically when used with LiteIDE
12-
*.out
14+
*.out

.goreleaser.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
env:
2+
- GO111MODULE=on
3+
- GOPROXY=https://gocenter.io
4+
before:
5+
hooks:
6+
- go mod tidy
7+
builds:
8+
- env:
9+
- CGO_ENABLED=0
10+
archives:
11+
- replacements:
12+
darwin: Darwin
13+
linux: Linux
14+
windows: Windows
15+
386: i386
16+
amd64: x86_64
17+
checksum:
18+
name_template: 'checksums.txt'
19+
snapshot:
20+
name_template: "{{ .Tag }}-next"
21+
changelog:
22+
sort: asc
23+
filters:
24+
exclude:
25+
- '^docs:'
26+
- '^test:'

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
# tftp-proxy
22
A TFTP server that proxies request to an HTTP backend if a file is not found.
33

4-
# How to build
4+
# Building
5+
56
go build
67

8+
or for linux:
9+
10+
env GOOS=linux GOARCH=amd64 go build
11+
712
# How to run
813
./tftp-proxy -url=http://example.com -dir=/var/lib/tftpboot &
14+
15+
or for linux:
16+
17+
scp tftp-proxy.service tftp-proxy destination-host:
18+
ssh destination-host
19+
sudo mv tftp-proxy.service /etc/systemd/system/
20+
sudo mv tftp-proxy /usr/bin/tftp-proxy
21+
sudo vi /etc/systemd/system/tftp-proxy.service
22+
systemctl enable tftp-proxy

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
module tftp-proxy
22

33
require github.com/pin/tftp v2.1.0+incompatible
4+
5+
go 1.13

tftp-proxy.service

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Unit]
2+
Description=tftp-proxy
3+
4+
[Service]
5+
ExecStart=/usr/bin/tftp-proxy -url=http://zerotouch.example.com
6+
7+
[Install]
8+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)