Compare commits

...

5 Commits

Author SHA1 Message Date
Dennis Schwerdel ea5d515ffd Use specific version of asciidoctor that works 2020-11-07 12:59:44 +01:00
Dennis Schwerdel 8e40e74914 Release 2.0.1 2020-11-07 12:34:51 +01:00
Dennis Schwerdel f210f75a25 Allow default port for peers 2020-11-07 12:25:12 +01:00
Dennis Schwerdel 46c8407db9 Merge branch 'master' of github.com:dswd/vpncloud 2020-11-07 12:04:30 +01:00
Dennis Schwerdel c31de207c7 Some small fixes 2020-11-07 12:04:25 +01:00
11 changed files with 59 additions and 23 deletions

View File

@ -1,7 +1,7 @@
FROM centos:7
RUN yum groupinstall -y 'Development Tools'
RUN yum install -y ruby && gem install asciidoctor
RUN yum install -y ruby && gem install asciidoctor -v 2.0.10
ADD entrypoint.sh /entrypoint.sh

View File

@ -2,18 +2,20 @@
This project follows [semantic versioning](http://semver.org).
### UNRELEASED
### v2.0.1 (2020-11-07)
- [changed] Changed documentation
- [changed] Updated dependencies
- [changed] Retrying connections for 120 secs
- [changed] Resetting own addresses periodically
- [changed] Using smallvec everywhere
- [changed] Assume default port for peers without port
- [fixed] Fixed corner case with lost init message
- [fixed] Do not reconnect to timed out pending connections
- [fixed] Most specific claims beat less specific claims
- [fixed] Count all invalid protocol traffic
- [fixed] Fixed compile with musl
- [fixed] Fixed time format in logs
### v2.0.0 (2020-10-30)

25
Cargo.lock generated
View File

@ -33,9 +33,9 @@ dependencies = [
[[package]]
name = "base-x"
version = "0.2.6"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1"
checksum = "c2734baf8ed08920ccecce1b48a2dfce4ac74a973144add031163bd21a1c5dab"
[[package]]
name = "bitflags"
@ -69,9 +69,9 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]]
name = "cc"
version = "1.0.61"
version = "1.0.62"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d"
checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40"
[[package]]
name = "cfg-if"
@ -128,6 +128,16 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "form_urlencoded"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00"
dependencies = [
"matches",
"percent-encoding",
]
[[package]]
name = "getrandom"
version = "0.1.15"
@ -740,10 +750,11 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
[[package]]
name = "url"
version = "2.1.1"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb"
checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e"
dependencies = [
"form_urlencoded",
"idna",
"matches",
"percent-encoding",
@ -769,7 +780,7 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
[[package]]
name = "vpncloud"
version = "2.0.0"
version = "2.0.1"
dependencies = [
"byteorder",
"daemonize",

View File

@ -1,6 +1,6 @@
[package]
name = "vpncloud"
version = "2.0.0"
version = "2.0.1"
authors = ["Dennis Schwerdel <schwerdel@googlemail.com>"]
build = "build.rs"
license = "GPL-3.0"

View File

@ -1,3 +1,20 @@
vpncloud (2.0.1) stable; urgency=medium
* [changed] Changed documentation
* [changed] Updated dependencies
* [changed] Retrying connections for 120 secs
* [changed] Resetting own addresses periodically
* [changed] Using smallvec everywhere
* [changed] Assume default port for peers without port
* [fixed] Fixed corner case with lost init message
* [fixed] Do not reconnect to timed out pending connections
* [fixed] Most specific claims beat less specific claims
* [fixed] Count all invalid protocol traffic
* [fixed] Fixed compile with musl
* [fixed] Fixed time format in logs
-- Dennis Schwerdel <schwerdel@googlemail.com> Sat, 07 Nov 2020 12:28:00 +0100
vpncloud (2.0.0) stable; urgency=medium
* [added] **Add strong crypto, complete rewrite of crypto system**

View File

@ -1,7 +1,7 @@
FROM centos:7
RUN yum groupinstall -y 'Development Tools'
RUN yum install -y ruby && gem install asciidoctor
RUN yum install -y ruby && gem install asciidoctor -v 2.0.10
RUN useradd -ms /bin/bash user
USER user

View File

@ -5,7 +5,7 @@ import atexit, argparse, os
REGION = "eu-central-1"
VERSION = "1.4.0"
VERSION = "2.0.0"
parser = argparse.ArgumentParser(description='Create a test setup')

View File

@ -373,8 +373,14 @@ impl<D: Device, P: Protocol, S: Socket, TS: TimeSource> GenericCloud<D, P, S, TS
// Resolve entries anew
if let Some((ref address, ref mut next_resolve)) = entry.address {
if *next_resolve <= now {
if let Ok(addrs) = resolve(address as &str) {
entry.resolved = addrs;
match resolve(address as &str) {
Ok(addrs) => entry.resolved = addrs,
Err(_) => {
match resolve(&format!("{}:{}", address, DEFAULT_PORT)) {
Ok(addrs) => entry.resolved = addrs,
Err(err) => warn!("Failed to resolve {}: {}", address, err)
}
}
}
*next_resolve = now + RESOLVE_INTERVAL;
}
@ -828,7 +834,7 @@ impl<D: Device, P: Protocol, S: Socket, TS: TimeSource> GenericCloud<D, P, S, TS
if poll_error {
fail!("Poll wait failed again: {}", err);
}
error!("Poll wait failed: {}, retrying...", err);
debug!("Poll wait failed: {}, retrying...", err);
poll_error = true;
}
WaitResult::Timeout => {}

View File

@ -26,13 +26,13 @@ pub enum Error {
#[error("Socker error: {0}")]
Socket(&'static str),
#[error("Socker error: {0}")]
#[error("Socker error: {0} ({1})")]
SocketIo(&'static str, #[source] io::Error),
#[error("Device error: {0}")]
Device(&'static str),
#[error("Device error: {0}")]
#[error("Device error: {0} ({1})")]
DeviceIo(&'static str, #[source] io::Error),
#[error("File error: {0}")]
@ -41,7 +41,7 @@ pub enum Error {
#[error("Message error: {0}")]
Message(&'static str),
#[error("Beacon error: {0}")]
#[error("Beacon error: {0} ({1})")]
BeaconIo(&'static str, #[source] io::Error),
#[error("Parse error: {0}")]

View File

@ -88,7 +88,7 @@ impl log::Log for DualLogger {
println!("{} - {}", record.level(), record.args());
if let Some(ref file) = self.file {
let mut file = file.lock().expect("Lock poisoned");
let time = time::OffsetDateTime::now_local().format("%F %T");
let time = time::OffsetDateTime::now_local().format("%F %H:%M:%S");
writeln!(file, "{} - {} - {}", time, record.level(), record.args())
.expect("Failed to write to logfile");
}

View File

@ -13,8 +13,8 @@ use crate::error::Error;
#[cfg(not(target_os = "linux"))] use time;
use signal::{trap::Trap, Signal};
use std::time::Instant;
use smallvec::SmallVec;
use std::time::Instant;
pub type Duration = u32;
@ -218,9 +218,8 @@ pub fn get_internal_ip() -> Ipv4Addr {
#[allow(unknown_lints, clippy::needless_pass_by_value)]
pub fn resolve<Addr: ToSocketAddrs + fmt::Debug>(addr: Addr) -> Result<SmallVec<[SocketAddr; 3]>, Error> {
let addrs = addr.to_socket_addrs().map_err(|_| Error::NameUnresolvable(format!("{:?}", addr)))?;
// Remove duplicates in addrs (why are there duplicates???)
let mut addrs = addrs.collect::<SmallVec<_>>();
let mut addrs =
addr.to_socket_addrs().map_err(|_| Error::NameUnresolvable(format!("{:?}", addr)))?.collect::<SmallVec<_>>();
// Try IPv4 first as it usually is faster
addrs.sort_by_key(|addr| {
match *addr {
@ -228,6 +227,7 @@ pub fn resolve<Addr: ToSocketAddrs + fmt::Debug>(addr: Addr) -> Result<SmallVec<
SocketAddr::V6(_) => 6
}
});
// Remove duplicates in addrs (why are there duplicates???)
addrs.dedup();
Ok(addrs)
}