Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4a19fb911 | ||
|
|
feb2b36c90 |
@@ -23,15 +23,15 @@ COPY .golangci.yml ./
|
|||||||
RUN golangci-lint run --timeout=10m
|
RUN golangci-lint run --timeout=10m
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM base AS build
|
FROM --platform=$BUILDPLATFORM base AS build
|
||||||
COPY --from=qmcgaw/xcputranslate /xcputranslate /usr/local/bin/xcputranslate
|
COPY --from=qmcgaw/xcputranslate:v0.4.0 /xcputranslate /usr/local/bin/xcputranslate
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ARG VERSION=unknown
|
ARG VERSION=unknown
|
||||||
ARG BUILD_DATE="an unknown date"
|
ARG BUILD_DATE="an unknown date"
|
||||||
ARG COMMIT=unknown
|
ARG COMMIT=unknown
|
||||||
COPY cmd/ ./cmd/
|
COPY cmd/ ./cmd/
|
||||||
COPY internal/ ./internal/
|
COPY internal/ ./internal/
|
||||||
RUN GOARCH="$(echo ${TARGETPLATFORM} | xcputranslate -field arch)" \
|
RUN GOARCH="$(xcputranslate -field arch -targetplatform ${TARGETPLATFORM})" \
|
||||||
GOARM="$(echo ${TARGETPLATFORM} | xcputranslate -field arm)" \
|
GOARM="$(xcputranslate -field arm -targetplatform ${TARGETPLATFORM})" \
|
||||||
go build -trimpath -ldflags="-s -w \
|
go build -trimpath -ldflags="-s -w \
|
||||||
-X 'main.version=$VERSION' \
|
-X 'main.version=$VERSION' \
|
||||||
-X 'main.buildDate=$BUILD_DATE' \
|
-X 'main.buildDate=$BUILD_DATE' \
|
||||||
|
|||||||
@@ -71,8 +71,7 @@ func (n *nordvpn) GetOpenVPNConnection(selection models.ServerSelection) (
|
|||||||
|
|
||||||
connections := make([]models.OpenVPNConnection, len(servers))
|
connections := make([]models.OpenVPNConnection, len(servers))
|
||||||
for i := range servers {
|
for i := range servers {
|
||||||
connection := models.OpenVPNConnection{IP: servers[i].IP, Port: port, Protocol: selection.Protocol}
|
connections[i] = models.OpenVPNConnection{IP: servers[i].IP, Port: port, Protocol: selection.Protocol}
|
||||||
connections = append(connections, connection)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pickRandomConnection(connections, n.randSource), nil
|
return pickRandomConnection(connections, n.randSource), nil
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ func (w *windscribe) GetOpenVPNConnection(selection models.ServerSelection) (con
|
|||||||
}
|
}
|
||||||
|
|
||||||
connections := make([]models.OpenVPNConnection, len(servers))
|
connections := make([]models.OpenVPNConnection, len(servers))
|
||||||
for _, server := range servers {
|
for i := range servers {
|
||||||
connections = append(connections, models.OpenVPNConnection{IP: server.IP, Port: port, Protocol: selection.Protocol})
|
connections[i] = models.OpenVPNConnection{IP: servers[i].IP, Port: port, Protocol: selection.Protocol}
|
||||||
}
|
}
|
||||||
|
|
||||||
return pickRandomConnection(connections, w.randSource), nil
|
return pickRandomConnection(connections, w.randSource), nil
|
||||||
|
|||||||
Reference in New Issue
Block a user