Open dswd opened 8 years ago
I might have a look at getting it running on OS X, another one to add would be freebsd (pfSense package too).
That would be great. I also added FreeBSD.
May be worth looking at OpenVPN's implementation for OS X and FreeBSD.
I added some more documentation and changed the polling mechanism to be more flexible (could now implement kqueue) to make porting easier for you.
I've started working on kqueue (bsd/osx) support, just waiting on https://github.com/nix-rust/nix/pull/396 at the moment.
Signal also seems to only be supported on linux so will have to sort that out.
I adore this software. I'm a complete noob. I really want to run it on my RPi and my phone. I've been unable to cross-compile it (and I even tried compiling on the RPi). Here is a sample output:
$ cargo build --target=armv7-unknown-linux-gnueabihf Compiling vpncloud v0.8.1 (file:///home/h0p3/vpncloud.rs) error: failed to run custom build command for
vpncloud v0.8.1 (file:///home/h0p3/vpncloud.rs)
process didn't exit successfully:/home/h0p3/vpncloud.rs/target/debug/build/vpncloud-641c68931705eb78/build-script-build
(exit code: 101) --- stdout TARGET = Some("armv7-unknown-linux-gnueabihf") OPT_LEVEL = Some("0") TARGET = Some("armv7-unknown-linux-gnueabihf") HOST = Some("x86_64-unknown-linux-gnu") TARGET = Some("armv7-unknown-linux-gnueabihf") TARGET = Some("armv7-unknown-linux-gnueabihf") HOST = Some("x86_64-unknown-linux-gnu") CC_armv7-unknown-linux-gnueabihf = None CC_armv7_unknown_linux_gnueabihf = None TARGET_CC = None CC = None HOST = Some("x86_64-unknown-linux-gnu") CROSS_COMPILE = None TARGET = Some("armv7-unknown-linux-gnueabihf") HOST = Some("x86_64-unknown-linux-gnu") CFLAGS_armv7-unknown-linux-gnueabihf = None CFLAGS_armv7_unknown_linux_gnueabihf = None TARGET_CFLAGS = None CFLAGS = None PROFILE = Some("debug") running: "arm-linux-gnueabihf-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-march=armv7-a" "-I" "src" "-o" "/home/h0p3/vpncloud.rs/target/armv7-unknown-linux-gnueabihf/debug/build/vpncloud-6ec0f618f669dc21/out/src/c/tuntap.o" "-c" "src/c/tuntap.c" exit code: 0 TARGET = Some("armv7-unknown-linux-gnueabihf") TARGET = Some("armv7-unknown-linux-gnueabihf") HOST = Some("x86_64-unknown-linux-gnu") AR_armv7-unknown-linux-gnueabihf = None AR_armv7_unknown_linux_gnueabihf = None TARGET_AR = None AR = None TARGET = Some("armv7-unknown-linux-gnueabihf") TARGET = Some("armv7-unknown-linux-gnueabihf") running: "ar" "crs" "/home/h0p3/vpncloud.rs/target/armv7-unknown-linux-gnueabihf/debug/build/vpncloud-6ec0f618f669dc21/out/libtuntap.a" "/home/h0p3/vpncloud.rs/target/armv7-unknown-linux-gnueabihf/debug/build/vpncloud-6ec0f618f669dc21/out/src/c/tuntap.o" exit code: 0 TARGET = Some("armv7-unknown-linux-gnueabihf") cargo:rustc-link-lib=static=tuntap cargo:rustc-link-search=native=/home/h0p3/vpncloud.rs/target/armv7-unknown-linux-gnueabihf/debug/build/vpncloud-6ec0f618f669dc21/out--- stderr make: No rule to make target 'clean'. Stop. sh: 0: Can't open autogen.sh sh: 0: Can't open configure make: No targets specified and no makefile found. Stop. thread 'main' panicked at 'called
Result::unwrap()
on anErr
value: Error { repr: Custom(Custom { kind: InvalidInput, error: StringError("the source path is not an existing regular file") }) }', /checkout/src/libcore/result.rs:916:5 note: Run withRUST_BACKTRACE=1
for a backtrace.
Can anyone point me in the right direction?
@fourbytes so ,have u successfully compiled vpncloud on mac?
@fourbytes
on mac:
git clone https://github.com/dswd/vpncloud vpncloud-by-dswd
cd vpncloud-by-dswd
cargo build --release
it shows:
...
Compiling rand v0.7.2
error: failed to run custom build command for vpncloud v1.0.0 (/Users/brite/vpncloud-by-dswd)
Caused by:
process didn't exit successfully: /Users/brite/vpncloud-by-dswd/target/release/build/vpncloud-d91f8ff6549d48b0/build-script-build
(exit code: 1)
--- stdout
cargo:rerun-if-changed=src/c/tuntap.c
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("cmpxchg16b,fxsr,mmx,sse,sse2,sse3,ssse3")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-Wall" "-Wextra" "-o" "/Users/brite/vpncloud-by-dswd/target/release/build/vpncloud-5215daba07884332/out/src/c/tuntap.o" "-c" "src/c/tuntap.c"
cargo:warning=src/c/tuntap.c:7:10: fatal error: 'linux/if_tun.h' file not found
cargo:warning=#include <linux/if_tun.h>
cargo:warning= ^
cargo:warning=1 error generated.
exit code: 1
--- stderr
error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-Wall" "-Wextra" "-o" "/Users/brite/vpncloud-by-dswd/target/release/build/vpncloud-5215daba07884332/out/src/c/tuntap.o" "-c" "src/c/tuntap.c" with args "cc" did not execute successfully (status code exit code: 1).
warning: build failed, waiting for other jobs to finish... Building [==============================================> ] 91/105 error: build failed
i saw: "fatal error: 'linux/if_tun.h' file not found",how to fix this issue?
I am sorry, but it won't just compile like that. OS X has a different way of using virtual network devices to Linux, so it will need some code changes.
Just to update wintun 0.9 has been released and should be much nicer to work with. https://lists.zx2c4.com/pipermail/wireguard/2020-November/005921.html
@ofer-dev does wintun also support tap devices? Vpncloud supports tun and tap and I would like to have one lib for windows if possible.
Wintun only support tun devices. However, it is faster and smaller than tap-windows6, so less room for bugs. But if tap devices are necessary to the best of my knowledge tap-windows6 is the only option.
references: https://lists.zx2c4.com/pipermail/wireguard/2019-March/004038.html https://lists.zx2c4.com/pipermail/wireguard/2019-May/004168.html https://www.wintun.net/
p.s. As of version 2.5 OpenVPN also ships with wintun. https://openvpn.net/community-downloads-2/
Any thought to packaging VPNCloud as a SNAP?
Quite a number of Linux distributions support Snap out of the box such as Ubuntu (and e.g. Kubuntu), Manjaro, Zorin OS, KDE Neon, Solus and Li-f-e.
Snap is also available for many other distributions such as CentOS, Debian, Elementary OS, Fedora, GalliumOS, Kali Linux, Linux Mint, OpenEmbedded, Parrot Security OS, Pop! OS, Raspbian, Red Hat Enterprise Linux and openSUSE.
Snap also supports upgrade/rollbacks etc..
Snap's goal was to ease the load on developers and also "containerize" the applications installed instead of speading config files etc all over a disk.
https://snapcraft.io/docs/creating-a-snap
Just an idea.
Hi Brian. I thought about that but haven't followed that up since I have no experience in writing snaps. So if you want to help, you can create a snap and I will add it to the build process and maintain it as good as I can.
It's been two three years, and I've yet to find a serious alternative to this piece of software. I have no idea why this tool is not much bigger than it is, btw. It's amazing (and thank you for providing such a gift to the world). You write code with moral merit. I might not be able to write the snap, but I'd donate for it.
Hi, thanks a lot for the kind words. I looked into building snaps a little and managed to build a simple snap from the deb package. However:
Right now the snap just provides the binary. Any help would be appreciated.
I just thought about something else. Since VpnCloud really just comes as a binary with 3 support files (manpage, system service, example config), maybe I can provide a standalone executable which has install
and uninstall
commands that create/delete those 3 files. Alternatively, the binary could get the ability to manage instances (create config, delete config) which also creates the required service file. This would work on any Linux system I can think of. What do you think about that? Would that be useful to you?
@dswd
I don't know if this helps but here is the OpenVPN SNAP:
IBCNServices/easy-openvpn-server: Plug-and-play OpenVPN server which generates server and client config files for you.
@dswd
First, I want to introduce myself to you. Hi there! My name is h0p3. It's an honor and a pleasure to meet you. I've been an admirer from afar. Maybe that will change; I don't know. If you ever need a friend, a madman, or a retard in your life, HMU: https://philosopher.life/ (feel free to ignore my public self-modeling; it's currently being quietly written [can check the diffs]). I record my conversations (including this one, and I'm happy to think about that with you, if you want), and if you prefer an alias, let me know (you've already earned one with me).
I've been thinking about your words. I like many of the changes you've made to this software over the years (to my poor understanding, of course). I'm sure I sound like an entitled user, and I apologize. I am grateful for this gift.
Perhaps all I can offer in return at the moment is my paranoid, ignorant opinion here (might not be worth much, sorry). I think you have a tool that competes with Zerotier (this is the tit I'm trying to get off) and perhaps even https://github.com/yggdrasil-network/yggdrasil-go. Having something that "just werx" on any Linux machine is quite an accomplishment, especially if there is a simple installation (if you had more people helping you, it seems like it could be used on most unlocked platforms [perhaps even inside the browser via WASM one day]). I like to think that this tool could be the basis of the decentralization that so many applications are really seeking in the end. Here's some dumb questions and uses I have in mind:
You need a dozen people to solve these problems maybe. Please ignore my questions (they are insane, I know). You have already given more than you have to.
I don't know what fitting assumptions you ought to make here. I'm not a dev; I'm just a skiddie who uses his computer to get shit done. If you can avoid package managers, then why not avoid them? I like the last binary option you mentioned the most.
@m6ram Thanks for the compliments. As those questions go beyond the topic of this issue, I quoted and answered them in #159.
Debian packages for armel (eg. raspberry pi zero and older raspberry pi) would be much appreciated
Created a pull request for armel #274
With armel build target support merged (#274) and version 2.3.0 released, a deployment of the latest debs to https://repo.ddswd.de/deb would be much appreciated.
A new crate may be of help, particularly for running as a Windows service: https://github.com/chipsenkbeil/service-manager-rs
Any chance to have this packaged for OpenWRT with LUCI support?
Very much looking forward to vpncloud supporting windows platform
This is a tracking issue on building VpnCloud for other operating systems and other architectures.
Implementation hints: