Skip to content

Commit

Permalink
Revert OF 4.8.0 changes. Stay at OF 4.7.5 for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
deleolajide committed Nov 23, 2023
1 parent d078156 commit fa0f03e
Show file tree
Hide file tree
Showing 19 changed files with 177 additions and 199 deletions.
8 changes: 4 additions & 4 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ call mvn clean package -Dmaven.test.skip=true

cd target
rename pade-openfire-plugin-assembly.jar pade.jar
rd "D:\Openfire\openfire_4_8_0\plugins\pade" /q /s
del "D:\Openfire\openfire_4_8_0\plugins\pade.jar"
del /q "D:\Openfire\openfire_4_8_0\logs\*.*"
copy pade.jar D:\Openfire\openfire_4_8_0\plugins\pade.jar
rd "D:\Openfire\openfire_4_7_5\plugins\pade" /q /s
del "D:\Openfire\openfire_4_7_5\plugins\pade.jar"
del /q "D:\Openfire\openfire_4_7_5\logs\*.*"
copy pade.jar D:\Openfire\openfire_4_7_5\plugins\pade.jar

rd "D:\Projects\openfire-cluster\node1\plugins\pade" /q /s
del "D:\Projects\openfire-cluster\node1\plugins\pade.jar"
Expand Down
2 changes: 1 addition & 1 deletion changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1>
Pade Changelog
</h1>

<p><b>2.0.0</b> -- <i>June 30, 2024</i></p>
<p><b>1.7.9</b> -- <i>December 31, 2023</i></p>
<ul>
<li></li>
</ul>
Expand Down
7 changes: 4 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
<description>${project.description}</description>
<author>Ignite Realtime</author>
<version>${project.version}</version>
<date>2024-06-30</date>
<minServerVersion>4.8.0</minServerVersion>

<date>08/10/2023</date>
<priorToServerVersion>4.8.0</priorToServerVersion>
<minServerVersion>4.7.0</minServerVersion>
<minJavaVersion>1.8</minJavaVersion>
<adminconsole>
<tab id="tab-ofmeet" name="${plugin.title}" url="ofmeet-summary.jsp" description="${plugin.description}">
<sidebar id="siderbar-ofmeet" name="${plugin.jitsi.title}">
Expand Down
17 changes: 6 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<artifactId>plugins</artifactId>
<groupId>org.igniterealtime.openfire</groupId>
<version>4.8.0-SNAPSHOT</version>
<version>4.7.0</version>
</parent>

<groupId>org.igniterealtime.openfire</groupId>
<artifactId>pade</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>1.7.9-SNAPSHOT</version>

<name>Pade</name>
<description>Web-based chat, groupchat, telephones, audio and video conferencing solution using ConverseJS, Jitsi and FreeSWITCH</description>
Expand Down Expand Up @@ -290,7 +290,7 @@
<dependency>
<groupId>org.eclipse.jetty.fcgi</groupId>
<artifactId>fcgi-server</artifactId>
<version>10.0.17</version>
<version>9.4.12.v20180830</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.j256.two-factor-auth/two-factor-auth -->
Expand All @@ -309,7 +309,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
<version>20230227</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -396,6 +396,7 @@
<version>3.0-24-g34c2ce5</version>
</dependency>


<dependency>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
Expand All @@ -406,14 +407,8 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>10.0.17</version>
<version>9.4.35.v20201120</version>
</dependency>

<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-jetty-client</artifactId>
<version>10.0.17</version>
</dependency>

<dependency>
<groupId>com.yubico</groupId>
Expand Down
15 changes: 8 additions & 7 deletions src/java/org/ifsoft/download/Servlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ private void writeHeader(String urlString, HttpServletResponse response)
response.setHeader("Content-Type", "text/html");

response.setHeader("Connection", "close");

HttpBindManager boshManager = HttpBindManager.getInstance();
response.setHeader("Access-Control-Allow-Methods", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS.getValue()));
response.setHeader("Access-Control-Allow-Headers", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS.getValue() + ", Authorization"));
response.setHeader("Access-Control-Max-Age", String.valueOf(HttpBindManager.HTTP_BIND_CORS_MAX_AGE.getValue().toSeconds()));
response.setHeader("Access-Control-Allow-Origin", String.valueOf(HttpBindManager.HTTP_BIND_ALLOWED_ORIGINS.getDefaultValue()));
response.setHeader("Access-Control-Allow-Credentials", "true");

HttpBindManager boshManager = HttpBindManager.getInstance();

