Compare commits

...

11 commits
1.1.6 ... main

Author SHA1 Message Date
10f6aa8455
Release 1.1.9 Ammend
All checks were successful
Build and release binary file and packages / test (push) Successful in 21s
Run Tests on Code / run-tests (push) Successful in 23s
Build and release binary file and packages / build (push) Successful in 2m1s
Build and release binary file and packages / upload-generic-package (push) Successful in 1s
Build and release binary file and packages / upload-debian-package (push) Successful in 2s
Build and release binary file and packages / create-release (push) Successful in 9s
2024-09-30 11:41:20 +02:00
af6dcad5df
Release 1.1.9
All checks were successful
Run Tests on Code / run-tests (push) Successful in 23s
2024-09-30 11:40:07 +02:00
afb4dd8ff3
Include interface name when malformed IP is detected 2024-09-30 11:39:43 +02:00
3f41b8958e
Update Release Debian Ref Collecting
All checks were successful
Run Tests on Code / run-tests (push) Successful in 13s
2024-08-07 20:50:25 +02:00
7e7646a4eb Merge pull request 'Bump forgejo-release to v2' (#36) from actions-update into main
All checks were successful
Run Tests on Code / run-tests (push) Successful in 42s
Reviewed-on: https://forgejo.neshweb.net///Neshura/cloudflare-dns-updater/pulls/36
2024-08-06 12:23:21 +00:00
40f617a2d6 Bump forgejo-release to v2
All checks were successful
Build binary file and bundle packages / test (pull_request) Successful in 35s
Run Tests on Code / run-tests (push) Successful in 37s
Build binary file and bundle packages / build (pull_request) Successful in 49s
2024-08-06 12:20:15 +00:00
65519933be
Release 1.1.8
All checks were successful
Run Tests on Code / run-tests (push) Successful in 24s
Build and release binary file and packages / test (push) Successful in 7s
Build and release binary file and packages / build (push) Successful in 23s
Build and release binary file and packages / upload-generic-package (push) Successful in 1s
Build and release binary file and packages / upload-debian-package (push) Successful in 1s
Build and release binary file and packages / create-release (push) Successful in 7s
2024-06-10 12:46:00 +02:00
2c83671c8e Migrate away from Mullvad API
All checks were successful
Run Tests on Code / run-tests (push) Successful in 20s
2024-06-10 11:51:27 +02:00
3626237d90
Release 1.1.7
All checks were successful
Run Tests on Code / run-tests (push) Successful in 20s
Build and release binary file and packages / test (push) Successful in 22s
Build and release binary file and packages / build (push) Successful in 28s
Build and release binary file and packages / upload-generic-package (push) Successful in 1s
Build and release binary file and packages / upload-debian-package (push) Successful in 1s
Build and release binary file and packages / create-release (push) Successful in 7s
2024-03-04 16:44:11 +01:00
6a31ae0f9a
Elevated Mullvad Error Returns to Error Level from Warning
All checks were successful
Run Tests on Code / run-tests (push) Successful in 10s
2024-03-04 16:43:56 +01:00
04a1be9bcb
Improved Error Message Syntax 2024-03-04 16:43:06 +01:00
6 changed files with 26 additions and 26 deletions

View file

@ -63,7 +63,7 @@ jobs:
name: Bundle .deb package name: Bundle .deb package
run: | run: |
cargo deb cargo deb
DEBIAN_REF=$(echo ${{ github.ref_name }} | tr - \~) DEBIAN_REF=$(cat Cargo.toml | grep -E "(^|\|)version =" | cut -f2- -d= | tr -d \" | tr -d " " | tr - \~)
echo "DEBIAN_REF=$DEBIAN_REF" >> dist/build.env echo "DEBIAN_REF=$DEBIAN_REF" >> dist/build.env
DEBIAN_REV=-$(cat Cargo.toml | grep -E "(^|\|)revision =" | cut -f2- -d= | tr -d \" | tr -d " ") DEBIAN_REV=-$(cat Cargo.toml | grep -E "(^|\|)revision =" | cut -f2- -d= | tr -d \" | tr -d " ")
echo "DEBIAN_REV=$DEBIAN_REV" >> dist/build.env echo "DEBIAN_REV=$DEBIAN_REV" >> dist/build.env
@ -137,7 +137,7 @@ jobs:
run: rm release_blobs/build.env run: rm release_blobs/build.env
- -
name: Release New Version name: Release New Version
uses: actions/forgejo-release@v1 uses: actions/forgejo-release@v2
with: with:
direction: upload direction: upload
url: https://forgejo.neshweb.net url: https://forgejo.neshweb.net

2
Cargo.lock generated
View file

@ -114,7 +114,7 @@ dependencies = [
[[package]] [[package]]
name = "cloudflare-dns-updater" name = "cloudflare-dns-updater"
version = "1.1.6" version = "1.1.9"
dependencies = [ dependencies = [
"chrono", "chrono",
"confy", "confy",

View file

@ -1,7 +1,7 @@
[package] [package]
authors = ["Neshura"] authors = ["Neshura"]
name = "cloudflare-dns-updater" name = "cloudflare-dns-updater"
version = "1.1.6" version = "1.1.9"
edition = "2021" edition = "2021"
description = "Application for automatically updating Cloudflare DNS records" description = "Application for automatically updating Cloudflare DNS records"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"

View file

@ -64,7 +64,7 @@ impl CloudflareZone {
let entries = match response.json::<CloudflareApiResults>() { let entries = match response.json::<CloudflareApiResults>() {
Ok(data) => data, Ok(data) => data,
Err(e) => { Err(e) => {
let err_msg = format!("Unable to parse API response. Error: {e}"); let err_msg = format!("Unable to parse API response: {e}");
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -75,7 +75,7 @@ impl CloudflareZone {
Ok(entries.result) Ok(entries.result)
} else { } else {
let err_msg = format!("Unable to fetch Cloudflare Zone Entries for {}. Error: {}",self.name ,response.status()); let err_msg = format!("Unable to fetch Cloudflare Zone Entries for {}: {}",self.name ,response.status());
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -84,7 +84,7 @@ impl CloudflareZone {
} }
} }
Err(e) => { Err(e) => {
let err_msg = format!("Unable to access Cloudflare API. Error: {e}"); let err_msg = format!("Unable to access Cloudflare API: {e}");
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -107,7 +107,7 @@ impl CloudflareZone {
self.validate_response(response) self.validate_response(response)
}, },
Err(e) => { Err(e) => {
let err_msg = format!("Unable to access Cloudflare API. Error: {e}"); let err_msg = format!("Unable to access Cloudflare API: {e}");
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -133,7 +133,7 @@ impl CloudflareZone {
self.validate_response(response) self.validate_response(response)
}, },
Err(e) => { Err(e) => {
let err_msg = format!("Unable to access Cloudflare API. Error: {e}"); let err_msg = format!("Unable to access Cloudflare API: {e}");
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -174,7 +174,7 @@ impl CloudflareZone {
self.validate_response(response) self.validate_response(response)
}, },
Err(e) => { Err(e) => {
let err_msg = format!("Unable to access Cloudflare API. Error: {e}"); let err_msg = format!("Unable to access Cloudflare API: {e}");
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -200,7 +200,7 @@ impl CloudflareZone {
self.validate_response(response) self.validate_response(response)
}, },
Err(e) => { Err(e) => {
let err_msg = format!("Unable to access Cloudflare API. Error: {e}"); let err_msg = format!("Unable to access Cloudflare API: {e}");
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -270,7 +270,7 @@ impl CloudflareZone {
match Url::parse(input) { match Url::parse(input) {
Ok(url) => Ok(url), Ok(url) => Ok(url),
Err(e) => { Err(e) => {
let err_msg = format!("Unable to parse URL. Error: {}", e); let err_msg = format!("Unable to parse URL: {}", e);
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -293,7 +293,7 @@ impl CloudflareZone {
let data = match response.json::<CloudflareApiResult>() { let data = match response.json::<CloudflareApiResult>() {
Ok(data) => data, Ok(data) => data,
Err(e) => { Err(e) => {
let err_msg = format!("Unable to parse API response. Error: {e}"); let err_msg = format!("Unable to parse API response: {e}");
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -305,7 +305,7 @@ impl CloudflareZone {
match data.success { match data.success {
true => Ok(()), true => Ok(()),
false => { false => {
let err_msg = format!("Unexpected error while updating DNS record. Info: {:?}", data); let err_msg = format!("Unexpected error while updating DNS record: {:?}", data);
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),
@ -314,7 +314,7 @@ impl CloudflareZone {
} }
} }
} else { } else {
let err_msg = format!("Unable to post/put Cloudflare DNS entry. Error: {}", response.status()); let err_msg = format!("Unable to post/put Cloudflare DNS entry: {}", response.status());
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),

View file

@ -37,7 +37,7 @@ impl InterfaceConfig {
let interface_address = match self.interfaces.get(interface_name) { let interface_address = match self.interfaces.get(interface_name) {
Some(address) => *address, Some(address) => *address,
None => { None => {
let err_msg = "Malformed IP in interfaces.toml"; let err_msg = format!("Malformed or missing IP in interfaces.toml for interface {}", interface_name);
match connected_to_journal() { match connected_to_journal() {
true => error!("[ERROR] {err_msg}"), true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"), false => eprintln!("[ERROR] {err_msg}"),

View file

@ -24,8 +24,8 @@ struct Addresses {
impl Addresses { impl Addresses {
fn new() -> Result<Self, Box<dyn Error>> { fn new() -> Result<Self, Box<dyn Error>> {
let mut ret = Self { let mut ret = Self {
ipv4_uri: "https://am.i.mullvad.net/ip".to_owned(), ipv4_uri: "http://ip4only.me/api/".to_owned(),
ipv6_uri: "https://ipv6.am.i.mullvad.net/ip".to_owned(), ipv6_uri: "http://ip6only.me/api/".to_owned(),
ipv4: Ipv4Addr::new(0, 0, 0, 0), ipv4: Ipv4Addr::new(0, 0, 0, 0),
ipv6: Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0) ipv6: Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)
}; };
@ -79,10 +79,10 @@ impl Addresses {
} }
} }
Err(e) => { Err(e) => {
let warn_msg = format!("Unable to fetch IPv4 from '{}'. Error: {}", self.ipv4_uri, e); let error_msg = format!("Unable to fetch IPv4 from '{}': {}", self.ipv4_uri, e);
match connected_to_journal() { match connected_to_journal() {
true => warn!("[WARN] {warn_msg}"), true => error!("[ERROR] {error_msg}"),
false => println!("[WARN] {warn_msg}"), false => eprintln!("[ERROR] {error_msg}"),
} }
} }
} }
@ -108,10 +108,10 @@ impl Addresses {
} }
} }
Err(e) => { Err(e) => {
let warn_msg = format!("Unable to fetch IPv6 from '{}'. Error: {}", self.ipv6_uri, e); let error_msg = format!("Unable to fetch IPv6 from '{}': {}", self.ipv6_uri, e);
match connected_to_journal() { match connected_to_journal() {
true => warn!("[WARN] {warn_msg}"), true => error!("[ERROR] {error_msg}"),
false => println!("[WARN] {warn_msg}"), false => eprintln!("[ERROR] {error_msg}"),
} }
} }
} }
@ -122,7 +122,7 @@ impl Addresses {
Ok(res) => { Ok(res) => {
match res.status() { match res.status() {
StatusCode::OK => { StatusCode::OK => {
let ip_string = res.text().expect("Returned data should always contain text").trim_end().to_owned(); let ip_string = res.text().expect("Returned data should always contain text").trim_end().split(',').collect::<Vec<&str>>()[1].to_owned();
Ok(Ipv4Addr::from_str(ip_string.as_str()).expect("Returned IP should always be parseable")) Ok(Ipv4Addr::from_str(ip_string.as_str()).expect("Returned IP should always be parseable"))
}, },
_ => { _ => {
@ -145,7 +145,7 @@ impl Addresses {
Ok(res) => { Ok(res) => {
match res.status() { match res.status() {
StatusCode::OK => { StatusCode::OK => {
let ip_string = res.text().expect("Returned data should always contain text").trim_end().to_owned(); let ip_string: String = res.text().expect("Returned data should always contain text").trim_end().split(',').collect::<Vec<&str>>()[1].to_owned();
Ok(Ipv6Addr::from_str(ip_string.as_str()).expect("Returned IP should always be parseable")) Ok(Ipv6Addr::from_str(ip_string.as_str()).expect("Returned IP should always be parseable"))
}, },
_ => { _ => {