11 Commits
0.1.0 ... 0.1.1

8 changed files with 655 additions and 1038 deletions

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

1588
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,16 @@
[package]
name = "ics-proxy"
version = "0.1.0"
edition = "2018"
version = "0.1.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
actix-web = "3"
uuid = { version = "0.8.2", features = ["v4"] }
actix-web = "4.0"
uuid = { version = "0.8", features = ["v4"] }
url = "2.2"
reqwest = { version = "0.11", features = ["blocking"] }
tera = "1.12.1"
tera = "1.15"
dotenv = "0.15"
sqlx = { version = "0.4.2", features = [ "sqlite", "runtime-actix-native-tls" ] }
sqlx = { version = "0.5", features = [ "sqlite", "runtime-actix-rustls" ] }

View File

@@ -1,11 +1,11 @@
FROM rust:1.54 as builder
FROM rust:1.56 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:buster-slim
FROM debian:bullseye-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

View File

@@ -1,6 +1,13 @@
# ics-proxy
You can find a running instance of this code on [ics-proxy.de](https://ics-proxy.de). The docker image is published on [DockerHub](https://hub.docker.com/repository/docker/13hannes11/ics-proxy).
You can find a running instance of this code on [ics-proxy.de](https://ics-proxy.de). The docker image is published on the [GitHub Container Registry](https://github.com/13hannes11/ics-proxy/pkgs/container/ics-proxy).
## Screenshots
![image](https://user-images.githubusercontent.com/9381167/136559243-2a7c9062-33e3-436e-a781-fef3173e1671.png)
![image](https://user-images.githubusercontent.com/9381167/136559368-3404a94f-35d1-4235-8c98-2f837b75fda0.png)
## Motivation
@@ -15,3 +22,6 @@ The easiest way to build this repository is to use docker. You can simply run `d
## Deployment
To deploy you can simply use the `docker-compose.yml` file.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

12
docker-compose.dev.yml Normal file
View File

@@ -0,0 +1,12 @@
version: '3'
services:
ics-proxy:
container_name: ics-proxy
build: .
env_file: .env
ports:
- "8080:8080"
volumes:
- database:/app/db
volumes:
database:

View File

@@ -2,6 +2,7 @@ use std::collections::HashMap;
use url::Url;
use actix_web::http::StatusCode;
use actix_web::web::Data;
use actix_web::{error, web, App, Error, HttpRequest, HttpResponse, HttpServer, Responder, Result};
use sqlx::{Pool, Sqlite, SqlitePool};
use tera::Tera;
@@ -299,9 +300,9 @@ async fn main() -> std::io::Result<()> {
let tera = Tera::new("templates/**/*.html").unwrap();
App::new()
.data(db_pool.clone()) // pass database pool to application so we can access it inside handlers
.data(tera)
.data(conf.clone())
.app_data(Data::new(db_pool.clone())) // pass database pool to application so we can access it inside handlers
.app_data(Data::new(tera))
.app_data(Data::new(conf.clone()))
.route("/{id}/events.ics", web::get().to(make_ics_request))
.service(web::resource("/").route(web::get().to(index)))
.service(web::resource("/edit").route(web::get().to(edit_page)))