From fe9ba616f58268856d499cb5e3c68ef2c2e0547c Mon Sep 17 00:00:00 2001 From: Moses Narrow <36607567+0pcom@users.noreply.github.com> Date: Mon, 23 Jan 2023 09:04:50 -0600 Subject: [PATCH 1/6] remove systray builds doc - substantially inaccurate. No external deps are needed any longer --- docs/systray-builds.md | 77 ------------------------------------------ 1 file changed, 77 deletions(-) delete mode 100644 docs/systray-builds.md diff --git a/docs/systray-builds.md b/docs/systray-builds.md deleted file mode 100644 index 8066a39f26..0000000000 --- a/docs/systray-builds.md +++ /dev/null @@ -1,77 +0,0 @@ -# Building Systray - -To build `skywire-visor` with systray feature enabled, you have to had these installed on your system: - -### Prequisites - -#### Linux - -- Debian / Ubuntu and its derivations - -```bash -$ sudo apt-get install gcc libgtk-3-dev libayatana-appindicator3-dev libappindicator3-dev -``` - -- Fedora / RHEL and its derivations - -```bash -$ sudo dnf install gtk3-devel libappindicator-gtk3-devel -``` - -- ArchLinux and its variants - -```bash -$ sudo pacman -S libappindicator-gtk3 gtk3 -``` -also need install `libayatana-appindicator`. You can install it by [AUR](https://aur.archlinux.org/packages/libayatana-appindicator). - -Other distros might require the installation of said library in their own respective name. - -#### Mac / Darwin - -You need to have `XCode` installed. - -#### Windows - -- WIP - -### Build - -The following command will build the systray app to the root of this repo - -```bash -$ make build-systray -``` - -### Running - -#### Linux - -- You need to have an icon defined in `/opt/skywire/icon.png` (WIP, provide linux installer for it) -- You need to install `gnome-shell-extension-appindicator` -- After you installed the extension, go to the tweaks section of your gnome shell settings, and - activate `Kstatusnotifieritem / appindicator support` -- Alternatively, you can use: - -```bash -$ gnome-extensions enable ubuntu-appindicators@ubuntu.com -``` - -- Logout, and run the application - -#### Mac / Darwin - -You need to have an icon defined in `/Applications/Skywire.app/Contents/Resources/icon.tiff` - -#### Windows - -TBD - -Then you can run it with - -```bash - -# Linux and MacOS -$ sudo chown root ./apps/vpn-client -$ sudo chmod 4755 ./apps/vpn-client -$ ./skywire-visor -c --systray From 6cdb264af1e13ed6a60047f41757d80bcd4121fc Mon Sep 17 00:00:00 2001 From: Moses Narrow <36607567+0pcom@users.noreply.github.com> Date: Mon, 23 Jan 2023 09:19:22 -0600 Subject: [PATCH 2/6] remove the old deb_install.md from docs. Extremely dated & no longer accurate --- docs/deb_install.md | 139 -------------------------------------------- 1 file changed, 139 deletions(-) delete mode 100644 docs/deb_install.md diff --git a/docs/deb_install.md b/docs/deb_install.md deleted file mode 100644 index 62df06f647..0000000000 --- a/docs/deb_install.md +++ /dev/null @@ -1,139 +0,0 @@ -# Debian - -## Installation - -### Developer - -Prequisites: - -- Debian Host -- devscripts -- binutils-i686-linux-gnu -- binutils-aarch64-linux-gnu -- binutils-arm-linux-gnueabi -- dh-systemd -- build-essential -- crossbuild-essential-armhf -- gpg -- dpkg-sig - - -In order to create the Skywire debian packages, make sure you are running a debian based distro. - -To sign the debian packages, add both the public and secret key if not already. -Follow [this guide](https://www.debuntu.org/how-to-importexport-gpg-key-pair/) for more info. - -```bash -$ gpg --import ~/mygpgkey_pub.gpg -$ gpg --allow-secret-key-import --import ~/mygpgkey_sec.gpg -``` - -Check if it is added correctly: -```bash -$ gpg --list-keys -``` - -Run the packaging make target. Make sure the `Author Email` and `Author Name` is the same as the key in `gpg --list-keys`: -(NOTE: the email should be the same as the email of the key you are sigining with) - -The debian package should be created after a release has been made in `github.com/skycoin/skywire` and the version should follow the tag defined in the `skywire` repo. - -```bash -$ make deb-package - -... -... -Version : 0.5.0 -Author Email : someemail@email.com -Author Name : Some Name -``` -The Version, Author Email, and Author Name needs to be added via the terminal in order to build the packages. - -During its work script will create packages for the following architectures: -- amd64 -- i386 -- arm -- arm64 -- armhf - -For each architecture a changelog file will be created for a package and will be opened with the editor. Apply needed changes and save it. - -The script will complain that there's no original code tarball. Ignore the warning by pressing `y`. - -Once the script finishes, you'll see a `deb` directory in you current folder. This is where the finished packages are. Put these to `/var/www/repos/apt/debian` on the `apt server` and remove the old packages there. - -To sign the packages use:
-(NOTE: the email should be the same as the one used in `make deb-package`. as well as the email of the key you are sigining with) -```bash -$ ./scripts/deb_installer/sign_deb.sh someemail@email.com -``` - -This will sign all packages. - -To verify the signature of a single package use: -```bash -$ dpkg-sig --verify ./deb/skywire_0.5.0-1_amd64.deb -Processing ./deb/skywire_0.5.0-1_amd64.deb... -GOODSIG _gpgbuilder 9A86A72D257E9EEAD3CE6ADDCC2026E6F21CEDA7 1620395902 -``` - -If the package isn't signed, then the output will be `NOSIGN`. -If there is some error, it will be `BADSIG`. -If the package is signed, then the output will be `GOODSIG`. Followed by who signed the package `_gpgbuilder` -and then the keyid of the key that the package is signed with `9A86A72D257E9EEAD3CE6ADDCC2026E6F21CEDA7` -and lastly the epoch time of when it was signed `1620395902`. -To verify that the correct key was used for the signing, compare the `keyid` with the correct `keyid` from -`gpg --list-keys`. - -To remove old packages from the repo, cd to `/var/www/repos/apt/debian` and use: -```bash -$ reprepro remove stretch skywire -``` - -This should be repeated for all needed debian releases. - -To add new packages to the repo, from the `/var/www/repos/apt/debian` use: -```bash -$ reprepro includedeb jessie ./skywire_0.5.0-1_amd64.deb -``` - -This should be repeated for all needed debian releases and built packages. - -To install the package use: -``` -$ sudo dpkg -i ./deb/skywire_0.5.0-1_amd64.deb -``` -This will install `skywire` and `skywire-cli` - -To generate a config use -``` -$ skywire-cli config gen -pro /opt/skywire/skywire-visor.json -``` - -To uninstall the package use: -``` -$ sudo apt-get remove skywire -``` - -### End User - -Import the public key -```bash -$ wget -O - http://subdomain.skycoin.com/public-gpg.key | sudo apt-key add - -``` - -Add repo to sources.list - -```bash -$ deb http://subdomain.skycoin.com/ skywire main -``` - -Run -```bash -$ apt-get update -``` - -To uninstall use: -``` -$ sudo apt-get remove skywire -``` \ No newline at end of file From 8b7b0ca0092ce99c4df0f90515228460908f7c68 Mon Sep 17 00:00:00 2001 From: Moses Narrow <36607567+0pcom@users.noreply.github.com> Date: Mon, 23 Jan 2023 09:19:50 -0600 Subject: [PATCH 3/6] minor update to documentation. Revised skyforwarding doc --- docs/skywire_app_api.md | 10 +++++----- docs/skywire_forwarding.md | 38 ++++++++++++++++++++++++-------------- docs/static-builds.md | 6 ++++-- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/docs/skywire_app_api.md b/docs/skywire_app_api.md index 47ed94add2..1e8fdb554b 100644 --- a/docs/skywire_app_api.md +++ b/docs/skywire_app_api.md @@ -3,7 +3,7 @@ ## Type of apps Skywire apps can be used in two ways. 1. As a Skywire Visor App -2. As a External App +2. As an External App ### Skywire Visor App A skywire visor app is started, stopped, monitored and controlled via the skywire visor. The app is controlled via the interface `Proc` which requires a `PROC_CONFIG` env variable that the app reads to @@ -104,9 +104,9 @@ The params are ProcKey: pKey, } ``` - and pass it + and pass it - `procAddr` - This is required and can be read form a flag in the app. This address is set in the visor config under `launcher/server_addr`. + This is required and can be read form a flag in the app. This address is set in the visor config under `launcher/server_addr`. The app needs this to create a connection to the visor. - `procKey *appcommon.ProcKey` This is required and can be read form a flag in the app. The app needs to be registered to the visor first so that a RPC gateway will await for a connection from the app. @@ -136,7 +136,7 @@ The app client has the following methods. ``` the type of network to use (dmsg or skynet), the public key of the remote visor and - the dmsg or skynet port to connect to on the remote visor. + the dmsg or skynet port to connect to on the remote visor. It returns a `conn net.Conn` that can be used to read and write to the connected dmsg/skynet app on the remote visor. - `Listen` Listen listens on the specified `port` for the incoming connections. @@ -148,4 +148,4 @@ The app client has the following methods. - `Skywire visor app` For a skywire visor app all info logs should be logged with `fmt.Printf()` which writes to `os.Stdout` and errors with `print()` which writes to `os.Stderr`. This keeps the app logs clean as they are read byt the visor and displayed alongside visor logs. - `External app` - Any type of logging can be used. \ No newline at end of file + Any type of logging can be used. diff --git a/docs/skywire_forwarding.md b/docs/skywire_forwarding.md index 8b769a75ea..5d6abfeb52 100644 --- a/docs/skywire_forwarding.md +++ b/docs/skywire_forwarding.md @@ -1,23 +1,28 @@ -# Skywire forwarding +# Proxy Ports Over Skywire -## Register http server for forwarding -In order to for other visors to connect to the http server we need to register it via either the CLI or directly via the RPC. +## `skywire-cli fwd` + +To forward ports over skywire, register the port via the CLI ### CLI CLI can be used if you do not want to make any changes to the code of the http server or if it is written in another language. + - Register - `skywire-cli skyfwd register -l ` + `skywire-cli fwd -p ` Register a local port to be accessed by remote visors + - deregister - `skywire-cli skyfwd deregister -l ` + `skywire-cli fwd -d ` Deregister a local port to be accessed by remote visors + - ls-ports - `skywire-cli skyfwd ls-ports` + `skywire-cli fwd -l` List all registered ports ### RPC -RPC can be used to register and deregister within the http server code so that the process is automatic. -First create a RPC client conn to the local visor + +RPC can be used for integration with applications to register and deregister within the http server code so that the process is automatic. First create a RPC client conn to the local visor + ``` func client() (visor.API, error) { const rpcDialTimeout = time.Second * 5 @@ -38,15 +43,20 @@ err = rpcClient.DeregisterHTTPPort(port) ## Connect to the forwarded server -In order to connect to a server forwarded by a remote visor use the CLI. + +Connect to a server forwarded by a remote visor. ### CLI + - connect - `skywire-cli skyfwd connect -l -r ` - Connect to a server running on a remote visor machine. The http server will then be forwarded to the specified local port. + `skywire-cli rev -p -r ` + Connect to a server running on a remote visor machine. + The http server is proxied to the specified local port. + - disconnect - `skywire-cli skyfwd disconnect ` + `skywire-cli rev -d ` Disconnect from the server running on a remote visor machine + - ls - `skywire-cli skyfwd ls` - List all ongoing skyforwarding connections \ No newline at end of file + `skywire-cli rev -l` + List all configured connections diff --git a/docs/static-builds.md b/docs/static-builds.md index b7fcdc6dc6..ce4db2b4ca 100644 --- a/docs/static-builds.md +++ b/docs/static-builds.md @@ -2,7 +2,9 @@ You can statically compile all Skywire binaries. Install musl-tools with a package manager of your choice. -musl ports for Mac are not supported. +Note: the binary releases are compiled with musl. The skywire AUR package is also compiled with musl by default. + +musl ports for Mac are not supported. To compile and install the binaries run: @@ -12,4 +14,4 @@ $ make build-static # installs all dependencies, build binaries and skywire apps # Install statically compiled skywire-visor, skywire-cli and app CLI execs. $ make install-static -``` \ No newline at end of file +``` From 8ca418345508d38e468abbe9b504adafb1341bcd Mon Sep 17 00:00:00 2001 From: Moses Narrow <36607567+0pcom@users.noreply.github.com> Date: Mon, 23 Jan 2023 09:46:39 -0600 Subject: [PATCH 4/6] small readme changes --- README.md | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index e514106735..c3c7d16486 100644 --- a/README.md +++ b/README.md @@ -307,13 +307,13 @@ output tree ``` ├──skywire-cli └─┬skywire-visor - └─┬apps - ├──skychat - ├──skysocks - ├──skysocks-client - ├──vpn-client - ├──vpn-server - └──skychat + └─┬apps + ├──skychat + ├──skysocks + ├──skysocks-client + ├──vpn-client + ├──vpn-server + └──skychat ``` install these executables to the `GOPATH` @@ -344,14 +344,14 @@ Running from source as outlined here does not write the config to disk or explic ``` ├──skywire-config.json └─┬local - ├──skychat - ├──skysocks - ├──apps-pid.txt - ├──skychat_log.db - ├──reward.txt - ├──node-info.json - └─┬transport_logs - └──2022-11-12.csv + ├──skychat + ├──skysocks + ├──apps-pid.txt + ├──skychat_log.db + ├──reward.txt + ├──node-info.json + └─┬transport_logs + └──2022-11-12.csv ``` Some of these files are served via the [dmsghttp logserver](https://github.com/skycoin/skywire/wiki/DMSGHTTP-logserver) @@ -415,7 +415,7 @@ docker run --rm -v :/opt/skywire \ skycoin/skywire:test skywire-cli config update hypervisor-pks ``` -Or from docker image: +Or from docker image:/* #nosec */ ``` docker run --rm -v :/opt/skywire \ @@ -449,9 +449,11 @@ docker run --rm -p 8000:8000 --name=skywire skycoin/skywire:test skywire-visor `skywire-visor` can be run on Windows. The setup requires additional setup steps that are specified in [the docs](docs/windows-setup.md). -### Using Skywire connection for apps +### Using Skywire forwarding for publishing http server over skynet + +The skywire-cli subcommand `skywire-cli fwd` is used to register and connect to http servers over the skynet -to be documented +- [skywire forwarding](docs/skywire_forwarding.md) ### Using the Skywire VPN @@ -461,11 +463,6 @@ If you are interested in running the Skywire VPN as either a client or a server, - [Setup the Skywire VPN server](https://github.com/skycoin/skywire/wiki/Skywire-VPN-Server) - [Package Installation Guide](https://github.com/skycoin/skywire/wiki/Skywire-Package-Installation) -### Using Skywire forwarding for publishing http server over skynet - -The skywire-cli subcommand `skywire-cli skyfwd` is used to register and connect to http servers over the skynet - -- [skywire forwarding](docs/skywire_forwarding.md) ## Creating a GitHub release @@ -483,6 +480,6 @@ use [goreleaser](https://goreleaser.com) for creating them. 6. Create a `git` tag with desired release version and release name: `git tag -a 0.1.0 -m "First release"`, where `0.1.0` is release version and `First release` is release name. 5. Push the created tag to the repository: `git push origin 0.1.0`, where `0.1.0` is release version. -6. [Issue a personal GitHub access token.](https://github.com/settings/tokens) -7. Run `GITHUB_TOKEN=your_token make github-release` +6. [ ̶I̶s̶s̶u̶e̶ ̶a̶ ̶p̶e̶r̶s̶o̶n̶a̶l̶ ̶G̶i̶t̶H̶u̶b̶ ̶a̶c̶c̶e̶s̶s̶ ̶t̶o̶k̶e̶n̶.̶](https://github.com/settings/tokens) +7. ̶R̶u̶n̶ ̶`̶G̶I̶T̶H̶U̶B̶_̶T̶O̶K̶E̶N̶=̶y̶o̶u̶r̶_̶t̶o̶k̶e̶n̶ ̶m̶a̶k̶e̶ ̶g̶i̶t̶h̶u̶b̶-̶r̶e̶l̶e̶a̶s̶e̶`̶ 8. [Check the created GitHub release.](https://github.com/skycoin/skywire/releases/) From 11fa8c7bdd18bbb558ab8e435f7cd65e1771fb90 Mon Sep 17 00:00:00 2001 From: Moses Narrow <36607567+0pcom@users.noreply.github.com> Date: Mon, 23 Jan 2023 09:48:49 -0600 Subject: [PATCH 5/6] readme formatting changes --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c3c7d16486..3ca6c1ab96 100644 --- a/README.md +++ b/README.md @@ -307,13 +307,13 @@ output tree ``` ├──skywire-cli └─┬skywire-visor - └─┬apps - ├──skychat - ├──skysocks - ├──skysocks-client - ├──vpn-client - ├──vpn-server - └──skychat + └─┬apps + ├──skychat + ├──skysocks + ├──skysocks-client + ├──vpn-client + ├──vpn-server + └──skychat ``` install these executables to the `GOPATH` @@ -344,14 +344,14 @@ Running from source as outlined here does not write the config to disk or explic ``` ├──skywire-config.json └─┬local - ├──skychat - ├──skysocks - ├──apps-pid.txt - ├──skychat_log.db - ├──reward.txt - ├──node-info.json - └─┬transport_logs - └──2022-11-12.csv + ├──skychat + ├──skysocks + ├──apps-pid.txt + ├──skychat_log.db + ├──reward.txt + ├──node-info.json + └─┬transport_logs + └──2022-11-12.csv ``` Some of these files are served via the [dmsghttp logserver](https://github.com/skycoin/skywire/wiki/DMSGHTTP-logserver) From 868c081c89b617fb503420a6414cc8a694b3c642 Mon Sep 17 00:00:00 2001 From: Moses Narrow <36607567+0pcom@users.noreply.github.com> Date: Mon, 23 Jan 2023 09:49:51 -0600 Subject: [PATCH 6/6] readme formatting changes --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3ca6c1ab96..225402a3c6 100644 --- a/README.md +++ b/README.md @@ -308,12 +308,12 @@ output tree ├──skywire-cli └─┬skywire-visor └─┬apps - ├──skychat - ├──skysocks - ├──skysocks-client - ├──vpn-client - ├──vpn-server - └──skychat + ├──skychat + ├──skysocks + ├──skysocks-client + ├──vpn-client + ├──vpn-server + └──skychat ``` install these executables to the `GOPATH` @@ -351,7 +351,7 @@ Running from source as outlined here does not write the config to disk or explic ├──reward.txt ├──node-info.json └─┬transport_logs - └──2022-11-12.csv + └──2022-11-12.csv ``` Some of these files are served via the [dmsghttp logserver](https://github.com/skycoin/skywire/wiki/DMSGHTTP-logserver)