Skip to content

Commit 9d48cd7

Browse files
committed
Initial release
1 parent 57d1002 commit 9d48cd7

File tree

10 files changed

+397
-0
lines changed

10 files changed

+397
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: kbudde

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '25 19 * * 3'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'go' ]
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33+
# Learn more:
34+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/[email protected]
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v1
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
49+
50+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51+
# If this step fails, then you should remove it and run the build manually (see below)
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v1
54+
55+
# ℹ️ Command-line programs to run using the OS shell.
56+
# 📚 https://git.io/JvXDl
57+
58+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59+
# and modify them (or add more) to build your code if your project
60+
# uses a compiled language
61+
62+
#- run: |
63+
# make bootstrap
64+
# make release
65+
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v1

.github/workflows/goreleaser.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
-
16+
name: Checkout
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
-
21+
name: Set up Go
22+
uses: actions/setup-go@v2
23+
with:
24+
go-version: 1.17
25+
-
26+
name: Docker Login
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.repository_owner }}
31+
password: ${{ secrets.GH_TOKEN }}
32+
-
33+
name: Docker Setup Buildx
34+
uses: docker/[email protected]
35+
-
36+
name: Run GoReleaser
37+
uses: goreleaser/goreleaser-action@v2
38+
with:
39+
distribution: goreleaser
40+
version: latest
41+
args: release --rm-dist
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.goreleaser.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
5+
- env:
6+
- CGO_ENABLED=0
7+
targets:
8+
- linux_amd64
9+
- linux_arm64
10+
- linux_arm_6
11+
- linux_arm_7
12+
tags: timetzdata
13+
ldflags:
14+
- -X main.Version={{.Version}}
15+
- -X main.Revision={{.ShortCommit}}
16+
- -X main.Branch={{.Branch}}
17+
- -X main.BuildDate={{.CommitDate}}
18+
checksum:
19+
name_template: 'checksums.txt'
20+
21+
release:
22+
footer: |
23+
## Docker images
24+
- `docker pull ghcr.io/kbudde/gota:{{.Version}}`
25+
- `docker pull ghcr.io/kbudde/gota:{{.ShortCommit}}`
26+
dockers:
27+
- goos: linux
28+
goarch: amd64
29+
image_templates:
30+
- "ghcr.io/kbudde/gota:linux-amd64-{{.ShortCommit}}"
31+
use: buildx
32+
build_flag_templates:
33+
- "--label=org.opencontainers.image.created={{.Date}}"
34+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
35+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
36+
- "--label=org.opencontainers.image.version={{.Version}}"
37+
- "--label=org.opencontainers.image.source=https://github.com/kbudde/gota"
38+
- "--platform=linux/amd64"
39+
40+
- goos: linux
41+
goarch: arm
42+
goarm: 6
43+
image_templates:
44+
- "ghcr.io/kbudde/gota:linux-arm6-{{.ShortCommit}}"
45+
use: buildx
46+
build_flag_templates:
47+
- "--label=org.opencontainers.image.created={{.Date}}"
48+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
49+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
50+
- "--label=org.opencontainers.image.version={{.Version}}"
51+
- "--label=org.opencontainers.image.source=https://github.com/kbudde/gota"
52+
- "--platform=linux/arm/v6"
53+
54+
- goos: linux
55+
goarch: arm
56+
goarm: 7
57+
image_templates:
58+
- "ghcr.io/kbudde/gota:linux-arm7-{{.ShortCommit}}"
59+
use: buildx
60+
build_flag_templates:
61+
- "--label=org.opencontainers.image.created={{.Date}}"
62+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
63+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
64+
- "--label=org.opencontainers.image.version={{.Version}}"
65+
- "--label=org.opencontainers.image.source=https://github.com/kbudde/gota"
66+
- "--platform=linux/arm/v7"
67+
68+
- goos: linux
69+
goarch: arm64
70+
image_templates:
71+
- "ghcr.io/kbudde/gota:linux-arm64-{{.ShortCommit}}"
72+
use: buildx
73+
build_flag_templates:
74+
- "--label=org.opencontainers.image.created={{.Date}}"
75+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
76+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
77+
- "--label=org.opencontainers.image.version={{.Version}}"
78+
- "--label=org.opencontainers.image.source=https://github.com/kbudde/gota"
79+
- "--platform=linux/arm64"
80+
81+
82+
docker_manifests:
83+
-
84+
name_template: ghcr.io/kbudde/gota:latest
85+
image_templates:
86+
- ghcr.io/kbudde/gota:linux-amd64-{{.ShortCommit}}
87+
- ghcr.io/kbudde/gota:linux-arm6-{{.ShortCommit}}
88+
- ghcr.io/kbudde/gota:linux-arm7-{{.ShortCommit}}
89+
- ghcr.io/kbudde/gota:linux-arm64-{{.ShortCommit}}
90+
-
91+
name_template: ghcr.io/kbudde/gota:{{.Version}}
92+
image_templates:
93+
- ghcr.io/kbudde/gota:linux-amd64-{{.ShortCommit}}
94+
- ghcr.io/kbudde/gota:linux-arm6-{{.ShortCommit}}
95+
- ghcr.io/kbudde/gota:linux-arm7-{{.ShortCommit}}
96+
- ghcr.io/kbudde/gota:linux-arm64-{{.ShortCommit}}
97+

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM scratch
2+
3+
USER 5000
4+
COPY gota /bin/gota
5+
CMD [ "/bin/gota" ]

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
# gota
22
Arduino http OTA server implemented in golang
3+
4+
It's a very simple example. Do not use for anything :)
5+
6+
## how to use
7+
8+
upload file with curl to this server
9+
10+
`curl -X POST -F "[email protected]" localhost:8080/upload/`
11+
12+
download file with curl from this server
13+
14+
`curl http://localhost:8080/download/main.go`

go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/kbudde/gota
2+
3+
go 1.17
4+
5+
require (
6+
github.com/kelseyhightower/envconfig v1.4.0
7+
github.com/rs/zerolog v1.26.1
8+
)

go.sum

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
2+
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
3+
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
4+
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
5+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
6+
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
7+
github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc=
8+
github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc=
9+
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
10+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
11+
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
12+
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
13+
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
14+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
15+
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
16+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
17+
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
18+
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
19+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
20+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
21+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
22+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
23+
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
24+
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
25+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
26+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
27+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
28+
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
29+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
30+
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
31+
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
32+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
33+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
34+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 commit comments

Comments
 (0)