frontend performance, rpc/rest jwt authentication
This commit is contained in:
12
main.go
12
main.go
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user