Compare commits

..

No commits in common. "ea5d515ffd375be6d272f6a3ee9442c9706e19fe" and "61733ac648d7b136ab3c0843844d50a805e7d0d2" have entirely different histories.

11 changed files with 23 additions and 59 deletions

View File

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

View File

@ -2,20 +2,18 @@
This project follows [semantic versioning](http://semver.org).
### v2.0.1 (2020-11-07)
### UNRELEASED
- [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.7"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2734baf8ed08920ccecce1b48a2dfce4ac74a973144add031163bd21a1c5dab"
checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1"
[[package]]
name = "bitflags"
@ -69,9 +69,9 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]]
name = "cc"
version = "1.0.62"
version = "1.0.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40"
checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d"
[[package]]
name = "cfg-if"
@ -128,16 +128,6 @@ 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"
@ -750,11 +740,10 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
[[package]]
name = "url"
version = "2.2.0"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e"
checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb"
dependencies = [
"form_urlencoded",
"idna",
"matches",
"percent-encoding",
@ -780,7 +769,7 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
[[package]]
name = "vpncloud"
version = "2.0.1"
version = "2.0.0"
dependencies = [
"byteorder",
"daemonize",

View File

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

View File

@ -1,20 +1,3 @@
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 -v 2.0.10
RUN yum install -y ruby && gem install asciidoctor
RUN useradd -ms /bin/bash user
USER user

View File

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

View File

@ -373,14 +373,8 @@ 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 {
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)
}
}
if let Ok(addrs) = resolve(address as &str) {
entry.resolved = addrs;
}
*next_resolve = now + RESOLVE_INTERVAL;
}
@ -834,7 +828,7 @@ impl<D: Device, P: Protocol, S: Socket, TS: TimeSource> GenericCloud<D, P, S, TS
if poll_error {
fail!("Poll wait failed again: {}", err);
}
debug!("Poll wait failed: {}, retrying...", err);
error!("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} ({1})")]
#[error("Socker error: {0}")]
SocketIo(&'static str, #[source] io::Error),
#[error("Device error: {0}")]
Device(&'static str),
#[error("Device error: {0} ({1})")]
#[error("Device error: {0}")]
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} ({1})")]
#[error("Beacon error: {0}")]
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 %H:%M:%S");
let time = time::OffsetDateTime::now_local().format("%F %T");
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 smallvec::SmallVec;
use std::time::Instant;
use smallvec::SmallVec;
pub type Duration = u32;
@ -218,8 +218,9 @@ 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 mut addrs =
addr.to_socket_addrs().map_err(|_| Error::NameUnresolvable(format!("{:?}", addr)))?.collect::<SmallVec<_>>();
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<_>>();
// Try IPv4 first as it usually is faster
addrs.sort_by_key(|addr| {
match *addr {
@ -227,7 +228,6 @@ 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)
}