| skipped 115 lines |
116 | 116 | | log.Println("Updating Sirius General Purpose Vulnerability Database...") |
117 | 117 | | |
118 | 118 | | //DB Connection |
119 | | - | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017")) |
| 119 | + | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017")) |
120 | 120 | | if err != nil { |
121 | 121 | | log.Fatal(err) |
122 | 122 | | } |
| skipped 36 lines |
159 | 159 | | |
160 | 160 | | func DatabaseConnect() *mongo.Client { |
161 | 161 | | //DB Connection |
162 | | - | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017")) |
| 162 | + | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017")) |
163 | 163 | | if err != nil { |
164 | 164 | | log.Fatal(err) |
165 | 165 | | } |
| skipped 8 lines |
174 | 174 | | |
175 | 175 | | func GetHosts() []SVDBHost { |
176 | 176 | | //DB Connection |
177 | | - | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017")) |
| 177 | + | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017")) |
178 | 178 | | if err != nil { |
179 | 179 | | log.Fatal(err) |
180 | 180 | | } |
| skipped 11 lines |
192 | 192 | | |
193 | 193 | | func GetFinding(request FindingRequest) []SVDBEntry { |
194 | 194 | | //DB Connection |
195 | | - | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017")) |
| 195 | + | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017")) |
196 | 196 | | if err != nil { |
197 | 197 | | log.Fatal(err) |
198 | 198 | | } |
| skipped 19 lines |
218 | 218 | | } |
219 | 219 | | } |
220 | 220 | | |
221 | | - | fmt.Println(findingList) |
| 221 | + | //fmt.Println(findingList) |
222 | 222 | | return findingList |
223 | 223 | | } |
224 | 224 | | |
225 | 225 | | func listHosts(client *mongo.Client) []SVDBHost { |
226 | | - | client, err := mongo.Connect(context.TODO()) |
| 226 | + | //client, err := mongo.Connect(context.TODO()) |
227 | 227 | | hostCollection := client.Database("Sirius").Collection("Hosts") |
228 | 228 | | |
229 | 229 | | var host SVDBHost |
| skipped 30 lines |
260 | 260 | | log.Println(host) |
261 | 261 | | |
262 | 262 | | //DB Connection |
263 | | - | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017")) |
| 263 | + | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017")) |
264 | 264 | | if err != nil { |
265 | 265 | | log.Fatal(err) |
266 | 266 | | } |
| skipped 15 lines |
282 | 282 | | log.Println("Got host update report") |
283 | 283 | | |
284 | 284 | | //DB Connection |
285 | | - | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017")) |
| 285 | + | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017")) |
286 | 286 | | if err != nil { |
287 | 287 | | log.Fatal(err) |
288 | 288 | | } |
| skipped 13 lines |
302 | 302 | | //Add CVE API Endpoint? |
303 | 303 | | func NewCVE(host string, cve string) { |
304 | 304 | | //DB Connection |
305 | | - | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017")) |
| 305 | + | client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://mongo:27017")) |
306 | 306 | | if err != nil { |
307 | 307 | | log.Fatal(err) |
308 | 308 | | } |
| skipped 330 lines |