Compare commits
2 Commits
4b28396134
...
feature/sc
Author | SHA1 | Date | |
---|---|---|---|
20950ebd5c
|
|||
62ba975afd
|
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
target/
|
||||||
|
.git/
|
||||||
|
.env
|
||||||
|
data/
|
31
.drone.yml
Normal file
31
.drone.yml
Normal 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
21
Dockerfile
Normal 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"]
|
@@ -9,7 +9,7 @@ use axum::{
|
|||||||
};
|
};
|
||||||
use oauth2::{
|
use oauth2::{
|
||||||
basic::BasicClient, reqwest::async_http_client, AuthUrl, AuthorizationCode, ClientId,
|
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 reqwest::header::SET_COOKIE;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
@@ -79,7 +79,7 @@ impl Server {
|
|||||||
|
|
||||||
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
||||||
|
|
||||||
return Server { app, addr };
|
Server { app, addr }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn start(self) -> anyhow::Result<()> {
|
pub async fn start(self) -> anyhow::Result<()> {
|
||||||
|
@@ -48,8 +48,8 @@ impl InMemoryDownloadService {
|
|||||||
id.clone(),
|
id.clone(),
|
||||||
(
|
(
|
||||||
Arc::new(Mutex::new(d.clone())),
|
Arc::new(Mutex::new(d.clone())),
|
||||||
shared_tx.clone(),
|
shared_tx,
|
||||||
rx.clone(),
|
rx,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user