Skip to content

Commit 7e2b74f

Browse files
committed
wip: complete enterprise
1 parent 47e9c55 commit 7e2b74f

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ WORKDIR /space-cloud
66
RUN set -ex \
77
&& apk add --no-cache ca-certificates wget \
88
&& wget http://192.168.43.226:8000/space-cloud \
9-
&& wget http://192.168.43.226:8000/config.yaml \
9+
#&& wget http://192.168.43.226:8000/config.yaml \
1010
&& chmod +x space-cloud
1111
ENV PROD=false
1212
ENV PATH="/space-cloud:${PATH}"
1313
EXPOSE 8080
14-
CMD ./space-cloud run --config config.yaml
14+
CMD ./space-cloud run

go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/go-stack/stack v1.8.0 // indirect
99
github.com/golang/protobuf v1.3.2
1010
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
11-
github.com/gorilla/mux v1.7.0
11+
github.com/gorilla/mux v1.7.2
1212
github.com/gorilla/websocket v1.4.0
1313
github.com/hashicorp/memberlist v0.1.4
1414
github.com/hashicorp/raft v1.1.0
@@ -17,6 +17,8 @@ require (
1717
github.com/kr/pty v1.1.4 // indirect
1818
github.com/lib/pq v1.0.0
1919
github.com/mitchellh/mapstructure v1.1.2
20+
github.com/nats-io/gnatsd v1.4.1 // indirect
21+
github.com/nats-io/go-nats v1.7.2
2022
github.com/nats-io/nats-server/v2 v2.0.2
2123
github.com/nats-io/nats.go v1.8.1
2224
github.com/rs/cors v1.6.0

go.sum

+4-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
6262
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k=
6363
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
6464
github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4=
65-
github.com/gorilla/mux v1.7.0 h1:tOSd0UKHQd6urX6ApfOn4XdBMY6Sh1MfxV3kmaazO+U=
66-
github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
65+
github.com/gorilla/mux v1.7.2 h1:zoNxOV7WjqXptQOVngLmcSQgXmgk4NMz1HibBchjl/I=
66+
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
6767
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
6868
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
6969
github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
@@ -132,6 +132,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
132132
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
133133
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
134134
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
135+
github.com/nats-io/gnatsd v1.4.1/go.mod h1:nqco77VO78hLCJpIcVfygDP2rPGfsEHkGTUk94uh5DQ=
136+
github.com/nats-io/go-nats v1.7.2/go.mod h1:+t7RHT5ApZebkrQdnn6AhQJmhJJiKAvJUio1PiiCtj0=
135137
github.com/nats-io/jwt v0.2.8 h1:PXr0mRjPCPX4cXsdfHcsqoplrNXnKOD+g2yHoh9qy1I=
136138
github.com/nats-io/jwt v0.2.8/go.mod h1:mQxQ0uHQ9FhEVPIcTSKwx2lqZEpXWWcCgA7R6NrWvvY=
137139
github.com/nats-io/nats-server/v2 v2.0.2 h1:dB1cucvPi3Kgq0H7LbOENHfRf4buy8coAP48CjSvgm8=

utils/admin/validate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/gorilla/websocket"
99
)
1010

11-
const url = "wss://spaceuptech.com/v1/authenticate/socket/json"
11+
const url = "ws://192.168.43.226:11000/v1/authenticate/socket/json"
1212

1313
// validator is the object which valiates the space cloud instance
1414
type validator struct {

utils/projects/store.go

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package projects
22

3-
import "github.com/spaceuptech/space-cloud/config"
3+
import (
4+
"log"
5+
6+
"github.com/spaceuptech/space-cloud/config"
7+
)
48

59
// StoreProject stores the provided project config
610
func (p *Projects) StoreProject(config *config.Project) error {
@@ -17,24 +21,28 @@ func (p *Projects) StoreProject(config *config.Project) error {
1721
state.UserManagement.SetConfig(config.Modules.Auth)
1822

1923
if err := state.Static.SetConfig(config.Modules.Static); err != nil {
20-
return err
24+
log.Println("Static module config error:", err)
2125
}
2226

2327
// Set the configuration for the file storage module
2428
if err := state.FileStore.SetConfig(config.Modules.FileStore); err != nil {
25-
return err
29+
log.Println("File storage module config error:", err)
2630
}
2731

2832
// Set the configuration for the functions module
2933
if err := state.Functions.SetConfig(config.Modules.Functions); err != nil {
30-
return err
34+
log.Println("Functions module config error:", err)
3135
}
3236

3337
// Set the configuration for the Realtime module
3438
if err := state.Realtime.SetConfig(config.ID, config.Modules.Realtime); err != nil {
35-
return err
39+
log.Println("Realtime module config error:", err)
3640
}
3741

3842
// Set the configuration for the crud module
39-
return state.Crud.SetConfig(config.Modules.Crud)
43+
if err := state.Crud.SetConfig(config.Modules.Crud); err != nil {
44+
log.Println("Database module config error:", err)
45+
}
46+
47+
return nil
4048
}

0 commit comments

Comments
 (0)