Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mysteriumnetwork/node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.15.0
Choose a base ref
...
head repository: mysteriumnetwork/node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 1,073 changed files with 99,552 additions and 31,708 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build/
.git/
vendor
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @tadovas @zolia @vkuznecovas @soffokl
* @soffokl @waldz @redmundas @redhatua
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- Node version: [e.g. 0.19.1]
- OS: [e.g. raspbian buster, debian 10]
- Desktop app version (if applicable): [e.g. 2.0.4]
- Docker (if applicable): specify docker version and image tag
- Your identity (if applicable): [e.g. 0xDb34233cf11Ac64a449144Ec8D8251268a4b168A]
- Payment (top-op) reference (if applicable): [e.g. 1118e94e-27fc-4fd2-b604-fd26008fb709]


**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: "feature request"
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
3 changes: 3 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,9 @@ daysUntilClose: 60
exemptLabels:
- pinned
- security
- rfc
- "feature request"
- epic
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
180 changes: 180 additions & 0 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
name: Build packages
# Big chunk of the build process logic is in the mage build targets
on:
workflow_call:
push:
branches: [master]
tags:
- '*'
schedule:
- cron: '0 2 * * *'

env:
GITHUB_OWNER: mysteriumnetwork
GITHUB_REPO: node
GITHUB_SNAPSHOT_REPO: node-builds
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true # disable AWS region lookup

jobs:
setup-env:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'

