Compare commits
13 Commits
20230613
...
20230625-3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b362647ef3 | ||
|
|
f1d4f43fc7 | ||
|
|
585e970906 | ||
|
|
88d068a452 | ||
|
|
6cd395e190 | ||
|
|
4e710699f4 | ||
|
|
49f9422525 | ||
|
|
4513b84ec9 | ||
|
|
595761d045 | ||
|
|
7f0cb911a1 | ||
|
|
5acaafb691 | ||
|
|
613fbf8d61 | ||
|
|
ef8e1fc21b |
@@ -1,4 +1,4 @@
|
||||
name: Build docker image and push to docker hub on push
|
||||
name: On push to main
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -21,14 +21,13 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
RELEASE_VERSION="dev-$(date +%s)"
|
||||
echo "::set-output name=image_tag::${RELEASE_VERSION}"
|
||||
echo "Action image_tag=${RELEASE_VERSION}"
|
||||
echo "image_tag=${RELEASE_VERSION}" >> ${GITHUB_OUTPUT}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Install buildx
|
||||
uses: docker/setup-buildx-action@v2.6.0
|
||||
uses: docker/setup-buildx-action@v2.7.0
|
||||
|
||||
- name: Login to docker hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
@@ -44,7 +43,7 @@ jobs:
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Build and push ${{ github.repository }}:${{ steps.git.outputs.image_tag }}
|
||||
uses: docker/build-push-action@v4.1.0
|
||||
uses: docker/build-push-action@v4.1.1
|
||||
with:
|
||||
platforms: ${{ env.PLATFORMS }}
|
||||
push: true
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Build docker image and push to docker hub on release
|
||||
name: On release
|
||||
|
||||
on:
|
||||
release:
|
||||
@@ -20,14 +20,13 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
RELEASE_VERSION=${GITHUB_REF#refs/*/}
|
||||
echo "::set-output name=image_tag::${RELEASE_VERSION}"
|
||||
echo "Action image_tag=${RELEASE_VERSION}"
|
||||
echo "image_tag=${RELEASE_VERSION}" >> ${GITHUB_OUTPUT}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Install buildx
|
||||
uses: docker/setup-buildx-action@v2.6.0
|
||||
uses: docker/setup-buildx-action@v2.7.0
|
||||
|
||||
- name: Login to docker hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
@@ -43,7 +42,7 @@ jobs:
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Build and push ${{ github.repository }}:${{ steps.git.outputs.image_tag }}
|
||||
uses: docker/build-push-action@v4.1.0
|
||||
uses: docker/build-push-action@v4.1.1
|
||||
with:
|
||||
platforms: ${{ env.PLATFORMS }}
|
||||
push: true
|
||||
@@ -4,7 +4,7 @@ RUN mkdir /endlessh
|
||||
ADD . /endlessh
|
||||
WORKDIR /endlessh
|
||||
RUN go mod tidy
|
||||
RUN go build -o endlessh .
|
||||
RUN CGO_ENABLED=0 go build -o endlessh .
|
||||
|
||||
FROM gcr.io/distroless/base
|
||||
|
||||
|
||||
@@ -10,10 +10,9 @@ An example how to setup endlessh-go, Prometheus, and Grafana using [docker compo
|
||||
|
||||
An example how to setup endlessh-go with the Maxmind GeoIP Database.
|
||||
|
||||
### Using privileged ports (<1024) on docker
|
||||
## FAQ
|
||||
### Bind to privileged ports (<1024) in a container
|
||||
|
||||
If you want to run the image with privileged ports (below 1025), you need to set the container user to root:
|
||||
You need to add capability `NET_BIND_SERVICE` to the program.
|
||||
|
||||
```yml
|
||||
user: root
|
||||
```
|
||||
If you are using docker, this can be done via cli argument [`--cap-add`](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) or [`cap_add`](https://docs.docker.com/compose/compose-file/compose-file-v3/#cap_add-cap_drop) in the docker compose file.
|
||||
|
||||
10
go.mod
10
go.mod
@@ -4,9 +4,9 @@ go 1.20
|
||||
|
||||
require (
|
||||
github.com/golang/glog v1.1.1
|
||||
github.com/oschwald/geoip2-golang v1.8.0
|
||||
github.com/oschwald/geoip2-golang v1.9.0
|
||||
github.com/pierrre/geohash v1.1.0
|
||||
github.com/prometheus/client_golang v1.15.1
|
||||
github.com/prometheus/client_golang v1.16.0
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -14,10 +14,10 @@ require (
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/oschwald/maxminddb-golang v1.10.0 // indirect
|
||||
github.com/oschwald/maxminddb-golang v1.11.0 // indirect
|
||||
github.com/prometheus/client_model v0.3.0 // indirect
|
||||
github.com/prometheus/common v0.42.0 // indirect
|
||||
github.com/prometheus/procfs v0.9.0 // indirect
|
||||
golang.org/x/sys v0.6.0 // indirect
|
||||
github.com/prometheus/procfs v0.10.1 // indirect
|
||||
golang.org/x/sys v0.9.0 // indirect
|
||||
google.golang.org/protobuf v1.30.0 // indirect
|
||||
)
|
||||
|
||||
22
go.sum
22
go.sum
@@ -19,27 +19,27 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
|
||||
github.com/mmcloughlin/geohash v0.10.0 h1:9w1HchfDfdeLc+jFEf/04D27KP7E2QmpDu52wPbJWRE=
|
||||
github.com/oschwald/geoip2-golang v1.8.0 h1:KfjYB8ojCEn/QLqsDU0AzrJ3R5Qa9vFlx3z6SLNcKTs=
|
||||
github.com/oschwald/geoip2-golang v1.8.0/go.mod h1:R7bRvYjOeaoenAp9sKRS8GX5bJWcZ0laWO5+DauEktw=
|
||||
github.com/oschwald/maxminddb-golang v1.10.0 h1:Xp1u0ZhqkSuopaKmk1WwHtjF0H9Hd9181uj2MQ5Vndg=
|
||||
github.com/oschwald/maxminddb-golang v1.10.0/go.mod h1:Y2ELenReaLAZ0b400URyGwvYxHV1dLIxBuyOsyYjHK0=
|
||||
github.com/oschwald/geoip2-golang v1.9.0 h1:uvD3O6fXAXs+usU+UGExshpdP13GAqp4GBrzN7IgKZc=
|
||||
github.com/oschwald/geoip2-golang v1.9.0/go.mod h1:BHK6TvDyATVQhKNbQBdrj9eAvuwOMi2zSFXizL3K81Y=
|
||||
github.com/oschwald/maxminddb-golang v1.11.0 h1:aSXMqYR/EPNjGE8epgqwDay+P30hCBZIveY0WZbAWh0=
|
||||
github.com/oschwald/maxminddb-golang v1.11.0/go.mod h1:YmVI+H0zh3ySFR3w+oz8PCfglAFj3PuCmui13+P9zDg=
|
||||
github.com/pierrre/compare v1.1.0 h1:57z388tk9GXcyLnLXh1pMRdCQrfUH056x9dyNCCZZtg=
|
||||
github.com/pierrre/geohash v1.1.0 h1:AeTekkssK2HV3le9vya4cVFIPMx60bVIHaTvC+/5vyc=
|
||||
github.com/pierrre/geohash v1.1.0/go.mod h1:QQAU8mXr7WIhJJqL2uAvhJHrMeH/jLeETutCqY/fDeU=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI=
|
||||
github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
|
||||
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
|
||||
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
|
||||
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
|
||||
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
|
||||
github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
|
||||
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
|
||||
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
|
||||
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
|
||||
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
||||
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
|
||||
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/the42/cartconvert v0.0.0-20131203171324-aae784c392b8 h1:I4DY8wLxJXCrMYzDM6lKCGc3IQwJX0PlTLsd3nQqI3c=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
|
||||
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
|
||||
Reference in New Issue
Block a user