wanderer icon indicating copy to clipboard operation
wanderer copied to clipboard

Pocketbase Portal Admin Account Creation '405 Method Not Allowed'

Open emielpopla opened this issue 1 year ago • 1 comments

I installed Wanderer from source in a LXC container in Proxmox. Everything seems to work great so far. Now I want to add OAuth through pocketbase so I was following the steps as described in the documentation but I am stuck on the Admin User creation for Pocketbase.

I used NGINX to serve the pocketbase portal using this config on the wanderer LXC host:

server {
        listen       80;
        server_name  wandererdb.mydomain.com;

        # Logs
        access_log /var/log/nginx/pocketbase.access.log;
        error_log /var/log/nginx/pocketbase.error.log;

        client_max_body_size 10M;
        # Proxy Forward
        location / {
                proxy_pass http://127.0.0.1:8090/_/;
                proxy_set_header Connection '';
                proxy_http_version 1.1;
                proxy_read_timeout 360s;

                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }
}

I have another central NGINX reverse proxy with the same config but adding ssl encryption on another host. Now this seems to work great as I get access to the Pocketbase portal and it asks me to create my first admin account. When I fill in the email address and the passwords I get the message 'Method Not Allowed'.

Capture

In the NGINX logs on the wanderer host I get the following error message:

10.0.105.152 - - [23/May/2024:18:14:24 +0000] "POST /api/admins HTTP/1.1" 405 55 "https://wandererdb.mydomain.com/?installer" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0"

The API endpoint called for the admin creation doesn't seem to be in your API documentation but I found it in the Pocketbase documentation. I tried to call it via a curl request but got the same error.

Any ideas on what I could be doing wrong?

emielpopla avatar May 23 '24 18:05 emielpopla

Does it have something to do with CORS errors? I have set the following ENV variables but no ORIGIN env variable yet.

MEILI_URL=http://127.0.0.1:7700 PUBLIC_POCKETBASE_URL=http://127.0.0.1:8090

Wanderer is available (internally) on wanderer.mydomain.com

emielpopla avatar May 23 '24 18:05 emielpopla

I found the issue.

I needed to set proxy_pass to http://127.0.0.1:8090 instead of http://127.0.0.1:8090// and then go to wandererdb.mydomain.com// and then everything worked.

emielpopla avatar May 28 '24 19:05 emielpopla