9 Commits

Author SHA1 Message Date
Alec Scott
5ff46dc02e Merge pull request #27 from hyprspace/add/UPnP
Add initial support for UPnP to Hyprspace
2021-08-21 12:06:45 -07:00
Alec Scott
52c78391bb Add initial support for UPnP to Hyprspace 2021-08-21 12:04:47 -07:00
Alec Scott
c5ccc0daaa Update README.md 2021-07-22 09:56:38 -07:00
Alec Scott
795da55458 Update README.md 2021-07-22 09:54:27 -07:00
Alec Scott
5b957d3ed7 Create codeql-analysis.yml 2021-07-13 15:48:08 -07:00
Alec Scott
f9c74c1cc1 Merge pull request #19 from max-privatevoid/patch-1
Don't hardcode `ip` binary path
2021-07-08 18:54:11 -07:00
Max
17f09c48dc Don't hardcode ip binary path
Not all systems install the binary in this path, a correctly configured PATH environment variable should suffice.
2021-07-05 22:49:03 +02:00
Alec Scott
05cc6b08ce Merge pull request #15 from hyprspace/feature/dht-client
Switch to DHTClient Mode & Build Smaller Binaries
2021-06-26 10:36:58 -07:00
Alec Scott
1e23bdb2e0 Switch to DHTClient Mode & Build Smaller Binaries 2021-06-26 10:33:08 -07:00
6 changed files with 80 additions and 6 deletions

View File

@@ -7,6 +7,6 @@ do
platform_split=(${platform//\// })
GOOS=${platform_split[0]}
GOARCH=${platform_split[1]}
env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "-X github.com/hyprspace/hyprspace/cli.appVersion=$1" -o hyprspace-$1-${GOOS}-${GOARCH} .
env GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 go build -ldflags "-s -w -X github.com/hyprspace/hyprspace/cli.appVersion=$1" -o hyprspace-$1-${GOOS}-${GOARCH} .
done

71
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '21 19 * * 0'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@@ -2,6 +2,7 @@
# Hyprspace
[![Go Report Card](https://goreportcard.com/badge/github.com/hyprspace/hyprspace)](https://goreportcard.com/report/github.com/hyprspace/hyprspace)
[![](https://img.shields.io/matrix/hyprspace:matrix.org)](https://matrix.to/#/%23hyprspace:matrix.org)
A Lightweight VPN Built on top of Libp2p for Truly Distributed Networks.

1
go.mod
View File

@@ -6,6 +6,7 @@ require (
github.com/DataDrake/cli-ng/v2 v2.0.2
github.com/hashicorp/go-version v1.2.1 // indirect
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf
github.com/ipfs/go-datastore v0.4.5
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-libp2p v0.14.1
github.com/libp2p/go-libp2p-core v0.8.5

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"sync"
"github.com/ipfs/go-datastore"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
@@ -29,6 +30,9 @@ func CreateNode(ctx context.Context, inputKey string, port int, handler network.
node, err = libp2p.New(ctx,
libp2p.ListenAddrStrings(fmt.Sprintf("/ip4/0.0.0.0/tcp/%d", port)),
libp2p.Identity(privateKey),
libp2p.DefaultSecurity,
libp2p.NATPortMap(),
libp2p.FallbackDefaults,
)
if err != nil {
return
@@ -38,10 +42,7 @@ func CreateNode(ctx context.Context, inputKey string, port int, handler network.
node.SetStreamHandler(Protocol, handler)
// Create DHT Subsystem
dhtOut, err = dht.New(ctx, node)
if err != nil {
return
}
dhtOut = dht.NewDHTClient(ctx, node, datastore.NewMapDatastore())
// Define Bootstrap Nodes.
peers := []string{

View File

@@ -46,7 +46,7 @@ func Delete(name string) (err error) {
}
func ip(args ...string) (err error) {
cmd := exec.Command("/sbin/ip", args...)
cmd := exec.Command("ip", args...)
err = cmd.Run()
return
}