Skip to content

Commit

Permalink
fix connection string expansion, css
Browse files Browse the repository at this point in the history
  • Loading branch information
Preetam committed Jan 18, 2022
1 parent 582389e commit 4740d62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM golang:1.17 AS build-go
COPY . /src

COPY --from=build-ui /src/ui/public/js/app.js /src/ui/public/js/app.js
COPY --from=build-ui /src/ui/public/js/app.css /src/ui/public/js/app.css
RUN cd /src/ && go build -x -ldflags "-linkmode external -extldflags -static"

FROM alpine:3
Expand Down
1 change: 1 addition & 0 deletions api/data_connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ func (api *API) ReadDataConnection(id string) (*config.DataConnection, error) {
if err != nil {
return nil, err
}
conn.ExpandConnectionString()
return conn, nil
}
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type DataSource struct {
Query string `yaml:"query" json:"query"`
}

func (dc *DataConnection) expandConnectionString() {
func (dc *DataConnection) ExpandConnectionString() {
if strings.HasPrefix(dc.ConnectionString, "$") {
dc.ConnectionString = os.ExpandEnv(dc.ConnectionString)
}
Expand Down Expand Up @@ -92,7 +92,7 @@ func (c *Config) Parse(content []byte, dir string) error {
}

for i, dataConnection := range c.DataConnections {
dataConnection.expandConnectionString()
dataConnection.ExpandConnectionString()
if dataConnection.Path != "" {
if !filepath.IsAbs(dataConnection.Path) {
c.DataConnections[i].Path = filepath.Join(dir, dataConnection.Path)
Expand Down

0 comments on commit 4740d62

Please sign in to comment.