diff --git a/.gitignore b/.gitignore index 58c8800..ad17873 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build build.properties target ssl/ +src/main/java/net/socialgamer/cah/util/RealShadowBannedStringProvider.java diff --git a/WebContent/privacy.html b/WebContent/privacy.html index 52cb2d7..a5041e3 100644 --- a/WebContent/privacy.html +++ b/WebContent/privacy.html @@ -12,9 +12,18 @@ pretendyoure.xzy/zy domain. Other servers may have other logging policies.
There are two kinds of temporary logs.
+Logs which contain your chosen user name and IP address (and, on rare occasion, things you say in chat) are collected and kept for a period of a few weeks, to assist with monitoring the server. -These logs are never shared with anybody.
+These logs are not willingly shared with third parties, and to date have not been shared with third +parties. +If the automatic moderating software takes action against you, your user name, IP address, and +the chat message that triggered said action are logged. These logs are retained for approximately +one month for evaluating the performance of the automatic moderation. These logs are not willingly +shared with third parties, and to date have not been shared with third parties. You may not +be informed that the automatic moderating software has taken action against you.
Game play details are kept on a permanent basis, to analyze which cards are the most and least popular. The data in these logs may be made publicly available once an interface is completed, and @@ -35,8 +44,8 @@ tracked between multiple sessions.
At no point is your IP address, chosen user name, or chat logged permanently or shared -with anyone for any purpose. Fill-in-the-blank card text is, however, logged.
+At no point is your IP address, chosen user name, or chat shared with anyone for any +purpose. Fill-in-the-blank card text is, however, logged and shared.
Yeah, who doesn't use that these days? I honestly don't look at it very often. It's cool to see
where people are getting linked to this from. You can block it if you really want to, but I'd prefer
diff --git a/build.properties.example b/build.properties.example
index 31ef294..6e12452 100644
--- a/build.properties.example
+++ b/build.properties.example
@@ -11,9 +11,13 @@ pyx.id_code_salt=
# comma-separated listed of IP addresses (v4 or v6) from which users are considered admins.
pyx.admin_addrs=127.0.0.1,::1
-# comma-separated list of strings that will cause a chat message to get silently dropped without
-# notifying the user. does not currently permanently shadowban the user, but maybe it should...
-pyx.shadowban_strings=
+# The name of a class that implements net.socialgamer.cah.util.ChatFilter.ShadowBannedStringProvider
+# which will then be called to get the shadowbanned strings.
+# Ideally we'd just have the list of strings here, but providing unicode characters directly gets
+# mangled during the build process, and for some reason unicode escapes were not being loaded
+# properly at runtime.
+# If this is blank, it is ignored and no strings will cause such filtering to occur.
+pyx.shadowban_strings_provider=
# Settings for global chat protection. Some of these do not apply to game chats.
# Ratio of 'basic' characters to length of message. Basic characters are defined by
# Character.isJavaIdentifierPart, which stipulates:
diff --git a/src/main/filtered-resources/WEB-INF/pyx.properties b/src/main/filtered-resources/WEB-INF/pyx.properties
index 7192eb9..2eec093 100644
--- a/src/main/filtered-resources/WEB-INF/pyx.properties
+++ b/src/main/filtered-resources/WEB-INF/pyx.properties
@@ -6,7 +6,8 @@ pyx.server.broadcast_connects_and_disconnects=${pyx.broadcast_connects_and_disco
pyx.server.global_chat_enabled=${pyx.global_chat_enabled}
pyx.server.id_code_salt=${pyx.id_code_salt}
pyx.server.admin_addrs=${pyx.admin_addrs}
-pyx.chat.shadowban_strings=${pyx.shadowban_strings}
+# changing this at runtime has no effect
+pyx.chat.shadowban_strings_provider=${pyx.shadowban_strings_provider}
pyx.chat.global.flood_count=${pyx.global.flood_count}
pyx.chat.global.flood_time=${pyx.global.flood_time}
pyx.chat.global.basic_ratio=${pyx.global.basic_ratio}
diff --git a/src/main/java/net/socialgamer/cah/util/ChatFilter.java b/src/main/java/net/socialgamer/cah/util/ChatFilter.java
index 7a23189..09c0533 100644
--- a/src/main/java/net/socialgamer/cah/util/ChatFilter.java
+++ b/src/main/java/net/socialgamer/cah/util/ChatFilter.java
@@ -36,7 +36,6 @@ import java.util.regex.Pattern;
import org.apache.log4j.Logger;
-import com.google.common.collect.ImmutableSet;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
@@ -60,7 +59,8 @@ public class ChatFilter {
private static final int DEFAULT_SPACES_REQUIRED = 3;
private static final int DEFAULT_CAPSLOCK_MIN_MSG_LENGTH = 50;
private static final double DEFAULT_CAPSLOCK_RATIO = .5;
- private static final String DEFAULT_SHADOWBAN_CHARACTERS = "";
+ public static final String DEFAULT_SHADOWBAN_PROVIDER = DefaultShadowBannedStringsProvider.class
+ .getCanonicalName();
public static final Pattern SIMPLE_MESSAGE_PATTERN = Pattern
.compile("^[a-zA-Z0-9 _\\-=+*()\\[\\]\\\\/|,.!:'\"`~#]+$");
@@ -189,8 +189,17 @@ public class ChatFilter {
}
private Set