diff --git a/.github/workflows/dockerbuild.yaml b/.github/workflows/dockerbuild.yaml index e2195a71..aedd1c12 100644 --- a/.github/workflows/dockerbuild.yaml +++ b/.github/workflows/dockerbuild.yaml @@ -32,18 +32,17 @@ jobs: version: nightly experimental: true steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -64,15 +63,20 @@ jobs: #,linux/386 - no node image I guess? push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.app }}:${{ matrix.version }} + + - name: Login to Ghcr + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: frikky + password: ${{ secrets.GHCR_PW }} + - name: Ghcr Build and push id: docker_build uses: docker/build-push-action@v2 env: BUILDX_NO_DEFAULT_LOAD: true with: - registry: ghcr.io - username: "frikky" - password: ${{ secrets.GHCR_PW }} context: ${{ matrix.path }}/ file: ${{ matrix.path }}/Dockerfile platforms: linux/amd64,linux/arm64 diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index e4d03489..9d2f9ae7 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -2,7 +2,7 @@ module main go 1.16 -//replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared +replace github.com/shuffle/shuffle-shared => ../../../shuffle-shared //replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi //replace github.com/frikky/go-elasticsearch => ../../../../git/go-elasticsearch diff --git a/backend/go-app/main.go b/backend/go-app/main.go index 54733b33..ee98591d 100644 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -1362,7 +1362,18 @@ func handleLogin(resp http.ResponseWriter, request *http.Request) { } // FIXME - have timeout here + tutorialsFinished := Userdata.PersonalInfo.Tutorials + returnValue := shuffle.HandleInfo{ + Success: true, + Tutorials: tutorialsFinished, + } + loginData := `{"success": true}` + newData, err := json.Marshal(returnValue) + if err == nil { + loginData = string(newData) + } + if len(Userdata.Session) != 0 { log.Println("[INFO] User session already exists - resetting it") expiration := time.Now().Add(3600 * time.Second) @@ -1373,7 +1384,16 @@ func handleLogin(resp http.ResponseWriter, request *http.Request) { Expires: expiration, }) + returnValue.Cookies = append(returnValue.Cookies, shuffle.SessionCookie{ + Key: "session_token", + Value: Userdata.Session, + Expiration: expiration.Unix(), + }) loginData = fmt.Sprintf(`{"success": true, "cookies": [{"key": "session_token", "value": "%s", "expiration": %d}]}`, Userdata.Session, expiration.Unix()) + newData, err := json.Marshal(returnValue) + if err == nil { + loginData = string(newData) + } //log.Printf("SESSION LENGTH MORE THAN 0 IN LOGIN: %s", Userdata.Session) err = shuffle.SetSession(ctx, Userdata, Userdata.Session) @@ -1410,7 +1430,17 @@ func handleLogin(resp http.ResponseWriter, request *http.Request) { return } + returnValue.Cookies = append(returnValue.Cookies, shuffle.SessionCookie{ + Key: "session_token", + Value: sessionToken, + Expiration: expiration.Unix(), + }) + loginData = fmt.Sprintf(`{"success": true, "cookies": [{"key": "session_token", "value": "%s", "expiration": %d}]}`, sessionToken, expiration.Unix()) + newData, err := json.Marshal(returnValue) + if err == nil { + loginData = string(newData) + } } log.Printf("[INFO] %s SUCCESSFULLY LOGGED IN with session %s", data.Username, Userdata.Session) diff --git a/docker-compose.yml b/docker-compose.yml index 7f4df4a7..6cde7541 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: frontend: - build: ./frontend + #build: ./frontend image: ghcr.io/frikky/shuffle-frontend:nightly container_name: shuffle-frontend hostname: shuffle-frontend @@ -26,13 +26,13 @@ services: networks: - shuffle volumes: - #- /var/run/docker.sock:/var/run/docker.sock + - /var/run/docker.sock:/var/run/docker.sock - ${SHUFFLE_APP_HOTLOAD_LOCATION}:/shuffle-apps:z - ${SHUFFLE_FILE_LOCATION}:/shuffle-files:z #- ${SHUFFLE_OPENSEARCH_CERTIFICATE_FILE}:/shuffle-files/es_certificate env_file: .env environment: - - DOCKER_HOST=tcp://docker-socket-proxy:2375 + #- DOCKER_HOST=tcp://docker-socket-proxy:2375 - SHUFFLE_APP_HOTLOAD_FOLDER=/shuffle-apps - SHUFFLE_FILE_LOCATION=/shuffle-files restart: unless-stopped @@ -45,10 +45,10 @@ services: hostname: shuffle-orborus networks: - shuffle - #volumes: - # - /var/run/docker.sock:/var/run/docker.sock + volumes: + - /var/run/docker.sock:/var/run/docker.sock environment: - - DOCKER_HOST=tcp://docker-socket-proxy:2375 + #- DOCKER_HOST=tcp://docker-socket-proxy:2375 - SHUFFLE_WORKER_VERSION=latest - ENVIRONMENT_NAME=${ENVIRONMENT_NAME} - BASE_URL=http://${OUTER_HOSTNAME}:5001 diff --git a/frontend/src/components/WelcomeForm.jsx b/frontend/src/components/WelcomeForm.jsx index 3e570fc6..eee12b40 100644 --- a/frontend/src/components/WelcomeForm.jsx +++ b/frontend/src/components/WelcomeForm.jsx @@ -580,7 +580,7 @@ const WelcomeForm = (props) => {
{isCloud ? null : - This data will be used within the product and NOT be shared unless cloud synchronization is configured. + This data will be used within the product and NOT be shared unless cloud synchronization is configured. } {activeStep === steps.length ? (