response.setHeader("Access-Control-Allow-Origin", boshManager.getCORSAllowOrigin());
response.setHeader("Access-Control-Allow-Headers", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS_DEFAULT + ", Authorization");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS_DEFAULT);

}
catch(Exception e)
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/org/ifsoft/meet/MeetService.java
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ public static String sendEmailMessage(String toName, String toEmail, String from
message.setRecipient(Message.RecipientType.TO, to);
message.setFrom(from);
message.setReplyTo(new javax.mail.Address[]{from});
message.setSubject(StringUtils.replace(subject, "\n", "", new int[2]), encoding);
message.setSubject(StringUtils.replace(subject, "\n", ""), encoding);

if (textBody != null && htmlBody != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/java/org/ifsoft/mta/MtaManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private Connector createSSLConnector( final Server mtaServer ) {
httpsConfig.setSendDateHeader(false);
httpsConfig.addCustomizer(new SecureRequestCustomizer());

final SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
final SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.addExcludeProtocols("SSLv3");
sslContextFactory.setEndpointIdentificationAlgorithm(null);
sslContextFactory.setTrustStorePath(c2sTrustStoreLocation);
Expand Down
12 changes: 6 additions & 6 deletions src/java/org/ifsoft/sso/Password.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ private void writeHeader(HttpServletResponse response)
response.setHeader("Pragma", "no-cache");
response.setHeader("Content-Type", "application/javascript");
response.setHeader("Connection", "close");

HttpBindManager boshManager = HttpBindManager.getInstance();
response.setHeader("Access-Control-Allow-Methods", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS.getValue()));
response.setHeader("Access-Control-Allow-Headers", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS.getValue() + ", Authorization"));
response.setHeader("Access-Control-Max-Age", String.valueOf(HttpBindManager.HTTP_BIND_CORS_MAX_AGE.getValue().toSeconds()));
response.setHeader("Access-Control-Allow-Origin", String.valueOf(HttpBindManager.HTTP_BIND_ALLOWED_ORIGINS.getDefaultValue()));

HttpBindManager boshManager = HttpBindManager.getInstance();

response.setHeader("Access-Control-Allow-Origin", boshManager.getCORSAllowOrigin());
response.setHeader("Access-Control-Allow-Headers", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS_DEFAULT + ", Authorization");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS_DEFAULT);
}
}
14 changes: 7 additions & 7 deletions src/java/org/ifsoft/sso/SmartIdCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ private void writeHeader(HttpServletResponse response)
response.setHeader("Pragma", "no-cache");
response.setHeader("Content-Type", "application/javascript");
response.setHeader("Connection", "close");
HttpBindManager boshManager = HttpBindManager.getInstance();
response.setHeader("Access-Control-Allow-Methods", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS.getValue()));
response.setHeader("Access-Control-Allow-Headers", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS.getValue() + ", Authorization"));
response.setHeader("Access-Control-Max-Age", String.valueOf(HttpBindManager.HTTP_BIND_CORS_MAX_AGE.getValue().toSeconds()));
response.setHeader("Access-Control-Allow-Origin", String.valueOf(HttpBindManager.HTTP_BIND_ALLOWED_ORIGINS.getDefaultValue()));
response.setHeader("Access-Control-Allow-Credentials", "true");

HttpBindManager boshManager = HttpBindManager.getInstance();

response.setHeader("Access-Control-Allow-Origin", boshManager.getCORSAllowOrigin());
response.setHeader("Access-Control-Allow-Headers", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS_DEFAULT + ", Authorization");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS_DEFAULT);
}

public String get(String url) throws ClientProtocolException, IOException
Expand Down
12 changes: 6 additions & 6 deletions src/java/org/ifsoft/sso/SmartIdCardCert.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ private void writeHeader(HttpServletResponse response)
response.setHeader("Content-Type", "application/javascript");
response.setHeader("Connection", "close");

HttpBindManager boshManager = HttpBindManager.getInstance();
response.setHeader("Access-Control-Allow-Methods", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS.getValue()));
response.setHeader("Access-Control-Allow-Headers", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS.getValue() + ", Authorization"));
response.setHeader("Access-Control-Max-Age", String.valueOf(HttpBindManager.HTTP_BIND_CORS_MAX_AGE.getValue().toSeconds()));
response.setHeader("Access-Control-Allow-Origin", String.valueOf(HttpBindManager.HTTP_BIND_ALLOWED_ORIGINS.getDefaultValue()));
response.setHeader("Access-Control-Allow-Credentials", "true");
HttpBindManager boshManager = HttpBindManager.getInstance();

