diff --git a/config.schema.toml b/config.schema.toml index e328970..7254638 100644 --- a/config.schema.toml +++ b/config.schema.toml @@ -10,10 +10,6 @@ ping=3 # Ping every three minutes enabled=true # Enable Auto Updater check=2 # Check every two minutes -[cluster] -id=1 # Cluster ID -node=1 # Node ID - [mongodb] database="PingBot" # MongoDB Database Name collection="URL" # MongoDB Collection Name diff --git a/config/env.go b/config/env.go index 3001f29..9fdf495 100644 --- a/config/env.go +++ b/config/env.go @@ -8,9 +8,7 @@ import ( var ( // mongo - Mongo_URI = os.Getenv("MONGODB_URI") - Mongo_DB = os.Getenv("MONGODB_DB") - Mongo_Collection = os.Getenv("MONGODB_COLLECTION") + Mongo_URI = os.Getenv("MONGO_URI") // github GH_Token = os.Getenv("GH_TOKEN") diff --git a/config/toml.go b/config/toml.go index 58d2f25..239a1eb 100644 --- a/config/toml.go +++ b/config/toml.go @@ -35,8 +35,7 @@ type autoUpdateConfig struct { } type clusterConfig struct { - ID int - Node int + ID int } type mongoDBConfig struct { @@ -65,14 +64,6 @@ func init() { } } } - - if Toml.MongoDB.Collection != "" { - Mongo_Collection = Toml.MongoDB.Collection - } - - if Toml.MongoDB.Database != "" { - Mongo_DB = Toml.MongoDB.Database - } } func DownloadFile(filepath string, url string) error { diff --git a/database/mongo/connect.go b/database/mongo/connect.go index 141e9e1..91cc28f 100644 --- a/database/mongo/connect.go +++ b/database/mongo/connect.go @@ -33,7 +33,7 @@ func Connect() error { return err } - Coll = Client.Database(config.Mongo_DB).Collection(config.Mongo_Collection) + Coll = Client.Database(config.Toml.MongoDB.Database).Collection(config.Toml.MongoDB.Collection) return nil }) diff --git a/website/routes/api/status.go b/website/routes/api/status.go index 63399f5..03a3714 100644 --- a/website/routes/api/status.go +++ b/website/routes/api/status.go @@ -55,7 +55,6 @@ func Status(c *gin.Context) { }, "node": json{ "cluster": config.Toml.Cluster.ID, - "node": config.Toml.Cluster.Node, "uptime": common.Uptime(config.StartTime), }, })