aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer.go
diff options
context:
space:
mode:
authorjerebear12 <72420925+jerebear12@users.noreply.github.com>2023-12-20 18:21:11 -0600
committerGitHub <noreply@github.com>2023-12-20 16:21:11 -0800
commit06343f897645c4650f8f65e9a7ecd9b255820cfd (patch)
treeff6053af3bb23025a8d66f4275a460aa3ce1fbdf /weed/command/filer.go
parent3c9bcfb864b6c06cdc8ca189655a896feab9d343 (diff)
downloadseaweedfs-06343f897645c4650f8f65e9a7ecd9b255820cfd.tar.xz
seaweedfs-06343f897645c4650f8f65e9a7ecd9b255820cfd.zip
Set allowed origins in config (#5109)
* Add a way to use a JWT in an HTTP only cookie If a JWT is not included in the Authorization header or a query string, attempt to get a JWT from an HTTP only cookie. * Added a way to specify allowed origins header from config * Removed unecessary log * Check list of domains from config or command flag * Handle default wildcard and change name of config value to cors
Diffstat (limited to 'weed/command/filer.go')
-rw-r--r--weed/command/filer.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index fe0beb5b8..50fc4492b 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -61,6 +61,7 @@ type FilerOptions struct {
showUIDirectoryDelete *bool
downloadMaxMBps *int
diskType *string
+ allowedOrigins *string
}
func init() {
@@ -91,6 +92,7 @@ func init() {
f.showUIDirectoryDelete = cmdFiler.Flag.Bool("ui.deleteDir", true, "enable filer UI show delete directory button")
f.downloadMaxMBps = cmdFiler.Flag.Int("downloadMaxMBps", 0, "download max speed for each download request, in MB per second")
f.diskType = cmdFiler.Flag.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
+ f.allowedOrigins = cmdFiler.Flag.String("allowedOrigins", "*", "comma separated list of allowed origins")
// start s3 on filer
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
@@ -229,6 +231,9 @@ func (fo *FilerOptions) startFiler() {
if *fo.bindIp == "" {
*fo.bindIp = *fo.ip
}
+ if *fo.allowedOrigins == "" {
+ *fo.allowedOrigins = "*"
+ }
defaultLevelDbDirectory := util.ResolvePath(*fo.defaultLevelDbDirectory + "/filerldb2")
@@ -253,6 +258,7 @@ func (fo *FilerOptions) startFiler() {
ShowUIDirectoryDelete: *fo.showUIDirectoryDelete,
DownloadMaxBytesPs: int64(*fo.downloadMaxMBps) * 1024 * 1024,
DiskType: *fo.diskType,
+ AllowedOrigins: strings.Split(*fo.allowedOrigins, ","),
})
if nfs_err != nil {
glog.Fatalf("Filer startup error: %v", nfs_err)