response.setHeader("Access-Control-Allow-Origin", boshManager.getCORSAllowOrigin());
response.setHeader("Access-Control-Allow-Headers", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS_DEFAULT + ", Authorization");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS_DEFAULT);
}

}
10 changes: 5 additions & 5 deletions src/java/org/ifsoft/sso/WellKnownHostMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ private void writeHeader(HttpServletResponse response)
response.setHeader("Content-Type", "application/javascript");
response.setHeader("Connection", "close");

HttpBindManager boshManager = HttpBindManager.getInstance();
response.setHeader("Access-Control-Allow-Methods", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS.getValue()));
response.setHeader("Access-Control-Allow-Headers", String.join(",", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS.getValue() + ", Authorization"));
response.setHeader("Access-Control-Max-Age", String.valueOf(HttpBindManager.HTTP_BIND_CORS_MAX_AGE.getValue().toSeconds()));
response.setHeader("Access-Control-Allow-Origin", String.valueOf(HttpBindManager.HTTP_BIND_ALLOWED_ORIGINS.getDefaultValue()));
HttpBindManager boshManager = HttpBindManager.getInstance();

response.setHeader("Access-Control-Allow-Origin", boshManager.getCORSAllowOrigin());
response.setHeader("Access-Control-Allow-Headers", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS_DEFAULT + ", Authorization");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS_DEFAULT);
}
}
5 changes: 5 additions & 0 deletions src/java/org/ifsoft/websockets/LiveStreamSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
import org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest;
import org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse;
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
import org.eclipse.jetty.websocket.api.annotations.*;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.RemoteEndpoint;
Expand Down
12 changes: 7 additions & 5 deletions src/java/org/ifsoft/websockets/ProxyConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
import java.security.cert.X509Certificate;
import java.util.*;
import java.util.concurrent.*;
import java.time.Duration;
import javax.net.*;
import javax.net.ssl.*;
import javax.security.auth.callback.*;

