Add support for creating network if it is missing

This commit is contained in:
Dane Everitt
2019-12-07 17:31:12 -08:00
parent 21d8384848
commit 91d5735ba8
3 changed files with 149 additions and 24 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/remeh/sizedwaitgroup"
"go.uber.org/zap"
"net/http"
"os"
)
// Entrypoint for the Wings application. Configures the logger and checks any
@@ -70,6 +71,15 @@ func main() {
return
}
if err := ConfigureDockerEnvironment(c.Docker); err != nil {
zap.S().Fatalw("failed to configure docker environment", zap.Error(errors.WithStack(err)))
os.Exit(1)
}
if err := c.WriteToDisk(); err != nil {
zap.S().Errorw("failed to save configuration to disk", zap.Error(errors.WithStack(err)))
}
// Just for some nice log output.
for _, s := range server.GetServers().All() {
zap.S().Infow("loaded configuration for server", zap.String("server", s.Uuid))
@@ -143,7 +153,7 @@ func main() {
}
r := &Router{
token: c.AuthenticationToken,
token: c.AuthenticationToken,
upgrader: websocket.Upgrader{
// Ensure that the websocket request is originating from the Panel itself,
// and not some other location.