Skip to content

Commit

Permalink
Merge pull request #98 from dappnode/v0.1.20
Browse files Browse the repository at this point in the history
Removed port 22 from UPnP functionality
  • Loading branch information
eduadiez authored Dec 19, 2018
2 parents 43e003d + ce207d6 commit 1f14a5f
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 59 deletions.
97 changes: 79 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,84 @@ language: node_js
dist: trusty
sudo: required

# Test envs will overwrite defaults
env:
- DAPPNODE=rocks
jobs:
include:
# In app tests
##############
- stage: test
env:
- IN_APP_TEST
node_js:
- "node"
cache:
directories:
- build/src/node_modules
install:
# This is a dockerized application, the node app is in /build/src
- cd ./build/src
- npm install
before_script:
- npm run lint
script:
- npm run test

node_js:
- "node"
# - npm run report-coverage
# after_success: # Upload coverage reports
# - COVERALLS_REPO_TOKEN=$coveralls_repo_token npm run coveralls
# Test that it builds correctly
###############################
- stage: build test
services:
- docker
script:
- docker-compose -f "$(find . -maxdepth 1 -name "docker-compose*")" build

cache:
directories:
- build/src/node_modules
install:
# This is a dockerized application, the node app is in /build/src
- cd ./build/src
- npm install
before_script:
- npm run lint
script:
- npm run test
after_success:
- COVERALLS_REPO_TOKEN=$coveralls_repo_token npm run coverage
# Deploy stage
# - code below is common between DAppNode packages
##################################################
- stage: release
services:
- docker
script: skip
node_js: lts/*
before_deploy:
# Run the dappnodesdk
- travis_retry npm install -g @dappnode/dappnodesdk
- export TRAVIS_TAG=$(IPFS_PROVIDER=ipfs.infura.io IPFS_PROTO=https PROVIDER=wss://mainnet.infura.io/ws dappnodesdk next patch)
- echo "NEXT TRAVIS_TAG $TRAVIS_TAG"
- IPFS_PROVIDER=ipfs.infura.io IPFS_PROTO=https PROVIDER=wss://mainnet.infura.io/ws SILENT=true dappnodesdk publish patch
# Set up git user name
- git config --global user.email "dappnode@dappnode.io"
- git config --global user.name "dappnode"
# Correct origin to push new branch
- git remote rm origin
- git remote add origin https://user:${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
# Check if the tag exists, if so delete it
- if [ $(git tag -l "$TRAVIS_TAG") ]; then export DELETE_TAG=true ; fi
- if [ $DELETE_TAG ]; then git push --delete origin $TRAVIS_TAG || echo "Error deleting tag from origin" ; fi
- if [ $DELETE_TAG ]; then git tag --delete $TRAVIS_TAG || echo "Error deleting tag locally" ; fi
# Tag this commit
- git tag $TRAVIS_TAG
# Return to master.
- git checkout master
deploy:
provider: releases
prerelease: true
api_key: "$GITHUB_TOKEN"
file_glob: true
file: build_${TRAVIS_TAG}/*
skip_cleanup: true
name: "v$TRAVIS_TAG"
body: "# Changelog"
on:
branch: master
after_deploy:
echo "Successfully released"
# - export GIT_BRANCH="master"
# - bash github_release_script.sh
# - echo "FINAL AFTER RELEASE SCRIPT"
# - echo "$(Date)" > a.text
# - git add .
# - git commit -m "message"
# - git checkout -b "v0.1.15"
# - git push origin "v0.1.15"
8 changes: 6 additions & 2 deletions build/src/upnp_openports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@
export IMAGE=$(docker inspect DAppNodeCore-vpn.dnp.dappnode.eth -f '{{.Config.Image}}')

# Delete UPnP Ports
## VPN
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -d 500 UDP
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -d 4500 UDP
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -d 22 TCP
## SSH
#docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -d 22 TCP
## Ethereum Node
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -d 30303 UDP
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -d 30303 TCP
## IPFS Node
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -d 4001 TCP
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -d 4002 UDP
# Open UPnP Ports
## VPN
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -r 500 UDP
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -r 4500 UDP
## SSH
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -r 22 TCP
#docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -r 22 TCP
## Ethereum Node
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -r 30303 UDP
docker run --rm --net=host ${IMAGE} upnpc -e DAppNode -r 30303 TCP
Expand Down
16 changes: 4 additions & 12 deletions dappnode_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vpn.dnp.dappnode.eth",
"version": "0.1.19",
"version": "0.1.20",
"description": "Dappnode package responsible for providing the VPN (L2TP/IPSec) connection",
"avatar": "/ipfs/QmWwMb3XhuCH6JnCF6m6EQzA4mW9pHHtg7rqAfhDr2ofi8",
"type": "dncore",
Expand All @@ -15,10 +15,7 @@
"/var/run/docker.sock:/var/run/docker.sock",
"/usr/src/dappnode/config:/usr/src/app/config:ro"
],
"ports": [
"4500:4500/udp",
"500:500/udp"
],
"ports": ["4500:4500/udp", "500:500/udp"],
"privileged": "true",
"restart": "always",
"subnet": "172.33.0.0/16",
Expand All @@ -30,12 +27,7 @@
"DAppLion <dapplion@giveth.io> (https://github.com/dapplion)",
"Alex Floyd <alex@giveth.io> (https://github.com/mex20)"
],
"keywords": [
"DAppNodeCore",
"VPN",
"IPSec",
"L2TP"
],
"keywords": ["DAppNodeCore", "VPN", "IPSec", "L2TP"],
"homepage": {
"userui": "https://dappnode.github.io/DAppNode_OTP",
"homepage": "https://github.com/dappnode/DNP_VPN#readme"
Expand All @@ -48,4 +40,4 @@
"url": "https://github.com/dappnode/DNP_VPN/issues"
},
"license": "GPL-3.0"
}
}
53 changes: 26 additions & 27 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
version: '3.4'
version: "3.4"
networks:
network:
driver: bridge
ipam:
config:
-
subnet: 172.33.0.0/16
network:
driver: bridge
ipam:
config:
- subnet: 172.33.0.0/16
volumes:
vpndnpdappnodeeth_data: {}
vpndnpdappnodeeth_data: {}
services:
vpn.dnp.dappnode.eth:
build: ./build
image: 'vpn.dnp.dappnode.eth:0.1.19'
container_name: DAppNodeCore-vpn.dnp.dappnode.eth
privileged: true
restart: always
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- '/etc/hostname:/etc/vpnname:ro'
- '/usr/src/dappnode/config:/usr/src/app/config:ro'
- '/lib/modules:/lib/modules:ro'
- 'vpndnpdappnodeeth_data:/usr/src/app/secrets'
ports:
- '4500:4500/udp'
- '500:500/udp'
dns: 172.33.1.2
networks:
network:
ipv4_address: 172.33.1.4
vpn.dnp.dappnode.eth:
build: ./build
image: "vpn.dnp.dappnode.eth:0.1.20"
container_name: DAppNodeCore-vpn.dnp.dappnode.eth
privileged: true
restart: always
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/etc/hostname:/etc/vpnname:ro"
- "/usr/src/dappnode/config:/usr/src/app/config:ro"
- "/lib/modules:/lib/modules:ro"
- "vpndnpdappnodeeth_data:/usr/src/app/secrets"
ports:
- "4500:4500/udp"
- "500:500/udp"
dns: 172.33.1.2
networks:
network:
ipv4_address: 172.33.1.4

0 comments on commit 1f14a5f

Please sign in to comment.