import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.http.HttpClientTransportOverHTTP;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
import org.eclipse.jetty.websocket.client.WebSocketClient;
Expand Down Expand Up @@ -52,6 +53,7 @@ public ProxyConnection(URI uri, List<String> subprotocol, int connectTimeout)
{
Log.debug("ProxyConnection " + uri + " " + subprotocol);

final SslContextFactory clientSslContextFactory = SslContextFactoryProvider.getClientSslContextFactory();
if("wss".equals(uri.getScheme()))
{
Log.debug("ProxyConnection - SSL");
Expand All @@ -60,7 +62,7 @@ public ProxyConnection(URI uri, List<String> subprotocol, int connectTimeout)
}
else isSecure = false;

httpClient = new HttpClient();
httpClient = new HttpClient(new HttpClientTransportOverHTTP(1),clientSslContextFactory);
final QueuedThreadPool queuedThreadPool = QueuedThreadPoolProvider.getQueuedThreadPool("ProxyConnection-HttpClient");
httpClient.setExecutor(queuedThreadPool);
httpClient.setConnectTimeout(connectTimeout);
Expand All @@ -69,10 +71,10 @@ public ProxyConnection(URI uri, List<String> subprotocol, int connectTimeout)
{
httpClient.start();
wsClient = new WebSocketClient(httpClient);
wsClient.setIdleTimeout(Duration.ofMinutes(5));
wsClient.start();

final ClientUpgradeRequest request = new ClientUpgradeRequest(uri);
final ClientUpgradeRequest request = new ClientUpgradeRequest();
request.setRequestURI​(uri);
if (subprotocol != null) request.setSubProtocols(subprotocol);

proxySocket = new ProxySocket(this);
Expand Down Expand Up @@ -243,7 +245,7 @@ public void deliver(String text)
{
try {
Log.debug("ProxySocket deliver: \n" + text);
session.getRemote().sendString(text);
session.getRemote().sendStringByFuture(text);
lastMessage = null;
} catch (Exception e) {
Log.error("ProxySocket deliver", e);
Expand Down
7 changes: 6 additions & 1 deletion src/java/org/ifsoft/websockets/ProxyWebSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
import org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest;
import org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse;
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
import org.eclipse.jetty.websocket.api.annotations.*;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.RemoteEndpoint;
Expand Down Expand Up @@ -90,7 +95,7 @@ public void deliver(String message)
{
try {
Log.debug(" : Delivered : \n" + message );
wsSession.getRemote().sendString(message);
wsSession.getRemote().sendStringByFuture(message);
} catch (Exception e) {
Log.error("ProxyWebSocket deliver " + e);
Log.warn("Could not deliver : \n" + message );
Expand Down
53 changes: 30 additions & 23 deletions src/java/org/jivesoftware/openfire/plugin/ofmeet/OfMeetPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
import org.eclipse.jetty.servlet.*;
import org.eclipse.jetty.websocket.servlet.*;
import org.eclipse.jetty.websocket.server.*;
import org.eclipse.jetty.websocket.server.config.*;
import org.eclipse.jetty.http.pathmap.ServletPathSpec;
import org.eclipse.jetty.websocket.server.pathmap.ServletPathSpec;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
Expand Down Expand Up @@ -399,15 +398,18 @@ public void destroyPlugin()
protected void loadPublicWebApp() throws Exception
{
Log.info( "Initializing public web application for /colibri-ws web socket" );

JettyWebSocketServlet websocketServlet = new JettyWebSocketServlet() {
@Override protected void configure(JettyWebSocketServletFactory factory) {
factory.addMapping("/*", (req, res) -> new JvbSocketCreator());
}
};
jvbWsContext = new ServletContextHandler();
jvbWsContext.addServlet(new ServletHolder(websocketServlet), "/colibri-ws");
JettyWebSocketServletContainerInitializer.configure(jvbWsContext, (JettyWebSocketServletContainerInitializer.Configurator) null);

jvbWsContext = new ServletContextHandler(null, "/colibri-ws", ServletContextHandler.SESSIONS);

try {
WebSocketUpgradeFilter wsfilter = WebSocketUpgradeFilter.configureContext(jvbWsContext);
wsfilter.getFactory().getPolicy().setIdleTimeout(60 * 60 * 1000);
wsfilter.getFactory().getPolicy().setMaxTextMessageSize(64000000);
wsfilter.addMapping(new ServletPathSpec("/*"), new JvbSocketCreator());

} catch (Exception e) {
Log.error("loadPublicWebApp", e);
}

HttpBindManager.getInstance().addJettyHandler(jvbWsContext);

Expand All @@ -425,9 +427,9 @@ protected void loadPublicWebApp() throws Exception
}


public static class JvbSocketCreator implements JettyWebSocketCreator
public static class JvbSocketCreator implements WebSocketCreator
{
@Override public Object createWebSocket(JettyServerUpgradeRequest req, JettyServerUpgradeResponse resp)
@Override public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp)
{
String ipaddr = JiveGlobals.getProperty( "ofmeet.videobridge.rest.host", OfMeetPlugin.self.getIpAddress());
String jvbPort = JiveGlobals.getProperty( "ofmeet.websockets.plainport", "8180");
Expand Down Expand Up @@ -820,14 +822,19 @@ private void setupFFMPEG(File pluginDirectory)

private void startFFMPEG(String path)
{
JettyWebSocketServlet websocketServlet = new JettyWebSocketServlet() {
@Override protected void configure(JettyWebSocketServletFactory factory) {
factory.addMapping("/*", (req, res) -> new StreamSocketCreator());
}
};
streamWsContext = new ServletContextHandler();
streamWsContext.addServlet(new ServletHolder(websocketServlet), "/livestream-ws");
JettyWebSocketServletContainerInitializer.configure(streamWsContext, (JettyWebSocketServletContainerInitializer.Configurator) null);
streamWsContext = new ServletContextHandler(null, "/livestream-ws", ServletContextHandler.SESSIONS);

try {
WebSocketUpgradeFilter wsfilter2 = WebSocketUpgradeFilter.configureContext(streamWsContext);
wsfilter2.getFactory().getPolicy().setIdleTimeout(60 * 60 * 1000);
wsfilter2.getFactory().getPolicy().setMaxTextMessageSize(64000000);
wsfilter2.getFactory().getPolicy().setMaxBinaryMessageSize(64000000);

wsfilter2.addMapping(new ServletPathSpec("/*"), new StreamSocketCreator());

} catch (Exception e) {
Log.error("loadPublicWebApp", e);
}

try {
String ffmpegName = null;
Expand Down Expand Up @@ -860,9 +867,9 @@ private void extractFile(ZipInputStream zipIn, String filePath) throws IOExcepti
bos.close();
}

public static class StreamSocketCreator implements JettyWebSocketCreator
public static class StreamSocketCreator implements WebSocketCreator
{
@Override public Object createWebSocket(JettyServerUpgradeRequest req, JettyServerUpgradeResponse resp)
@Override public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp)
{
String streamKey = null;

Expand Down
Loading

0 comments on commit fa0f03e

Please sign in to comment.