Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
Paul van Tilburg | c2450267e0 | |
Paul van Tilburg | 087ecf00f1 | |
Paul van Tilburg | f8ea25c516 | |
Paul van Tilburg | f830d34464 | |
Paul van Tilburg | ff10cc19e8 |
|
@ -108,5 +108,5 @@ jobs:
|
||||||
DEB_REPO_TOKEN: '${{ secrets.DEB_REPO_TOKEN }}'
|
DEB_REPO_TOKEN: '${{ secrets.DEB_REPO_TOKEN }}'
|
||||||
run: |
|
run: |
|
||||||
curl --config <(printf "user=%s:%s" paul "${DEB_REPO_TOKEN}") \
|
curl --config <(printf "user=%s:%s" paul "${DEB_REPO_TOKEN}") \
|
||||||
--upload-file target/debian/sandbox*.deb \
|
--upload-file target/debian/sinoptik*.deb \
|
||||||
https://git.luon.net/api/packages/paul/debian/pool/bookworm/main/upload
|
https://git.luon.net/api/packages/paul/debian/pool/bookworm/main/upload
|
||||||
|
|
20
CHANGELOG.md
20
CHANGELOG.md
|
@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.2.10] - 2023-11-03
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
* Update dependencies
|
||||||
|
([RUSTSEC-2020-0071](https://rustsec.org/advisories/RUSTSEC-2020-0071.html),
|
||||||
|
[RUSTSEC-2023-0044](https://rustsec.org/advisories/RUSTSEC-2023-0044.html))
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Switch to Rocket 0.5 RC4
|
||||||
|
* Update dependency on `cached`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Fix clippy issues
|
||||||
|
|
||||||
## [0.2.9] - 2023-08-25
|
## [0.2.9] - 2023-08-25
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -142,7 +159,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
Initial release.
|
Initial release.
|
||||||
|
|
||||||
[Unreleased]: https://git.luon.net/paul/sinoptik/compare/v0.2.9...HEAD
|
[Unreleased]: https://git.luon.net/paul/sinoptik/compare/v0.2.10...HEAD
|
||||||
|
[0.2.10]: https://git.luon.net/paul/sinoptik/compare/v0.2.9...v0.2.10
|
||||||
[0.2.9]: https://git.luon.net/paul/sinoptik/compare/v0.2.8...v0.2.9
|
[0.2.9]: https://git.luon.net/paul/sinoptik/compare/v0.2.8...v0.2.9
|
||||||
[0.2.8]: https://git.luon.net/paul/sinoptik/compare/v0.2.7...v0.2.8
|
[0.2.8]: https://git.luon.net/paul/sinoptik/compare/v0.2.7...v0.2.8
|
||||||
[0.2.7]: https://git.luon.net/paul/sinoptik/compare/v0.2.6...v0.2.7
|
[0.2.7]: https://git.luon.net/paul/sinoptik/compare/v0.2.6...v0.2.7
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sinoptik"
|
name = "sinoptik"
|
||||||
version = "0.2.9"
|
version = "0.2.10"
|
||||||
authors = [
|
authors = [
|
||||||
"Admar Schoonen <admar@luon.net",
|
"Admar Schoonen <admar@luon.net",
|
||||||
"Paul van Tilburg <paul@luon.net>"
|
"Paul van Tilburg <paul@luon.net>"
|
||||||
|
@ -12,7 +12,7 @@ repository = "https://git.luon.net/paul/sinoptik"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cached = { version = "0.44.0", features = ["async"] }
|
cached = { version = "0.46.0", features = ["async"] }
|
||||||
chrono = "0.4.19"
|
chrono = "0.4.19"
|
||||||
chrono-tz = "0.8.1"
|
chrono-tz = "0.8.1"
|
||||||
csv = "1.1.6"
|
csv = "1.1.6"
|
||||||
|
|
12
src/lib.rs
12
src/lib.rs
|
@ -366,7 +366,7 @@ mod tests {
|
||||||
|
|
||||||
// No metric selected, don't know which map to show?
|
// No metric selected, don't know which map to show?
|
||||||
let response = client.get("/map?address=eindhoven").dispatch();
|
let response = client.get("/map?address=eindhoven").dispatch();
|
||||||
assert_eq!(response.status(), Status::NotFound);
|
assert_eq!(response.status(), Status::UnprocessableEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -375,10 +375,6 @@ mod tests {
|
||||||
let maps_handle_clone = Arc::clone(&maps_handle);
|
let maps_handle_clone = Arc::clone(&maps_handle);
|
||||||
let client = Client::tracked(rocket(maps_handle)).expect("Not a valid Rocket instance");
|
let client = Client::tracked(rocket(maps_handle)).expect("Not a valid Rocket instance");
|
||||||
|
|
||||||
// No metric passed, don't know which map to show?
|
|
||||||
let response = client.get("/map?lat=51.4&lon=5.5").dispatch();
|
|
||||||
assert_eq!(response.status(), Status::NotFound);
|
|
||||||
|
|
||||||
// No maps available yet.
|
// No maps available yet.
|
||||||
let response = client.get("/map?lat=51.4&lon=5.5&metric=pollen").dispatch();
|
let response = client.get("/map?lat=51.4&lon=5.5&metric=pollen").dispatch();
|
||||||
assert_eq!(response.status(), Status::ServiceUnavailable);
|
assert_eq!(response.status(), Status::ServiceUnavailable);
|
||||||
|
@ -395,8 +391,12 @@ mod tests {
|
||||||
assert_eq!(response.status(), Status::Ok);
|
assert_eq!(response.status(), Status::Ok);
|
||||||
assert_eq!(response.content_type(), Some(ContentType::PNG));
|
assert_eq!(response.content_type(), Some(ContentType::PNG));
|
||||||
|
|
||||||
|
// ... but not if it is out of bounds.
|
||||||
|
let response = client.get("/map?lat=0.0&lon=0.0&metric=pollen").dispatch();
|
||||||
|
assert_eq!(response.status(), Status::NotFound);
|
||||||
|
|
||||||
// No metric passed, don't know which map to show?
|
// No metric passed, don't know which map to show?
|
||||||
let response = client.get("/map?lat=51.4&lon=5.5").dispatch();
|
let response = client.get("/map?lat=51.4&lon=5.5").dispatch();
|
||||||
assert_eq!(response.status(), Status::NotFound);
|
assert_eq!(response.status(), Status::UnprocessableEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ use std::f64::consts::PI;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
use chrono::serde::ts_seconds;
|
use chrono::serde::ts_seconds;
|
||||||
use chrono::{DateTime, Duration, NaiveDateTime, Utc};
|
use chrono::{DateTime, Duration, NaiveDateTime, TimeZone, Utc};
|
||||||
use image::{
|
use image::{
|
||||||
DynamicImage, GenericImage, GenericImageView, ImageError, ImageFormat, Pixel, Rgb, Rgba,
|
DynamicImage, GenericImage, GenericImageView, ImageError, ImageFormat, Pixel, Rgb, Rgba,
|
||||||
};
|
};
|
||||||
|
@ -449,7 +449,7 @@ async fn retrieve_image(url: Url) -> Result<RetrievedMaps> {
|
||||||
.ok_or_else(|| Error::InvalidImagePath(path.to_owned()))?;
|
.ok_or_else(|| Error::InvalidImagePath(path.to_owned()))?;
|
||||||
let timestamp = NaiveDateTime::parse_from_str(timestamp_str, "%Y%m%d%H%M")?;
|
let timestamp = NaiveDateTime::parse_from_str(timestamp_str, "%Y%m%d%H%M")?;
|
||||||
|
|
||||||
DateTime::<Utc>::from_utc(timestamp, Utc)
|
Utc.from_utc_datetime(×tamp)
|
||||||
};
|
};
|
||||||
let bytes = response.bytes().await?;
|
let bytes = response.bytes().await?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue