Commit 58f8087f authored by Mo Firouz's avatar Mo Firouz
Browse files

Pack UI components and serve through console server. Implement console accounts operations. (#228)

parent b2937c0c
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -122,7 +122,15 @@ To build the codebase and generate all sources use these steps.
    go get -u github.com/gobuffalo/packr/...
    ```

2. Compile protocol buffers, gateway code, and pack the SQL migration files. Then build the codebase.
2. If you've made changes to the embedded Developer Console:

    ```shell
    cd console/ui
    yarn build
    cd ../../
    ```

3. Compile protocol buffers, gateway code, and pack the SQL migration files. Then build the codebase.

    ```shell
    protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=plugins=grpc:. ./api/api.proto
+36 −0

File added.

Preview size limit exceeded, changes collapsed.

console/ui.go

0 → 100644
+12 −0
Original line number Diff line number Diff line
package console

import (
	"net/http"

	"github.com/gobuffalo/packr"
)

func Handler() http.Handler {
	uiBox := packr.NewBox("./ui/dist") // path must be string not a variable for packr to understand
	return http.FileServer(uiBox)
}
+5 −0
Original line number Diff line number Diff line
// vue.config.js
module.exports = {
  outputDir: 'dist',
  assetsDir: 'assets',
}
+15 −0
Original line number Diff line number Diff line
@@ -94,6 +94,21 @@ func ParseArgs(logger *zap.Logger, args []string) Config {
	if l := len(mainConfig.Name); l < 1 || l > 16 {
		logger.Fatal("Name must be 1-16 characters", zap.String("param", "name"))
	}
	if mainConfig.GetSocket().ServerKey == "" {
		logger.Fatal("Server key must be set", zap.String("param", "socket.server_key"))
	}
	if mainConfig.GetSession().EncryptionKey == "" {
		logger.Fatal("Encryption key must be set", zap.String("param", "session.encryption_key"))
	}
	if mainConfig.GetRuntime().HTTPKey == "" {
		logger.Fatal("Runtime HTTP key must be set", zap.String("param", "runtime.http_key"))
	}
	if mainConfig.GetConsole().Username == "" {
		logger.Fatal("Console username must be set", zap.String("param", "console.username"))
	}
	if mainConfig.GetConsole().Password == "" {
		logger.Fatal("Console password must be set", zap.String("param", "console.password"))
	}
	if p := mainConfig.GetSocket().Protocol; p != "tcp" && p != "tcp4" && p != "tcp6" {
		logger.Fatal("Socket protocol must be one of: tcp, tcp4, tcp6", zap.String("socket.protocol", mainConfig.GetSocket().Protocol))
	}
Loading