diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 84cf6eb6..292b8976 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,4 +4,22 @@ cd frontend npm run dist go mod vendor go run backend/cmd/fasten/fasten.go start --config ./config.example.yaml --debug + +docker build -t fasten-couchdb -f docker/couchdb/Dockerfile . +docker run --rm -it -p 5984:5984 -v './.couchdb/data:/opt/couchdb/data' fasten-couchdb ``` + +# Docker +`` + +- http://localhost:9090/web/dashboard - WebUI +- http://localhost:9090/database - CouchDB proxy +- http://localhost:5984/_utils/ - CouchDB admin UI + +# Credentials +- Couchdb: + - username: `admin` + - password: `mysecretpassword` +- WebUI: + - username: `testuser` + - password: `testuser` diff --git a/backend/pkg/config/config.go b/backend/pkg/config/config.go index 189ea40b..dde760b6 100644 --- a/backend/pkg/config/config.go +++ b/backend/pkg/config/config.go @@ -25,7 +25,6 @@ func (c *configuration) Init() error { c.SetDefault("web.listen.host", "0.0.0.0") c.SetDefault("web.listen.basepath", "") c.SetDefault("web.src.frontend.path", "/opt/fasten/web") - c.SetDefault("web.database.location", "/opt/fasten/db/fasten.db") //TODO: should be /opt/fasten/fasten.db c.SetDefault("web.couchdb.scheme", "http") c.SetDefault("web.couchdb.host", "localhost") diff --git a/backend/pkg/database/couchdb_repository.go b/backend/pkg/database/couchdb_repository.go index 92ac650e..266c6126 100644 --- a/backend/pkg/database/couchdb_repository.go +++ b/backend/pkg/database/couchdb_repository.go @@ -12,24 +12,13 @@ import ( ) func NewRepository(appConfig config.Interface, globalLogger logrus.FieldLogger) (DatabaseRepository, error) { - //backgroundContext := context.Background() - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Gorm/SQLite setup + // Couchdb setup //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - globalLogger.Infof("Trying to connect to sqlite db: %s\n", appConfig.GetString("web.database.location")) - - // When a transaction cannot lock the database, because it is already locked by another one, - // SQLite by default throws an error: database is locked. This behavior is usually not appropriate when - // concurrent access is needed, typically when multiple processes write to the same database. - // PRAGMA busy_timeout lets you set a timeout or a handler for these events. When setting a timeout, - // SQLite will try the transaction multiple times within this timeout. - // fixes #341 - // https://rsqlite.r-dbi.org/reference/sqlitesetbusyhandler - // retrying for 30000 milliseconds, 30seconds - this would be unreasonable for a distributed multi-tenant application, - // but should be fine for local usage. - couchdbUrl := fmt.Sprintf("%s://%s:%s", appConfig.GetString("web.couchdb.scheme"), appConfig.GetString("web.couchdb.host"), appConfig.GetString("web.couchdb.port")) + + globalLogger.Infof("Trying to connect to couchdb: %s\n", couchdbUrl) + database, err := kivik.New("couch", couchdbUrl) if err != nil { return nil, fmt.Errorf("Failed to connect to database! - %v", err) @@ -44,7 +33,7 @@ func NewRepository(appConfig config.Interface, globalLogger logrus.FieldLogger) if err != nil { return nil, fmt.Errorf("Failed to authenticate to database! - %v", err) } - globalLogger.Infof("Successfully connected to coubdb: %s\n", couchdbUrl) + globalLogger.Infof("Successfully connected to couchdb: %s\n", couchdbUrl) deviceRepo := couchdbRepository{ appConfig: appConfig, diff --git a/backend/pkg/web/handler/couchdb_proxy.go b/backend/pkg/web/handler/couchdb_proxy.go index eb24d300..27dac632 100644 --- a/backend/pkg/web/handler/couchdb_proxy.go +++ b/backend/pkg/web/handler/couchdb_proxy.go @@ -32,6 +32,8 @@ func CouchDBProxy(c *gin.Context) { req.URL.Host = remote.Host log.Printf(c.Param("proxyPath")) req.URL.Path = strings.TrimPrefix(c.Param("proxyPath"), "/database") + + //todo: throw an error if not a user DB. } proxy.ServeHTTP(c.Writer, c.Request) diff --git a/config.yaml b/config.yaml index 4804fcec..383516e5 100644 --- a/config.yaml +++ b/config.yaml @@ -6,9 +6,6 @@ version: 1 web: - jwt: - # used to encrypt/validate JWT session key (used for authentication) - encryptionkey: 'changethissupersecretkey' listen: port: 8080 host: 0.0.0.0 diff --git a/docker/couchdb/Dockerfile b/docker/couchdb/Dockerfile index 52311df5..042870b6 100644 --- a/docker/couchdb/Dockerfile +++ b/docker/couchdb/Dockerfile @@ -11,5 +11,6 @@ RUN curl https://github.com/just-containers/s6-overlay/releases/download/v1.21.8 COPY /docker/couchdb/local.ini /opt/couchdb/etc/ COPY /docker/rootfs / +RUN rm -rf /etc/services/fasten #delete the fasten app from the couchdbase container. ENTRYPOINT ["/init"] diff --git a/frontend/src/assets/images/azia-social.png b/frontend/src/assets/images/azia-social.png deleted file mode 100644 index b235ff19..00000000 Binary files a/frontend/src/assets/images/azia-social.png and /dev/null differ diff --git a/frontend/src/assets/images/eight.jpg b/frontend/src/assets/images/eight.jpg deleted file mode 100644 index 2ba10f66..00000000 Binary files a/frontend/src/assets/images/eight.jpg and /dev/null differ diff --git a/frontend/src/assets/images/eight.png b/frontend/src/assets/images/eight.png deleted file mode 100644 index 4c4fa953..00000000 Binary files a/frontend/src/assets/images/eight.png and /dev/null differ diff --git a/frontend/src/assets/images/five.jpg b/frontend/src/assets/images/five.jpg deleted file mode 100644 index 8e31696e..00000000 Binary files a/frontend/src/assets/images/five.jpg and /dev/null differ diff --git a/frontend/src/assets/images/five.png b/frontend/src/assets/images/five.png deleted file mode 100644 index eb21c970..00000000 Binary files a/frontend/src/assets/images/five.png and /dev/null differ diff --git a/frontend/src/assets/images/four.jpg b/frontend/src/assets/images/four.jpg deleted file mode 100644 index 3658e24b..00000000 Binary files a/frontend/src/assets/images/four.jpg and /dev/null differ diff --git a/frontend/src/assets/images/four.png b/frontend/src/assets/images/four.png deleted file mode 100644 index 5f7244d6..00000000 Binary files a/frontend/src/assets/images/four.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-eight.png b/frontend/src/assets/images/img-dashboard-eight.png deleted file mode 100644 index 5f9ebeb7..00000000 Binary files a/frontend/src/assets/images/img-dashboard-eight.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-five.png b/frontend/src/assets/images/img-dashboard-five.png deleted file mode 100644 index 70a0b25c..00000000 Binary files a/frontend/src/assets/images/img-dashboard-five.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-four.png b/frontend/src/assets/images/img-dashboard-four.png deleted file mode 100644 index 3582bc0b..00000000 Binary files a/frontend/src/assets/images/img-dashboard-four.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-nine.png b/frontend/src/assets/images/img-dashboard-nine.png deleted file mode 100644 index fc0e4aaa..00000000 Binary files a/frontend/src/assets/images/img-dashboard-nine.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-one.png b/frontend/src/assets/images/img-dashboard-one.png deleted file mode 100644 index 0064314b..00000000 Binary files a/frontend/src/assets/images/img-dashboard-one.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-seven.png b/frontend/src/assets/images/img-dashboard-seven.png deleted file mode 100644 index cf3c431b..00000000 Binary files a/frontend/src/assets/images/img-dashboard-seven.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-six.png b/frontend/src/assets/images/img-dashboard-six.png deleted file mode 100644 index 8f1b5e24..00000000 Binary files a/frontend/src/assets/images/img-dashboard-six.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-ten.png b/frontend/src/assets/images/img-dashboard-ten.png deleted file mode 100644 index 524b5fee..00000000 Binary files a/frontend/src/assets/images/img-dashboard-ten.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-three.png b/frontend/src/assets/images/img-dashboard-three.png deleted file mode 100644 index 01bff8be..00000000 Binary files a/frontend/src/assets/images/img-dashboard-three.png and /dev/null differ diff --git a/frontend/src/assets/images/img-dashboard-two.png b/frontend/src/assets/images/img-dashboard-two.png deleted file mode 100644 index 54b8d143..00000000 Binary files a/frontend/src/assets/images/img-dashboard-two.png and /dev/null differ diff --git a/frontend/src/assets/images/img1.jpg b/frontend/src/assets/images/img1.jpg deleted file mode 100644 index 1cc285a3..00000000 Binary files a/frontend/src/assets/images/img1.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img10.jpg b/frontend/src/assets/images/img10.jpg deleted file mode 100644 index 0564fca3..00000000 Binary files a/frontend/src/assets/images/img10.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img11.jpg b/frontend/src/assets/images/img11.jpg deleted file mode 100644 index 3766c53d..00000000 Binary files a/frontend/src/assets/images/img11.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img12.jpg b/frontend/src/assets/images/img12.jpg deleted file mode 100644 index 8959e1af..00000000 Binary files a/frontend/src/assets/images/img12.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img13.jpg b/frontend/src/assets/images/img13.jpg deleted file mode 100644 index d38ca065..00000000 Binary files a/frontend/src/assets/images/img13.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img14.jpg b/frontend/src/assets/images/img14.jpg deleted file mode 100644 index 33d2c91f..00000000 Binary files a/frontend/src/assets/images/img14.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img15.jpg b/frontend/src/assets/images/img15.jpg deleted file mode 100644 index d4a6116f..00000000 Binary files a/frontend/src/assets/images/img15.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img16.jpg b/frontend/src/assets/images/img16.jpg deleted file mode 100644 index b1951603..00000000 Binary files a/frontend/src/assets/images/img16.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img17.jpg b/frontend/src/assets/images/img17.jpg deleted file mode 100644 index 44d39723..00000000 Binary files a/frontend/src/assets/images/img17.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img18.jpg b/frontend/src/assets/images/img18.jpg deleted file mode 100644 index 98b94c89..00000000 Binary files a/frontend/src/assets/images/img18.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img19.jpg b/frontend/src/assets/images/img19.jpg deleted file mode 100644 index 3057de6a..00000000 Binary files a/frontend/src/assets/images/img19.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img2.jpg b/frontend/src/assets/images/img2.jpg deleted file mode 100644 index d16d581b..00000000 Binary files a/frontend/src/assets/images/img2.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img20.jpg b/frontend/src/assets/images/img20.jpg deleted file mode 100644 index 561c77b6..00000000 Binary files a/frontend/src/assets/images/img20.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img21.jpg b/frontend/src/assets/images/img21.jpg deleted file mode 100644 index fe757440..00000000 Binary files a/frontend/src/assets/images/img21.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img22.jpg b/frontend/src/assets/images/img22.jpg deleted file mode 100644 index 97183dc2..00000000 Binary files a/frontend/src/assets/images/img22.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img23.jpg b/frontend/src/assets/images/img23.jpg deleted file mode 100644 index acfebab1..00000000 Binary files a/frontend/src/assets/images/img23.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img24.jpg b/frontend/src/assets/images/img24.jpg deleted file mode 100644 index 0f26ccb8..00000000 Binary files a/frontend/src/assets/images/img24.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img3.jpg b/frontend/src/assets/images/img3.jpg deleted file mode 100644 index 1cf8b9ef..00000000 Binary files a/frontend/src/assets/images/img3.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img4.jpg b/frontend/src/assets/images/img4.jpg deleted file mode 100644 index 6a0d0394..00000000 Binary files a/frontend/src/assets/images/img4.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img5.jpg b/frontend/src/assets/images/img5.jpg deleted file mode 100644 index 1f107b26..00000000 Binary files a/frontend/src/assets/images/img5.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img6.jpg b/frontend/src/assets/images/img6.jpg deleted file mode 100644 index 7bd7f5d7..00000000 Binary files a/frontend/src/assets/images/img6.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img7.jpg b/frontend/src/assets/images/img7.jpg deleted file mode 100644 index 05497fe4..00000000 Binary files a/frontend/src/assets/images/img7.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img8.jpg b/frontend/src/assets/images/img8.jpg deleted file mode 100644 index 1571f8de..00000000 Binary files a/frontend/src/assets/images/img8.jpg and /dev/null differ diff --git a/frontend/src/assets/images/img9.jpg b/frontend/src/assets/images/img9.jpg deleted file mode 100644 index cb17bfa0..00000000 Binary files a/frontend/src/assets/images/img9.jpg and /dev/null differ diff --git a/frontend/src/assets/images/mastercard.png b/frontend/src/assets/images/mastercard.png deleted file mode 100644 index c0465ef7..00000000 Binary files a/frontend/src/assets/images/mastercard.png and /dev/null differ diff --git a/frontend/src/assets/images/nine.jpg b/frontend/src/assets/images/nine.jpg deleted file mode 100644 index 856d4b32..00000000 Binary files a/frontend/src/assets/images/nine.jpg and /dev/null differ diff --git a/frontend/src/assets/images/nine.png b/frontend/src/assets/images/nine.png deleted file mode 100644 index f7643dd4..00000000 Binary files a/frontend/src/assets/images/nine.png and /dev/null differ diff --git a/frontend/src/assets/images/one.jpg b/frontend/src/assets/images/one.jpg deleted file mode 100644 index 035a749f..00000000 Binary files a/frontend/src/assets/images/one.jpg and /dev/null differ diff --git a/frontend/src/assets/images/one.png b/frontend/src/assets/images/one.png deleted file mode 100644 index f145a7f3..00000000 Binary files a/frontend/src/assets/images/one.png and /dev/null differ diff --git a/frontend/src/assets/images/seven.jpg b/frontend/src/assets/images/seven.jpg deleted file mode 100644 index bf678804..00000000 Binary files a/frontend/src/assets/images/seven.jpg and /dev/null differ diff --git a/frontend/src/assets/images/seven.png b/frontend/src/assets/images/seven.png deleted file mode 100644 index eb5e6c8c..00000000 Binary files a/frontend/src/assets/images/seven.png and /dev/null differ diff --git a/frontend/src/assets/images/six.jpg b/frontend/src/assets/images/six.jpg deleted file mode 100644 index 498353d2..00000000 Binary files a/frontend/src/assets/images/six.jpg and /dev/null differ diff --git a/frontend/src/assets/images/six.png b/frontend/src/assets/images/six.png deleted file mode 100644 index 52c2aab4..00000000 Binary files a/frontend/src/assets/images/six.png and /dev/null differ diff --git a/frontend/src/assets/images/temple.svg b/frontend/src/assets/images/temple.svg deleted file mode 100644 index b663e479..00000000 --- a/frontend/src/assets/images/temple.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/frontend/src/assets/images/ten.jpg b/frontend/src/assets/images/ten.jpg deleted file mode 100644 index c4639d32..00000000 Binary files a/frontend/src/assets/images/ten.jpg and /dev/null differ diff --git a/frontend/src/assets/images/ten.png b/frontend/src/assets/images/ten.png deleted file mode 100644 index 07455fab..00000000 Binary files a/frontend/src/assets/images/ten.png and /dev/null differ diff --git a/frontend/src/assets/images/three.jpg b/frontend/src/assets/images/three.jpg deleted file mode 100644 index dce13e50..00000000 Binary files a/frontend/src/assets/images/three.jpg and /dev/null differ diff --git a/frontend/src/assets/images/three.png b/frontend/src/assets/images/three.png deleted file mode 100644 index 11092f49..00000000 Binary files a/frontend/src/assets/images/three.png and /dev/null differ diff --git a/frontend/src/assets/images/two.jpg b/frontend/src/assets/images/two.jpg deleted file mode 100644 index f6042fbe..00000000 Binary files a/frontend/src/assets/images/two.jpg and /dev/null differ diff --git a/frontend/src/assets/images/two.png b/frontend/src/assets/images/two.png deleted file mode 100644 index 62cf74e2..00000000 Binary files a/frontend/src/assets/images/two.png and /dev/null differ diff --git a/frontend/src/assets/images/visa.png b/frontend/src/assets/images/visa.png deleted file mode 100644 index a8096697..00000000 Binary files a/frontend/src/assets/images/visa.png and /dev/null differ