mirror of
https://github.com/13hannes11/ics-proxy.git
synced 2024-09-06 08:01:41 +02:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e6cfa7f8f | |||
|
|
bdf96b366a | ||
|
|
569e7f71ef | ||
|
|
41234a1fac | ||
|
|
0064698574 | ||
|
|
271af82794 | ||
|
|
776dccb15c | ||
|
|
64b416e8b6 | ||
|
|
977110fa99 | ||
|
|
a701eb9a76 | ||
|
|
b3aeef646a | ||
| b89e4af7ac | |||
| 074c194c0c | |||
| af1e32ac24 | |||
| 129481840f | |||
| 16cd3ca123 | |||
| 936c536cc0 |
1533
Cargo.lock
generated
1533
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,13 @@
|
||||
[package]
|
||||
name = "ics-proxy"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
actix-web = "4.0"
|
||||
uuid = { version = "0.8", features = ["v4"] }
|
||||
uuid = { version = "1.0", features = ["v4"] }
|
||||
url = "2.2"
|
||||
reqwest = { version = "0.11", features = ["blocking"] }
|
||||
tera = "1.15"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
FROM rust:1.56 as builder
|
||||
FROM rust:1.72 as builder
|
||||
RUN apt-get update && apt-get install -y sqlite3 && rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /usr/src/ics-proxy
|
||||
COPY . .
|
||||
RUN cd db && ./create_db.sh
|
||||
RUN cargo install --path .
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
FROM debian:stable-slim
|
||||
RUN apt-get update && apt-get install -y sqlite3 openssl ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR app
|
||||
COPY --from=builder /usr/local/cargo/bin/ics-proxy ./ics-proxy
|
||||
|
||||
@@ -19,6 +19,8 @@ Additionally, each semester this needed to be done as well. I therefore created
|
||||
|
||||
The easiest way to build this repository is to use docker. You can simply run `docker build -t ics-proxy .`
|
||||
|
||||
Alternatively you can build and run a local dev version with `docker-compose -f docker-compose.dev.yml up`.
|
||||
|
||||
## Deployment
|
||||
|
||||
To deploy you can simply use the `docker-compose.yml` file.
|
||||
|
||||
@@ -26,8 +26,8 @@ async fn make_ics_request(req: HttpRequest, db_pool: web::Data<Pool<Sqlite>>) ->
|
||||
|
||||
match Uuid::parse_str(id) {
|
||||
Ok(uuid) => match Link::find_by_uuid(uuid.to_string(), db_pool).await {
|
||||
Ok(link) => match reqwest::blocking::get(link.destination) {
|
||||
Ok(r) => match r.text() {
|
||||
Ok(link) => match reqwest::get(link.destination).await {
|
||||
Ok(r) => match r.text().await {
|
||||
Ok(res) => HttpResponse::Ok().content_type("text/calendar").body(res),
|
||||
Err(err) => HttpResponse::Ok()
|
||||
.status(StatusCode::INTERNAL_SERVER_ERROR)
|
||||
|
||||
Reference in New Issue
Block a user