- name: Prepare environment
run: |
RELEASE_BUILD=false
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then RELEASE_BUILD=true; fi
RC_BUILD=false
if [[ "${GITHUB_REF}" == refs/tags/*-rc* ]]; then RC_BUILD=true; fi
SNAPSHOT_BUILD=false
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then SNAPSHOT_BUILD=true; fi
PR_BUILD=false
if [[ "${SNAPSHOT_BUILD}" == "false" && "${RELEASE_BUILD}" == "false" ]]; then PR_BUILD=true; fi
if [[ "${RELEASE_BUILD}" == "true" ]]; then
BUILD_VERSION="${GITHUB_REF#refs/tags/}";
elif [[ "${SNAPSHOT_BUILD}" == "true" ]]; then
BUILD_VERSION="$(git describe --abbrev=0 --tags)"-1snapshot-"$(date '+%Y%m%dT%H%M')"-"$(echo ${GITHUB_SHA} | cut -c1-8)";
elif [[ "${PR_BUILD}" == "true" ]]; then
BRANCH="${GITHUB_HEAD_REF////-}"
if [[ "${BRANCH}" == "" ]]; then BRANCH="${GITHUB_REF_NAME}"; fi
BUILD_VERSION="$(git describe --abbrev=0 --tags)"-1branch-"${BRANCH}";
fi
cat <<EOT >> env.sh
export RELEASE_BUILD=$RELEASE_BUILD;
export RC_BUILD=$RC_BUILD;
export PR_BUILD=$PR_BUILD;
export SNAPSHOT_BUILD=$SNAPSHOT_BUILD;
export BUILD_VERSION=$BUILD_VERSION;
export BUILD_NUMBER="${{ github.run_id }}";
export BUILD_COMMIT="$(echo ${GITHUB_SHA} | cut -c1-8)";
export BUILD_BRANCH="${GITHUB_REF_NAME}";
EOT
- uses: actions/upload-artifact@v4
with:
name: env.sh
path: env.sh

- name: Create bucket
if: |
github.ref == 'refs/heads/master' ||
github.ref_type == 'tag'
run: |
source env.sh
go run mage.go -v MakeBucket
build-packages:
runs-on: ubuntu-latest
needs: [setup-env]

strategy:
max-parallel: 6
matrix:
platform:
- PackageLinuxRaspberryImage
- PackageLinuxAmd64
- PackageLinuxArm
- PackageLinuxDebianAmd64
- PackageLinuxDebianArm64
- PackageLinuxDebianArmv6l
- PackageLinuxDebianArm
- PackageMacOSAmd64
- PackageMacOSArm64
- PackageWindowsAmd64
- PackageAndroid
- PackageAndroidProvider

steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- uses: actions/download-artifact@v4
with:
name: env.sh

- name: Setup FPM
run: |
sudo apt-get update
sudo apt-get install ruby-dev build-essential
sudo gem i fpm -f
- name: Build package
run: |
source env.sh
unset CI # workaround for "PackageAndroid" target
sudo -E go run mage.go -v ${{ matrix.platform }}
build-swagger:
runs-on: ubuntu-latest
needs: [setup-env, build-packages]

steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- uses: actions/download-artifact@v4
with:
name: env.sh
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build docker
run: |
source env.sh
go run mage.go -v PackageDockerSwaggerRedoc
release:
needs: [build-packages, build-swagger]
uses: ./.github/workflows/release.yml
secrets: inherit
if: |
github.ref == 'refs/heads/master' ||
github.ref_type == 'tag'
cleanup-env:
runs-on: ubuntu-latest
needs: [release]
if: |
always() &&
(github.ref == 'refs/heads/master' || github.ref_type == 'tag')
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- uses: actions/download-artifact@v4
with:
name: env.sh

- name: Remove bucket
run: |
source env.sh
go run mage.go -v RemoveBucket || true # ignore if bucket was not available
132 changes: 132 additions & 0 deletions .github/workflows/mobile-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Mobile-release

on:
release:
types: [released]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Get Release
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: mysteriumnetwork/mysterium-mobile-provider
ref: 'master'
path: mobile-app
token: ${{ secrets.REPO_TOKEN }}

- name: Update version
run: |
APP_VERSION=$(echo "$(grep "versionName" "./mobile-app/android/app/build.gradle.kts" | awk -F '"' '{print $2}')" + 0.1 | bc)
sed -i -E "/versionName\s*=\s*\"[0-9]+\.[0-9]+\"/s/\"[0-9]+\.[0-9]+\"/\"$APP_VERSION\"/" "./mobile-app/android/app/build.gradle.kts"
sed -i -E "/node\s*=\s*\"[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?\"/s/\"[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?\"/\"${{ env.RELEASE_VERSION }}\"/" "./mobile-app/android/gradle/libs.versions.toml"
- name: Pushes to another repository
id: push_directory
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.REPO_TOKEN }}
with:
source-directory: mobile-app
destination-github-username: 'mysteriumnetwork'
destination-repository-name: 'mysterium-mobile-provider'
user-email: core-services@mysterium.network
commit-message: Create release version ${{ env.RELEASE_VERSION }}
target-branch: master

- name: Send pull-request
env:
GH_TOKEN: ${{ secrets.REPO_TOKEN }}
run: |
LATEST_TAG=$(git describe --tags --always --abbrev=0)
REPOSITORY="mysteriumTeam/mysterium-mobile-provider"
FOLDER="bin/$REPOSITORY"
BRANCH_NAME="release-$LATEST_TAG"
# Clone the remote repository and change working directory to the
# folder it was cloned to.
git clone \
--depth=1 \
--branch=bitrise \
https://mpolubotko:${{ secrets.REPO_TOKEN }}@github.com/$REPOSITORY \
$FOLDER
cd $FOLDER
# Setup the committers identity.
git config user.email "core-services@mysterium.network"
git config user.name "MysteriumTeam"
# Create a new feature branch for the changes.
git checkout -b $BRANCH_NAME
# Update the script files to the latest version.
cp -R ../../../mobile-app/android android
# Commit the changes and push the feature branch to origin
git add .
git commit -m "update files for new release version $LATEST_TAG"
git push origin $BRANCH_NAME
# Store the PAT in a file that can be accessed by the
# GitHub CLI.
echo "${{ secrets.REPO_TOKEN }}" > token.txt
# Authorize GitHub CLI for the current repository and
# create a pull-request containing the updates.
PR_URL=$(gh pr create \
--body "" \
--title "Release $LATEST_TAG" \
--head "$BRANCH_NAME" \
--base "master" \
| sed -n 's#https://github\.com/[^/]\+/[^/]\+/\pull/\([0-9]\+\).*#\1#p')
echo "PR_NUMBER=$PR_URL" >> $GITHUB_ENV
- name: Approve Pull Request
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
REPO_OWNER: "MysteriumTeam"
REPO_NAME: "mysterium-mobile-provider"
PR_NUMBER: ${{ env.PR_NUMBER }}
run: |
response=$(curl -s -o /dev/null -w "%{http_code}" -L -X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/pulls/$PR_NUMBER/merge \
-d '{"commit_title":"Release v${{ env.RELEASE_VERSION }}","commit_message":"${{ env.RELEASE_VERSION }}"}')
# Check HTTP response
if [ "$response" == "204" ] || [ "$response" == "200" ] || [ "$response" == "201" ]; then
echo "PR was approved successfully"
else
echo "Couldn't approved PR, HTTP-status: $response"
exit 1
fi
- name: "Call Bitrise API"
uses: indiesdev/curl@v1.1
with:
url: https://api.bitrise.io/v0.1/apps/${{ secrets.BITRISE_APP_ID }}/builds
method: "POST"
id: api
accept: 200, 201
headers: '{ "accept": "application/json", "Authorization": "${{ secrets.BITRISE_TOKEN }}", "Content-Type": "application/json" }'
body: '{ "hook_info": {"type": "bitrise"}, "build_params": {"branch":"master", "workflow_id":"build"}}'
timeout: 10000
log-response: true

- name: "Bitrise response"
run: echo ${{ steps.api.outputs.response }}
Loading