1 Commits

Author SHA1 Message Date
f4ea2d98ab feature/scel-base (#1)
Some checks reported errors
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
continuous-integration/drone Build was killed
Reviewed-on: https://git.front.kjuulh.io/kjuulh/scel/pulls/1
2022-07-18 13:16:06 +02:00
6 changed files with 60 additions and 4 deletions

4
.dockerignore Normal file
View File

@@ -0,0 +1,4 @@
target/
.git/
.env
data/

31
.drone.yml Normal file
View File

@@ -0,0 +1,31 @@
kind: pipeline
name: default
type: docker
steps:
- name: server
image: plugins/docker
environment:
DOCKER_BUILDKIT: 1
settings:
username: kasperhermansen
password:
from_secret:
docker_secret
repo: kasperhermansen/scel
tags: latest
context: .
dockerfile: Dockerfile
cache_from: kasperhermansen/scel:latest
- name: send telegram notification
image: appleboy/drone-telegram
settings:
token:
from_secret: telegram_token
to: 2129601481
format: markdown
depends_on:
- server
when:
status: [failure]

21
Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM rust:1.60 as builder
WORKDIR /usr/src/scel
COPY . .
RUN --mount=type=cache,target=/usr/src/scel/target cargo build --release
RUN --mount=type=cache,target=/usr/src/scel/target cargo install --path src/cmd/scel
FROM debian:bullseye-slim
# Install YTD
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
apt-get update && apt-get install -y python3 python3-pip
RUN python3 -m pip install -U yt-dlp
# Copy binary
COPY --from=builder /usr/local/cargo/bin/scel /usr/local/bin/scel
CMD ["scel"]

View File

@@ -9,7 +9,7 @@ use axum::{
};
use oauth2::{
basic::BasicClient, reqwest::async_http_client, AuthUrl, AuthorizationCode, ClientId,
ClientSecret, CsrfToken, RedirectUrl, Scope, TokenResponse, TokenUrl,
ClientSecret, CsrfToken, RedirectUrl, TokenResponse, TokenUrl,
};
use reqwest::header::SET_COOKIE;
use serde::Deserialize;

View File

@@ -79,7 +79,7 @@ impl Server {
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
return Server { app, addr };
Server { app, addr }
}
pub async fn start(self) -> anyhow::Result<()> {

View File

@@ -48,8 +48,8 @@ impl InMemoryDownloadService {
id.clone(),
(
Arc::new(Mutex::new(d.clone())),
shared_tx.clone(),
rx.clone(),
shared_tx,
rx,
),
);