update
This commit is contained in:
parent
95d134c2ec
commit
368afccb7f
18
config.yml
18
config.yml
@ -3,16 +3,18 @@ robotfs:
|
||||
log_path: "/var/log/robotfs"
|
||||
|
||||
redis:
|
||||
address: "localhost:6379"
|
||||
password: ""
|
||||
db: 0
|
||||
address: "180.76.110.177:6379"
|
||||
username: "default"
|
||||
password: "uRC0EKTFm*4"
|
||||
database: 0
|
||||
# superLargeDirectories: []
|
||||
|
||||
s3:
|
||||
region: "us-east-1"
|
||||
endpoint: "http://localhost:9000"
|
||||
access_key_id: "minioadmin"
|
||||
secret_access_key: "minioadmin"
|
||||
bucket_name: "robotfs"
|
||||
region: "default"
|
||||
endpoint: "http://120.48.66.228:6202"
|
||||
access_key_id: "admin"
|
||||
secret_access_key: "admin"
|
||||
bucket_name: "myjfs"
|
||||
use_path_style: true
|
||||
|
||||
juicefs:
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"robotfs/utils"
|
||||
"time"
|
||||
|
||||
"gosvc"
|
||||
@ -8,6 +9,10 @@ import (
|
||||
"gosvc/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
cfg = utils.GetViper()
|
||||
)
|
||||
|
||||
func SetupServiceConfig() {
|
||||
gosvc.Config = gosvc.ServiceConfig{
|
||||
Name: "robotfs",
|
||||
@ -17,7 +22,7 @@ func SetupServiceConfig() {
|
||||
},
|
||||
Logger: gosvc.LoggerConfig{
|
||||
Options: logger.Options{
|
||||
TargetDirectory: "/var/log/robotfs",
|
||||
TargetDirectory: cfg.GetString("robotfs.log_path"),
|
||||
FilePrefix: "robotfs",
|
||||
CycleFiles: 16,
|
||||
MaxFileSize: 64 * 1024 * 1024,
|
||||
@ -37,7 +42,7 @@ func SetupServiceConfig() {
|
||||
HTTPServer: gosvc.HTTPServerConfig{
|
||||
Enable: true,
|
||||
Options: httpserver.Options{
|
||||
Address: "0.0.0.0:6201",
|
||||
Address: cfg.GetString("robotfs.address"),
|
||||
TLSEnabled: false,
|
||||
CrossOriginEnabled: true,
|
||||
MaxConcurrentStreams: 10000,
|
||||
|
||||
@ -21,15 +21,17 @@ func (store *RedisLuaStore) GetName() string {
|
||||
func (store *RedisLuaStore) Initialize(configuration utils.Configuration, prefix string) (err error) {
|
||||
return store.initialize(
|
||||
configuration.GetString(prefix+"address"),
|
||||
configuration.GetString(prefix+"username"),
|
||||
configuration.GetString(prefix+"password"),
|
||||
configuration.GetInt(prefix+"database"),
|
||||
configuration.GetStringSlice(prefix+"superLargeDirectories"),
|
||||
)
|
||||
}
|
||||
|
||||
func (store *RedisLuaStore) initialize(hostPort string, password string, database int, superLargeDirectories []string) (err error) {
|
||||
func (store *RedisLuaStore) initialize(hostPort string, username, password string, database int, superLargeDirectories []string) (err error) {
|
||||
store.Client = redis.NewClient(&redis.Options{
|
||||
Addr: hostPort,
|
||||
Username: username,
|
||||
Password: password,
|
||||
DB: database,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user