feat: add HTTP file server with beautiful file browser UI

이 커밋은 다음에 포함됨:
Your Name
2026-04-28 22:11:41 +08:00
부모 2459122c0e
커밋 8cfa25f0f3
5개의 변경된 파일630개의 추가작업 그리고 7개의 파일을 삭제
+22 -5
파일 보기
@@ -8,11 +8,12 @@ import (
// Config represents the application configuration
type Config struct {
mu sync.RWMutex `json:"-"`
FTP FTPConfig `json:"ftp"`
Web WebConfig `json:"web"`
Admin AdminConfig `json:"admin"`
FTPUsers []FTPUser `json:"ftpUsers"`
mu sync.RWMutex `json:"-"`
FTP FTPConfig `json:"ftp"`
Web WebConfig `json:"web"`
HTTPFile HTTPFileConfig `json:"httpFile"`
Admin AdminConfig `json:"admin"`
FTPUsers []FTPUser `json:"ftpUsers"`
}
// FTPConfig holds FTP server settings
@@ -30,6 +31,15 @@ type WebConfig struct {
Port int `json:"port"`
}
// HTTPFileConfig holds HTTP file server settings
type HTTPFileConfig struct {
Enable bool `json:"enable"`
Host string `json:"host"`
Port int `json:"port"`
RootDir string `json:"rootDir"`
Upload bool `json:"upload"`
}
// AdminConfig holds admin credentials
type AdminConfig struct {
Username string `json:"username"`
@@ -58,6 +68,13 @@ func DefaultConfig() *Config {
Host: "0.0.0.0",
Port: 8080,
},
HTTPFile: HTTPFileConfig{
Enable: true,
Host: "0.0.0.0",
Port: 9090,
RootDir: "./ftp_root",
Upload: true,
},
Admin: AdminConfig{
Username: "admin",
Password: "admin123",