Compare commits

..

1 Commits

Author SHA1 Message Date
9ea000c912 restrict user with a whitelist 2025-03-17 10:25:04 +01:00
6 changed files with 14 additions and 38 deletions

View File

@@ -24,12 +24,11 @@ COPY --from=ui /usr/src/yt-dlp-webui/frontend /usr/src/yt-dlp-webui/frontend
RUN CGO_ENABLED=0 GOOS=linux go build -o yt-dlp-webui
# -----------------------------------------------------------------------------
# Runtime ---------------------------------------------------------------------
FROM python:3.13.2-alpine3.21
# dependencies ----------------------------------------------------------------
FROM alpine:edge
RUN apk update && \
apk add ffmpeg ca-certificates curl wget gnutls --no-cache && \
pip install "yt-dlp[default,curl-cffi,mutagen,pycryptodomex,phantomjs,secretstorage]"
apk add ffmpeg yt-dlp ca-certificates curl wget psmisc
VOLUME /downloads /config
@@ -40,4 +39,4 @@ COPY --from=build /usr/src/yt-dlp-webui/yt-dlp-webui /app
ENV JWT_SECRET=secret
EXPOSE 3033
ENTRYPOINT [ "./yt-dlp-webui" , "--out", "/downloads", "--conf", "/config/config.yml", "--db", "/config/local.db" ]
ENTRYPOINT [ "./yt-dlp-webui" , "--out", "/downloads", "--conf", "/config/config.yml", "--db", "/config/local.db" ]

View File

@@ -28,7 +28,7 @@ docker pull ghcr.io/marcopiovanello/yt-dlp-web-ui:latest
## Community stuff
Feel free to join :)
[Discord](https://discord.gg/GZAX5FfGzE)
[![Discord Banner](https://api.weblutions.com/discord/invite/3Sj9ZZHv/)](https://discord.gg/WRnVWr4y)
## Some screeshots
![image](https://github.com/user-attachments/assets/fc43a3fb-ecf9-449d-b5cb-5d5635020c00)

View File

@@ -121,18 +121,14 @@ export const appTitleState = atomWithStorage(
export const serverAddressAndPortState = atom((get) => {
if (get(servedFromReverseProxySubDirState)) {
return `${get(serverAddressState)}/${get(servedFromReverseProxySubDirState)}/`
.replaceAll('"', '') // XXX: atomWithStorage uses JSON.stringify to serialize
.replaceAll('//', '/') // which puts extra double quotes.
.replaceAll('"', '') // TODO: atomWithStorage put extra double quotes on strings
}
if (get(servedFromReverseProxyState)) {
return `${get(serverAddressState)}`
.replaceAll('"', '')
}
const sap = `${get(serverAddressState)}:${get(serverPortState)}`
return `${get(serverAddressState)}:${get(serverPortState)}`
.replaceAll('"', '')
return sap.endsWith('/') ? sap.slice(0, -1) : sap
})
export const serverURL = atom((get) =>
@@ -141,16 +137,12 @@ export const serverURL = atom((get) =>
export const rpcWebSocketEndpoint = atom((get) => {
const proto = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
const sap = get(serverAddressAndPortState)
return `${proto}//${sap.endsWith('/') ? sap.slice(0, -1) : sap}/rpc/ws`
return `${proto}//${get(serverAddressAndPortState)}/rpc/ws`
})
export const rpcHTTPEndpoint = atom((get) => {
const proto = window.location.protocol
const sap = get(serverAddressAndPortState)
return `${proto}//${sap.endsWith('/') ? sap.slice(0, -1) : sap}/rpc/http`
return `${proto}//${get(serverAddressAndPortState)}/rpc/http`
})
export const serverSideCookiesState = atom<Promise<string>>(async (get) => await pipe(

View File

@@ -32,7 +32,6 @@ const HomeSpeedDial: React.FC<Props> = ({ onDownloadOpen, onEditorOpen }) => {
ariaLabel="Home speed dial"
sx={{ position: 'absolute', bottom: 64, right: 24 }}
icon={<SpeedDialIcon />}
onClick={onDownloadOpen}
>
<SpeedDialAction
icon={listView ? <ViewAgendaIcon /> : <FormatListBulleted />}

View File

@@ -1,9 +1,6 @@
import { tryCatch } from 'fp-ts/TaskEither'
import * as J from 'fp-ts/Json'
import * as E from 'fp-ts/Either'
import { pipe } from 'fp-ts/lib/function'
async function fetcher(url: string, opt?: RequestInit, controller?: AbortController): Promise<string> {
async function fetcher<T>(url: string, opt?: RequestInit): Promise<T> {
const jwt = localStorage.getItem('token')
if (opt && !opt.headers) {
@@ -17,27 +14,17 @@ async function fetcher(url: string, opt?: RequestInit, controller?: AbortControl
headers: {
...opt?.headers,
'X-Authentication': jwt ?? ''
},
signal: controller?.signal
}
})
if (!res.ok) {
throw await res.text()
}
return res.text()
return res.json() as T
}
export const ffetch = <T>(url: string, opt?: RequestInit, controller?: AbortController) => tryCatch(
async () => pipe(
await fetcher(url, opt, controller),
J.parse,
E.match(
(l) => l as T,
(r) => r as T
)
),
export const ffetch = <T>(url: string, opt?: RequestInit) => tryCatch(
() => fetcher<T>(url, opt),
(e) => `error while fetching: ${e}`
)

View File

@@ -93,7 +93,6 @@ func (p *Process) Start() {
baseParams := []string{
strings.Split(p.Url, "?list")[0], //no playlist
"--no-exec",
"--newline",
"--no-colors",
"--no-playlist",