Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 forbidden when changing database #11

Open
AmsellemJoseph opened this issue Oct 3, 2023 · 4 comments
Open

403 forbidden when changing database #11

AmsellemJoseph opened this issue Oct 3, 2023 · 4 comments

Comments

@AmsellemJoseph
Copy link

Hey, I'm facing for a new issue.

I deployed evidence with docker compose, and everything seems ok, but when I'm going to settings to change database, when I choose postgres or else, I put my credentials, when I save them, I got a 403 forbidden error, and on log from chrome I have this:

POST https://my-domain.com/api/settings.json 403 (Forbidden)

But when I'm clickin on thus url i get this:

{
    "settings": {
        "database": "duckdb",
        "credentials": {
            "filename": "needful_things.duckdb",
            "gitignoreDuckdb": null
        }
    },
    "gitIgnore": ".evidence/template\n.svelte-kit\nbuild\nnode_modules\n.DS_Store\n.vscode/settings.json\n"
}

here is my docker-compose file:

version: "3.3"
services:
  evidence:
    image: evidencedev/devenv:ubuntu
    command: "--init"
    restart: always
    environment:
      EVIDENCE_DATABASE: evidence
      EVIDENCE_POSTGRES_USER: postgres
      EVIDENCE_POSTGRES_HOST: postgres
      EVIDENCE_POSTGRES_DATABASE: evidence
      EVIDENCE_POSTGRES_PASSWORD: ${ADMIN_PASSWORD}
      EVIDENCE_POSTGRES_PORT: 5432
    volumes:
      - "./my-project:/evidence-workspace"
    ports:
      - "172.17.0.1:55558:3000"

  postgres:
    image: "elestio/postgres:15"
    container_name: postgres
    restart: always
    environment:
      - "POSTGRES_DB=evidence"
      - "POSTGRES_PASSWORD=${AP_POSTGRES_PASSWORD}"
      - "POSTGRES_USER=postgres"
      - "POSTGRES_HOST_AUTH_METHOD=trust"
    volumes:
      - "./postgres_data:/var/lib/postgresql/data"
    ports:
      - 172.17.0.1:42962:5432

  pgadmin4:
    image: dpage/pgadmin4:latest
    restart: always
    environment:
      PGADMIN_DEFAULT_EMAIL: ${ADMIN_EMAIL}
      PGADMIN_DEFAULT_PASSWORD: ${ADMIN_PASSWORD}
      PGADMIN_LISTEN_PORT: 8080
    ports:
      - "172.17.0.1:17371:8080"
    volumes:
      - ./servers.json:/pgadmin4/servers.json

Thx a lot for your work and for your responses 😊

@mgmorcos
Copy link

I get the 403 as well, with CORS error.

@ud3sh
Copy link
Member

ud3sh commented Oct 20, 2023

@AmsellemJoseph @mgmorcos it seems like the new Ubuntu image is more peculiar about CORS issues. Proper fix may involve something like this but particular to the image we are using

If you are looking to connect to an external DB that is not DuckDB/Mother Duck, replacing the evidencedev/devenv image with evidencedev/devenv-lite should do. I just tested this out with an external big query connection and it works

@mgmorcos
Copy link

Hi @ud3sh thank you for taking a look. This workaround did not resolve the issue for me, I still see 403's.

@AmsellemJoseph
Copy link
Author

hey @ud3sh, thanks for your response, but I have the same issue with 403...
I'm already use a reverse proxy NGINX, but event when adding

add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';

I still have this issue.
thx a lot for your job and your responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants