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

Is jetty mandatory and other questions ... #26

Closed
ErwanF76 opened this issue Jul 23, 2020 · 2 comments
Closed

Is jetty mandatory and other questions ... #26

ErwanF76 opened this issue Jul 23, 2020 · 2 comments

Comments

@ErwanF76
Copy link

Hi !

I need some clarifications :)

A short summary of my settings:

  • 2 Openfire servers running into 2 differents domains;
  • 2 Converse.js clients running at each extremities.
    That gives:
    Client 1 (converse.js) <-> Openfire@domain1.org <-> Openfire@domain2.org <-> Client 2 (converse.js)
    Everything works fine (chat, group chat, HTTP-upload thx to the dedicated plug-in).

For some reasons, I would like to use distinct ports for Chat and HTTP-upload.
I noticed that I could configure the HTTP-upload plug-in using the properties below:

  • plugin.httpfileupload.announcedWebHost -> DNS name of the local Openfire server
  • plugin.httpfileupload.announcedWebPort -> 7444 (port different from 7443)
    The new port is taken into account by the attempt of transfer (could see that in Openfire logs), unfortunately the port is not actually opened on Openfire host :(
    Is this the expected behaviour ?

I tried to use an Nginx as external Web server (running on another machine).
But I noticed that some dependencies from Jetty are somehow hardcoded in the source code of the httpfileuploadcomponent.
In addition, when trying to upload files from Converse.js, the intermediate UUID sub-folder (in the upload path) is not created in the target web context root folder 'httpfileupload' hosted by the Nginx server.
My understanding is that I can't run another Web server than Jetty, the one embedded into Openfire server. No chance to run another type of Web server as Nginx, and on another server than Openfire.
Do you confirm ?

Many many thx for your clarification.
KR
ErwanF

@hamzaozturk
Copy link

You need to set some header parameters for converse.js to be worked.

server {
    listen 80;
    listen [::]:80;
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name upload.example.com;

    ssl_certificate /root/certificate/fullchain.pem;
    ssl_certificate_key /root/certificate/privkey.pem;

    client_max_body_size 50m;

    location / {
            add_header Access-Control-Allow-Origin '*';
            add_header Access-Control-Allow-Methods 'PUT, GET, OPTIONS, HEAD';
            add_header Access-Control-Allow-Headers 'Authorization, Content-Type';
            add_header Access-Control-Allow-Credentials 'true';

            proxy_pass http://%ip_address%:12121;
    }
}

@guusdk
Copy link
Owner

guusdk commented Nov 4, 2021

This project (unlike the very similar project that wraps all this in an Openfire plugin) can be ran as a stand-alone instance. If it is running as such, it needs to have some kind of webserver that can handle the HTTP-part of the functionality. For this, an embedded Jetty server is launched (when running as an Openfire plugin, the Jetty webserver that is provided by Openfire is used).

You can configure the directory that is used to store files using the fileRepo option in the launcher, or use the plugin.httpfileupload.fileRepo system property when running as a plugin in Openfire. When you are converging multiple instances of this project under one URL, you must make sure that all instances use the same file repository: otherwise parts of the content will appear to be 'missing', depending on what instance is being used.

@guusdk guusdk closed this as completed Nov 4, 2021
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