frontend performance, rpc/rest jwt authentication

This commit is contained in:
2023-06-22 11:31:24 +02:00
parent 78c1559e84
commit d6c0646756
24 changed files with 691 additions and 360 deletions

12
main.go
View File

@@ -16,15 +16,22 @@ var (
downloadPath string
downloaderPath string
requireAuth bool
rpcSecret string
//go:embed frontend/dist
frontend embed.FS
)
func init() {
flag.IntVar(&port, "port", 3033, "Port where server will listen at")
flag.StringVar(&configFile, "conf", "", "yt-dlp-WebUI config file path")
flag.StringVar(&downloadPath, "out", ".", "Directory where files will be saved")
flag.StringVar(&downloadPath, "out", ".", "Where files will be saved")
flag.StringVar(&downloaderPath, "driver", "yt-dlp", "yt-dlp executable path")
flag.BoolVar(&requireAuth, "auth", false, "Enable RPC authentication")
flag.StringVar(&rpcSecret, "secret", "", "Secret required for auth")
flag.Parse()
}
@@ -41,6 +48,9 @@ func main() {
c.DownloadPath(downloadPath)
c.DownloaderPath(downloaderPath)
c.RequireAuth(requireAuth)
c.RPCSecret(rpcSecret)
if configFile != "" {
c.LoadFromFile(configFile)
}