Makefile fixes; adding DiscordBridge whitelist
This commit is contained in:
parent
d39ed670cc
commit
11da27e0c4
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
raven.mono
|
||||
theraven-*.tar.xz
|
||||
pkg/
|
||||
src/
|
||||
.config
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections.Generic;
|
||||
using AniNIX.Shared;
|
||||
|
||||
@ -13,6 +14,9 @@ namespace AniNIX.TheRaven {
|
||||
public string target { get; protected set; }
|
||||
public string message { get; protected set; }
|
||||
|
||||
// Adding whitelist for default Discord-Bridge config
|
||||
private string _discordRegex = "\\<.+\\>\\s+";
|
||||
|
||||
public IRCServerMessage(String serverString) {
|
||||
incomingIRCString = serverString.Trim();
|
||||
try {
|
||||
@ -23,6 +27,7 @@ namespace AniNIX.TheRaven {
|
||||
messageL.RemoveAt(0);
|
||||
messageL.RemoveAt(0);
|
||||
message = String.Join(":",messageL.ToArray());
|
||||
message = Regex.Replace(message,_discordRegex,"");
|
||||
if (bySpace[0].Contains("!")) {
|
||||
String[] byExclamation = bySpace[0].Split('!');
|
||||
user = byExclamation[0];
|
||||
|
10
Makefile
10
Makefile
@ -1,11 +1,8 @@
|
||||
CONFDIR = ${pkgdir}/usr/local/etc/TheRaven
|
||||
INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | /bin/bash
|
||||
|
||||
compile: clean ./chatbot-support.bash ./math-support.bash /usr/sbin/pb
|
||||
mkdir -p ${pkgdir}/usr/local/src/
|
||||
if [ ! -d ${pkgdir}/usr/local/src/SharedLibraries ]; then git -C ${pkgdir}/usr/local/src/ clone https://aninix.net/foundation/SharedLibraries; fi
|
||||
git -C ${pkgdir}/usr/local/src/SharedLibraries pull
|
||||
(mcs -out:raven.mono ${pkgdir}/usr/local/src/SharedLibraries/CSharp/*.csharp *.csharp Raven.csharp 2>&1 | grep -v CS2002); printf ""
|
||||
(mcs -out:raven.mono /opt/aninix/SharedLibraries/CSharp/*.csharp *.csharp Raven.csharp 2>&1 | grep -v CS2002); printf ""
|
||||
|
||||
clean:
|
||||
for i in raven.mono; do if [ -f $$i ]; then rm $$i; fi; done
|
||||
@ -13,12 +10,13 @@ clean:
|
||||
test: compile
|
||||
script -c "mono ./raven.mono -c raven-test.conf -v" ${pkgdir}/tmp/raven-test.log
|
||||
|
||||
install: compile
|
||||
install: compile /usr/sbin/pwgen
|
||||
mkdir -p ${pkgdir}/opt
|
||||
cp raven.mono ${pkgdir}/opt/raven.mono
|
||||
if [ ! -d ${CONFDIR} ]; then mkdir -p ${CONFDIR}; cp sample-confs/* ${CONFDIR}; fi
|
||||
# Hook to deprivilege bot
|
||||
if ! getent passwd raven; then useradd -M -G git,ircd,api -d ${CONFDIR} raven; fi
|
||||
if ! getent passwd raven; then useradd -M -G git,ircd,api -d ${CONFDIR} raven; fi
|
||||
echo "raven:$$(/usr/sbin/pwgen 24 1)" | chpasswd;
|
||||
make checkperm
|
||||
# Hook for Heartbeat
|
||||
if [ -f ${pkgdir}/usr/local/etc/Heartbeat/services.list ] && [ `grep -c TheRaven ${pkgdir}/usr/local/etc/Heartbeat/services.list` -eq 0 ]; then echo "" >> ${pkgdir}/usr/local/etc/Heartbeat/services.list; fi
|
||||
|
Loading…
Reference in New Issue
Block a user