Skip to content

JWT error blocks uploads #94

@mountainmiller

Description

@mountainmiller

I suspect this may be a configuration error on my part, but the documentation is a bit sparse.

Symptom

I am using KiwiIRC connecting via a WebSocket to Ergo IRCd on the same server, so I have the plugin server, as I am not using a webircgateway. When I go to upload a file, after selecting an image file and hitting the "Upload" button, I get the console message

Tokens were not available synchronously. Cancelling upload start and acquiring tokens.

And then after a delay of a few seconds, this pops in a little bubble on the upload dialog.

Unhandled error acquiring EXTJWT tokens!

At no point during this do I see any new requests in the Network tab of the browser Dev Tools.

Config details

In the plugin server config, I have

[Server]
ListenAddress = "127.0.0.1:8088"

and further down

[JwtSecretsByIssuer]
"example.net = "[SECRET]"

With the corresponding JWT config in my Ergo config file:

extjwt:
    expiration: 45s
    secret: "[SECRET]"

In the KiwiIRC config.json,

  "plugins": [
    { "name": "fileuploader", "url": "static/plugins/plugin-fileuploader.js" },
  ],
  "fileuploader": {
    "server": "http://example.net/chat-files",
    "maxFileSize": ,
    "note": "Add an optional note to the upload dialog"
  }

Then I have nginx set up to reverse proxy the server endpoint:

    # KiwiIRC 
    location /chat-files {
		    proxy_pass http://127.0.0.1:8088;
		    proxy_read_timeout 1m;
		    proxy_http_version 1.1;
		    proxy_set_header X-Forwarded-For $remote_addr;
		    proxy_set_header X-Forwarded-Proto $scheme;
    }

What am I doing wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions