igniterealtime / openfire-contentfilter-plugin Goto Github PK
View Code? Open in Web Editor NEWAllows admins to configure various actions based on message content
License: Apache License 2.0
Allows admins to configure various actions based on message content
License: Apache License 2.0
If filter is enabled and one selects to Reject packet and presses Save settings, it preserves such setting. But after server restart it switches to Allow (with a mask) instead of Reject.
Hello,
I am using the plugin in a docker version of openfire and on container restart the filter regex is reset to default ( the settings are saved and i am using a large regex, 67KB worth of text) . I have a persistent volume for /var/lib/openfire, so that is not the issue....
I have been unable to find where the information is saved.... is it in memory only ? Can we make the regex persistent somehow ?
Thanks,
Adrian
...Migrated from Ignite Jira OF-1047...
When "Include original packet" setting is enabled in Content Match Notification part of Content Filter plugin's settings it then sends multiple notifications to the designated person. It looks like when forbidden pattern is detected it tries to send a notification to admin and as original packet includes forbidden content it then tries to reject it again and goes into loop. So admin gets this:
Disallowed content detected in message from:wroot to:test@wroot, message was rejected.
Original subject:Content filter notification! (null)
Original content:Disallowed content detected in message from:wroot to:test@wroot, message was rejected.
Original subject:Content filter notification! (null)
<<<1000+ same two lines as above>>>
Original content:Disallowed content detected in message from:wroot to:test@wroot, message was rejected.
Original subject:Content filter notification! (john)
Original content:Disallowed content detected in message from:john@wroot/Exodus to:nova@wroot, message was rejected.
Original subject:
Original content:dog
When it should only be:
Original content:Disallowed content detected in message from:john@wroot/Exodus to:nova@wroot, message was rejected.
Original subject:
Original content:dog
This plugin still uses the old JiveGlobals method of defining/storing/retrieving global configuration.
SystemProperties enable description, visible defaults, change detection and other benefits. Update the plugin to use these instead.
contentFilter 1.8.1 with openfire 4.7.5
<parent>
<artifactId>plugins</artifactId>
<groupId>org.igniterealtime.openfire</groupId>
<version>4.7.5</version>
</parent>
package failed log :
[INFO] At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[WARNING] org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [9] in the generated java file: [D:\Openfire-4.7.5\plugins\openfire-contentFilter-plugin-1.8.1\target\classes\org\jivesoftware\openfire\plugin\contentFilter\contentfilter_002dprops_002dedit_002dform_jsp.java]
The package org.jivesoftware.openfire.plugin.contentFilter collides with a type
contentfilter_002dprops_002dedit_002dform_jsp.java
/*
* Generated by the Jasper component of Apache Tomcat
* Version: JspC/ApacheTomcat8
* Generated at: 2023-10-23 10:23:58 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.jivesoftware.openfire.plugin.contentFilter;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.user.*;
import org.jivesoftware.openfire.plugin.ContentFilterPlugin;
import org.jivesoftware.util.*;
import java.util.regex.Pattern;
public final class contentfilter_002dprops_002dedit_002dform_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent,
org.apache.jasper.runtime.JspSourceImports {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
static {
_jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(3);
_jspx_dependants.put("jar:file:/C:/Users/Admin/.m2/repository/org/apache/taglibs/taglibs-standard-impl/1.2.5/taglibs-standard-impl-1.2.5.jar!/META-INF/fmt.tld", Long.valueOf(1425949870000L));
_jspx_dependants.put("file:/C:/Users/Admin/.m2/repository/org/apache/taglibs/taglibs-standard-impl/1.2.5/taglibs-standard-impl-1.2.5.jar", Long.valueOf(1696919848625L));
_jspx_dependants.put("jar:file:/C:/Users/Admin/.m2/repository/org/apache/taglibs/taglibs-standard-impl/1.2.5/taglibs-standard-impl-1.2.5.jar!/META-INF/c.tld", Long.valueOf(1425949870000L));
}
.....
To build plugins for Openfire 4.3.0 pom.xml should include repositories tags pointing to Archiva. If plugin has pages in Admin Console, web.xml should also be added.
For references:
igniterealtime/openfire-clientControl-plugin#11
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.