Skip to content

Please remove CORS #807

Closed
Closed

Description

@Cyberlytical-LLC

Hi I tried getting this figured out a few months ago with no luck. I am trying to host bracket behind HAproxy but I either get a CORS error or "404 not found" I have followed all your steps in the docs with no luck. I have tried setting everything in Docker compose and the env files with no progress. I am happy to post my configs if it is helpful. I need this up in the next couple weeks for am event I am hosting.

Activity

  1. henninfi commented on Jul 9, 2024

    @henninfi

    It's hosted here for free, but it's not entirely up to date with this repo:

    RankIt

  2. Cyberlytical-LLC commented on Jul 10, 2024

    @Cyberlytical-LLC
    Author

    I appreciate that, but I would like to host this myself. Any help to get it going is appreciated

  3. Cyberlytical-LLC commented on Jul 10, 2024

    @Cyberlytical-LLC
    Author

    This is my Docker Compose. For now I don't want to use .env until I get it exactly how I need it.

    `version: 3.1

    services:
    bracket-frontend:
    image: ghcr.io/evroon/bracket-frontend
    container_name: bracket-frontend
    ports:
    - "3000:3000"
    environment:
    NEXT_PUBLIC_API_BASE_URL: "https://my.domain.org"
    NEXT_PUBLIC_HCAPTCHA_SITE_KEY: "REDACTED"
    NODE_ENV: "production"
    restart: unless-stopped

    bracket-backend:
        image: ghcr.io/evroon/bracket-backend
        container_name: bracket-backend
        ports:
            - "8400:8400"
        environment:
            ENVIRONMENT: "PRODUCTION"
            PG_DSN:'postgresql://bracket_ci:bracket_ci@localhost:5532/bracket_ci'
            JWT_SECRET:'REDACTED'
            CORS_ORIGINS:"https://my.domain.org"
            CORS_ORIGIN_REGEX:'*'
            ADMIN_EMAIL:'REDACTED'
            ADMIN_PASSWORD:'REDACTED'
            ALLOW_USER_REGISTRATION:true
            ALLOW_INSECURE_HTTP_SSO:false
            CAPTCHA_SECRET:'REDACTED'
            AUTO_RUN_MIGRATIONS:true
        volumes:
          - ./backend/static:/app/static
        restart: unless-stopped
        depends_on:
          - postgres
    
    postgres:
        image: postgres
        restart: always
        environment:
          POSTGRES_DB: bracket_prod
          POSTGRES_USER: bracket_prod
          POSTGRES_PASSWORD: bracket_prod`
    

    Even with this setting, sign ups are still blocked (states its in BETA), and I get either a connection refused or internal server error when logging in.

  4. evroon commented on Jul 10, 2024

    @evroon
    Owner

    NEXT_PUBLIC_API_BASE_URL should point to the root url of the backend
    CORS_ORIGINS should point to the root url of the frontend

    In your case they're the same which can't be correct AFAIK

  5. Cyberlytical-LLC commented on Jul 10, 2024

    @Cyberlytical-LLC
    Author

    So NEXT_PUBLIC_API_BASE_URL should be something like 10.10.5.11:8400?

  6. djpiper28 commented on Jul 10, 2024

    @djpiper28
    Contributor

    I have an up to date version hosted at https://bracket.djpiper28.co.uk

  7. Cyberlytical-LLC commented on Jul 10, 2024

    @Cyberlytical-LLC
    Author

    @djpiper28 Again I appreciate the offers for a free version hosted by you guys. However due to some logistical reasons this has to be contained within our environment. I am more than happy to pay for help if one of you is willing. Normally I would figure these things out on my own but I am buried with other tasks atm.

  8. djpiper28 commented on Jul 10, 2024

    @djpiper28
    Contributor

    I can pop in a discord call and help you fix cors tomorrow if you want. I've got my setup on my kubernetes cluster and I'm fine for anyone to use it.

  9. Cyberlytical-LLC commented on Jul 10, 2024

    @Cyberlytical-LLC
    Author

    @djpiper28 Thank you very much. That is very kind of you. I'll be sending a small donation to the project and please let me know how I can repay you personally.

    Is there somewhere I can donate?

  10. djpiper28 commented on Jul 10, 2024

    @djpiper28
    Contributor

    I won't take your cash. But if you add me on discord (@dannypiper) I am more then happy to help you set it up in a call.

  11. Cyberlytical-LLC commented on Jul 10, 2024

    @Cyberlytical-LLC
    Author

    Thank you. I added you on discord.

  12. Repository owner locked and limited conversation to collaborators on Jul 10, 2024
  13. converted this issue into a discussion #813 on Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions