From 8d81a0117ff8323d62e22f817a0d54d66f09ef40 Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Mon, 12 Apr 2021 19:30:57 +0200 Subject: [PATCH 1/9] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfb16a9..d2548e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ This project follows [semantic versioning](http://semver.org). +### UNRELEASED + +- [added] Option to specify advertised addresses +- [added] Peers now learn their own address from peers + ### v2.2.0 (2021-04-06) - [added] Service target file (thanks to mnhauke) From 37aebf64c3d59ad519e4476135f08fdedda29deb Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Mon, 12 Apr 2021 19:47:17 +0200 Subject: [PATCH 2/9] Remove time in favor of chrono --- Cargo.lock | 174 ++++++++++------------------------------------- Cargo.toml | 3 +- src/main.rs | 2 +- src/tests/mod.rs | 7 +- 4 files changed, 39 insertions(+), 147 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76701b2..46517c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,12 +38,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" -[[package]] -name = "base-x" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" - [[package]] name = "base64" version = "0.13.0" @@ -103,9 +97,9 @@ checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" [[package]] name = "cast" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +checksum = "8f566d1fbeb40ec78c78344e9983f46ff9eb4e944fa930ed01b7d72b72a37c11" dependencies = [ "rustc_version", ] @@ -128,6 +122,18 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "winapi", +] + [[package]] name = "clap" version = "2.33.3" @@ -158,12 +164,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "const_fn" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076a6803b0dacd6a88cfe64deba628b01533ff5ef265687e6938280c1afd0a28" - [[package]] name = "cpuid-bool" version = "0.1.2" @@ -208,9 +208,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -304,12 +304,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - [[package]] name = "dtoa" version = "0.4.8" @@ -391,9 +385,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ "bytes", "fnv", @@ -402,9 +396,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.5" +version = "1.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" +checksum = "bc35c995b9d93ec174cf9a27d425c7892722101e14993cd227fdb51d70cf9589" [[package]] name = "iai" @@ -551,6 +545,16 @@ dependencies = [ "libc", ] +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.14" @@ -662,12 +666,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - [[package]] name = "proc-macro2" version = "1.0.26" @@ -919,12 +917,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "sha1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" - [[package]] name = "signal" version = "0.7.0" @@ -947,64 +939,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check", -] - -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1", - "syn", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "strsim" version = "0.8.0" @@ -1037,9 +971,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87" +checksum = "48fe99c6bd8b1cc636890bcc071842de909d902c81ac7dab53ba33c421ab8ffb" dependencies = [ "proc-macro2", "quote", @@ -1099,44 +1033,6 @@ dependencies = [ "syn", ] -[[package]] -name = "time" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b7151c9065e80917fbf285d9a5d1432f60db41d170ccafc749a136b41a93af" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb", - "time-macros", - "version_check", - "winapi", -] - -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - -[[package]] -name = "time-macros-impl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "standback", - "syn", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -1190,9 +1086,9 @@ checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" dependencies = [ "matches", ] @@ -1271,6 +1167,7 @@ name = "vpncloud" version = "2.2.0" dependencies = [ "byteorder", + "chrono", "criterion", "daemonize", "dialoguer", @@ -1289,7 +1186,6 @@ dependencies = [ "structopt", "tempfile", "thiserror", - "time", "tungstenite", "url", "yaml-rust", diff --git a/Cargo.toml b/Cargo.toml index af7d619..f44cbe1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ toolchain = "1.51.0" upx_version = "3.96" [dependencies] -time = "=0.2.22" +chrono = { version = "0.4", features = ["std", "clock"], default_features = false} structopt = "0.3" serde = { version = "1.0", features = ["derive"] } serde_yaml = "0.8" @@ -37,6 +37,7 @@ tungstenite = { version = "0.13", optional = true, default-features = false } url = { version = "2.2", optional = true } igd = { version = "0.12", optional = true } + [dev-dependencies] tempfile = "3" criterion = { version = "0.3", features = ["html_reports"] } diff --git a/src/main.rs b/src/main.rs index f8e09af..cd49fab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -96,7 +96,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 = chrono::Local::now().format("%F %H:%M:%S"); writeln!(file, "{} - {} - {}", time, record.level(), record.args()) .expect("Failed to write to logfile"); } diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 67dd149..16e2f86 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -5,9 +5,4 @@ mod common; mod nat; mod payload; -mod peers; - -#[test] -fn test_time_format() { - assert!(time::OffsetDateTime::try_now_local().is_ok()); -} +mod peers; \ No newline at end of file From 25e2f327e92bb2874d8b236acd30169092b80e34 Mon Sep 17 00:00:00 2001 From: dswd Date: Sun, 18 Apr 2021 19:36:56 +0200 Subject: [PATCH 3/9] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 27 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 16 ++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..0e35324 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Report a bug +title: '' +labels: '' +assignees: '' + +--- + +### Describe the bug +A clear and concise description of what the bug is. + +### Details of your setup + +**VpnCloud version:** + +**Description of your VPN setup** +- How many nodes? +- Any NAT involved? +- Any custom routing? + +**Config file contents** +normally in `/etc/vpncloud/MYNET.net` +:bangbang: make sure to mask (`***`) passwords and public IPs/hostnames :bangbang: + +**Log entries** +normally in `/var/log/vpncloud.MYNET.log` diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..9028701 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,16 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +** Describe the high-level goal you want to achieve ** + +I would like to... + +** Describe the proposed solution ** + +I propose to... From ea53a4aad587dc720fd184625d72cc4c8bedb582 Mon Sep 17 00:00:00 2001 From: dswd Date: Sun, 18 Apr 2021 19:40:29 +0200 Subject: [PATCH 4/9] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..99611aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: VpnCloud Documentation + url: https://vpncloud.ddswd.de/docs + about: Pleae check the documentation before asking how things work. + - name: VpnCloud Discussion Group on GitHub + url: https://github.com/dswd/vpncloud/discussions + about: Please discuss or ask anything there that is **not an issue**. From b0d73c44ed16f5d7a005f51992a2683248344376 Mon Sep 17 00:00:00 2001 From: dswd Date: Sun, 18 Apr 2021 19:41:54 +0200 Subject: [PATCH 5/9] Update config.yml --- .github/ISSUE_TEMPLATE/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 99611aa..83396ba 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,7 +2,7 @@ blank_issues_enabled: true contact_links: - name: VpnCloud Documentation url: https://vpncloud.ddswd.de/docs - about: Pleae check the documentation before asking how things work. - - name: VpnCloud Discussion Group on GitHub + about: Please check the documentation before asking how things work. + - name: Discussion Group on GitHub url: https://github.com/dswd/vpncloud/discussions - about: Please discuss or ask anything there that is **not an issue**. + about: Please discuss or ask anything there that is not an issue. From 41bcb46579124ee5f5db1e9b6746fbf4288ff78f Mon Sep 17 00:00:00 2001 From: dswd Date: Sun, 18 Apr 2021 20:32:18 +0200 Subject: [PATCH 6/9] Create issue_template.md --- .github/ISSUE_TEMPLATE/issue_template.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/issue_template.md diff --git a/.github/ISSUE_TEMPLATE/issue_template.md b/.github/ISSUE_TEMPLATE/issue_template.md new file mode 100644 index 0000000..e04dbdb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue_template.md @@ -0,0 +1,14 @@ +--- +name: Other issue +about: Any other issue +title: '' +labels: '' +assignees: '' + +--- + +### Describe your issue + +👉 Please use the [Discussion group](https://github.com/dswd/vpncloud/discussions) if you... +* just want to ask a question +* want to discuss a new feature From 396351b61c16cede52b82dda6d68e025d27118ef Mon Sep 17 00:00:00 2001 From: dswd Date: Sun, 18 Apr 2021 20:33:32 +0200 Subject: [PATCH 7/9] Update config.yml --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 83396ba..067e795 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,4 +1,4 @@ -blank_issues_enabled: true +blank_issues_enabled: false contact_links: - name: VpnCloud Documentation url: https://vpncloud.ddswd.de/docs From 213faa5649998dcdf78562393ddbead2dab916f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Apr 2021 05:18:48 +0000 Subject: [PATCH 8/9] Bump libc from 0.2.93 to 0.2.94 Bumps [libc](https://github.com/rust-lang/libc) from 0.2.93 to 0.2.94. - [Release notes](https://github.com/rust-lang/libc/releases) - [Commits](https://github.com/rust-lang/libc/compare/0.2.93...0.2.94) Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46517c9..f3d4648 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -480,9 +480,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" +checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" [[package]] name = "linked-hash-map" From 0119820495a367242484e3b7779606cf086c5d9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 05:30:48 +0000 Subject: [PATCH 9/9] Bump url from 2.2.1 to 2.2.2 Bumps [url](https://github.com/servo/rust-url) from 2.2.1 to 2.2.2. - [Release notes](https://github.com/servo/rust-url/releases) - [Commits](https://github.com/servo/rust-url/compare/v2.2.1...v2.2.2) Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3d4648..506afd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1128,9 +1128,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna",