feat: add HTTP file server with beautiful file browser UI
이 커밋은 다음에 포함됨:
+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",
|
||||
|
||||
새 이슈에서 참조
사용자 차단