Skip to content

Commit

Permalink
Merge pull request #716 from gravitl/develop
Browse files Browse the repository at this point in the history
v0.10.0
  • Loading branch information
afeiszli authored Feb 9, 2022
2 parents 7110c50 + 51f4249 commit af1067c
Show file tree
Hide file tree
Showing 167 changed files with 5,784 additions and 1,604 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/buildandrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:

- name: Build
run: |
env GOOS=linux GOARCH=amd64 go build -o build/netmaker main.go
cd netclient
env GOOS=linux GOARCH=amd64 go build -o build/netclient main.go
env GOOS=linux GOARCH=arm GOARM=5 go build -o build/netclient-arm5/netclient main.go
Expand All @@ -47,6 +48,16 @@ jobs:
env CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -o build/netclient-freebsd-arm64/netclient main.go
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o build/netclient-darwin/netclient main.go
- name: Upload netmaker x86 to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/netmaker
tag: ${{ env.NETMAKER_VERSION }}
overwrite: true
prerelease: true
asset_name: netmaker

- name: Upload x86 to Release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/publish-netclient-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Publish Netclient Docker

on:
workflow_dispatch:
inputs:
tag:
description: 'docker tag'
required: true
release:
types: [published]

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set tag
run: |
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
TAG=${{ github.event.inputs.tag }}
elif [[ "${{ github.ref_name }}" == 'master' ]]; then
TAG="latest"
else
TAG="${{ github.ref_name }}"
fi
echo "TAG=${TAG}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build x86 and export to Docker
uses: docker/build-push-action@v2
with:
context: .
load: true
platforms: linux/amd64
file: docker/Dockerfile-netclient-multiarch
tags: ${{ env.TAG }}
-
name: Test x86
run: |
docker run --rm ${{ env.TAG }}&
sleep 10
kill %1
-
name: Build arm and export to Docker
uses: docker/build-push-action@v2
with:
context: .
load: true
platforms: linux/arm64
file: docker/Dockerfile-netclient-multiarch
tags: ${{ env.TAG }}
-
name: Test arm
run: |
docker run --rm ${{ env.TAG }}&
sleep 10
kill %1
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: gravitl/netclient:${{ env.TAG }}
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Build
run: |
env GOOS=linux GOARCH=amd64 go build main.go
cd netclient
env GOOS=linux GOARCH=amd64 go build main.go
env GOOS=freebsd GOARCH=amd64 go build main.go
env GOOS=darwin GOARCH=amd64 go build main.go
env GOOS=windows GOARCH=amd64 go build main.go
tests:
env:
DATABASE: sqlite
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ config/dnsconfig/
data/
.vscode/
.idea/

71 changes: 71 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# How to contribute to Netmaker

Hey! We're glad you're here. We need your help making Netmaker as great as it can be.

If you haven't already, come chat with us in [Discord](https://discord.gg/zRb9Vfhk8A). We can help you find the right thing to work on.

Before you start contributing, take a moment to check here if it makes sense.

#### **Did you find a bug?**

