Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/auto_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Bump upstream version

on:
schedule:
- cron: "00 */4 * * *"
workflow_dispatch:
push:
branches:
- "main"

jobs:
bump-upstream:
uses: dappnode/workflows/.github/workflows/bump-upstream.yml@master
secrets: inherit
Comment on lines +13 to +14
7 changes: 1 addition & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: npx @dappnode/dappnodesdk build --skip_save
env:
# Read access to the private dappnode-nexus-sdk repository. The
# default GITHUB_TOKEN is scoped to this repository only and cannot
# fetch the proxy source.
NEXUS_SDK_TOKEN: ${{ secrets.NEXUS_SDK_TOKEN }}

release:
name: Release
needs: build-test
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'repository_dispatch'
steps:
Expand All @@ -31,5 +27,4 @@ jobs:
run: npx @dappnode/dappnodesdk publish patch --dappnode_team_preset --timeout 2h
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEXUS_SDK_TOKEN: ${{ secrets.NEXUS_SDK_TOKEN }}
DEVELOPER_ADDRESS: "0xf35960302a07022aba880dffaec2fdd64d5bf1c1"
14 changes: 3 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,15 @@ FROM ${GO_IMAGE} AS build

ARG UPSTREAM_VERSION
RUN test -n "${UPSTREAM_VERSION}" \
&& test "$(printf '%s' "${UPSTREAM_VERSION}" | wc -c)" -eq 40 \
&& printf '%s' "${UPSTREAM_VERSION}" | grep -Eq '^[0-9a-f]{40}$'
&& printf '%s' "${UPSTREAM_VERSION}" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'

RUN apk add --no-cache ca-certificates git

WORKDIR /src
RUN git init \
&& git remote add origin https://github.com/dappnode/dappnode-nexus-sdk.git
RUN --mount=type=secret,id=github_token \
if test -s /run/secrets/github_token; then \
auth_header="$(printf 'x-access-token:%s' "$(cat /run/secrets/github_token)" | base64 | tr -d '\n')"; \
git -c http.extraHeader="Authorization: Basic ${auth_header}" fetch --depth=1 origin "${UPSTREAM_VERSION}"; \
else \
git fetch --depth=1 origin "${UPSTREAM_VERSION}"; \
fi \
&& git checkout --detach FETCH_HEAD \
&& test "$(git rev-parse HEAD)" = "${UPSTREAM_VERSION}"
RUN git fetch --depth=1 origin "refs/tags/${UPSTREAM_VERSION}" \
&& git checkout --detach FETCH_HEAD

RUN go mod download \
&& go mod verify \
Expand Down
2 changes: 1 addition & 1 deletion dappnode_package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nexus-proxy.dnp.dappnode.eth",
"version": "0.1.0",
"upstreamVersion": "219977388b9f26435c2529fc1cd52ff7229e5397",
"upstreamVersion": "v0.1.0",
"upstreamRepo": "dappnode/dappnode-nexus-sdk",
"upstreamArg": "UPSTREAM_VERSION",
"shortDescription": "Keep your Nexus prompts private, and verify it yourself",
Expand Down
8 changes: 1 addition & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ services:
context: .
dockerfile: Dockerfile
args:
UPSTREAM_VERSION: 219977388b9f26435c2529fc1cd52ff7229e5397
secrets:
- github_token
UPSTREAM_VERSION: v0.1.0
image: nexus-proxy.dnp.dappnode.eth:0.1.0
container_name: DAppNodeCore-nexus-proxy.dnp.dappnode.eth
restart: unless-stopped
Expand Down Expand Up @@ -49,7 +47,3 @@ services:

volumes:
verification_state: {}

secrets:
github_token:
environment: NEXUS_SDK_TOKEN
Loading