* Search on on GitHub under [Issues](https://github.com/gravitl/netmaker/issues) to make sure the bug was not already discovered.

* If you don't find an open issue that addresses the problem, you can [open a new one](https://github.com/gravitl/netmaker/issues/new).

* If you're creating a new issue, include a **title and clear description**, as much relevant information as possible **including logs**, and an explanation/output demonstrating expected behavior vs. actual behavior. Make sure to specify the **version of netmaker/netclient.** If it's a server issue, describe the environment where the server is running. If it's a client issue, give us the operating system and any relevant environment factors (CGNAT, 4g router, etc).

* Respond to team queries in a timely manner, since stale issues will be closed.

#### **Did you write a patch that fixes a bug?**

* Open a new GitHub pull request with the patch **against the 'develop' branch**.

* The PR should clearly describe the problem and solution. Include an issue number if possible.

* Make sure to add comments for any new functions

#### **Did you fix whitespace, format code, or make a purely cosmetic patch?**

Cosmetic changes that do not add substantial useability, stability, functionality, or testability to the code base will not be accepted. The calculation is simple. If it will take more time to merge and test than it took you to make and submit the code, it is likely not worthwhile (execptions exist of course for critical errors with easy fixes).

#### **Do you want to add a new feature to Netmaker?**

* Once again, join the [Discord](https://discord.gg/zRb9Vfhk8A)! Bring it up there and we can discuss. Even if you do not know what you want to build, but you want to build something, we can help you choose something from the roadmap.

#### **Do you want to contribute to Netmaker documentation?**

* Make sure your documentation compiles correctly

* You will need [sphinx](https://www.sphinx-doc.org/en/master/usage/installation.html) and the [material theme](https://github.com/bashtage/sphinx-material/) to run the documentation locally.

* Once the above plugins are installed, you can navigate to the **docs** directory and run **make html**

* View the compiled files (start with index.html under _build) in your browser and make sure your changes look correct before submitting.


## Submitting Changes

* Please label your branch using our convention: **purpose_version_thing-you-did**. Purpose is either feature, bugfix, or hotfix.

* Examples: feature_v0.9.5_widget, bugfix_v0.8.2_ipv6-changes

* Please open a [Pull Request](https://github.com/gravitl/netmaker/compare/develop...master?expand=1) against the develop branch with your branch which clearly describes everything you've done and references any related GitHub issues.

* You will need to sign the CLA in order for us to accept your changes (a bot should appear asking you to sign)

* Please respond to any feedback in a timely manner. Stale PR's will be closed periodically.

## Coding conventions

Take a look around the code to get a feel for how we're doing things.

* Use private functions where possible
* Use the custom loggers for log messages
* Comment any new public functions




## Thanks for taking the time to read this! You're awesome, and we look forward to working with you!

-The Netmaker Team
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<p align="center">
<a href="https://github.com/gravitl/netmaker/releases">
<img src="https://img.shields.io/badge/Version-0.9.4-informational?style=flat-square" />
<img src="https://img.shields.io/badge/Version-0.10.0-informational?style=flat-square" />
</a>
<a href="https://hub.docker.com/r/gravitl/netmaker/tags">
<img src="https://img.shields.io/docker/pulls/gravitl/netmaker" />
Expand Down Expand Up @@ -45,7 +45,7 @@

`wget -qO - https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/nm-quick.sh | sudo bash`

<img src="./docs/images/install-server.gif" width="50%" /><img src="./docs/images/visit-website.gif" width="50%" />
<img src="./docs/images/visit-website.gif" width="50%" /><img src="./docs/images/graph-readme.gif" width="50%" />

Upon completion, the logs will display the instructions to connect various devices. These can also be retrieved from the UI under "Access Keys."

Expand Down
31 changes: 24 additions & 7 deletions compose/docker-compose.contained.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ version: "3.4"
services:
netmaker:
container_name: netmaker
image: gravitl/netmaker:v0.9.4
image: gravitl/netmaker:v0.10.0
volumes:
- dnsconfig:/root/config/dnsconfig
- /usr/bin/wg:/usr/bin/wg
- sqldata:/root/data
cap_add:
- NET_ADMIN
- NET_RAW
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
restart: always
privileged: true
environment:
SERVER_HOST: "SERVER_PUBLIC_IP"
SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
Expand All @@ -25,11 +29,15 @@ services:
GRPC_PORT: "50051"
CLIENT_MODE: "on"
MASTER_KEY: "REPLACE_MASTER_KEY"
SERVER_GRPC_WIREGUARD: "off"
CORS_ALLOWED_ORIGIN: "*"
DISPLAY_KEYS: "on"
DATABASE: "sqlite"
NODE_ID: "netmaker-server-1"
MQ_HOST: "mq"
HOST_NETWORK: "off"
MANAGE_IPTABLES: "on"
PORT_FORWARD_SERVICES: "mq,dns,ssh"
VERBOSITY: "1"
ports:
- "51821-51830:51821-51830/udp"
- "8081:8081"
Expand All @@ -38,7 +46,7 @@ services:
container_name: netmaker-ui
depends_on:
- netmaker
image: gravitl/netmaker-ui:v0.9.3
image: gravitl/netmaker-ui:v0.10.0
links:
- "netmaker:api"
ports:
Expand All @@ -53,9 +61,6 @@ services:
command: -conf /root/dnsconfig/Corefile
container_name: coredns
restart: always
ports:
- "COREDNS_IP:53:53/udp"
- "COREDNS_IP:53:53/tcp"
volumes:
- dnsconfig:/root/dnsconfig
caddy:
Expand All @@ -68,9 +73,21 @@ services:
# - $PWD/site:/srv # you could also serve a static site in site folder
- caddy_data:/data
- caddy_conf:/config
mq:
image: eclipse-mosquitto:2.0.14
container_name: mq
restart: unless-stopped
ports:
- "1883:1883"
volumes:
- /root/mosquitto.conf:/mosquitto/config/mosquitto.conf
- mosquitto_data:/mosquitto/data
- mosquitto_logs:/mosquitto/log
volumes:
caddy_data: {}
caddy_conf: {}
sqldata: {}
dnsconfig: {}
mosquitto_data: {}
mosquitto_logs: {}

Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@ version: "3.4"
services:
netmaker:
container_name: netmaker
image: gravitl/netmaker:v0.9.4
image: gravitl/netmaker:v0.10.0
volumes:
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
- /run/systemd/system:/run/systemd/system
- /etc/systemd/system:/etc/systemd/system
- /sys/fs/cgroup:/sys/fs/cgroup
- /usr/bin/wg:/usr/bin/wg
- dnsconfig:/root/config/dnsconfig
- /usr/bin/wg:/usr/bin/wg
- sqldata:/root/data
cap_add:
- /run/xtables.lock:/run/xtables.lock
cap_add:
- NET_ADMIN
- SYS_ADMIN
restart: always
- NET_RAW
- SYS_MODULE
network_mode: host
privileged: true
restart: always
environment:
SERVER_HOST: "SERVER_PUBLIC_IP"
SERVER_API_CONN_STRING: "api.NETMAKER_BASE_DOMAIN:443"
Expand All @@ -35,12 +32,16 @@ services:
CORS_ALLOWED_ORIGIN: "*"
DISPLAY_KEYS: "on"
DATABASE: "sqlite"
HOST_NETWORK: "on"
NODE_ID: "netmaker-server-1"
MANAGE_IPTABLES: "on"
PORT_FORWARD_SERVICES: ""
VERBOSITY: "1"
netmaker-ui:
container_name: netmaker-ui
depends_on:
- netmaker
image: gravitl/netmaker-ui:v0.9.3
image: gravitl/netmaker-ui:0.10.0
links:
- "netmaker:api"
ports:
Expand All @@ -56,8 +57,8 @@ services:
container_name: coredns
restart: always
ports:
- "COREDNS_IP:53:53/udp"
- "COREDNS_IP:53:53/tcp"
- "53053:53/udp"
- "53053:53/tcp"
volumes:
- dnsconfig:/root/dnsconfig
caddy:
Expand All @@ -70,8 +71,20 @@ services:
# - $PWD/site:/srv # you could also serve a static site in site folder
- caddy_data:/data
- caddy_conf:/config
mq:
image: eclipse-mosquitto:2.0.14
container_name: mq
restart: unless-stopped
ports:
- "1883:1883"
volumes:
- /root/mosquitto.conf:/mosquitto/config/mosquitto.conf
- mosquitto_data:/mosquitto/data
- mosquitto_logs:/mosquitto/log
volumes:
caddy_data: {}
caddy_conf: {}
sqldata: {}
dnsconfig: {}
mosquitto_data: {}
mosquitto_logs: {}
Loading

0 comments on commit af1067c

Please sign in to comment.