Este commit está contenido en:
Your Name
2020-07-03 11:49:11 +00:00
padre 48621bb2ed
commit 52d607ee8e
Se han modificado 547 ficheros con 37750 adiciones y 36525 borrados

Ver fichero

@@ -5,9 +5,6 @@ services:
image: metasploitframework/metasploit-framework:latest image: metasploitframework/metasploit-framework:latest
hostname: ms hostname: ms
container_name: ms container_name: ms
# entrypoint:
# - /bin/sleep
# - 1d
environment: environment:
DATABASE_URL: postgres://msf:msf@db-ms:5432/msf DATABASE_URL: postgres://msf:msf@db-ms:5432/msf
stdin_open: true stdin_open: true

Ver fichero

@@ -5,6 +5,7 @@
# opendkim-genkey -b 2048 -h rsa-sha256 -r -s dkim -d hatthieves.es -v # opendkim-genkey -b 2048 -h rsa-sha256 -r -s dkim -d hatthieves.es -v
DOMAIN="hatthieves.es" DOMAIN="hatthieves.es"
DOMAIN2="hatthieves.com" DOMAIN2="hatthieves.com"
DOMAIN3="hatthieves.co"
IP=82.223.3.135 IP=82.223.3.135
IPV6=2001:ba0:1800:80e0::1 IPV6=2001:ba0:1800:80e0::1
DKIM=$(sed -e 's/"/\"/g' /etc/bind/dkim.txt) DKIM=$(sed -e 's/"/\"/g' /etc/bind/dkim.txt)
@@ -115,6 +116,15 @@ zone \"$DOMAIN2\" {
}; };
}; };
zone \"$DOMAIN3\" {
type master;
file \"/etc/bind/$DOMAIN3.signed\";
allow-update {
key \"$DOMAIN3.\";
key \"_acme-challenge.$DOMAIN3.\";
};
};
zone \"$(ipv6calc -q -a $IP | sed -e 's/^[[:digit:]]\+\.//' -e 's/\.$//')\" { zone \"$(ipv6calc -q -a $IP | sed -e 's/^[[:digit:]]\+\.//' -e 's/\.$//')\" {
type master; type master;
file \"/etc/bind/rev.$(ipv6calc -q -a $IP | sed -e 's/^[[:digit:]]\+\.//' -e 's/\.$//')\"; file \"/etc/bind/rev.$(ipv6calc -q -a $IP | sed -e 's/^[[:digit:]]\+\.//' -e 's/\.$//')\";
@@ -186,6 +196,11 @@ key \"_acme-challenge.$DOMAIN.\" {
key \"_acme-challenge.$DOMAIN2.\" { key \"_acme-challenge.$DOMAIN2.\" {
algorithm hmac-sha512; algorithm hmac-sha512;
secret \"JlCDMOnkKuNHSiDi6GnxurCwGpnw85NngKogSqKjSU+cvb8RJSQEZekkfW88hZIPUf0cY+Td9c2SttUL05xQEw==\"; secret \"JlCDMOnkKuNHSiDi6GnxurCwGpnw85NngKogSqKjSU+cvb8RJSQEZekkfW88hZIPUf0cY+Td9c2SttUL05xQEw==\";
};
key \"_acme-challenge.$DOMAIN3.\" {
algorithm hmac-sha512;
secret \"Au4vHdNujqmk9p77UvMIYydOgj4vFCioan7RFBprqtepjohr9eVFN6wMcvYR3HKFLWv0ZW7YZoFZmHFKtiaUKA==\";
};"> /etc/bind/named.conf.options };"> /etc/bind/named.conf.options
echo -e "; echo -e ";
; BIND data for $DOMAIN2 ; BIND data for $DOMAIN2
@@ -212,6 +227,31 @@ $DKIM2
\$INCLUDE K$DOMAIN2.+008+61170.key \$INCLUDE K$DOMAIN2.+008+61170.key
\$INCLUDE K$DOMAIN2.+008+28449.key \$INCLUDE K$DOMAIN2.+008+28449.key
\$INCLUDE K_acme-challenge.$DOMAIN2.+165+29132.key"> /etc/bind/$DOMAIN2 \$INCLUDE K_acme-challenge.$DOMAIN2.+165+29132.key"> /etc/bind/$DOMAIN2
echo -e ";
; BIND data for $DOMAIN3
;
\$TTL 3h
@ IN SOA ns1.$DOMAIN3. admin.$DOMAIN3. (
$(date +%Y%m%d)$(cat /etc/bind/version) ; SERIAL
3h ; Refresh
1h ; Retry
1w ; Expire
1h ) ; Minimum
;
@ IN NS ns1.$DOMAIN.
@ IN NS ns2.$DOMAIN.
$DOMAIN3. IN A $IP
$DOMAIN3. IN AAAA $IPV6
* IN CNAME $DOMAIN3.
$DOMAIN3. IN MX 10 mail.$DOMAIN3.
$DOMAIN3. IN TXT \"v=spf1 ip4:172.200.0.0/24 a mx -all\"
_dmarc IN TXT \"v=DMARC1;p=reject;rua=mailto:postmaster@$DOMAIN;pct=100;ruf=mailto:postmaster@$DOMAIN;sp=reject;aspf=s;adkim=s;ri=86400;fo=0;rf=afrf\"
$DKIM3
\$INCLUDE K$DOMAIN3.+008+03409.key
\$INCLUDE K$DOMAIN3.+008+09300.key
\$INCLUDE K_acme-challenge.$DOMAIN3.+165+22537.key"> /etc/bind/$DOMAIN3
COUNT=$(echo $(cat /etc/bind/version)"+1" | bc) COUNT=$(echo $(cat /etc/bind/version)"+1" | bc)
echo $COUNT > /etc/bind/version echo $COUNT > /etc/bind/version
mkdir /run/named mkdir /run/named
@@ -220,4 +260,5 @@ chown 101.101 -R /run/named
cd /etc/bind cd /etc/bind
dnssec-signzone -A -3 $(head -c 1000 /dev/urandom | sha1sum | cut -b 1-16) -N INCREMENT $DOMAIN dnssec-signzone -A -3 $(head -c 1000 /dev/urandom | sha1sum | cut -b 1-16) -N INCREMENT $DOMAIN
dnssec-signzone -P -A -3 $(head -c 1000 /dev/urandom | sha1sum | cut -b 1-16) -N INCREMENT $DOMAIN2 dnssec-signzone -P -A -3 $(head -c 1000 /dev/urandom | sha1sum | cut -b 1-16) -N INCREMENT $DOMAIN2
dnssec-signzone -P -A -3 $(head -c 1000 /dev/urandom | sha1sum | cut -b 1-16) -N INCREMENT $DOMAIN3
named -c named.conf -g -u bind named -c named.conf -g -u bind

Ver fichero

@@ -2,7 +2,7 @@ version: '2'
services: services:
elasticsearch: elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0 image: docker.elastic.co/elasticsearch/elasticsearch:7.7.1
hostname: elasticsearch hostname: elasticsearch
container_name: elasticsearch container_name: elasticsearch
restart: always restart: always
@@ -10,6 +10,10 @@ services:
- node.name=elastic - node.name=elastic
- cluster.name=cluster01 - cluster.name=cluster01
- cluster.initial_master_nodes=elastic - cluster.initial_master_nodes=elastic
- cluster.routing.allocation.disk.threshold_enabled=false
- cluster.routing.allocation.disk.watermark.flood_stage=1%
- cluster.routing.allocation.disk.watermark.high=1%
- cluster.routing.allocation.disk.watermark.low=0%
- bootstrap.memory_lock=true - bootstrap.memory_lock=true
- ES_JAVA_OPTS=-Xms1g -Xmx1g - ES_JAVA_OPTS=-Xms1g -Xmx1g
ulimits: ulimits:
@@ -27,7 +31,7 @@ services:
ipv4_address: 172.1.0.101 ipv4_address: 172.1.0.101
kibana: kibana:
image: docker.elastic.co/kibana/kibana:7.7.0 image: docker.elastic.co/kibana/kibana:7.7.1
hostname: kibana hostname: kibana
container_name: kibana container_name: kibana
restart: always restart: always
@@ -41,7 +45,7 @@ services:
ipv4_address: 172.1.0.102 ipv4_address: 172.1.0.102
logstash: logstash:
image: docker.elastic.co/logstash/logstash:7.7.0 image: docker.elastic.co/logstash/logstash:7.7.1
hostname: logstash hostname: logstash
container_name: logstash container_name: logstash
restart: always restart: always
@@ -60,7 +64,7 @@ services:
ipv4_address: 172.1.0.103 ipv4_address: 172.1.0.103
# filebeat: # filebeat:
# image: docker.elastic.co/beats/filebeat:7.7.0 # image: docker.elastic.co/beats/filebeat:7.7.1
# hostname: filebeat # hostname: filebeat
# container_name: filebeat # container_name: filebeat
# restart: always # restart: always

Ver fichero

@@ -1,4 +1,5 @@
version: "2.3" version: "2"
services: services:
wildduck: wildduck:
build: ./wildduck build: ./wildduck
@@ -13,14 +14,18 @@ services:
- "587:587" - "587:587"
- "993:993" - "993:993"
expose: expose:
- 25
- 80 - 80
- 12080 - 12080
volumes: volumes:
- ./entrypoint.sh:/entrypoint.sh:ro - ./entrypoint.sh:/entrypoint.sh:ro
- /opt/docker/secure:/secure:ro - /opt/docker/secure:/secure:ro
- ./wildduck/config:/wildduck/config - ./wildduck/config:/wildduck/config:ro
- ./wildduck-mta/config:/wildduck-mta/config - ./wildduck-mta/config:/wildduck-mta/config:ro
- ./haraka/config:/haraka/config - ./haraka/config:/haraka/config:ro
- ./attachments:/home/node/attachments
- ./zonemta-wildduck.js:/wildduck-mta/plugins/zonemta-wildduck.js:ro
- ./maildropper.js:/wildduck/lib/maildropper.js:ro
depends_on: depends_on:
- redis - redis
- mongo - mongo
@@ -67,9 +72,12 @@ services:
expose: expose:
- 3000 - 3000
volumes: volumes:
- ./webmail/config:/webmail/config - ./webmail/config:/webmail/config:ro
- ./webmail/views:/webmail/views - ./webmail/views/index.hbs:/webmail/views/index.hbs:ro
- ./webmail/logo.png:/webmail/public/logo.png - ./webmail/views/layout.hbs:/webmail/views/layout.hbs:ro
- ./webmail/views/layout-popup.hbs:/webmail/views/layout-popup.hbs:ro
- ./webmail/views/layout-webmail.hbs:/webmail/views/layout-webmail.hbs:ro
- ./webmail/logo.png:/webmail/public/logo.png:ro
depends_on: depends_on:
- redis - redis
- mongo - mongo

Ver fichero

@@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
sudo service rspamd start sudo service rspamd start
cd /haraka cd /haraka
node haraka.js & NODE_ENV=production node haraka.js &
cd /wildduck cd /wildduck
node server.js & NODE_ENV=production node server.js &
cd /wildduck-mta cd /wildduck-mta
npm start --production & NODE_ENV=production npm start &
/bin/sleep infinity /bin/sleep infinity

Ver fichero

@@ -3,7 +3,7 @@ reject_all=false
single_recipient=true single_recipient=true
empty_return_path=true empty_return_path=true
bad_rcpt=true bad_rcpt=true
bounce_spf=true bounce_spf=false
non_local_msgid=true non_local_msgid=true
[reject] [reject]

Ver fichero

@@ -2,4 +2,4 @@ disabled = false
selector=dkim selector=dkim
domain=hatthieves.es domain=hatthieves.es
headers_to_sign=From, Sender, Reply-To, Subject, Date, Message-ID, To, Cc, MIME-Version headers_to_sign=From, Sender, Reply-To, Subject, Date, Message-ID, To, Cc, MIME-Version
dkim.private.key = /secure/dkim_private.key dkim.private.key=/../../secure/dkim_private.key

Ver fichero

@@ -1,17 +1,17 @@
; disable checks or reject for each test if you are worried about strictness ; disable checks or reject for each test if you are worried about strictness
;dns_timeout=30 dns_timeout=30
[check] [check]
; match_re=true ; match_re=true
bare_ip=true ; bare_ip=false
; dynamic=true ; dynamic=true
; big_company=true ; big_company=true
; literal_mismatch: 1 = exact IP match, 2 = IP/24 match, 3 = /24 or RFC1918 ; literal_mismatch: 1 = exact IP match, 2 = IP/24 match, 3 = /24 or RFC1918
; literal_mismatch=2 ; literal_mismatch=2
valid_hostname=true valid_hostname=true
forward_dns=true ; forward_dns=true
rdns_match=true ; rdns_match=true
; host_mismatch: hostname differs between EHLO invocations ; host_mismatch: hostname differs between EHLO invocations
host_mismatch=true host_mismatch=true
; proto_mismatch: host sent EHLO but then tries to sent HELO or vice-versa ; proto_mismatch: host sent EHLO but then tries to sent HELO or vice-versa
@@ -22,15 +22,15 @@ host_mismatch=true
; proto_mismatch=false ; proto_mismatch=false
proto_mismatch=true proto_mismatch=true
; rdns_match=false ; rdns_match=false
rdns_match=true rdns_match=false
; dynamic=false ; dynamic=false
; bare_ip=false ; bare_ip=false
bare_ip=true bare_ip=false
; literal_mismatch=false ; literal_mismatch=false
; valid_hostname=false ; valid_hostname=false
valid_hostname=true valid_hostname=true
; forward_dns=false ; forward_dns=false
forward_dns=true ; forward_dns=true
; big_company=true ; big_company=true
[skip] [skip]

Ver fichero

@@ -1,4 +1,4 @@
timeout=30 timeout=30
allow_mx_ip=0 allow_mx_ip=0
reject_no_mx=1 reject_no_mx=1
re_bogus_ip=^(?:0\.0\.0\.0|255\.255\.255\.255|127\.) re_bogus_ip=^(?:0\.0\.0\.0|255\.255\.255\.255|127\.|172\.)

Ver fichero

@@ -10,7 +10,7 @@ user=
; password ; password
pass= pass=
; host ; host
host=127.0.0.1 host=172.200.0.103
; port ; port
port=27017 port=27017
; database name ; database name
@@ -23,7 +23,7 @@ delivery=email_delivery_results
; Absolute path to store attachments ; Absolute path to store attachments
[attachments] [attachments]
path=/home/node/Haraka/attachments path=/home/node/attachments
[enable] [enable]
queue=yes queue=yes

Ver fichero

@@ -8,10 +8,12 @@
; uncomment to disable tls for outbound mail ; uncomment to disable tls for outbound mail
; enable_tls=false ; enable_tls=false
enable_tls=true
; maxTempFailures (default: 13) ; maxTempFailures (default: 13)
; ipv6_enabled (default: false) ; ipv6_enabled (default: false)
ipv6_enabled=true
; load_pid_queue ; load_pid_queue
; flush_queue ; flush_queue
@@ -24,7 +26,9 @@
; pool_timeout: default : 300 ; pool_timeout: default : 300
; pool_timeout=0 ; pool_timeout=0
pool_timeout=30
; pool_concurrency_max: default: 10 ; pool_concurrency_max: default: 10
; set to zero to disable pools ; set to zero to disable pools
; pool_concurrency_max=0 ; pool_concurrency_max=0
pool_concurrency_max=20

Ver fichero

@@ -24,6 +24,7 @@ access
# block mails from known bad hosts (see config/dnsbl.zones for the DNS zones queried) # block mails from known bad hosts (see config/dnsbl.zones for the DNS zones queried)
#dnsbl #dnsbl
redis redis
#mongodb
# HELO # HELO
#early_talker #early_talker
@@ -76,3 +77,4 @@ queue/lmtp
#watch #watch
wildduck wildduck

Ver fichero

@@ -1,6 +1,6 @@
; address to listen on (default: all IPv6 and IPv4 addresses, port 25) ; address to listen on (default: all IPv6 and IPv4 addresses, port 25)
; use "[::0]:25" to listen on IPv6 and IPv4 (not all OSes) ; use "[::0]:25" to listen on IPv6 and IPv4 (not all OSes)
; listen=[::0]:25 listen=[::0]:25
; Note you can listen on multiple IPs/ports using commas: ; Note you can listen on multiple IPs/ports using commas:
;listen=127.0.0.1:2529,127.0.0.2:2529,127.0.0.3:2530 ;listen=127.0.0.1:2529,127.0.0.2:2529,127.0.0.3:2530
@@ -24,7 +24,7 @@ public_ip=82.223.3.135
; Run using cluster to fork multiple backend processes ; Run using cluster to fork multiple backend processes
;nodes=cpus ;nodes=cpus
nodes=4 nodes=6
; Daemonize ; Daemonize
;daemonize=true ;daemonize=true

Ver fichero

@@ -29,6 +29,6 @@ ciphers=ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-G
; no_tls_hosts - disable TLS for servers with broken TLS. ; no_tls_hosts - disable TLS for servers with broken TLS.
[no_tls_hosts] [no_tls_hosts]
; 127.0.0.1 127.0.0.1
; 192.168.1.1 ; 192.168.1.1
; 172.16.0.0/16 ; 172.16.0.0/16

Ver fichero

@@ -49,7 +49,7 @@ sender:
srs: srs:
# must be shared with ZoneMTA SRS config, otherwise messages sent from ZoneMTA are not recognized by Haraka # must be shared with ZoneMTA SRS config, otherwise messages sent from ZoneMTA are not recognized by Haraka
secret: 'asecretcat' secret: 'a secret hat'
attachments: attachments:
type: 'gridstore' type: 'gridstore'

Ver fichero

@@ -3,6 +3,5 @@ RUN apt update && apt -y install git python make sudo
RUN git clone https://github.com/nodemailer/wildduck-webmail /webmail RUN git clone https://github.com/nodemailer/wildduck-webmail /webmail
RUN chown node.node -R /webmail RUN chown node.node -R /webmail
WORKDIR /webmail WORKDIR /webmail
RUN git checkout 5c54625a8b192823184ba7f5da41f3414e76db94 RUN sudo -u node npm i
RUN sudo -u node npm install
RUN sudo -u node npm run bowerdeps RUN sudo -u node npm run bowerdeps

Ver fichero

@@ -15,6 +15,7 @@ title="Wild Duck Mail - HatThieves.es"
enableSpecial=true # if true the allow creating addresses with special usernames enableSpecial=true # if true the allow creating addresses with special usernames
# allowed domains for new addresses # allowed domains for new addresses
domains=["hatthieves.es"] domains=["hatthieves.es"]
generalNotification=""
[api] [api]
# url="http://127.0.0.1:8080" # url="http://127.0.0.1:8080"
@@ -53,7 +54,7 @@ title="Wild Duck Mail - HatThieves.es"
[u2f] [u2f]
# set to false if not using HTTPS # set to false if not using HTTPS
enabled=false enabled=true
# must be https url or use default # must be https url or use default
#appId="https://127.0.0.1:8080" #appId="https://127.0.0.1:8080"
appId="https://webmail.hatthieves.es" appId="https://webmail.hatthieves.es"

Ver fichero

@@ -19,48 +19,57 @@
<div class="panel-body"> <div class="panel-body">
<p> <p>
If enabled then an autoreply message is sent to all incoming messages. If a contact sends multiple messages then the autoreply is sent at most once in every four hours. If enabled then an autoreply message is sent to all incoming messages. If a contact sends
multiple messages then the autoreply is sent at most once in every four hours.
</p> </p>
<div class="radio"> <div class="radio">
<label> <label>
<input type="radio" name="status" value="false" {{#unless values.status}}checked{{/unless}}> <input type="radio" name="status" value="false"
Autoreply is {{#unless values.status}}<span class="label label-default">disabled</span>{{else}}disabled{{/unless}} {{#unless values.status}}checked{{/unless}}>
Autoreply is {{#unless values.status}}<span
class="label label-default">disabled</span>{{else}}disabled{{/unless}}
</label> </label>
</div> </div>
<div class="radio"> <div class="radio">
<label> <label>
<input type="radio" name="status" value="true" {{#if values.status}}checked{{/if}}> <input type="radio" name="status" value="true" {{#if values.status}}checked{{/if}}>
Autoreply is {{#if values.status}}<span class="label label-info">enabled</span>{{else}}enabled{{/if}} Autoreply is {{#if values.status}}<span
class="label label-info">enabled</span>{{else}}enabled{{/if}}
</label> </label>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="name">Name</label> <label for="name">Name</label>
<input type="text" class="form-control" id="name" name="name" value="{{values.name}}" placeholder="Sender name in the autoreply From: header"> <input type="text" class="form-control" id="name" name="name" value="{{values.name}}"
placeholder="Sender name in the autoreply From: header">
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="subject">Subject</label> <label for="subject">Subject</label>
<input type="text" class="form-control" id="subject" name="subject" value="{{values.subject}}" placeholder="Leave blank to use the default subject"> <input type="text" class="form-control" id="subject" name="subject"
value="{{values.subject}}" placeholder="Leave blank to use the default subject">
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="daterange">Time</label> <label for="daterange">Time</label>
<div class="form-group-sm daterangeElm" style="position: relative"> <div class="form-group-sm daterangeElm" style="position: relative">
<input type="text" id="daterange" class="form-control" value=""> <input type="text" id="daterange" class="form-control" value="">
<i class="glyphicon glyphicon-calendar fa fa-calendar" style="position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;"></i> <i class="glyphicon glyphicon-calendar fa fa-calendar"
style="position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;"></i>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="message">Message</label> <label for="message">Message</label>
<textarea class="form-control" name="text" value="{{values.text}}" rows="3">{{values.text}}</textarea> <textarea class="form-control" name="text" value="{{values.text}}"
rows="3">{{values.text}}</textarea>
</div> </div>
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> Update</button> <button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-wrench"
aria-hidden="true"></span> Update</button>
</div> </div>
</div> </div>
@@ -73,8 +82,11 @@
</div> </div>
<script> <script>
const startValue = (document.getElementById('start').value || '').trim();
const endValue = (document.getElementById('end').value || '').trim();
document.addEventListener("DOMContentLoaded", function (event) { document.addEventListener("DOMContentLoaded", function (event) {
$('#daterange').daterangepicker({ const rangeOptions = {
"showDropdowns": true, "showDropdowns": true,
"showISOWeekNumbers": true, "showISOWeekNumbers": true,
"timePicker": true, "timePicker": true,
@@ -116,16 +128,18 @@
"firstDay": 1 "firstDay": 1
}, },
{{#if values.start}}
"startDate": moment("{{values.start}}").format('DD/MM/YYYY HH:mm'),
{{/if}}
{{#if values.end}}
"endDate": moment("{{values.end}}").format('DD/MM/YYYY HH:mm'),
{{/if}}
"alwaysShowCalendars": true "alwaysShowCalendars": true
}, function(start, end, label) { }
if (startValue) {
rangeOptions.startDate = moment(startValue).format('DD/MM/YYYY HH:mm')
}
if (endValue) {
rangeOptions.endDate = moment(endValue).format('DD/MM/YYYY HH:mm')
}
$('#daterange').daterangepicker(rangeOptions, function (start, end, label) {
document.getElementById('start').value = start.valueOf(); document.getElementById('start').value = start.valueOf();
document.getElementById('end').value = end.valueOf(); document.getElementById('end').value = end.valueOf();
document.getElementById('daterange').value = start.format('DD/MM/YYYY HH:mm') + ' ' + end.format('DD/MM/YYYY HH:mm'); document.getElementById('daterange').value = start.format('DD/MM/YYYY HH:mm') + ' ' + end.format('DD/MM/YYYY HH:mm');
@@ -135,8 +149,8 @@
$(this).parent().find('input').click(); $(this).parent().find('input').click();
}); });
{{#if values.start}} if (startValue && endValue) {
document.getElementById('daterange').value = moment("{{values.start}}").format('DD/MM/YYYY HH:mm') + ' ' + moment("{{values.end}}").format('DD/MM/YYYY HH:mm'); document.getElementById('daterange').value = moment(startValue).format('DD/MM/YYYY HH:mm') + ' ' + moment(endValue).format('DD/MM/YYYY HH:mm');
{{/if}} }
}); });
</script> </script>

Ver fichero

@@ -6,7 +6,8 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">Account configuration</h3></div> <h3 class="panel-title">Account configuration</h3>
</div>
<div class="panel-body"> <div class="panel-body">
<p> <p>
Use the following configuration for your desktop email client. Use the following configuration for your desktop email client.
@@ -145,6 +146,14 @@
<th> <th>
Password Password
</th> </th>
{{#if use2fa}}
<td colspan="3">
Two factor authentication is enabled on your account.
Generate application specific passwords <a
href="https://mailtest-01.tahvel.info/account/security/asps">here</a> to use IMAP, POP3 and
SMTP.
</td>
{{else}}
<td> <td>
******** ********
</td> </td>
@@ -154,6 +163,7 @@
<td> <td>
******** ********
</td> </td>
{{/if}}
</tr> </tr>
</tbody> </tbody>
</table> </table>

Ver fichero

@@ -1,3 +1,4 @@
<script> <script>
window.location.href = "https://webmail.hatthieves.es/account/login"; window.location.href = "/account/login";
</script> </script>

Ver fichero

@@ -29,6 +29,12 @@
{{flash_messages}} {{flash_messages}}
</div> </div>
{{#if generalNotification}}
<div class="panel panel-warning">
<div class="panel-heading">{{{generalNotification}}}</div>
</div>
{{/if}}
<div class="container"> <div class="container">
<div class="form-popup"> <div class="form-popup">
@@ -40,7 +46,8 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted">&copy; 2019 <a href="/">{{serviceName}}</a>. <a href="mailto:info@{{serviceDomain}}">info@{{serviceDomain}}</a>. </p> <p class="text-muted">&copy; 2020 <a href="/">{{serviceName}}</a>. <a
href="mailto:info@{{serviceDomain}}">info@{{serviceDomain}}</a>. </p>
</div> </div>
</footer> </footer>

Ver fichero

@@ -23,14 +23,16 @@
</div> </div>
<div style="margin: 10px 0 10px 0;" class="text-center"> <div style="margin: 10px 0 10px 0;" class="text-center">
<a href="/webmail/send" style="width: 100%" class="btn btn-default"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span> Compose message</a> <a href="/webmail/send" style="width: 100%" class="btn btn-default"><span
class="glyphicon glyphicon-edit" aria-hidden="true"></span> Compose message</a>
</div> </div>
<ul class="nav nav-sidebar"> <ul class="nav nav-sidebar">
{{#each mailboxes}} {{#each mailboxes}}
<li id="mailbox-list-{{id}}" {{#if selected}} class="active" {{/if}}> <li id="mailbox-list-{{id}}" {{#if selected}} class="active" {{/if}}>
<a href="/webmail/{{id}}"> <a href="/webmail/{{id}}">
<span class="badge pull-right unseen-counter-{{id}}" {{#if unseen}}style="display: block;"{{else}}style="display: none;"{{/if}}>{{unseen}}</span> <span class="badge pull-right unseen-counter-{{id}}" {{#if unseen}}style="display: block;"
{{else}}style="display: none;" {{/if}}>{{unseen}}</span>
{{{prefix}}} {{{prefix}}}
{{#if icon}} {{#if icon}}
<span class="glyphicon glyphicon-{{icon}}" aria-hidden="true"></span> <span class="glyphicon glyphicon-{{icon}}" aria-hidden="true"></span>
@@ -42,21 +44,31 @@
</li> </li>
{{/each}} {{/each}}
<li style="margin-top: 20px;"> <li style="margin-top: 20px;">
<a href="/webmail/create" class="text-muted"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create folder</a> <a href="/webmail/create" class="text-muted"><span class="glyphicon glyphicon-plus"
aria-hidden="true"></span> Create folder</a>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="webmail-main"> <div class="webmail-main">
{{#if generalNotification}}
<div class="panel panel-warning">
<div class="panel-heading">{{{generalNotification}}}</div>
</div>
{{/if}}
{{{body}}} {{{body}}}
</div> </div>
</div> </div>
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted">&copy; 2019 <a href="/">{{serviceName}}</a>. <a href="mailto:info@{{serviceDomain}}">info@{{serviceDomain}}</a>. </p> <p class="text-muted">&copy; 2020 <a href="/">{{serviceName}}</a>. <a
href="mailto:info@{{serviceDomain}}">info@{{serviceDomain}}</a>. </p>
</div> </div>
</footer> </footer>

Ver fichero

@@ -12,15 +12,24 @@
{{flash_messages}} {{flash_messages}}
</div> </div>
<div class="container"> <div class="container">
{{#if generalNotification}}
<div class="panel panel-warning">
<div class="panel-heading">{{{generalNotification}}}</div>
</div>
{{/if}}
{{{body}}} {{{body}}}
</div> </div>
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted">&copy; 2019 <a href="/">{{serviceName}}</a>. <a href="mailto:info@{{serviceDomain}}">info@{{serviceDomain}}</a>. </p> <p class="text-muted">&copy; 2020 <a href="/">{{serviceName}}</a>. <a
href="mailto:info@{{serviceDomain}}">info@{{serviceDomain}}</a>. </p>
</div> </div>
</footer> </footer>

Ver fichero

@@ -1,3 +1,4 @@
<li role="presentation" class="{{#if accMenuOverview}}active{{/if}}"><a href="/account/">Overview</a></li> <li role="presentation" class="{{#if accMenuOverview}}active{{/if}}"><a href="/account/">Overview</a></li>
<li role="presentation" class="{{#if accMenuProfile}}active{{/if}}"><a href="/account/profile">Profile</a></li> <li role="presentation" class="{{#if accMenuProfile}}active{{/if}}"><a href="/account/profile">Profile</a></li>
<li role="presentation" class="{{#if accMenuIdentities}}active{{/if}}"><a href="/account/identities">Identities</a></li> <li role="presentation" class="{{#if accMenuIdentities}}active{{/if}}"><a href="/account/identities">Identities</a></li>
<li role="presentation" class="{{#if accMenuRestore}}active{{/if}}"><a href="/account/restore">Restore Messages</a></li>

Ver fichero

@@ -121,7 +121,7 @@
<div class="form-group{{#if errors.action_targets}} has-error{{/if}}"> <div class="form-group{{#if errors.action_targets}} has-error{{/if}}">
<label for="action_targets">Forward it to address:</label> <label for="action_targets">Forward it to address:</label>
<input type="text" class="form-control input-sm" name="action_targets" id="action_targets" value="{{values.action_targets}}" placeholder="user@example.com"> <input type="text" class="form-control input-sm" name="action_targets" id="action_targets" value="{{values.action_targets}}" placeholder="user@example.com">
<span class="help-block">Somma separated list of email addresses or URLs</span> <span class="help-block">Comma separated list of email addresses or URLs</span>
{{#if errors.action_targets}} {{#if errors.action_targets}}
<span class="help-block">{{errors.action_targets}}</span> <span class="help-block">{{errors.action_targets}}</span>
{{/if}} {{/if}}

Ver fichero

@@ -1,7 +1,8 @@
<nav class="navbar navbar-default navbar-static-top"> <nav class="navbar navbar-default navbar-static-top">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
@@ -19,7 +20,9 @@
<li {{#if activeWebmail}} class="active" {{/if}}> <li {{#if activeWebmail}} class="active" {{/if}}>
<a href="/webmail/"> <a href="/webmail/">
<span class="glyphicon glyphicon-inbox" aria-hidden="true"></span> Webmail <span class="glyphicon glyphicon-inbox" aria-hidden="true"></span> Webmail
<span class="badge pull-right unseen-counter-{{inboxId}}" {{#if inboxUnseen}}style="display: block;"{{else}}style="display: none;"{{/if}}>{{inboxUnseen}}</span> <span class="badge pull-right unseen-counter-{{inboxId}}"
{{#if inboxUnseen}}style="display: block;" {{else}}style="display: none;"
{{/if}}>{{inboxUnseen}}</span>
</a> </a>
</li> </li>
<li {{#if activeFilters}} class="active" {{/if}}> <li {{#if activeFilters}} class="active" {{/if}}>
@@ -38,7 +41,8 @@
</a> </a>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">
<img src="{{user.gravatar}}" class="profile-image img-circle" width="20" height="20"> <img src="{{user.gravatar}}" class="profile-image img-circle" width="20" height="20">
{{#if user.name}} {{#if user.name}}
@@ -60,7 +64,8 @@
</a> </a>
</li> </li>
<li role="separator" class="divider"></li> <li role="separator" class="divider"></li>
<li><a href="/account/logout"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> Log out</a></li> <li><a href="/account/logout"><span class="glyphicon glyphicon-log-out"
aria-hidden="true"></span> Log out</a></li>
</ul> </ul>
</li> </li>
{{else}} {{else}}

Ver fichero

@@ -1,8 +1,8 @@
<h2 class="sub-header"> <h2 class="sub-header">
{{#if mailbox.editable}} {{#if mailbox.editable}}
<div class="pull-right"> <div class="pull-right">
<a href="/webmail/{{mailbox.id}}/settings" class="btn btn-default"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Settings</a> <a href="/webmail/{{mailbox.id}}/settings" class="btn btn-default"><span class="glyphicon glyphicon-cog"
aria-hidden="true"></span> Settings</a>
</div> </div>
{{/if}} {{/if}}
{{#if mailbox.icon}} {{#if mailbox.icon}}
@@ -19,25 +19,36 @@
<div class="pull-left" style="margin-left: 10px; width: 20px;"> <div class="pull-left" style="margin-left: 10px; width: 20px;">
<input type="checkbox" class="toggle-all" /> <input type="checkbox" class="toggle-all" />
</div> </div>
<div class="pull-left">
<a class="btn btn-default btn-xs {{#if filterUnseen}}active{{/if}}" title="filter unseen"
href="/webmail/{{mailbox.id}}?query={{query}}&amp;unseen={{#if filterUnseen}}false{{else}}true{{/if}}">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
</a>
</div>
<fieldset id="action-toolbar" disabled> <fieldset id="action-toolbar" disabled>
<div class="form-group"> <div class="form-group">
<span style="display: inline-block; width: 10px;"></span>
<button class="btn btn-default btn-xs bulk-mark-seen">Mark as Seen</button> <button class="btn btn-default btn-xs bulk-mark-seen">Mark as Seen</button>
<button class="btn btn-default btn-xs bulk-mark-unseen">Mark as Unseen</button> <button class="btn btn-default btn-xs bulk-mark-unseen">Mark as Unseen</button>
<span style="display: inline-block; width: 10px;"></span> <span style="display: inline-block; width: 10px;"></span>
<button class="btn btn-default btn-xs bulk-delete" data-toggle="modal" data-target="#deleteModal"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete</button> <button class="btn btn-default btn-xs bulk-delete" data-toggle="modal" data-target="#deleteModal"><span
class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete</button>
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"
<span class="glyphicon glyphicon-inbox" aria-hidden="true"></span> Move <span class="caret"></span> aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-inbox" aria-hidden="true"></span> Move <span
class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{{#each mailboxes}} {{#each mailboxes}}
{{#if canMoveTo}} {{#if canMoveTo}}
<li><a href="#" class="bulk-move" data-mailbox="{{id}}" data-mailbox-path="{{path}}" data-toggle="modal" data-target="#moveModal"> <li><a href="#" class="bulk-move" data-mailbox="{{id}}" data-mailbox-path="{{path}}"
data-toggle="modal" data-target="#moveModal">
{{{prefix}}} {{{prefix}}}
{{#if icon}} {{#if icon}}
<span class="glyphicon glyphicon-{{icon}}" aria-hidden="true"></span> <span class="glyphicon glyphicon-{{icon}}" aria-hidden="true"></span>
@@ -51,6 +62,8 @@
</ul> </ul>
</div> </div>
<span style="display: inline-block; width: 10px;"></span>
</div> </div>
</fieldset> </fieldset>
</div> </div>
@@ -64,11 +77,13 @@
<div class="clearfix"></div> <div class="clearfix"></div>
{{#if isTrash}} {{#if isTrash}}
<div class="alert alert-info" style="padding: 5px 15px;" role="alert">Messages in Trash folder are deleted permanently after 30 days</div> <div class="alert alert-info" style="padding: 5px 15px;" role="alert">Messages in Trash folder are deleted permanently
after 30 days</div>
{{/if}} {{/if}}
{{#if isJunk}} {{#if isJunk}}
<div class="alert alert-info" style="padding: 5px 15px;" role="alert">Messages in Junk Mail folder are deleted permanently after 30 days</div> <div class="alert alert-info" style="padding: 5px 15px;" role="alert">Messages in Junk Mail folder are deleted
permanently after 30 days</div>
{{/if}} {{/if}}
<div class="table-responsive"> <div class="table-responsive">
@@ -94,17 +109,22 @@
<nav aria-label="nav"> <nav aria-label="nav">
<ul class="pager"> <ul class="pager">
{{#if previousCursor}} {{#if previousCursor}}
<li class="previous"><a href="/webmail/{{mailbox.id}}?previous={{previousCursor}}&amp;page={{previousPage}}&amp;query={{query}}"><span aria-hidden="true">&larr;</span> Newer</a></li> <li class="previous"><a
href="/webmail/{{mailbox.id}}?previous={{previousCursor}}&amp;page={{previousPage}}&amp;query={{query}}&amp;unseen={{filterUnseen}}"><span
aria-hidden="true">&larr;</span> Newer</a></li>
{{else}} {{else}}
<li class="previous disabled"><a href="#"><span aria-hidden="true">&larr;</span> Newer</a></li> <li class="previous disabled"><a href="#"><span aria-hidden="true">&larr;</span> Newer</a></li>
{{/if}} {{/if}}
<li style="display: inline-block; padding-top: 7px;"> <li style="display: inline-block; padding-top: 7px;">
Page <strong>{{page}}</strong> (<strong>{{startStr}}</strong><strong>{{endStr}}</strong> out of <strong>{{resultsStr}}</strong> messages) Page <strong>{{page}}</strong> (<strong>{{startStr}}</strong><strong>{{endStr}}</strong> out of
<strong>{{resultsStr}}</strong> messages)
</li> </li>
{{#if nextCursor}} {{#if nextCursor}}
<li class="next"><a href="/webmail/{{mailbox.id}}?next={{nextCursor}}&amp;page={{nextPage}}&amp;query={{query}}">Older <span aria-hidden="true">&rarr;</span></a></li> <li class="next"><a
href="/webmail/{{mailbox.id}}?next={{nextCursor}}&amp;page={{nextPage}}&amp;query={{query}}&amp;unseen={{filterUnseen}}">Older
<span aria-hidden="true">&rarr;</span></a></li>
{{else}} {{else}}
<li class="next disabled"><a href="#">Older <span aria-hidden="true">&rarr;</span></a></li> <li class="next disabled"><a href="#">Older <span aria-hidden="true">&rarr;</span></a></li>
{{/if}} {{/if}}
@@ -116,7 +136,8 @@
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="deleteModalLabel">Delete messages</h4> <h4 class="modal-title" id="deleteModalLabel">Delete messages</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@@ -128,7 +149,8 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">No, cancel</button> <button type="button" class="btn btn-default" data-dismiss="modal">No, cancel</button>
<button type="button" class="btn btn-danger bulk-delete-confirm" data-loading-text="Deleting..." >Yes, delete</button> <button type="button" class="btn btn-danger bulk-delete-confirm" data-loading-text="Deleting...">Yes,
delete</button>
</div> </div>
</div> </div>
</div> </div>
@@ -138,7 +160,8 @@
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="moveModalLabel">Move messages</h4> <h4 class="modal-title" id="moveModalLabel">Move messages</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@@ -146,7 +169,8 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">No, cancel</button> <button type="button" class="btn btn-default" data-dismiss="modal">No, cancel</button>
<button type="button" class="btn btn-primary bulk-move-confirm" data-loading-text="Moving..." >Yes, move</button> <button type="button" class="btn btn-primary bulk-move-confirm" data-loading-text="Moving...">Yes,
move</button>
</div> </div>
</div> </div>
</div> </div>

Ver fichero

@@ -9,3 +9,7 @@ redis="redis://172.200.0.102:6379/2"
# Database name for ZoneMTA data in MongoDB. In most cases it should be the same as in the connection string # Database name for ZoneMTA data in MongoDB. In most cases it should be the same as in the connection string
sender="zone-mta" sender="zone-mta"
users="wildduck"
gridfs="wildduck"

Ver fichero

@@ -3,5 +3,8 @@
[default] [default]
maxConnections=5 maxConnections=5
["hatthieves.es"]
maxConnections=20
["gmail.com"] ["gmail.com"]
maxConnections=10 maxConnections=10

Ver fichero

@@ -5,4 +5,4 @@ addMissing=["message-id", "date"]
# If true then delays messages with future Date: headers until that time has arrived # If true then delays messages with future Date: headers until that time has arrived
futureDate=false futureDate=false
# Add X-Originating-IP header # Add X-Originating-IP header
xOriginatingIP=true xOriginatingIP=false

Ver fichero

@@ -2,4 +2,4 @@
enabled=false enabled=false
#enabled="receiver" #enabled="receiver"
# only check authentication for interfaces with following names # only check authentication for interfaces with following names
interfaces=["feeder"] #interfaces=["feeder"]

Ver fichero

@@ -1,13 +1,13 @@
# List local IP addresses that can be used for outbound tcp connections # List local IP addresses that can be used for outbound tcp connections
# Server process must be able to locally bind to these addresses # Server process must be able to locally bind to these addresses
default=["0.0.0.0", "::"] #default=["0.0.0.0", "::"]
# or alternatively, to provide hostnames as well: # or alternatively, to provide hostnames as well:
# #
#[[default]] [[default]]
#address="1.2.3.4" address="0.0.0.0"
#name="ip-1.hostname" name="hatthieves.es"
# #
#[[default]] #[[default]]
#address="1.2.3.5" #address="1.2.3.5"

Ver fichero

@@ -1,6 +1,6 @@
[bounces] [bounces]
preferIPv6=false preferIPv6=false
ignoreIPv6=true ignoreIPv6=true
processes=1 processes=2
connections=2 connections=20
pool="default" pool="default"

Ver fichero

@@ -1,8 +1,8 @@
[default] [default]
preferIPv6=false preferIPv6=false
ignoreIPv6=true ignoreIPv6=true
processes=1 processes=2
connections=5 connections=20
pool="default" pool="default"
# If you want to send messages for this zone to next MTA instead of actual MX, then # If you want to send messages for this zone to next MTA instead of actual MX, then

Ver fichero

@@ -5,7 +5,7 @@ RUN wget -O- https://rspamd.com/apt-stable/gpg.key | apt-key add -
RUN echo "deb [arch=amd64] http://rspamd.com/apt-stable/ stretch main" > /etc/apt/sources.list.d/rspamd.list RUN echo "deb [arch=amd64] http://rspamd.com/apt-stable/ stretch main" > /etc/apt/sources.list.d/rspamd.list
RUN echo "deb-src [arch=amd64] http://rspamd.com/apt-stable/ stretch main" >> /etc/apt/sources.list.d/rspamd.list RUN echo "deb-src [arch=amd64] http://rspamd.com/apt-stable/ stretch main" >> /etc/apt/sources.list.d/rspamd.list
RUN apt update RUN apt update
RUN apt --no-install-recommends install -y rspamd RUN apt --no-install-recommends install -y rspamd && apt clean
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/node RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/node
RUN git clone https://github.com/nodemailer/wildduck /wildduck RUN git clone https://github.com/nodemailer/wildduck /wildduck
RUN git clone https://github.com/zone-eu/zone-mta-template /wildduck-mta RUN git clone https://github.com/zone-eu/zone-mta-template /wildduck-mta
@@ -21,4 +21,4 @@ RUN npm i --production
RUN npm i -S zonemta-wildduck zonemta-limiter RUN npm i -S zonemta-wildduck zonemta-limiter
WORKDIR /haraka WORKDIR /haraka
RUN npm i RUN npm i
RUN npm i -S haraka-plugin-wildduck haraka-plugin-rspamd haraka-plugin-limit haraka-plugin-karma haraka-plugin-redis RUN npm i -S haraka-plugin-wildduck haraka-plugin-rspamd haraka-plugin-limit haraka-plugin-karma haraka-plugin-redis haraka-plugin-mongodb

Ver fichero

@@ -13,10 +13,18 @@ accessToken = "nohaytoken"
[accessControl] [accessControl]
# If true then require a valid access token to perform API calls # If true then require a valid access token to perform API calls
# If a client provides a token then it is validated even if using a token is not required
enabled=false enabled=false
# Secret for HMAC # Secret for HMAC
# Changing this value invalidates all tokens # Changing this value invalidates all tokens
#secret = "sAiHB6XcSWJgsMrMl_vJzcfVlhhenJLi" secret="a secret cat"
# Generated access token TTL in seconds. Token TTL gets extended by this value every time the token is used. Defaults to 14 days
tokenTTL=1209600
# Generated access token max lifetime in seconds. Defaults to 180 days
tokenLifetime=15552000
[roles] [roles]
# @include "roles.json" # @include "roles.json"
@@ -32,7 +40,7 @@ enabled = false
# A reverse-DNS style identifier (com.example.myprofile, for example) that identifies the profile. # A reverse-DNS style identifier (com.example.myprofile, for example) that identifies the profile.
# This string is used to determine whether a new profile should replace an existing one or should be added. Username is prepended to this value. # This string is used to determine whether a new profile should replace an existing one or should be added. Username is prepended to this value.
identifier = "es.hatthieves" identifier = "es.hatthieves.ns1"
# A human-readable name for the profile. This value is displayed on the Detail screen. It does not have to be unique. # A human-readable name for the profile. This value is displayed on the Detail screen. It does not have to be unique.
displayName = "Wildduck Mail" displayName = "Wildduck Mail"

Ver fichero

@@ -8,7 +8,7 @@
ident="wildduck" ident="wildduck"
# how many processes to start # how many processes to start
processes = "2" processes=2
# default quota storage in MB (can be overriden per user) # default quota storage in MB (can be overriden per user)
maxStorage=1024 maxStorage=1024
@@ -37,7 +37,7 @@ cipher = "aes192"
#secret = "E2jYD-p2u68-qUEOJ1KkC3xmzySyTGRY" #secret = "E2jYD-p2u68-qUEOJ1KkC3xmzySyTGRY"
[u2f] [u2f]
# Fully qualified URL of your website (must use HTTPS!) # Fully qualified URL of your website (must use HTTPS!)
appId = "http://172.200.0.101" appId = "https://webmail.hatthieves.es"
[attachments] [attachments]
# @include "attachments.toml" # @include "attachments.toml"

Ver fichero

@@ -16,15 +16,3 @@ signTransportDomain=true
# do not change this # do not change this
hashAlgo="sha256" hashAlgo="sha256"
enabled="sender"
# Domain name in the dkim signature. Leave blank to use the domain of From: address
domain="hatthieves.es"
# Selector value in the dkim signature
selector="dkim"
# Key location. Relative to working directory
path="/secure/dkim_private.key"

Ver fichero

@@ -17,13 +17,13 @@
}, },
"userlisting": { "userlisting": {
"read:any": ["*", "!audit"] "read:any": ["*"]
}, },
"users": { "users": {
"create:any": ["*", "!audit"], "create:any": ["*"],
"read:any": ["*", "!audit"], "read:any": ["*"],
"update:any": ["*", "!audit"], "update:any": ["*"],
"delete:any": ["*"] "delete:any": ["*"]
}, },
@@ -40,6 +40,20 @@
"delete:any": ["*"] "delete:any": ["*"]
}, },
"attachments": {
"create:any": ["*"],
"read:any": ["*"],
"update:any": ["*"],
"delete:any": ["*"]
},
"storage": {
"create:any": ["*"],
"read:any": ["*"],
"update:any": ["*"],
"delete:any": ["*"]
},
"mailboxes": { "mailboxes": {
"create:any": ["*"], "create:any": ["*"],
"read:any": ["*"], "read:any": ["*"],
@@ -94,13 +108,13 @@
}, },
"userlisting": { "userlisting": {
"read:any": ["*", "!audit"] "read:any": ["*"]
}, },
"users": { "users": {
"create:any": ["*", "!audit"], "create:any": ["*"],
"read:any": ["*", "!audit"], "read:any": ["*"],
"update:any": ["*", "!audit"], "update:any": ["*"],
"delete:any": ["*"] "delete:any": ["*"]
}, },
@@ -153,8 +167,8 @@
}, },
"users": { "users": {
"read:any": ["*", "!audit"], "read:any": ["*"],
"update:any": ["*", "!audit"] "update:any": ["*"]
}, },
"asps": { "asps": {
@@ -170,6 +184,20 @@
"delete:any": ["*"] "delete:any": ["*"]
}, },
"attachments": {
"create:any": ["*"],
"read:any": ["*"],
"update:any": ["*"],
"delete:any": ["*"]
},
"storage": {
"create:any": ["*"],
"read:any": ["*"],
"update:any": ["*"],
"delete:any": ["*"]
},
"mailboxes": { "mailboxes": {
"create:any": ["*"], "create:any": ["*"],
"read:any": ["*"], "read:any": ["*"],
@@ -209,12 +237,12 @@
}, },
"userlisting": { "userlisting": {
"read:own": ["*", "!audit"] "read:own": ["*", "!tags", "!metaData", "!disabledScopes"]
}, },
"users": { "users": {
"read:own": ["*", "!audit"], "read:own": ["*", "!tags", "!metaData", "!disabledScopes"],
"update:own": ["*", "!audit"] "update:own": ["*", "!tags", "!metaData", "!disabledScopes"]
}, },
"asps": { "asps": {
@@ -230,6 +258,20 @@
"delete:own": ["*"] "delete:own": ["*"]
}, },
"attachments": {
"create:own": ["*"],
"read:own": ["*"],
"update:own": ["*"],
"delete:own": ["*"]
},
"storage": {
"create:own": ["*"],
"read:own": ["*"],
"update:own": ["*"],
"delete:own": ["*"]
},
"mailboxes": { "mailboxes": {
"create:own": ["*"], "create:own": ["*"],
"read:own": ["*"], "read:own": ["*"],
@@ -253,6 +295,18 @@
}, },
"auth": { "auth": {
"authentication": {
"create:any": ["*", "!token"]
}
},
"attachments": {
"attachments": {
"read:any": ["*"]
}
},
"tokenAuth": {
"authentication": { "authentication": {
"create:any": ["*"] "create:any": ["*"]
} }
@@ -260,6 +314,10 @@
"audit": { "audit": {
"users": { "users": {
"read:any": ["*"]
},
"audit": {
"create:any": ["*"], "create:any": ["*"],
"read:any": ["*"], "read:any": ["*"],
"update:any": ["*"], "update:any": ["*"],
@@ -267,3 +325,4 @@
} }
} }
} }

Ver fichero

@@ -521,7 +521,7 @@
data-bind="click: toggleToolbarOrientation"> data-bind="click: toggleToolbarOrientation">
<img class="handle-vertical" src="/svg/handle_vertical.svg" <img class="handle-vertical" src="/svg/handle_vertical.svg"
data-bind="click: toggleToolbarOrientation"> data-bind="click: toggleToolbarOrientation">
<img rel="HatThieves" src="https://www.hatthieves.es/wp-content/uploads/2019/08/cropped-ht.png"> <a href="https://p2p.hatthieves.es" target="_blank"><img rel="HatThieves" src="https://www.hatthieves.es/wp-content/uploads/2019/08/cropped-ht.png"></a>
<!--img class="tb-connect" data-bind="visible: !connectDialog.joinOnly(), <!--img class="tb-connect" data-bind="visible: !connectDialog.joinOnly(),
click: connectDialog.show" click: connectDialog.show"
rel="connect" src="/svg/applications-internet.svg"> rel="connect" src="/svg/applications-internet.svg">

Ver fichero

@@ -27,7 +27,7 @@ $CONFIG = array (
), ),
'datadirectory' => '/var/www/html/data', 'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql', 'dbtype' => 'mysql',
'version' => '18.0.4.2', 'version' => '19.0.0.12',
'overwrite.cli.url' => 'https://cloud.hatthieves.es', 'overwrite.cli.url' => 'https://cloud.hatthieves.es',
'dbname' => 'nextcloud', 'dbname' => 'nextcloud',
'dbhost' => 'mariadb-nextcloud', 'dbhost' => 'mariadb-nextcloud',

Ver fichero

@@ -9,23 +9,28 @@ services:
hostname: nginx hostname: nginx
container_name: nginx container_name: nginx
restart: always restart: always
# entrypoint: entrypoint:
# - /bin/bash - /bin/bash
# - /etc/nginx/entrypoint.sh - /etc/nginx/entrypoint.sh
volumes: volumes:
- ./nginx:/etc/nginx - ./nginx:/etc/nginx
- /opt/docker/secure/fullchain.pem:/etc/nginx/hatthieves.crt:ro - /opt/docker/secure/fullchain.pem:/etc/nginx/hatthieves.crt:ro
- /opt/docker/secure/privkey.pem:/etc/nginx/hatthieves.key:ro - /opt/docker/secure/privkey.pem:/etc/nginx/hatthieves.key:ro
- /root/letsencrypt/hatthieves.com/fullchain.pem:/etc/nginx/hatthieves.com.crt:ro - /root/letsencrypt/hatthieves.com/fullchain.pem:/etc/nginx/hatthieves.com.crt:ro
- /root/letsencrypt/hatthieves.com/privkey.pem:/etc/nginx/hatthieves.com.key:ro - /root/letsencrypt/hatthieves.com/privkey.pem:/etc/nginx/hatthieves.com.key:ro
- ./nginx/nginx.conf:/usr/local/nginx/conf/nginx.conf - /root/letsencrypt/hatthieves.co/fullchain.pem:/etc/nginx/hatthieves.co.crt:ro
- /root/letsencrypt/hatthieves.co/privkey.pem:/etc/nginx/hatthieves.co.key:ro
- ./nginx/nginx.conf:/usr/local/nginx/conf/nginx.conf:ro
- ./logs:/usr/local/nginx/logs - ./logs:/usr/local/nginx/logs
- ./html:/usr/local/nginx/html:ro
ports: ports:
- "80:80" - "80:80"
# - "2001:ba0:1800:80e0::1:80:80" # - "2001:ba0:1800:80e0::1:80:80"
- "443:443" - "443:443"
# - "2001:ba0:1800:80e0::1:443:443" # - "2001:ba0:1800:80e0::1:443:443"
- "443:443/udp" - "443:443/udp"
- "1936:1936"
- "1936:1936/udp"
# - "2001:ba0:1800:80e0::1:443:443/udp" # - "2001:ba0:1800:80e0::1:443:443/udp"
# cap_add: # cap_add:
# - NET_BIND_SERVICE # - NET_BIND_SERVICE
@@ -39,7 +44,6 @@ services:
mynet: mynet:
ipv4_address: 172.10.0.101 ipv4_address: 172.10.0.101
ipv6_address: 2001:db8:2::101 ipv6_address: 2001:db8:2::101
gollum:
haraka: haraka:
gitea: gitea:
pad: pad:
@@ -48,19 +52,14 @@ services:
registry: registry:
pleroma: pleroma:
ipfs: ipfs:
doom:
nextcloud: nextcloud:
magicworld: magicworld:
peertube: peertube:
g: g:
pleroma-test:
icecast2: icecast2:
gnusocial:
jitsi: jitsi:
tpmw:
wordpress: wordpress:
familyark: familyark:
crossposter:
kamailio: kamailio:
privatebin: privatebin:
glances: glances:
@@ -71,14 +70,16 @@ services:
nms: nms:
dvwa: dvwa:
bbb: bbb:
traefik:
elk: elk:
codimd: codimd:
netdata:
youtube: youtube:
mumbleweb: mumbleweb:
p2p: p2p:
webdav: webdav:
igunublue:
salva:
doom:
wtorrent:
networks: networks:
mynet: mynet:
@@ -89,10 +90,6 @@ networks:
- subnet: 172.10.0.0/24 - subnet: 172.10.0.0/24
- subnet: 2001:db8:2::/64 - subnet: 2001:db8:2::/64
gollum:
external:
name: gollum_mynet
haraka: haraka:
external: external:
name: harakawildduck_mynet name: harakawildduck_mynet
@@ -125,10 +122,6 @@ networks:
external: external:
name: ipfs_mynet name: ipfs_mynet
doom:
external:
name: web_mynet
nextcloud: nextcloud:
external: external:
name: nextcloud_mynet name: nextcloud_mynet
@@ -145,26 +138,14 @@ networks:
external: external:
name: g_mynet name: g_mynet
pleroma-test:
external:
name: pleromatest_mynet
icecast2: icecast2:
external: external:
name: icecast2_mynet name: icecast2_mynet
gnusocial:
external:
name: gnusocial_mynet
jitsi: jitsi:
external: external:
name: jitsimeet_mynet name: jitsimeet_mynet
tpmw:
external:
name: magicworldphoenix_mynet
wordpress: wordpress:
external: external:
name: wordpress_mynet name: wordpress_mynet
@@ -173,10 +154,6 @@ networks:
external: external:
name: familyark_mynet name: familyark_mynet
crossposter:
external:
name: crossposter_mynet
kamailio: kamailio:
external: external:
name: kamailio_mynet name: kamailio_mynet
@@ -217,10 +194,6 @@ networks:
external: external:
name: bigbluebutton_mynet name: bigbluebutton_mynet
traefik:
external:
name: traefik_mynet
elk: elk:
external: external:
name: elk_mynet name: elk_mynet
@@ -229,10 +202,6 @@ networks:
external: external:
name: codimd_mynet name: codimd_mynet
netdata:
external:
name: netdata_mynet
youtube: youtube:
external: external:
name: youtube_mynet name: youtube_mynet
@@ -248,3 +217,19 @@ networks:
webdav: webdav:
external: external:
name: webdav_mynet name: webdav_mynet
igunublue:
external:
name: igunublue_mynet
salva:
external:
name: salva_mynet
doom:
external:
name: web_mynet
wtorrent:
external:
name: wtorrent_mynet

Ver fichero

@@ -45,6 +45,25 @@ server {
return 301 https://www.hatthieves.es; return 301 https://www.hatthieves.es;
# rewrite ^/(.*)$ https://www.hatthieves.es/$1 permanent; # rewrite ^/(.*)$ https://www.hatthieves.es/$1 permanent;
} }
} }
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name hatthieves.co *.hatthieves.co;
# index index.html index.htm;
ssl_certificate /etc/nginx/hatthieves.co.crt;
ssl_certificate_key /etc/nginx/hatthieves.co.key;
ssl_dhparam /etc/nginx/dhparam.pem;
# ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
# add_header Alt-Svc 'h3-25=":443"; ma=86400';
add_header alt-svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
location / {
return 301 https://www.hatthieves.es;
# rewrite ^/(.*)$ https://www.hatthieves.es/$1 permanent;
}
}

Ver fichero

@@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
/etc/init.d/nginx start /bin/rm -rf /etc/nginx/hls/* /etc/nginx/live/* /etc/nginx/cache/*
/bin/sleep infinity /bin/bash /etc/nginx/script-hls.sh &
/usr/local/nginx/sbin/nginx -g 'daemon off;'

Ver fichero

@@ -1,92 +1,126 @@
#user www-data; # you must set worker processes based on your CPU cores, nginx does not benefit from setting more than that
worker_processes 4; worker_processes 6; #some last versions calculate it automatically
pid /run/nginx.pid;
#include /etc/nginx/modules-enabled/*.conf;
# number of file descriptors used for nginx
# the limit for the maximum FDs on the server is usually set by the OS.
# if you don't set FD's then OS settings will be used which is by default 2000
worker_rlimit_nofile 100000;
# provides the configuration file context in which the directives that affect connection processing are specified.
events { events {
worker_connections 256; # determines how much clients will be served per worker
# multi_accept on; # max clients = worker_connections * worker_processes
# max clients is also limited by the number of socket connections available on the system (~64k)
worker_connections 4000;
# optimized to serve many clients with each thread, essential for linux -- for testing environment
use epoll;
# accept as many connections as possible, may flood worker connections if set too low -- for testing environment
multi_accept on;
} }
http { http {
# cache informations about FDs, frequently accessed files
# can boost performance, but you need to test those values
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
## # only log critical errors
# Basic Settings access_log /usr/local/nginx/logs/access.log;
## error_log /usr/local/nginx/logs/error.log;
client_max_body_size 10M;
# copies data between one FD and other from within the kernel
# faster than read() + write()
sendfile on; sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64; # send headers in one piece, it is better than sending them one by one
# server_name_in_redirect off; tcp_nopush on;
# don't buffer data sent, good for small data bursts in real time
tcp_nodelay on;
# reduce the data that needs to be sent over network -- for testing environment
gzip on;
# gzip_static on;
gzip_min_length 10240;
gzip_comp_level 1;
gzip_vary on;
gzip_disable msie6;
gzip_proxied expired no-cache no-store private auth;
gzip_types
# text/html is always compressed by HttpGzipModule
text/css
text/javascript
text/xml
text/plain
text/x-component
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
application/atom+xml
font/truetype
font/opentype
application/vnd.ms-fontobject
image/svg+xml;
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
## ssl_protocols TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
## # allow the server to close connection on non responding client, this will free up memory
# Logging Settings reset_timedout_connection on;
##
# access_log /var/log/nginx/access.log; # request timed out -- default 60
# error_log /var/log/nginx/error.log; client_body_timeout 10;
# log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
# access_log /usr/local/nginx/logs/access.log main;
# error_log /usr/local/nginx/logs/error.log;
##
# Gzip Settings
##
gzip on; # if client stop responding, free up memory -- default 60
send_timeout 2;
# gzip_vary on; # server will close connection after this time -- default 75
# gzip_proxied any; keepalive_timeout 30;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
## # number of requests client can make over keep-alive -- for testing environment
# Virtual Host Configs keepalive_requests 100000;
##
include /etc/nginx/conf.d/*.conf; include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*; include /etc/nginx/sites-enabled/*;
server_tokens off; server_tokens off;
root /usr/local/nginx/html;
} }
rtmp {
server {
listen 1936;
application hls {
live on;
hls on;
hls_path /etc/nginx/hls;
hls_fragment 30s;
hls_playlist_length 3m;
allow publish 172.51.0.1;
deny publish all;
allow play all;
# exec_publish ffmpeg -loglevel quiet -re -i async:cache:rtmp://172.10.0.101:1936/hls/streaming -threads 1 -async 1 -codec copy -f flv rtmp://a.rtmp.youtube.com/live2/4qye-a4f7-9zfy-eq2u-30yz;
}
application live {
live on;
hls on;
hls_path /etc/nginx/live;
hls_fragment 30s;
hls_playlist_length 3m;
allow publish 78.30.47.115;
deny publish all;
allow play all;
}
}
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

Ver fichero

@@ -5,8 +5,6 @@ server {
client_max_body_size 2G; client_max_body_size 2G;
location / { location / {
proxy_pass http://172.44.0.101:3000; proxy_pass http://172.44.0.101:3000;
auth_basic "Registry realm";
auth_basic_user_file /etc/nginx/registry.htpasswd;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Ver fichero

@@ -3,7 +3,7 @@ server {
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
server_name games.hatthieves.es; server_name games.hatthieves.es;
location / { location / {
proxy_pass http://172.22.0.101:80; proxy_pass http://172.23.0.101:80;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Ver fichero

@@ -2,14 +2,81 @@ server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
server_name ipfs.hatthieves.es; server_name ipfs.hatthieves.es;
proxy_pass_request_headers on;
location / { location / {
proxy_pass http://172.5.0.101:8080; proxy_pass http://172.105.0.101:5001;
# proxy_pass http://172.5.0.101:5001/webui; auth_basic "Registry realm";
auth_basic_user_file /etc/nginx/registry.htpasswd;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_buffering off; proxy_buffering off;
proxy_http_version 1.1;
add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
} }
location /ipfs {
proxy_pass http://172.105.0.101:8080/ipfs;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_buffering off;
proxy_http_version 1.1;
add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
}
location /ipns {
proxy_pass http://172.105.0.101:8080/ipns;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_buffering off;
proxy_http_version 1.1;
add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
}
# location /p2p {
# proxy_pass http://172.105.0.101:4002;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "Upgrade";
# proxy_buffering off;
# proxy_http_version 1.1;
# add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
# }
# location /ws {
# proxy_pass http://172.105.0.101:4003;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "Upgrade";
# proxy_buffering off;
# proxy_http_version 1.1;
# add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
# }
# location /api {
# proxy_pass http://172.105.0.101:5001/ipfs/api/v0;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "Upgrade";
# proxy_buffering off;
# proxy_http_version 1.1;
# add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
# add_header Access-Control-Allow-Origin '*';
# add_header Access-Control-Allow-Methods '*';
# }
} }

Ver fichero

@@ -12,6 +12,8 @@ server {
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
proxy_buffering off; proxy_buffering off;
add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"'; add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
} }
location /ws { location /ws {
proxy_pass http://172.136.0.101:9000; proxy_pass http://172.136.0.101:9000;

Ver fichero

@@ -8,7 +8,10 @@ server {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_buffering off; proxy_buffering off;
proxy_http_version 1.1;
add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"'; add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
} }
} }

Ver fichero

@@ -11,7 +11,6 @@ server {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
proxy_buffering off;
proxy_http_version 1.1; proxy_http_version 1.1;
add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"'; add_header Alt-Svc 'h3-25=":443"; h3-24=":443"; ma=86400, h3-23=":443"';
} }

Ver fichero

@@ -35,14 +35,25 @@ const config = {
app: 'live', app: 'live',
ac: 'aac', ac: 'aac',
hls: true, hls: true,
hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]' hlsFlags: '[hls_time=30:hls_list_size=5:hls_flags=delete_segments]'
// args: '-profile:v baseline -level 3.0 -start_number 0'
// dash: true, // dash: true,
// dashFlags: '[f=dash:window_size=3:extra_window_size=5]' // dashFlags: '[f=dash:window_size=3:extra_window_size=5]'
}, },
// { // {
// app: 'ale',
// ac: 'aac',
// hls: true,
// hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]'
// },
// {
// app: 'live', // app: 'live',
// mp4: true, // mp4: true,
// mp4Flags: '[movflags=faststart]' // mp4Flags: '[movflags=faststart]'
// }
// {
// app: 'live',
// mp4: true
// } // }
] ]
}, },
@@ -55,7 +66,7 @@ const config = {
// tasks: [{ // tasks: [{
// app: 'live', // app: 'live',
// mode: 'push', // mode: 'push',
// edge: 'rtmp://a.rtmp.youtube.com/live2/xvc5-mcaq-rkcu-p5fy-ep2e', // edge: 'rtmp://a.rtmp.youtube.com/live2/dqpj-00y7-v2vt-yrpu-em4h',
// appendName: false // appendName: false
// }] // }]
// } // }

Ver fichero

@@ -12,6 +12,7 @@ services:
volumes: volumes:
- ./app.js:/usr/src/app/app.js:ro - ./app.js:/usr/src/app/app.js:ro
- ./entrypoint.sh:/usr/src/app/entrypoint.sh:ro - ./entrypoint.sh:/usr/src/app/entrypoint.sh:ro
- ./emitir.sh:/usr/src/app/emitir.sh:ro
- ./media:/usr/src/app/media - ./media:/usr/src/app/media
- ./lists:/lists:ro - ./lists:/lists:ro
expose: expose:
@@ -23,6 +24,7 @@ services:
networks: networks:
mynet: mynet:
ipv4_address: 172.14.0.101 ipv4_address: 172.14.0.101
peertube:
networks: networks:
mynet: mynet:
@@ -31,3 +33,6 @@ networks:
config: config:
- subnet: 172.14.0.0/24 - subnet: 172.14.0.0/24
peertube:
external:
name: peertube_mynet

8
production/nms/entrypoint.sh Archivo normal → Archivo ejecutable
Ver fichero

@@ -4,8 +4,6 @@ apk upgrade
apk add ffmpeg apk add ffmpeg
node app.js & node app.js &
sleep 1s sleep 1s
while [ True ]; do ./emitir.sh /lists/domingosnegros.txt /live/streaming?sign=1591094634811-f60cc56ae2f6fe84244dd22920837c21 &
for i in $(cat /lists/fanta.txt); do #./emitir.sh /lists/fanta-orig.txt /live/pelis?sign=1591044906701-e424ed0f9ae4e4a9193db9177ad12aeb &
ffmpeg -loglevel quiet -re -i async:cache:"$i" -threads 2 -f flv -vcodec h264 -acodec aac rtmp://127.0.0.1/live/streaming?sign=1590502038931-b04c1d7b5bfc3dc61ddce23b2dda3649 /bin/sleep infinity
done
done

Ver fichero

@@ -2,16 +2,16 @@ version: '2.2'
services: services:
peertube: peertube:
image: chocobozzz/peertube:production-buster image: chocobozzz/peertube:develop-buster
restart: always restart: always
hostname: peertube hostname: peertube
container_name: peertube container_name: peertube
volumes: volumes:
- ./peertube/config/default.yaml:/config/production.yaml:ro - ./peertube/config/production.yaml:/config/production.yaml
- ./peertube/storage:/app/storage - ./peertube/storage:/app/storage
expose: expose:
- 9000 - 9000
cpus: 1 # cpus: 1
# cpu_shares: 512 # cpu_shares: 512
networks: networks:
mynet: mynet:
@@ -58,4 +58,3 @@ networks:
haraka: haraka:
external: external:
name: harakawildduck_mynet name: harakawildduck_mynet

Ver fichero

@@ -1,18 +1,26 @@
listen: listen:
hostname: 'localhost' hostname: '172.115.0.101'
port: 9000 port: 9000
# Correspond to your reverse proxy server_name/listen configuration # Correspond to your reverse proxy server_name/listen configuration
webserver: webserver:
https: true https: true
hostname: 'example.com' hostname: 'peertube.hatthieves.es'
port: 443 port: 443
rates_limit: rates_limit:
api:
# 50 attempts in 10 seconds
window: 10 seconds
max: 50
login: login:
# 15 attempts in 5 min # 15 attempts in 5 min
window: 5 minutes window: 5 minutes
max: 15 max: 15
signup:
# 2 attempts in 5 min (only succeeded attempts are taken into account)
window: 5 minutes
max: 2
ask_send_email: ask_send_email:
# 3 attempts in 5 min # 3 attempts in 5 min
window: 5 minutes window: 5 minutes
@@ -26,11 +34,11 @@ trust_proxy:
# Your database name will be "peertube"+database.suffix # Your database name will be "peertube"+database.suffix
database: database:
hostname: 'localhost' hostname: '172.115.0.102'
port: 5432 port: 5432
suffix: '_prod' suffix: '_dev'
username: 'peertube' username: 'peertube'
password: 'peertube' password: 'p33rtub3.'
pool: pool:
max: 5 max: 5
@@ -38,38 +46,50 @@ database:
# You can also specify a 'socket' path to a unix socket but first need to # You can also specify a 'socket' path to a unix socket but first need to
# comment out hostname and port # comment out hostname and port
redis: redis:
hostname: 'localhost' hostname: '172.115.0.103'
port: 6379 port: 6379
auth: null auth: null
db: 0 db: 0
# SMTP server to send emails # SMTP server to send emails
smtp: smtp:
hostname: null hostname: smtp.hatthieves.es
port: 465 # If you use StartTLS: 587 port: 587 # If you use StartTLS: 587
username: null username: peertube@hatthieves.es
password: null password: p33rtub3.
tls: true # If you use StartTLS: false tls: true # If you use StartTLS: false
disable_starttls: false disable_starttls: false
ca_file: null # Used for self signed certificates ca_file: null # Used for self signed certificates
from_address: 'admin@example.com' from_address: 'peertube@hatthieves.es'
email:
body:
signature: "PeerTube"
subject:
prefix: "[PeerTube]"
# From the project root directory # From the project root directory
storage: storage:
tmp: '/var/www/peertube/storage/tmp/' # Used to download data (imports etc), store uploaded files before processing... tmp: 'storage/tmp/' # Use to download data (imports etc), store uploaded files before processing...
avatars: '/var/www/peertube/storage/avatars/' avatars: 'storage/avatars/'
videos: '/var/www/peertube/storage/videos/' videos: 'storage/videos/'
streaming_playlists: '/var/www/peertube/storage/streaming-playlists/' streaming_playlists: 'storage/streaming-playlists/'
redundancy: '/var/www/peertube/storage/videos/' redundancy: 'storage/redundancy/'
logs: '/var/www/peertube/storage/logs/' logs: 'storage/logs/'
previews: '/var/www/peertube/storage/previews/' previews: 'storage/previews/'
thumbnails: '/var/www/peertube/storage/thumbnails/' thumbnails: 'storage/thumbnails/'
torrents: '/var/www/peertube/storage/torrents/' torrents: 'storage/torrents/'
captions: '/var/www/peertube/storage/captions/' captions: 'storage/captions/'
cache: '/var/www/peertube/storage/cache/' cache: 'storage/cache/'
plugins: 'storage/plugins/'
log: log:
level: 'info' # debug/info/warning/error level: 'info' # debug/info/warning/error
rotation:
enabled : true # Enabled by default, if disabled make sure that 'storage.logs' is pointing to a folder handled by logrotate
maxFileSize: 12MB
maxFiles: 20
anonymizeIP: false
search: search:
# Add ability to fetch remote videos/actors by their URI, that may not be federated with your instance # Add ability to fetch remote videos/actors by their URI, that may not be federated with your instance
@@ -139,6 +159,14 @@ views:
remote: remote:
max_age: -1 max_age: -1
plugins:
# The website PeerTube will ask for available PeerTube plugins and themes
# This is an unmoderated plugin index, so only install plugins/themes you trust
index:
enabled: true
check_latest_versions_interval: '12 hours' # How often you want to check new plugins/themes versions
url: 'https://packages.joinpeertube.org'
############################################################################### ###############################################################################
# #
@@ -161,7 +189,7 @@ cache:
admin: admin:
# Used to generate the root user at first startup # Used to generate the root user at first startup
# And to receive emails from the contact form # And to receive emails from the contact form
email: 'admin@example.com' email: 'webmaster@hatthieves.es'
contact_form: contact_form:
enabled: true enabled: true
@@ -169,7 +197,7 @@ contact_form:
signup: signup:
enabled: false enabled: false
limit: 10 # When the limit is reached, registrations are disabled. -1 == unlimited limit: 10 # When the limit is reached, registrations are disabled. -1 == unlimited
requires_email_verification: false requires_email_verification: true
filters: filters:
cidr: # You can specify CIDR ranges to whitelist (empty = no filtering) or blacklist cidr: # You can specify CIDR ranges to whitelist (empty = no filtering) or blacklist
whitelist: [] whitelist: []
@@ -188,20 +216,30 @@ transcoding:
enabled: true enabled: true
# Allow your users to upload .mkv, .mov, .avi, .flv videos # Allow your users to upload .mkv, .mov, .avi, .flv videos
allow_additional_extensions: true allow_additional_extensions: true
# If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file
allow_audio_files: true
threads: 1 threads: 1
resolutions: # Only created if the original video has a higher resolution, uses more storage! resolutions: # Only created if the original video has a higher resolution, uses more storage!
0p: false # audio-only (creates mp4 without video stream, always created when enabled)
240p: false 240p: false
360p: false 360p: false
480p: false 480p: false
720p: false 720p: false
1080p: false 1080p: false
# /!\ EXPERIMENTAL /!\ 2160p: false
# /!\ Requires ffmpeg >= 4
# Generate videos in a WebTorrent format (what we do since the first PeerTube release)
# If you also enabled the hls format, it will multiply videos storage by 2
# If disabled, breaks federation with PeerTube instances < 2.1
webtorrent:
enabled: true
# /!\ Requires ffmpeg >= 4.1
# Generate HLS playlists and fragmented MP4 files. Better playback than with WebTorrent: # Generate HLS playlists and fragmented MP4 files. Better playback than with WebTorrent:
# * Resolution change is smoother # * Resolution change is smoother
# * Faster playback in particular with long videos # * Faster playback in particular with long videos
# * More stable playback (less bugs/infinite loading) # * More stable playback (less bugs/infinite loading)
# /!\ Multiplies videos storage by 2 /!\ # If you also enabled the webtorrent format, it will multiply videos storage by 2
hls: hls:
enabled: false enabled: false
@@ -210,6 +248,10 @@ import:
videos: videos:
http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html
enabled: false enabled: false
# You can use an HTTP/HTTPS/SOCKS proxy with youtube-dl
proxy:
enabled: false
url: ""
torrent: # Magnet URI or torrent file (use classic TCP/UDP/WebSeed to download the file) torrent: # Magnet URI or torrent file (use classic TCP/UDP/WebSeed to download the file)
enabled: false enabled: false
@@ -221,11 +263,64 @@ auto_blacklist:
# Instance settings # Instance settings
instance: instance:
name: 'PeerTube' name: "HatThieves's PeerTube"
short_description: 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.' short_description: 'PeerTube, a federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.'
description: '' # Support markdown description: 'Welcome to this PeerTube instance!' # Support markdown
terms: '' # Support markdown terms: 'No terms for now.' # Support markdown
code_of_conduct: '' # Supports markdown
# Who moderates the instance? What is the policy regarding NSFW videos? Political videos? etc
moderation_information: '' # Supports markdown
# Why did you create this instance?
creation_reason: ''
# Who is behind the instance? A single person? A non profit?
administrator: ''
# How long do you plan to maintain this instance?
maintenance_lifetime: ''
# How will you pay the PeerTube instance server? With your own funds? With users donations? Advertising?
business_model: ''
# If you want to explain on what type of hardware your PeerTube instance runs
# Example: "2 vCore, 2GB RAM..."
hardware_information: '' # Supports Markdown
# What are the main languages of your instance? To interact with your users for example
# Uncomment or add the languages you want
# List of supported languages: https://peertube.cpy.re/api/v1/videos/languages
languages:
# - en
# - es
# - fr
# You can specify the main categories of your instance (dedicated to music, gaming or politics etc)
# Uncomment or add the category ids you want
# List of supported categories: https://peertube.cpy.re/api/v1/videos/categories
categories:
# - 1 # Music
# - 2 # Films
# - 3 # Vehicles
# - 4 # Art
# - 5 # Sports
# - 6 # Travels
# - 7 # Gaming
# - 8 # People
# - 9 # Comedy
# - 10 # Entertainment
# - 11 # News & Politics
# - 12 # How To
# - 13 # Education
# - 14 # Activism
# - 15 # Science & Technology
# - 16 # Animals
# - 17 # Kids
# - 18 # Food
default_client_route: '/videos/trending' default_client_route: '/videos/trending'
# Whether or not the instance is dedicated to NSFW content # Whether or not the instance is dedicated to NSFW content
# Enabling it will allow other administrators to know that you are mainly federating sensitive content # Enabling it will allow other administrators to know that you are mainly federating sensitive content
# Moreover, the NSFW checkbox on video upload will be automatically checked by default # Moreover, the NSFW checkbox on video upload will be automatically checked by default
@@ -233,6 +328,7 @@ instance:
# By default, "do_not_list" or "blur" or "display" NSFW videos # By default, "do_not_list" or "blur" or "display" NSFW videos
# Could be overridden per user with a setting # Could be overridden per user with a setting
default_nsfw_policy: 'do_not_list' default_nsfw_policy: 'do_not_list'
customizations: customizations:
javascript: '' # Directly your JavaScript code (without <script> tags). Will be eval at runtime javascript: '' # Directly your JavaScript code (without <script> tags). Will be eval at runtime
css: '' # Directly your CSS code (without <style> tags). Will be injected at runtime css: '' # Directly your CSS code (without <style> tags). Will be injected at runtime
@@ -245,15 +341,13 @@ instance:
"# If you would like to report a security issue\n# you may report it to:\nContact: https://github.com/Chocobozzz/PeerTube/blob/develop/SECURITY.md\nContact: mailto:" "# If you would like to report a security issue\n# you may report it to:\nContact: https://github.com/Chocobozzz/PeerTube/blob/develop/SECURITY.md\nContact: mailto:"
services: services:
# You can provide a reporting endpoint for Content Security Policy violations
csp-logger:
# Cards configuration to format video in Twitter # Cards configuration to format video in Twitter
twitter: twitter:
username: '@Chocobozzz' # Indicates the Twitter account for the website or platform on which the content was published username: '@HatThieves' # Indicates the Twitter account for the website or platform on which the content was published
# If true, a video player will be embedded in the Twitter feed on PeerTube video share # If true, a video player will be embedded in the Twitter feed on PeerTube video share
# If false, we use an image link card that will redirect on your PeerTube instance # If false, we use an image link card that will redirect on your PeerTube instance
# Test on https://cards-dev.twitter.com/validator to see if you are whitelisted # Change it to "true", and then test on https://cards-dev.twitter.com/validator to see if you are whitelisted
whitelisted: false whitelisted: true
followers: followers:
instance: instance:
@@ -261,3 +355,21 @@ followers:
enabled: true enabled: true
# Whether or not an administrator must manually validate a new follower # Whether or not an administrator must manually validate a new follower
manual_approval: false manual_approval: false
followings:
instance:
# If you want to automatically follow back new instance followers
# If this option is enabled, use the mute feature instead of deleting followings
# /!\ Don't enable this if you don't have a reactive moderation team /!\
auto_follow_back:
enabled: false
# If you want to automatically follow instances of the public index
# If this option is enabled, use the mute feature instead of deleting followings
# /!\ Don't enable this if you don't have a reactive moderation team /!\
auto_follow_index:
enabled: false
index_url: 'https://instances.joinpeertube.org'
theme:
default: 'default'

Ver fichero

@@ -1,27 +1,16 @@
FROM elixir FROM elixir
ENV MIX_ENV=prod ENV MIX_ENV=prod
ENV VERSION 7bd4c145
RUN apt update && apt -y upgrade && apt -y install build-essential git imagemagick && apt clean RUN apt update && apt -y upgrade && apt -y install build-essential git imagemagick && apt clean
RUN adduser --system --disabled-password --home /pleroma pleroma RUN adduser --system --disabled-password --home /pleroma pleroma
USER pleroma USER pleroma
WORKDIR /pleroma WORKDIR /pleroma
RUN git clone https://git.pleroma.social/pleroma/pleroma /pleroma \ RUN git clone https://git.pleroma.social/pleroma/pleroma /pleroma \
&& mkdir -p /pleroma/uploads && mkdir -p /pleroma/uploads
#RUN git checkout $VERSION
RUN touch /pleroma/config/prod.secret.exs \ RUN touch /pleroma/config/prod.secret.exs \
&& mix local.rebar --force \
&& mix local.hex --force \ && mix local.hex --force \
&& mix local.rebar --force \
&& mix deps.get \ && mix deps.get \
&& mix deps.compile \ && mix deps.compile \
&& rm /pleroma/config/prod.secret.exs && rm /pleroma/config/prod.secret.exs
EXPOSE 4000 EXPOSE 4000

Ver fichero

@@ -58,20 +58,6 @@ config :pleroma, Pleroma.Captcha,
config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch" config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
config :pleroma, :hackney_pools,
federation: [
max_connections: 50,
timeout: 150_000
],
media: [
max_connections: 50,
timeout: 150_000
],
upload: [
max_connections: 25,
timeout: 300_000
]
# Upload configuration # Upload configuration
config :pleroma, Pleroma.Upload, config :pleroma, Pleroma.Upload,
uploader: Pleroma.Uploaders.Local, uploader: Pleroma.Uploaders.Local,
@@ -85,7 +71,8 @@ config :pleroma, Pleroma.Upload,
follow_redirect: true, follow_redirect: true,
pool: :upload pool: :upload
] ]
] ],
filename_display_max_length: 30
config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads" config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
@@ -191,20 +178,14 @@ config :pleroma, :http,
proxy_url: nil, proxy_url: nil,
send_user_agent: true, send_user_agent: true,
user_agent: :default, user_agent: :default,
adapter: [ adapter: []
ssl_options: [
# Workaround for remote server certificate chain issues
partial_chain: &:hackney_connect.partial_chain/1,
# We don't support TLS v1.3 yet
versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
]
]
config :pleroma, :instance, config :pleroma, :instance,
name: "Pleroma", name: "Pleroma",
email: "example@example.com", email: "example@example.com",
notify_email: "noreply@example.com", notify_email: "noreply@example.com",
description: "A Pleroma instance, an alternative fediverse server", description: "Pleroma: An efficient and flexible fediverse server",
background_image: "/images/city.jpg",
limit: 5_000, limit: 5_000,
chat_limit: 5_000, chat_limit: 5_000,
remote_limit: 100_000, remote_limit: 100_000,
@@ -260,7 +241,18 @@ config :pleroma, :instance,
account_field_value_length: 2048, account_field_value_length: 2048,
external_user_synchronization: true, external_user_synchronization: true,
extended_nickname_format: true, extended_nickname_format: true,
cleanup_attachments: false cleanup_attachments: false,
multi_factor_authentication: [
totp: [
# digits 6 or 8
digits: 6,
period: 30
],
backup_codes: [
number: 5,
length: 16
]
]
config :pleroma, :feed, config :pleroma, :feed,
post_title: %{ post_title: %{
@@ -282,20 +274,33 @@ config :pleroma, :markup,
config :pleroma, :frontend_configurations, config :pleroma, :frontend_configurations,
pleroma_fe: %{ pleroma_fe: %{
theme: "pleroma-dark", alwaysShowSubjectInput: true,
logo: "/static/logo.png",
background: "/images/city.jpg", background: "/images/city.jpg",
redirectRootNoLogin: "/main/all",
redirectRootLogin: "/main/friends",
showInstanceSpecificPanel: true,
scopeOptionsEnabled: false,
formattingOptionsEnabled: false,
collapseMessageWithSubject: false, collapseMessageWithSubject: false,
disableChat: false,
greentext: false,
hideFilteredStatuses: false,
hideMutedPosts: false,
hidePostStats: false, hidePostStats: false,
hideSitename: false,
hideUserStats: false, hideUserStats: false,
loginMethod: "password",
logo: "/static/logo.png",
logoMargin: ".1em",
logoMask: true,
minimalScopesMode: false,
noAttachmentLinks: false,
nsfwCensorImage: "",
postContentType: "text/plain",
redirectRootLogin: "/main/friends",
redirectRootNoLogin: "/main/all",
scopeCopy: true, scopeCopy: true,
sidebarRight: false,
showFeaturesPanel: true,
showInstanceSpecificPanel: false,
subjectLineBehavior: "email", subjectLineBehavior: "email",
alwaysShowSubjectInput: true theme: "pleroma-dark",
webPushNotifications: false
}, },
masto_fe: %{ masto_fe: %{
showInstanceSpecificPanel: true showInstanceSpecificPanel: true
@@ -356,7 +361,8 @@ config :pleroma, :mrf_simple,
reject: [], reject: [],
accept: [], accept: [],
avatar_removal: [], avatar_removal: [],
banner_removal: [] banner_removal: [],
reject_deletes: []
config :pleroma, :mrf_keyword, config :pleroma, :mrf_keyword,
reject: [], reject: [],
@@ -386,6 +392,10 @@ config :pleroma, :rich_media,
config :pleroma, :media_proxy, config :pleroma, :media_proxy,
enabled: false, enabled: false,
invalidation: [
enabled: false,
provider: Pleroma.Web.MediaProxy.Invalidation.Script
],
proxy_opts: [ proxy_opts: [
redirect_on_failure: false, redirect_on_failure: false,
max_body_length: 25 * 1_048_576, max_body_length: 25 * 1_048_576,
@@ -624,11 +634,57 @@ config :pleroma, Pleroma.Repo,
parameters: [gin_fuzzy_search_limit: "500"], parameters: [gin_fuzzy_search_limit: "500"],
prepare: :unnamed prepare: :unnamed
config :pleroma, :connections_pool,
checkin_timeout: 250,
max_connections: 250,
retry: 1,
retry_timeout: 1000,
await_up_timeout: 5_000
config :pleroma, :pools,
federation: [
size: 50,
max_overflow: 10,
timeout: 150_000
],
media: [
size: 50,
max_overflow: 10,
timeout: 150_000
],
upload: [
size: 25,
max_overflow: 5,
timeout: 300_000
],
default: [
size: 10,
max_overflow: 2,
timeout: 10_000
]
config :pleroma, :hackney_pools,
federation: [
max_connections: 50,
timeout: 150_000
],
media: [
max_connections: 50,
timeout: 150_000
],
upload: [
max_connections: 25,
timeout: 300_000
]
config :pleroma, :restrict_unauthenticated, config :pleroma, :restrict_unauthenticated,
timelines: %{local: false, federated: false}, timelines: %{local: false, federated: false},
profiles: %{local: false, remote: false}, profiles: %{local: false, remote: false},
activities: %{local: false, remote: false} activities: %{local: false, remote: false}
config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: false
# Import environment specific config. This must remain at the bottom # Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above. # of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs" import_config "#{Mix.env()}.exs"

Ver fichero

@@ -12,7 +12,7 @@ config :pleroma, Pleroma.Web.Endpoint,
signing_salt: "g0uP6uv4" signing_salt: "g0uP6uv4"
config :pleroma, :instance, config :pleroma, :instance,
name: "Pleroma/HatThieves.es", name: "HatThieves's Pleroma",
email: "info@hatthieves.es", email: "info@hatthieves.es",
notify_email: "info@hatthieves.es", notify_email: "info@hatthieves.es",
limit: 8192, limit: 8192,
@@ -51,6 +51,8 @@ version =
# Configures http settings, upstream proxy etc. # Configures http settings, upstream proxy etc.
config :pleroma, :http, proxy_url: nil config :pleroma, :http, proxy_url: nil
config :pleroma, configurable_from_database: true
config :pleroma, :activitypub, config :pleroma, :activitypub,
accept_blocks: true, accept_blocks: true,
unfollow_blocked: true, unfollow_blocked: true,
@@ -87,14 +89,14 @@ config :pleroma, :mrf_rejectnonpublic,
allow_direct: false allow_direct: false
config :pleroma, :mrf_simple, config :pleroma, :mrf_simple,
media_removal: ["gab.com"], media_removal: ["humblr.social","librem.one","quey.org","social.politicaconciencia.net","switter.at","7td.org","animalliberation.social","anime.website","barrag.net","bikeshed.party","blob.cat","busshi.moe","carnal-gabhub.ptotohype.net","carrot.army","cliterati.club","develop.gab.com","dickkickextremist.xyz","dogeposting.social","ekrem.develop.gab","expired.mentality.rip","fedi.absturztau.be","floppy.tokyo","freespeechextremist.com","freezepeach.xyz","gab.ai","gabble.xyz","gab.com","gabfed.com","gab.io","gab.polaris-1.work","gab.sleeck.eu","gleasonator.com","glindr.org","gnusocial.no","gs.smuglo.li","hagra.net","hitchhicker.social","hitchhiker.social","husk.site","inditoot.com","justicewarrior.social","kiwifarms.cc","ligma.pro","mastodon.starrevolution.org","neenster.org","not-develop.gab.com","npf.mlpol.net","pawoo.net","peertube.uno","pl.skyn3t.in","pl.smuglo.li","prout.social","qoto.org","search.fedi.app","shitposter.club","social.byoblu.com","social.sunshinegardens.org","socnet.supes.com","spinster.xyz","tube.gnous.eu","us.tv","uwu.social","video.nobodyhasthe.biz","witches.live","yggdrasil.social"],
media_nsfw: [], media_nsfw: [],
federated_timeline_removal: ["gab.com"], federated_timeline_removal: ["humblr.social","librem.one","quey.org","social.politicaconciencia.net","switter.at","7td.org","animalliberation.social","anime.website","barrag.net","bikeshed.party","blob.cat","busshi.moe","carnal-gabhub.ptotohype.net","carrot.army","cliterati.club","develop.gab.com","dickkickextremist.xyz","dogeposting.social","ekrem.develop.gab","expired.mentality.rip","fedi.absturztau.be","floppy.tokyo","freespeechextremist.com","freezepeach.xyz","gab.ai","gabble.xyz","gab.com","gabfed.com","gab.io","gab.polaris-1.work","gab.sleeck.eu","gleasonator.com","glindr.org","gnusocial.no","gs.smuglo.li","hagra.net","hitchhicker.social","hitchhiker.social","husk.site","inditoot.com","justicewarrior.social","kiwifarms.cc","ligma.pro","mastodon.starrevolution.org","neenster.org","not-develop.gab.com","npf.mlpol.net","pawoo.net","peertube.uno","pl.skyn3t.in","pl.smuglo.li","prout.social","qoto.org","search.fedi.app","shitposter.club","social.byoblu.com","social.sunshinegardens.org","socnet.supes.com","spinster.xyz","tube.gnous.eu","us.tv","uwu.social","video.nobodyhasthe.biz","witches.live","yggdrasil.social"],
report_removal: ["gab.com"], report_removal: ["humblr.social","librem.one","quey.org","social.politicaconciencia.net","switter.at","7td.org","animalliberation.social","anime.website","barrag.net","bikeshed.party","blob.cat","busshi.moe","carnal-gabhub.ptotohype.net","carrot.army","cliterati.club","develop.gab.com","dickkickextremist.xyz","dogeposting.social","ekrem.develop.gab","expired.mentality.rip","fedi.absturztau.be","floppy.tokyo","freespeechextremist.com","freezepeach.xyz","gab.ai","gabble.xyz","gab.com","gabfed.com","gab.io","gab.polaris-1.work","gab.sleeck.eu","gleasonator.com","glindr.org","gnusocial.no","gs.smuglo.li","hagra.net","hitchhicker.social","hitchhiker.social","husk.site","inditoot.com","justicewarrior.social","kiwifarms.cc","ligma.pro","mastodon.starrevolution.org","neenster.org","not-develop.gab.com","npf.mlpol.net","pawoo.net","peertube.uno","pl.skyn3t.in","pl.smuglo.li","prout.social","qoto.org","search.fedi.app","shitposter.club","social.byoblu.com","social.sunshinegardens.org","socnet.supes.com","spinster.xyz","tube.gnous.eu","us.tv","uwu.social","video.nobodyhasthe.biz","witches.live","yggdrasil.social"],
reject: ["gab.com"], reject: ["humblr.social","librem.one","quey.org","social.politicaconciencia.net","switter.at","7td.org","animalliberation.social","anime.website","barrag.net","bikeshed.party","blob.cat","busshi.moe","carnal-gabhub.ptotohype.net","carrot.army","cliterati.club","develop.gab.com","dickkickextremist.xyz","dogeposting.social","ekrem.develop.gab","expired.mentality.rip","fedi.absturztau.be","floppy.tokyo","freespeechextremist.com","freezepeach.xyz","gab.ai","gabble.xyz","gab.com","gabfed.com","gab.io","gab.polaris-1.work","gab.sleeck.eu","gleasonator.com","glindr.org","gnusocial.no","gs.smuglo.li","hagra.net","hitchhicker.social","hitchhiker.social","husk.site","inditoot.com","justicewarrior.social","kiwifarms.cc","ligma.pro","mastodon.starrevolution.org","neenster.org","not-develop.gab.com","npf.mlpol.net","pawoo.net","peertube.uno","pl.skyn3t.in","pl.smuglo.li","prout.social","qoto.org","search.fedi.app","shitposter.club","social.byoblu.com","social.sunshinegardens.org","socnet.supes.com","spinster.xyz","tube.gnous.eu","us.tv","uwu.social","video.nobodyhasthe.biz","witches.live","yggdrasil.social"],
accept: [], accept: [],
avatar_removal: ["gab.com"], avatar_removal: ["humblr.social","librem.one","quey.org","social.politicaconciencia.net","switter.at","7td.org","animalliberation.social","anime.website","barrag.net","bikeshed.party","blob.cat","busshi.moe","carnal-gabhub.ptotohype.net","carrot.army","cliterati.club","develop.gab.com","dickkickextremist.xyz","dogeposting.social","ekrem.develop.gab","expired.mentality.rip","fedi.absturztau.be","floppy.tokyo","freespeechextremist.com","freezepeach.xyz","gab.ai","gabble.xyz","gab.com","gabfed.com","gab.io","gab.polaris-1.work","gab.sleeck.eu","gleasonator.com","glindr.org","gnusocial.no","gs.smuglo.li","hagra.net","hitchhicker.social","hitchhiker.social","husk.site","inditoot.com","justicewarrior.social","kiwifarms.cc","ligma.pro","mastodon.starrevolution.org","neenster.org","not-develop.gab.com","npf.mlpol.net","pawoo.net","peertube.uno","pl.skyn3t.in","pl.smuglo.li","prout.social","qoto.org","search.fedi.app","shitposter.club","social.byoblu.com","social.sunshinegardens.org","socnet.supes.com","spinster.xyz","tube.gnous.eu","us.tv","uwu.social","video.nobodyhasthe.biz","witches.live","yggdrasil.social"],
banner_removal: ["gab.com"] banner_removal: ["humblr.social","librem.one","quey.org","social.politicaconciencia.net","switter.at","7td.org","animalliberation.social","anime.website","barrag.net","bikeshed.party","blob.cat","busshi.moe","carnal-gabhub.ptotohype.net","carrot.army","cliterati.club","develop.gab.com","dickkickextremist.xyz","dogeposting.social","ekrem.develop.gab","expired.mentality.rip","fedi.absturztau.be","floppy.tokyo","freespeechextremist.com","freezepeach.xyz","gab.ai","gabble.xyz","gab.com","gabfed.com","gab.io","gab.polaris-1.work","gab.sleeck.eu","gleasonator.com","glindr.org","gnusocial.no","gs.smuglo.li","hagra.net","hitchhicker.social","hitchhiker.social","husk.site","inditoot.com","justicewarrior.social","kiwifarms.cc","ligma.pro","mastodon.starrevolution.org","neenster.org","not-develop.gab.com","npf.mlpol.net","pawoo.net","peertube.uno","pl.skyn3t.in","pl.smuglo.li","prout.social","qoto.org","search.fedi.app","shitposter.club","social.byoblu.com","social.sunshinegardens.org","socnet.supes.com","spinster.xyz","tube.gnous.eu","us.tv","uwu.social","video.nobodyhasthe.biz","witches.live","yggdrasil.social"]
config :pleroma, :media_proxy, config :pleroma, :media_proxy,
enabled: false, enabled: false,

Ver fichero

@@ -2,5 +2,5 @@ module.exports = {
port: 8080, port: 8080,
username: 'user', username: 'user',
password: 'hatdav', password: 'hatdav',
limit: 100000000 // limit per user limit: 100000000000 // limit per user
} }

Ver fichero

@@ -36,7 +36,7 @@ services:
container_name: mysql-wordpress container_name: mysql-wordpress
hostname: mysql-wordpress hostname: mysql-wordpress
restart: always restart: always
command: ["mysqld", "--character-set-server=utf8", "--collation-server=utf8_general_ci", "--default-time-zone=+00:00","--explicit_defaults_for_timestamp", "--default-authentication-plugin=mysql_native_password"] command: ["mysqld", "--character-set-server=utf8", "--collation-server=utf8_general_ci", "--default-time-zone=+00:00","--explicit_defaults_for_timestamp", "--default-authentication-plugin=mysql_native_password", "--innodb_file_per_table=ON", "--innodb_stats_on_metadata=OFF", "--innodb_buffer_pool_instances=8", "--query_cache_type=0"]
expose: expose:
- 3306 - 3306
environment: environment:

Ver fichero

@@ -47,16 +47,5 @@
</div><!-- #page --> </div><!-- #page -->
<?php wp_footer(); ?> <?php wp_footer(); ?>
<!-- Start of Rocket.Chat Livechat Script -->
<script type="text/javascript">
(function(w, d, s, u) {
w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
var h = d.getElementsByTagName(s)[0], j = d.createElement(s);
j.async = true; j.src = 'https://talk.hatthieves.es/livechat/rocketchat-livechat.min.js?_=201903270000';
h.parentNode.insertBefore(j, h);
})(window, document, 'script', 'https://talk.hatthieves.es/livechat');
</script>
<!-- End of Rocket.Chat Livechat Script -->
</body> </body>
</html> </html>

Ver fichero

@@ -1,3 +1,68 @@
# BEGIN LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
<IfModule LiteSpeed>
RewriteEngine on
CacheLookup on
RewriteRule .* - [E=Cache-Control:no-autoflush]
### marker CACHE RESOURCE start ###
RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
### marker CACHE RESOURCE end ###
### marker FAVICON start ###
RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
### marker FAVICON end ###
### marker DROPQS start ###
CacheKeyModify -qs:fbclid
CacheKeyModify -qs:gclid
CacheKeyModify -qs:utm*
CacheKeyModify -qs:_ga
### marker DROPQS end ###
</IfModule>
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END LSCACHE
# BEGIN NON_LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
### marker BROWSER CACHE start ###
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType application/pdf A31557600
ExpiresByType image/x-icon A31557600
ExpiresByType image/vnd.microsoft.icon A31557600
ExpiresByType image/svg+xml A31557600
ExpiresByType image/jpg A31557600
ExpiresByType image/jpeg A31557600
ExpiresByType image/png A31557600
ExpiresByType image/gif A31557600
ExpiresByType image/webp A31557600
ExpiresByType video/ogg A31557600
ExpiresByType audio/ogg A31557600
ExpiresByType video/mp4 A31557600
ExpiresByType video/webm A31557600
ExpiresByType text/css A31557600
ExpiresByType text/javascript A31557600
ExpiresByType application/javascript A31557600
ExpiresByType application/x-javascript A31557600
ExpiresByType application/x-font-ttf A31557600
ExpiresByType application/x-font-woff A31557600
ExpiresByType application/font-woff A31557600
ExpiresByType application/font-woff2 A31557600
ExpiresByType application/vnd.ms-fontobject A31557600
ExpiresByType font/ttf A31557600
ExpiresByType font/woff A31557600
ExpiresByType font/woff2 A31557600
</IfModule>
### marker BROWSER CACHE end ###
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END NON_LSCACHE
# BEGIN All In One WP Security # BEGIN All In One WP Security
#AIOWPS_BASIC_HTACCESS_RULES_START #AIOWPS_BASIC_HTACCESS_RULES_START
<Files .htaccess> <Files .htaccess>
@@ -141,182 +206,6 @@ RewriteRule .* http://127.0.0.1 [L]
#AIOWPS_BLOCK_SPAMBOTS_END #AIOWPS_BLOCK_SPAMBOTS_END
# END All In One WP Security # END All In One WP Security
# BEGIN W3TC Browser Cache
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
AddType video/asf .asf .asx .wax .wmv .wmx
AddType video/avi .avi
AddType image/bmp .bmp
AddType application/java .class
AddType video/divx .divx
AddType application/msword .doc .docx
AddType application/vnd.ms-fontobject .eot
AddType application/x-msdownload .exe
AddType image/gif .gif
AddType application/x-gzip .gz .gzip
AddType image/x-icon .ico
AddType image/jpeg .jpg .jpeg .jpe
AddType image/webp .webp
AddType application/json .json
AddType application/vnd.ms-access .mdb
AddType audio/midi .mid .midi
AddType video/quicktime .mov .qt
AddType audio/mpeg .mp3 .m4a
AddType video/mp4 .mp4 .m4v
AddType video/mpeg .mpeg .mpg .mpe
AddType video/webm .webm
AddType application/vnd.ms-project .mpp
AddType application/x-font-otf .otf
AddType application/vnd.ms-opentype ._otf
AddType application/vnd.oasis.opendocument.database .odb
AddType application/vnd.oasis.opendocument.chart .odc
AddType application/vnd.oasis.opendocument.formula .odf
AddType application/vnd.oasis.opendocument.graphics .odg
AddType application/vnd.oasis.opendocument.presentation .odp
AddType application/vnd.oasis.opendocument.spreadsheet .ods
AddType application/vnd.oasis.opendocument.text .odt
AddType audio/ogg .ogg
AddType application/pdf .pdf
AddType image/png .png
AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
AddType audio/x-realaudio .ra .ram
AddType image/svg+xml .svg .svgz
AddType application/x-shockwave-flash .swf
AddType application/x-tar .tar
AddType image/tiff .tif .tiff
AddType application/x-font-ttf .ttf .ttc
AddType application/vnd.ms-opentype ._ttf
AddType audio/wav .wav
AddType audio/wma .wma
AddType application/vnd.ms-write .wri
AddType application/font-woff .woff
AddType application/font-woff2 .woff2
AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
AddType application/zip .zip
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css A31536000
ExpiresByType text/x-component A31536000
ExpiresByType application/x-javascript A31536000
ExpiresByType application/javascript A31536000
ExpiresByType text/javascript A31536000
ExpiresByType text/x-js A31536000
ExpiresByType video/asf A31536000
ExpiresByType video/avi A31536000
ExpiresByType image/bmp A31536000
ExpiresByType application/java A31536000
ExpiresByType video/divx A31536000
ExpiresByType application/msword A31536000
ExpiresByType application/vnd.ms-fontobject A31536000
ExpiresByType application/x-msdownload A31536000
ExpiresByType image/gif A31536000
ExpiresByType application/x-gzip A31536000
ExpiresByType image/x-icon A31536000
ExpiresByType image/jpeg A31536000
ExpiresByType image/webp A31536000
ExpiresByType application/json A31536000
ExpiresByType application/vnd.ms-access A31536000
ExpiresByType audio/midi A31536000
ExpiresByType video/quicktime A31536000
ExpiresByType audio/mpeg A31536000
ExpiresByType video/mp4 A31536000
ExpiresByType video/mpeg A31536000
ExpiresByType video/webm A31536000
ExpiresByType application/vnd.ms-project A31536000
ExpiresByType application/x-font-otf A31536000
ExpiresByType application/vnd.ms-opentype A31536000
ExpiresByType application/vnd.oasis.opendocument.database A31536000
ExpiresByType application/vnd.oasis.opendocument.chart A31536000
ExpiresByType application/vnd.oasis.opendocument.formula A31536000
ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
ExpiresByType application/vnd.oasis.opendocument.text A31536000
ExpiresByType audio/ogg A31536000
ExpiresByType application/pdf A31536000
ExpiresByType image/png A31536000
ExpiresByType application/vnd.ms-powerpoint A31536000
ExpiresByType audio/x-realaudio A31536000
ExpiresByType image/svg+xml A31536000
ExpiresByType application/x-shockwave-flash A31536000
ExpiresByType application/x-tar A31536000
ExpiresByType image/tiff A31536000
ExpiresByType application/x-font-ttf A31536000
ExpiresByType application/vnd.ms-opentype A31536000
ExpiresByType audio/wav A31536000
ExpiresByType audio/wma A31536000
ExpiresByType application/vnd.ms-write A31536000
ExpiresByType application/font-woff A31536000
ExpiresByType application/font-woff2 A31536000
ExpiresByType application/vnd.ms-excel A31536000
ExpiresByType application/zip A31536000
</IfModule>
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access video/webm application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint image/svg+xml application/x-shockwave-flash image/tiff application/x-font-ttf application/vnd.ms-opentype audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
</IfModule>
<FilesMatch "\.(css|htc|less|js|js2|js3|js4|CSS|HTC|LESS|JS|JS2|JS3|JS4)$">
FileETag MTime Size
<IfModule mod_headers.c>
Header unset Set-Cookie
</IfModule>
</FilesMatch>
<FilesMatch "\.(html|htm|rtf|rtx|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|TXT|XSD|XSL|XML)$">
FileETag MTime Size
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|webp|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|webm|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|_ttf|wav|wma|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|WEBP|JSON|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|WEBM|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|_TTF|WAV|WMA|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
FileETag MTime Size
<IfModule mod_headers.c>
Header unset Set-Cookie
</IfModule>
</FilesMatch>
<FilesMatch "\.(bmp|class|doc|docx|eot|exe|ico|json|mdb|webm|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|pot|pps|ppt|pptx|svg|svgz|swf|tif|tiff|ttf|ttc|_ttf|wav|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|BMP|CLASS|DOC|DOCX|EOT|EXE|ICO|JSON|MDB|WEBM|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|POT|PPS|PPT|PPTX|SVG|SVGZ|SWF|TIF|TIFF|TTF|TTC|_TTF|WAV|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW)$">
<IfModule mod_headers.c>
Header unset Last-Modified
</IfModule>
</FilesMatch>
<IfModule mod_headers.c>
Header set Referrer-Policy "no-referrer-when-downgrade"
</IfModule>
# END W3TC Browser Cache
# BEGIN W3TC CDN
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
# END W3TC CDN
# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteRule .* - [E=W3TC_SSL:_ssl]
RewriteCond %{SERVER_PORT} =443
RewriteRule .* - [E=W3TC_SSL:_ssl]
RewriteCond %{HTTP:X-Forwarded-Proto} =https [NC]
RewriteRule .* - [E=W3TC_SSL:_ssl]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=W3TC_ENC:_gzip]
RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
RewriteRule .* - [E=W3TC_PREVIEW:_preview]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =""
RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
RewriteCond %{REQUEST_URI} \/$
RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
</IfModule>
# END W3TC Page Cache core
# BEGIN WordPress # BEGIN WordPress
# Las directivas (líneas) entre `BEGIN WordPress` y `END WordPress` se generan dinámicamente # Las directivas (líneas) entre `BEGIN WordPress` y `END WordPress` se generan dinámicamente
# , y solo se deberían modificar mediante filtros de WordPress. # , y solo se deberían modificar mediante filtros de WordPress.

Las diferiencias del archivo han sido suprimidas porque una o mas lineas son muy largas

Ver fichero

@@ -1,199 +1,41 @@
<?php <?php
//ObjectCache Version: 1.4 defined( 'WPINC' ) || exit ;
/** /**
* W3 Total Cache Object Cache * LiteSpeed Object Cache
*
* @since 1.8
*/ */
if ( !defined( 'ABSPATH' ) ) {
die(); ! defined( 'LSCWP_OBJECT_CACHE' ) && define( 'LSCWP_OBJECT_CACHE', true ) ;
// Initialize const `LSCWP_DIR` and locate LSCWP plugin foder
$lscwp_dir = ( defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins' ) . '/litespeed-cache/' ;
// Use plugin as higher priority than MU plugin
if ( ! file_exists( $lscwp_dir . 'litespeed-cache.php' ) ) {
// Check if is mu plugin or not
$lscwp_dir = ( defined( 'WPMU_PLUGIN_DIR' ) ? WPMU_PLUGIN_DIR : WP_CONTENT_DIR . '/mu-plugins' ) . '/litespeed-cache/' ;
if ( ! file_exists( $lscwp_dir . 'litespeed-cache.php' ) ) {
$lscwp_dir = '' ;
}
} }
if ( !defined( 'W3TC_DIR' ) ) { $data_file = WP_CONTENT_DIR . '/.object-cache.ini' ;
define( 'W3TC_DIR', ( defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins' ) . '/w3-total-cache' ); $lib_file = $lscwp_dir . 'src/object.lib.php' ;
}
if ( !@is_dir( W3TC_DIR ) || !file_exists( W3TC_DIR . '/w3-total-cache-api.php' ) ) { // Can't find LSCWP location, terminate object cache process
if ( !defined( 'WP_ADMIN' ) ) { // lets don't show error on front end if ( ! $lscwp_dir || ! file_exists( $data_file ) || ( ! file_exists( $lib_file ) ) ) {
if ( ! is_admin() ) { // Bypass object cache for frontend
require_once ABSPATH . WPINC . '/cache.php' ; require_once ABSPATH . WPINC . '/cache.php' ;
} else {
echo sprintf( '<strong>W3 Total Cache Error:</strong> some files appear to be missing or out of place. Please re-install plugin or remove <strong>%s</strong>. <br />', __FILE__ );
} }
} else { else {
require_once W3TC_DIR . '/w3-total-cache-api.php'; $err = 'Can NOT find LSCWP path for object cache initialization in ' . __FILE__ ;
error_log( $err ) ;
/** echo $err ;
* Init cache }
* }
* @return void else {
*/ // Init object cache & LSCWP
function wp_cache_init() { if ( file_exists( $lib_file ) ) {
$GLOBALS['wp_object_cache'] = require_once $lib_file ;
\W3TC\Dispatcher::component( 'ObjectCache_WpObjectCache' );
}
/**
* Close cache
*
* @return boolean
*/
function wp_cache_close() {
return true;
}
/**
* Get cache
*
* @param string $id
* @param string $group
* @return mixed
*/
function wp_cache_get( $id, $group = 'default', $force = false, &$found = null ) {
global $wp_object_cache;
return $wp_object_cache->get( $id, $group, $force, $found );
}
/**
* Set cache
*
* @param string $id
* @param mixed $data
* @param string $group
* @param integer $expire
* @return boolean
*/
function wp_cache_set( $id, $data, $group = 'default', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->set( $id, $data, $group, (int)$expire );
}
/**
* Delete from cache
*
* @param string $id
* @param string $group
* @return boolean
*/
function wp_cache_delete( $id, $group = 'default' ) {
global $wp_object_cache;
return $wp_object_cache->delete( $id, $group );
}
/**
* Add data to cache
*
* @param string $id
* @param mixed $data
* @param string $group
* @param integer $expire
* @return boolean
*/
function wp_cache_add( $id, $data, $group = 'default', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->add( $id, $data, $group, (int)$expire );
}
/**
* Replace data in cache
*
* @param string $id
* @param mixed $data
* @param string $group
* @param integer $expire
* @return boolean
*/
function wp_cache_replace( $id, $data, $group = 'default', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->replace( $id, $data, $group, (int)$expire );
}
/**
* Reset cache
*
* @return boolean
*/
function wp_cache_reset() {
global $wp_object_cache;
return $wp_object_cache->reset();
}
/**
* Flush cache
*
* @return boolean
*/
function wp_cache_flush() {
global $wp_object_cache;
return $wp_object_cache->flush();
}
/**
* Add global groups
*
* @param array $groups
* @return void
*/
function wp_cache_add_global_groups( $groups ) {
global $wp_object_cache;
$wp_object_cache->add_global_groups( $groups );
}
/**
* Add non-persistent groups
*
* @param array $groups
* @return void
*/
function wp_cache_add_non_persistent_groups( $groups ) {
global $wp_object_cache;
$wp_object_cache->add_nonpersistent_groups( $groups );
}
/**
* Increment numeric cache item's value
*
* @param int|string $key The cache key to increment
* @param int $offset The amount by which to increment the item's value. Default is 1.
* @param string $group The group the key is in.
* @return bool|int False on failure, the item's new value on success.
*/
function wp_cache_incr( $key, $offset = 1, $group = 'default' ) {
global $wp_object_cache;
return $wp_object_cache->incr( $key, $offset, $group );
}
/**
* Decrement numeric cache item's value
*
* @param int|string $key The cache key to increment
* @param int $offset The amount by which to decrement the item's value. Default is 1.
* @param string $group The group the key is in.
* @return bool|int False on failure, the item's new value on success.
*/
function wp_cache_decr( $key, $offset = 1, $group = 'default' ) {
global $wp_object_cache;
return $wp_object_cache->decr( $key, $offset, $group );
}
/**
* Switch the internal blog id.
*
* This changes the blog id used to create keys in blog specific groups.
*
* @param int $blog_id Blog ID
*/
function wp_cache_switch_to_blog( $blog_id ) {
global $wp_object_cache;
return $wp_object_cache->switch_to_blog( $blog_id );
} }
} }

Ver fichero

@@ -79,15 +79,6 @@ table.comments td.comment p a:after {
.checkforspam { .checkforspam {
display: inline-block !important; display: inline-block !important;
} }
.checkforspam-progress {
display: none;
}
.checkforspam.checking .checkforspam-progress {
padding-left: 1ex;
}
.checkforspam.button-disabled .checkforspam-progress {
display: inline;
}
.checkforspam-spinner { .checkforspam-spinner {
display: inline-block; display: inline-block;

Ver fichero

@@ -84,6 +84,7 @@ jQuery( function ( $ ) {
}); });
// Show a preview image of the hovered URL. Applies to author URLs and URLs inside the comments. // Show a preview image of the hovered URL. Applies to author URLs and URLs inside the comments.
if ( "enable_mshots" in WPAkismet && WPAkismet.enable_mshots ) {
$( '#the-comment-list' ).on( 'mouseover', mshotEnabledLinkSelector, function () { $( '#the-comment-list' ).on( 'mouseover', mshotEnabledLinkSelector, function () {
clearTimeout( mshotRemovalTimer ); clearTimeout( mshotRemovalTimer );
@@ -145,9 +146,10 @@ jQuery( function ( $ ) {
} }
} ); } );
} ); } );
}
$( '.checkforspam' ).click( function( e ) { $( '.checkforspam.enable-on-load' ).click( function( e ) {
if ( $( this ).hasClass( 'checkforspam-pending-config' ) ) { if ( $( this ).hasClass( 'ajax-disabled' ) ) {
// Akismet hasn't been configured yet. Allow the user to proceed to the button's link. // Akismet hasn't been configured yet. Allow the user to proceed to the button's link.
return; return;
} }
@@ -162,11 +164,9 @@ jQuery( function ( $ ) {
$('.checkforspam').addClass('button-disabled').addClass( 'checking' ); $('.checkforspam').addClass('button-disabled').addClass( 'checking' );
$('.checkforspam-spinner').addClass( 'spinner' ).addClass( 'is-active' ); $('.checkforspam-spinner').addClass( 'spinner' ).addClass( 'is-active' );
// Update the label on the "Check for Spam" button to use the active "Checking for Spam" language.
$( '.checkforspam .akismet-label' ).text( $( '.checkforspam' ).data( 'active-label' ) );
akismet_check_for_spam(0, 100); akismet_check_for_spam(0, 100);
}); });
$( '.checkforspam.enable-on-load' ).removeClass( 'button-disabled' );
var spam_count = 0; var spam_count = 0;
var recheck_count = 0; var recheck_count = 0;
@@ -181,7 +181,7 @@ jQuery( function ( $ ) {
var percentage_complete = Math.round( ( recheck_count / check_for_spam_buttons.data( 'pending-comment-count' ) ) * 1000 ) / 10; var percentage_complete = Math.round( ( recheck_count / check_for_spam_buttons.data( 'pending-comment-count' ) ) * 1000 ) / 10;
// Update the progress counter on the "Check for Spam" button. // Update the progress counter on the "Check for Spam" button.
$( '.checkforspam-progress' ).text( check_for_spam_buttons.data( 'progress-label-format' ).replace( '%1$s', percentage_complete ) ); $( '.checkforspam' ).text( check_for_spam_buttons.data( 'progress-label' ).replace( '%1$s', percentage_complete ) );
$.post( $.post(
ajaxurl, ajaxurl,

Ver fichero

@@ -6,7 +6,7 @@
Plugin Name: Akismet Anti-Spam Plugin Name: Akismet Anti-Spam
Plugin URI: https://akismet.com/ Plugin URI: https://akismet.com/
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
Version: 4.1.5 Version: 4.1.6
Author: Automattic Author: Automattic
Author URI: https://automattic.com/wordpress-plugins/ Author URI: https://automattic.com/wordpress-plugins/
License: GPLv2 or later License: GPLv2 or later
@@ -37,7 +37,7 @@ if ( !function_exists( 'add_action' ) ) {
exit; exit;
} }
define( 'AKISMET_VERSION', '4.1.5' ); define( 'AKISMET_VERSION', '4.1.6' );
define( 'AKISMET__MINIMUM_WP_VERSION', '4.0' ); define( 'AKISMET__MINIMUM_WP_VERSION', '4.0' );
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'AKISMET_DELETE_LIMIT', 100000 ); define( 'AKISMET_DELETE_LIMIT', 100000 );

Ver fichero

@@ -153,6 +153,10 @@ class Akismet_Admin {
$inline_js['start_recheck'] = true; $inline_js['start_recheck'] = true;
} }
if ( apply_filters( 'akismet_enable_mshots', true ) ) {
$inline_js['enable_mshots'] = true;
}
wp_localize_script( 'akismet.js', 'WPAkismet', $inline_js ); wp_localize_script( 'akismet.js', 'WPAkismet', $inline_js );
} }
} }
@@ -383,7 +387,7 @@ class Akismet_Admin {
return; return;
} }
$link = add_query_arg( array( 'action' => 'akismet_recheck_queue' ), admin_url( 'admin.php' ) ); $link = '';
$comments_count = wp_count_comments(); $comments_count = wp_count_comments();
@@ -393,32 +397,30 @@ class Akismet_Admin {
$classes = array( $classes = array(
'button-secondary', 'button-secondary',
'checkforspam', 'checkforspam',
'button-disabled' // Disable button until the page is loaded
); );
if ( $comments_count->moderated > 0 ) {
$classes[] = 'enable-on-load';
if ( ! Akismet::get_api_key() ) { if ( ! Akismet::get_api_key() ) {
$link = admin_url( 'options-general.php?page=akismet-key-config' ); $link = add_query_arg( array( 'page' => 'akismet-key-config' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) );
$classes[] = 'ajax-disabled';
$classes[] = 'checkforspam-pending-config'; }
} }
if ( $comments_count->moderated == 0 ) {
$classes[] = 'button-disabled';
}
echo '<a echo '<a
class="' . esc_attr( implode( ' ', $classes ) ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '"' .
href="' . esc_url( $link ) . '" ( ! empty( $link ) ? ' href="' . esc_url( $link ) . '"' : '' ) .
data-active-label="' . esc_attr( __( 'Checking for Spam', 'akismet' ) ) . '" /* translators: The placeholder is for showing how much of the process has completed, as a percent. e.g., "Checking for Spam (40%)" */
data-progress-label-format="' . esc_attr( __( '(%1$s%)', 'akismet' ) ) . '" ' data-progress-label="' . esc_attr( __( 'Checking for Spam (%1$s%)', 'akismet' ) ) . '"
data-success-url="' . esc_attr( remove_query_arg( array( 'akismet_recheck', 'akismet_recheck_error' ), add_query_arg( array( 'akismet_recheck_complete' => 1, 'recheck_count' => urlencode( '__recheck_count__' ), 'spam_count' => urlencode( '__spam_count__' ) ) ) ) ) . '" data-success-url="' . esc_attr( remove_query_arg( array( 'akismet_recheck', 'akismet_recheck_error' ), add_query_arg( array( 'akismet_recheck_complete' => 1, 'recheck_count' => urlencode( '__recheck_count__' ), 'spam_count' => urlencode( '__spam_count__' ) ) ) ) ) . '"
data-failure-url="' . esc_attr( remove_query_arg( array( 'akismet_recheck', 'akismet_recheck_complete' ), add_query_arg( array( 'akismet_recheck_error' => 1 ) ) ) ) . '" data-failure-url="' . esc_attr( remove_query_arg( array( 'akismet_recheck', 'akismet_recheck_complete' ), add_query_arg( array( 'akismet_recheck_error' => 1 ) ) ) ) . '"
data-pending-comment-count="' . esc_attr( $comments_count->moderated ) . '" data-pending-comment-count="' . esc_attr( $comments_count->moderated ) . '"
data-nonce="' . esc_attr( wp_create_nonce( 'akismet_check_for_spam' ) ) . '" data-nonce="' . esc_attr( wp_create_nonce( 'akismet_check_for_spam' ) ) . '"
>'; ' . ( ! in_array( 'ajax-disabled', $classes ) ? 'onclick="return false;"' : '' ) . '
echo '<span class="akismet-label">' . esc_html__('Check for Spam', 'akismet') . '</span>'; >' . esc_html__('Check for Spam', 'akismet') . '</a>';
echo '<span class="checkforspam-progress"></span>';
echo '</a>';
echo '<span class="checkforspam-spinner"></span>'; echo '<span class="checkforspam-spinner"></span>';
} }
public static function recheck_queue() { public static function recheck_queue() {

Ver fichero

@@ -3,7 +3,7 @@ Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eo
Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
Requires at least: 4.6 Requires at least: 4.6
Tested up to: 5.4 Tested up to: 5.4
Stable tag: 4.1.5 Stable tag: 4.1.6
License: GPLv2 or later License: GPLv2 or later
Akismet checks your comments and contact form submissions against our global database of spam to protect you and your site from malicious content. Akismet checks your comments and contact form submissions against our global database of spam to protect you and your site from malicious content.
@@ -30,6 +30,12 @@ Upload the Akismet plugin to your blog, activate it, and then enter your Akismet
== Changelog == == Changelog ==
= 4.1.6 =
*Release Date - 4 June 2020*
* Disable "Check for Spam" button until the page is loaded to avoid errors with clicking through to queue recheck endpoint directly.
* Add filter "akismet_enable_mshots" to allow disabling screenshot popups on the edit comments admin page.
= 4.1.5 = = 4.1.5 =
*Release Date - 29 April 2020* *Release Date - 29 April 2020*

Ver fichero

@@ -90,15 +90,12 @@ class AIOWPSecurity_List_Logged_In_Users extends AIOWPSecurity_List_Table {
$user_id = absint($user_id); $user_id = absint($user_id);
$manager = WP_Session_Tokens::get_instance( $user_id ); $manager = WP_Session_Tokens::get_instance( $user_id );
$manager->destroy_all(); $manager->destroy_all();
//
$aio_wp_security->user_login_obj->update_user_online_transient($user_id, $ip_addr); $aio_wp_security->user_login_obj->cleanup_users_online_transient($user_id, $ip_addr);
// if($result != NULL)
// {
$success_msg = '<div id="message" class="updated fade"><p><strong>'; $success_msg = '<div id="message" class="updated fade"><p><strong>';
$success_msg .= __('The selected user was logged out successfully!','all-in-one-wp-security-and-firewall'); $success_msg .= __('The selected user was logged out successfully!','all-in-one-wp-security-and-firewall');
$success_msg .= '</strong></p></div>'; $success_msg .= '</strong></p></div>';
_e($success_msg); _e($success_msg);
// }
} }
} }
@@ -117,19 +114,10 @@ class AIOWPSecurity_List_Logged_In_Users extends AIOWPSecurity_List_Table {
if (AIOWPSecurity_Utility::is_multisite_install()) { if (AIOWPSecurity_Utility::is_multisite_install()) {
$current_blog_id = get_current_blog_id(); $current_blog_id = get_current_blog_id();
$is_main = is_main_site($current_blog_id);
if(empty($is_main)) {
// subsite - only get logged in users for this blog_id
$logged_in_users = AIOWPSecurity_User_Login::get_subsite_logged_in_users($current_blog_id); $logged_in_users = AIOWPSecurity_User_Login::get_subsite_logged_in_users($current_blog_id);
} else {
// main site - get sitewide users
$logged_in_users = get_site_transient('users_online');
}
} else { } else {
$logged_in_users = get_transient('users_online'); $logged_in_users = get_transient('users_online');
} }
if(empty($logged_in_users)){ if(empty($logged_in_users)){
$logged_in_users = array(); //If no transient found set to empty array $logged_in_users = array(); //If no transient found set to empty array
}else{ }else{

Ver fichero

@@ -174,7 +174,7 @@ class AIOWPSecurity_Settings_Menu extends AIOWPSecurity_Admin_Menu
<div class="postbox"> <div class="postbox">
<h3 class="hndle"><label for="title"><?php _e('Disable Security Features', 'all-in-one-wp-security-and-firewall'); ?></label></h3> <h3 class="hndle"><label for="title"><?php _e('Disable Security Features', 'all-in-one-wp-security-and-firewall'); ?></label></h3>
<div class="inside"> <div class="inside">
<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>"> <form method="post" action="">
<?php wp_nonce_field('aiowpsec-disable-all-features'); ?> <?php wp_nonce_field('aiowpsec-disable-all-features'); ?>
<div class="aio_blue_box"> <div class="aio_blue_box">
<?php <?php
@@ -191,7 +191,7 @@ class AIOWPSecurity_Settings_Menu extends AIOWPSecurity_Admin_Menu
<div class="postbox"> <div class="postbox">
<h3 class="hndle"><label for="title"><?php _e('Disable All Firewall Rules', 'all-in-one-wp-security-and-firewall'); ?></label></h3> <h3 class="hndle"><label for="title"><?php _e('Disable All Firewall Rules', 'all-in-one-wp-security-and-firewall'); ?></label></h3>
<div class="inside"> <div class="inside">
<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>"> <form method="post" action="">
<?php wp_nonce_field('aiowpsec-disable-all-firewall-rules'); ?> <?php wp_nonce_field('aiowpsec-disable-all-firewall-rules'); ?>
<div class="aio_blue_box"> <div class="aio_blue_box">
<?php <?php
@@ -208,7 +208,7 @@ class AIOWPSecurity_Settings_Menu extends AIOWPSecurity_Admin_Menu
<div class="postbox"> <div class="postbox">
<h3 class="hndle"><label for="title"><?php _e('Debug Settings', 'all-in-one-wp-security-and-firewall'); ?></label></h3> <h3 class="hndle"><label for="title"><?php _e('Debug Settings', 'all-in-one-wp-security-and-firewall'); ?></label></h3>
<div class="inside"> <div class="inside">
<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>"> <form method="post" action="">
<?php wp_nonce_field('aiowpsec-save-debug-settings'); ?> <?php wp_nonce_field('aiowpsec-save-debug-settings'); ?>
<div class="aio_blue_box"> <div class="aio_blue_box">
<?php <?php

Ver fichero

@@ -20,8 +20,6 @@ class AIOWPSecurity_General_Init_Tasks
AIOWPSecurity_Blocking::check_visitor_ip_and_perform_blocking(); AIOWPSecurity_Blocking::check_visitor_ip_and_perform_blocking();
if ($aio_wp_security->configs->get_value('aiowps_enable_autoblock_spam_ip') == '1') { if ($aio_wp_security->configs->get_value('aiowps_enable_autoblock_spam_ip') == '1') {
//add_action( 'spammed_comment', array(&$this, 'process_spammed_comment' )); //this hook gets fired when admin marks comment as spam
//add_action( 'akismet_submit_spam_comment', array(&$this, 'process_akismet_submit_spam_comment' ), 10, 2); //this hook gets fired when akismet marks a comment as spam
add_action( 'comment_post', array(&$this, 'spam_detect_process_comment_post' ), 10, 2); //this hook gets fired just after comment is saved to DB add_action( 'comment_post', array(&$this, 'spam_detect_process_comment_post' ), 10, 2); //this hook gets fired just after comment is saved to DB
add_action( 'transition_comment_status', array(&$this, 'process_transition_comment_status' ), 10, 3); //this hook gets fired when a comment's status changes add_action( 'transition_comment_status', array(&$this, 'process_transition_comment_status' ), 10, 3); //this hook gets fired when a comment's status changes
} }
@@ -246,7 +244,7 @@ class AIOWPSecurity_General_Init_Tasks
// For feature which displays logged in users // For feature which displays logged in users
$this->update_logged_in_user_transient(); $aio_wp_security->user_login_obj->update_users_online_transient();
// For block fake googlebots feature // For block fake googlebots feature
if($aio_wp_security->configs->get_value('aiowps_block_fake_googlebots') == '1'){ if($aio_wp_security->configs->get_value('aiowps_block_fake_googlebots') == '1'){
@@ -372,68 +370,6 @@ class AIOWPSecurity_General_Init_Tasks
} }
} }
function update_logged_in_user_transient(){
if(is_user_logged_in()){
$current_user_ip = AIOWPSecurity_Utility_IP::get_user_ip_address();
// get the logged in users list from transients entry
$logged_in_users = (AIOWPSecurity_Utility::is_multisite_install() ? get_site_transient('users_online') : get_transient('users_online'));
$current_user = wp_get_current_user();
$current_user = $current_user->ID;
$current_time = current_time('timestamp');
// Store last activity time and ip address in transient entry
if(AIOWPSecurity_Utility::is_multisite_install()) {
$current_blog_id = get_current_blog_id();
// For multi-sites also store blog_id
$current_user_info = array("user_id" => $current_user, "last_activity" => $current_time, "ip_address" => $current_user_ip, "blog_id" => $current_blog_id);
} else {
$current_user_info = array("user_id" => $current_user, "last_activity" => $current_time, "ip_address" => $current_user_ip); //We will store last activity time and ip address in transient entry
}
if($logged_in_users === false || $logged_in_users == NULL){
$logged_in_users = array();
$logged_in_users[] = $current_user_info;
AIOWPSecurity_Utility::is_multisite_install() ? set_site_transient('users_online', $logged_in_users, 30 * 60) : set_transient('users_online', $logged_in_users, 30 * 60);
}
else
{
$key = 0;
$do_nothing = false;
$update_existing = false;
$item_index = 0;
foreach ($logged_in_users as $value)
{
if($value['user_id'] == $current_user && strcmp($value['ip_address'], $current_user_ip) == 0)
{
if ($value['last_activity'] < ($current_time - (15 * 60)))
{
$update_existing = true;
$item_index = $key;
break;
}else{
$do_nothing = true;
break;
}
}
$key++;
}
if($update_existing)
{
//Update transient if the last activity was less than 15 min ago for this user
$logged_in_users[$item_index] = $current_user_info;
AIOWPSecurity_Utility::is_multisite_install() ? set_site_transient('users_online', $logged_in_users, 30 * 60) : set_transient('users_online', $logged_in_users, 30 * 60);
}else if($do_nothing){
//Do nothing
}else{
$logged_in_users[] = $current_user_info;
AIOWPSecurity_Utility::is_multisite_install() ? set_site_transient('users_online', $logged_in_users, 30 * 60) : set_transient('users_online', $logged_in_users, 30 * 60);
}
}
}
}
/** /**
* Renders captcha on form produced by the wp_login_form() function, ie, custom wp login form * Renders captcha on form produced by the wp_login_form() function, ie, custom wp login form
* @global type $aio_wp_security * @global type $aio_wp_security
@@ -527,7 +463,7 @@ class AIOWPSecurity_General_Init_Tasks
} }
//Don't do captcha for pingback/trackback //Don't do captcha for pingback/trackback
if ($comment['comment_type'] != '' && $comment['comment_type'] != 'comment') { if ($comment['comment_type'] != '' && $comment['comment_type'] != 'comment' && $comment['comment_type'] != 'review') {
return $comment; return $comment;
} }

Ver fichero

@@ -504,7 +504,7 @@ class AIOWPSecurity_User_Login
$ip_addr = AIOWPSecurity_Utility_IP::get_user_ip_address(); $ip_addr = AIOWPSecurity_Utility_IP::get_user_ip_address();
$user_id = $current_user->ID; $user_id = $current_user->ID;
//Clean up transients table //Clean up transients table
$this->update_user_online_transient($user_id, $ip_addr); $this->cleanup_users_online_transient($user_id, $ip_addr);
$login_activity_table = AIOWPSEC_TBL_USER_LOGIN_ACTIVITY; $login_activity_table = AIOWPSEC_TBL_USER_LOGIN_ACTIVITY;
$logout_date_time = current_time( 'mysql' ); $logout_date_time = current_time( 'mysql' );
$data = array('logout_date' => $logout_date_time); $data = array('logout_date' => $logout_date_time);
@@ -517,29 +517,93 @@ class AIOWPSecurity_User_Login
$aio_wp_security->debug_logger->log_debug("Error inserting record into ".$login_activity_table,4);//Log the highly unlikely event of DB error $aio_wp_security->debug_logger->log_debug("Error inserting record into ".$login_activity_table,4);//Log the highly unlikely event of DB error
} }
} }
/** /**
* This will clean up the "users_online" transient entry for the current user. * Update the 'users_online' transient
* * @return void
*/ */
function update_user_online_transient($user_id, $ip_addr) function update_users_online_transient()
{
if(is_user_logged_in()){
$is_multi_site = AIOWPSecurity_Utility::is_multisite_install();
$current_user_ip = AIOWPSecurity_Utility_IP::get_user_ip_address();
// get the logged in users list from transients entry
$logged_in_users = ($is_multi_site ? get_site_transient('users_online') : get_transient('users_online'));
$current_user = wp_get_current_user();
$current_user = $current_user->ID;
$current_time = current_time('timestamp');
$current_user_info = array();
// Store last activity time and ip address in transient entry
if($is_multi_site) {
$current_blog_id = get_current_blog_id();
// For multi-sites also store blog_id
$current_user_info = array("user_id" => $current_user, "last_activity" => $current_time, "ip_address" => $current_user_ip, "blog_id" => $current_blog_id);
} else {
$current_user_info = array("user_id" => $current_user, "last_activity" => $current_time, "ip_address" => $current_user_ip, "blog_id" => false);
}
if(empty($logged_in_users))
{
// case when "users_online" transient has been deleted after expiry or is empty
$logged_in_users = array();
$logged_in_users[] = $current_user_info;
$is_multi_site ? set_site_transient('users_online', $logged_in_users, 30 * 60) : set_transient('users_online', $logged_in_users, 30 * 60);
}
else
{
$key = 0;
$update_existing = false;
$item_index = 0;
foreach ($logged_in_users as $value)
{
$value_minus_activity = $value;
unset($value_minus_activity['last_activity']);
$current_user_minus_activity = $current_user_info;
unset($current_user_minus_activity['last_activity']);
// Check if current user we're looking at has an entry in the 'users_online' transient
if(empty(array_diff($current_user_minus_activity, $value_minus_activity)))
{
if ($value['last_activity'] < ($current_time - (15 * 60)))
{
$update_existing = true;
$item_index = $key;
break;
}else{
return; // do nothing and just return
}
}
$key++;
}
if($update_existing) {
// Update transient if the last activity was over 15 min ago for this user
$logged_in_users[$item_index] = $current_user_info;
AIOWPSecurity_Utility::is_multisite_install() ? set_site_transient('users_online', $logged_in_users, 30 * 60) : set_transient('users_online', $logged_in_users, 30 * 60);
} else {
$logged_in_users[] = $current_user_info;
AIOWPSecurity_Utility::is_multisite_install() ? set_site_transient('users_online', $logged_in_users, 30 * 60) : set_transient('users_online', $logged_in_users, 30 * 60);
}
}
}
}
/**
* This will clean up the "users_online" transient entry for the current user when a logout occurs
* @return void
*/
function cleanup_users_online_transient($user_id, $ip_addr)
{ {
global $aio_wp_security; global $aio_wp_security;
$is_multi_site = AIOWPSecurity_Utility::is_multisite_install(); $is_multi_site = AIOWPSecurity_Utility::is_multisite_install();
if ($is_multi_site) { if ($is_multi_site) {
$current_blog_id = get_current_blog_id(); $current_blog_id = get_current_blog_id();
$is_main = is_main_site($current_blog_id); $logged_in_users = AIOWPSecurity_User_Login::get_subsite_logged_in_users($current_blog_id);
if($is_main) {
$logged_in_users = get_site_transient('users_online');
} else {
switch_to_blog($current_blog_id);
$logged_in_users = get_transient('users_online');
}
} else { } else {
$logged_in_users = get_transient('users_online'); $logged_in_users = get_transient('users_online');
} }
//$logged_in_users = get_transient('users_online'); if (empty($logged_in_users))
if ($logged_in_users === false || $logged_in_users == NULL)
{ {
return; return;
} }
@@ -553,11 +617,10 @@ class AIOWPSecurity_User_Login
} }
$j++; $j++;
} }
//Save the transient
// AIOWPSecurity_Utility::is_multisite_install() ? set_site_transient('users_online', $logged_in_users, 30 * 60) : set_transient('users_online', $logged_in_users, 30 * 60); // Save the transient
if ($is_multi_site) { if ($is_multi_site) {
($is_main) ? set_site_transient('users_online', $logged_in_users, 30 * 60) : set_transient('users_online', $logged_in_users, 30 * 60); set_site_transient('users_online', $logged_in_users, 30 * 60);
} else { } else {
set_transient('users_online', $logged_in_users, 30 * 60); set_transient('users_online', $logged_in_users, 30 * 60);
} }
@@ -631,7 +694,7 @@ class AIOWPSecurity_User_Login
* Returns all logged in users for specific subsite of multisite installation * Returns all logged in users for specific subsite of multisite installation
* Checks the aiowps transient 'users_online' * Checks the aiowps transient 'users_online'
* @param type $blog_id * @param type $blog_id
* @return array * @return array|bool
*/ */
static function get_subsite_logged_in_users($blog_id=0) { static function get_subsite_logged_in_users($blog_id=0) {
if(empty($blog_id)) return false; if(empty($blog_id)) return false;
@@ -640,9 +703,11 @@ class AIOWPSecurity_User_Login
if (AIOWPSecurity_Utility::is_multisite_install()) { if (AIOWPSecurity_Utility::is_multisite_install()) {
// this contains all logged in users sitewide across subsites // this contains all logged in users sitewide across subsites
$users_online = get_site_transient('users_online'); $users_online = get_site_transient('users_online');
$logged_in_users = empty($users_online)?array():$users_online; if(empty($users_online)) {
// Subsite - extract only logged in users for current blog return array();
foreach($logged_in_users as $user) { }
// Extract only logged in users for current subsite
foreach($users_online as $user) {
if (isset($user['blog_id']) && $user['blog_id'] == $blog_id) { if (isset($user['blog_id']) && $user['blog_id'] == $blog_id) {
$subsite_logged_in_users[] = $user; $subsite_logged_in_users[] = $user;
} }
@@ -650,4 +715,5 @@ class AIOWPSecurity_User_Login
} }
return $subsite_logged_in_users; return $subsite_logged_in_users;
} }
} }

Ver fichero

@@ -4,7 +4,7 @@ Donate link: https://www.tipsandtricks-hq.com
Tags: security, secure, Anti Virus, antivirus, ban, ban hacker, virus, firewall, firewall security, login, lockdown, htaccess, hack, malware, vulnerability, protect, protection, phishing, database, backup, plugin, sql injection, ssl, restrict, login captcha, bot, hotlink, 404 detection, admin, rename, all in one, scan, scanner, iframe, Tags: security, secure, Anti Virus, antivirus, ban, ban hacker, virus, firewall, firewall security, login, lockdown, htaccess, hack, malware, vulnerability, protect, protection, phishing, database, backup, plugin, sql injection, ssl, restrict, login captcha, bot, hotlink, 404 detection, admin, rename, all in one, scan, scanner, iframe,
Requires at least: 4.7 Requires at least: 4.7
Tested up to: 5.4 Tested up to: 5.4
Stable tag: 4.4.3 Stable tag: 4.4.4
License: GPLv3 License: GPLv3
A comprehensive, user-friendly, all in one WordPress security and firewall plugin for your site. A comprehensive, user-friendly, all in one WordPress security and firewall plugin for your site.
@@ -184,6 +184,12 @@ None
== Changelog == == Changelog ==
= 4.4.4 =
- Fixed bugs and improved functionality related to "logged in users" functionality.
- Google recaptha checks for WooCommerce product reviews
- Replaced use of deprecated hook "wpmu_new_blog" with "wp_insert_site"
- Fixed a potential XSS issue in the settings menu of the plugin for IE11 or older browsers.
= 4.4.3 = = 4.4.3 =
- Improved file change detection feature to address DB backups failing silently in some cases due to very large serialized data stored in a single row. - Improved file change detection feature to address DB backups failing silently in some cases due to very large serialized data stored in a single row.
- Added new action hook (aiowps_rename_login_load) just before renamed login page is loaded. - Added new action hook (aiowps_rename_login_load) just before renamed login page is loaded.

Ver fichero

@@ -7,7 +7,7 @@ if ( !defined('ABSPATH') ) {
if (!class_exists('AIO_WP_Security')){ if (!class_exists('AIO_WP_Security')){
class AIO_WP_Security{ class AIO_WP_Security{
var $version = '4.4.3'; var $version = '4.4.4';
var $db_version = '1.9'; var $db_version = '1.9';
var $plugin_url; var $plugin_url;
var $plugin_path; var $plugin_path;

Ver fichero

@@ -1,7 +1,7 @@
<?php <?php
/* /*
Plugin Name: All In One WP Security Plugin Name: All In One WP Security
Version: 4.4.3 Version: 4.4.4
Plugin URI: https://www.tipsandtricks-hq.com/wordpress-security-and-firewall-plugin Plugin URI: https://www.tipsandtricks-hq.com/wordpress-security-and-firewall-plugin
Author: Tips and Tricks HQ, Peter Petreski, Ruhul, Ivy Author: Tips and Tricks HQ, Peter Petreski, Ruhul, Ivy
Author URI: https://www.tipsandtricks-hq.com/ Author URI: https://www.tipsandtricks-hq.com/
@@ -29,17 +29,20 @@ function aiowps_show_plugin_settings_link($links, $file)
} }
add_filter('plugin_action_links', 'aiowps_show_plugin_settings_link', 10, 2 ); add_filter('plugin_action_links', 'aiowps_show_plugin_settings_link', 10, 2 );
function aiowps_ms_handle_new_blog_creation($blog_id, $user_id, $domain, $path, $site_id, $meta ){ function aiowps_ms_handle_new_site($new_site){
global $wpdb; global $wpdb;
if (is_plugin_active_for_network(__FILE__)) $plugin_basename = plugin_basename( __FILE__ );
if (is_plugin_active_for_network($plugin_basename))
{ {
if(!class_exists('AIOWPSecurity_Installer')){ if(!class_exists('AIOWPSecurity_Installer')){
include_once('classes/wp-security-installer.php'); include_once('classes/wp-security-installer.php');
} }
$old_blog = $wpdb->blogid; $old_blog = $wpdb->blogid;
switch_to_blog($blog_id); switch_to_blog($new_site->blog_id);
AIOWPSecurity_Installer::create_db_tables(); AIOWPSecurity_Installer::create_db_tables();
switch_to_blog($old_blog); switch_to_blog($old_blog);
} }
} }
add_action('wpmu_new_blog', 'aiowps_ms_handle_new_blog_creation', 10, 6); add_action('wp_insert_site', 'aiowps_ms_handle_new_site', 10, 1);

Ver fichero

@@ -5,7 +5,7 @@
* *
* bbPress is forum software with a twist from the creators of WordPress. * bbPress is forum software with a twist from the creators of WordPress.
* *
* $Id: bbpress.php 7062 2020-01-30 12:32:42Z johnjamesjacoby $ * $Id: bbpress.php 7090 2020-05-28 16:58:55Z johnjamesjacoby $
* *
* @package bbPress * @package bbPress
* @subpackage Main * @subpackage Main
@@ -17,10 +17,12 @@
* Description: bbPress is forum software with a twist from the creators of WordPress. * Description: bbPress is forum software with a twist from the creators of WordPress.
* Author: The bbPress Contributors * Author: The bbPress Contributors
* Author URI: https://bbpress.org * Author URI: https://bbpress.org
* Version: 2.6.4 * Version: 2.6.5
* Text Domain: bbpress * Text Domain: bbpress
* Domain Path: /languages/ * Domain Path: /languages/
* License: GPLv2 or later (license.txt) * License: GPLv2 or later (license.txt)
* Requires PHP: 5.6.20
* Requires at least: 4.7
*/ */
// Exit if accessed directly // Exit if accessed directly
@@ -203,7 +205,7 @@ final class bbPress {
/** Versions **********************************************************/ /** Versions **********************************************************/
$this->version = '2.6.4'; $this->version = '2.6.5';
$this->db_version = '263'; $this->db_version = '263';
/** Paths *************************************************************/ /** Paths *************************************************************/

La diferencia del archivo ha sido suprimido porque es demasiado grande Cargar Diff

Ver fichero

@@ -5,6 +5,7 @@ jQuery( document ).ready( function() {
bbp_author_id.suggest( bbp_author_id.suggest(
bbp_author_id.data( 'ajax-url' ), bbp_author_id.data( 'ajax-url' ),
{ {
minchars: 1, // Allow single-digit user IDs
onSelect: function() { onSelect: function() {
var value = this.value; var value = this.value;
bbp_author_id.val( value.substr( 0, value.indexOf( ' ' ) ) ); bbp_author_id.val( value.substr( 0, value.indexOf( ' ' ) ) );

Ver fichero

@@ -1,3 +1,3 @@
/*! This file is automatically generated. */ /*! This file is automatically generated. */
jQuery(document).ready(function(){var a=jQuery("#bbp_author_id");a.suggest(a.data("ajax-url"),{onSelect:function(){var u=this.value;a.val(u.substr(0,u.indexOf(" ")))}})}); jQuery(document).ready(function(){var a=jQuery("#bbp_author_id");a.suggest(a.data("ajax-url"),{minchars:1,onSelect:function(){var u=this.value;a.val(u.substr(0,u.indexOf(" ")))}})});

Ver fichero

@@ -586,6 +586,11 @@ class BBP_Admin {
// Loop through fields for this section // Loop through fields for this section
foreach ( (array) $fields as $field_id => $field ) { foreach ( (array) $fields as $field_id => $field ) {
// Skip field if user is not capable
if ( ! empty( $field['capability'] ) && ! current_user_can( $field['capability'] ) ) {
continue;
}
// Add the field // Add the field
if ( ! empty( $field['callback'] ) && ! empty( $field['title'] ) ) { if ( ! empty( $field['callback'] ) && ! empty( $field['title'] ) ) {
add_settings_field( $field_id, $field['title'], $field['callback'], $page, $section_id, $field['args'] ); add_settings_field( $field_id, $field['title'], $field['callback'], $page, $section_id, $field['args'] );
@@ -891,29 +896,46 @@ class BBP_Admin {
*/ */
public function suggest_topic() { public function suggest_topic() {
// Bail early if no request // Do some very basic request checking
if ( empty( $_REQUEST['q'] ) ) { $request = ! empty( $_REQUEST['q'] )
wp_die( '0' ); ? trim( $_REQUEST['q'] )
: '';
// Bail early if empty request
if ( empty( $request ) ) {
wp_die();
} }
// Bail if user cannot moderate - only moderators can change hierarchy // Bail if user cannot moderate
if ( ! current_user_can( 'moderate' ) ) { if ( ! current_user_can( 'moderate' ) ) {
wp_die( '0' ); wp_die();
} }
// Check the ajax nonce // Check the ajax nonce
check_ajax_referer( 'bbp_suggest_topic_nonce' ); check_ajax_referer( 'bbp_suggest_topic_nonce' );
// Allow the maximum number of results to be filtered
$number = (int) apply_filters( 'bbp_suggest_topic_count', 10 );
// Try to get some topics // Try to get some topics
$topics = get_posts( array( $topics = get_posts( array(
's' => bbp_db()->esc_like( $_REQUEST['q'] ), 's' => bbp_db()->esc_like( $_REQUEST['q'] ),
'post_type' => bbp_get_topic_post_type() 'post_type' => bbp_get_topic_post_type(),
'posts_per_page' => $number,
// Performance
'nopaging' => true,
'suppress_filters' => true,
'update_post_term_cache' => false,
'update_post_meta_cache' => false,
'ignore_sticky_posts' => true,
'no_found_rows' => true
) ); ) );
// If we found some topics, loop through and display them // If we found some topics, loop through and display them
if ( ! empty( $topics ) ) { if ( ! empty( $topics ) ) {
foreach ( (array) $topics as $post ) { foreach ( (array) $topics as $post ) {
printf( esc_html__( '%s - %s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) . "\n" ); printf( esc_html__( '%1$s - %2$s', 'bbpress' ), bbp_get_topic_id( $post->ID ), bbp_get_topic_title( $post->ID ) . "\n" );
} }
} }
die(); die();
@@ -926,31 +948,74 @@ class BBP_Admin {
*/ */
public function suggest_user() { public function suggest_user() {
// Bail early if no request // Do some very basic request checking
if ( empty( $_REQUEST['q'] ) ) { $request = ! empty( $_REQUEST['q'] )
wp_die( '0' ); ? trim( $_REQUEST['q'] )
: '';
// Bail early if empty request
if ( empty( $request ) ) {
wp_die();
} }
// Bail if user cannot moderate - only moderators can change authorship // Bail if user cannot moderate
if ( ! current_user_can( 'moderate' ) ) { if ( ! current_user_can( 'moderate' ) ) {
wp_die( '0' ); wp_die();
} }
// Check the ajax nonce // Check the ajax nonce
check_ajax_referer( 'bbp_suggest_user_nonce' ); check_ajax_referer( 'bbp_suggest_user_nonce' );
// Try to get some users // Fields to retrieve & search by
$fields = $search = array( 'ID', 'user_nicename' );
// Keymasters & Super-Mods can also search by email
if ( current_user_can( 'keep_gate' ) || bbp_allow_super_mods() ) {
// Add user_email to searchable columns
array_push( $search, 'user_email' );
// Unstrict to also allow some email characters
$strict = false;
// Strict sanitizing if not Keymaster or Super-Mod
} else {
$strict = true;
}
// Sanitize the request value (possibly not strictly)
$suggest = sanitize_user( $request, $strict );
// Bail if searching for invalid user string
if ( empty( $suggest ) ) {
wp_die();
}
// These single characters should not trigger a user query
$disallowed_single_chars = array( '@', '.', '_', '-', '+', '!', '#', '$', '%', '&', '\\', '*', '+', '/', '=', '?', '^', '`', '{', '|', '}', '~' );
// Bail if request is only for the above single characters
if ( in_array( $suggest, $disallowed_single_chars, true ) ) {
wp_die();
}
// Allow the maximum number of results to be filtered
$number = (int) apply_filters( 'bbp_suggest_user_count', 10 );
// Query database for users based on above criteria
$users_query = new WP_User_Query( array( $users_query = new WP_User_Query( array(
'search' => '*' . bbp_db()->esc_like( $_REQUEST['q'] ) . '*', 'search' => '*' . bbp_db()->esc_like( $suggest ) . '*',
'fields' => array( 'ID', 'user_nicename' ), 'fields' => $fields,
'search_columns' => array( 'ID', 'user_nicename', 'user_email' ), 'search_columns' => $search,
'orderby' => 'ID' 'orderby' => 'ID',
'number' => $number,
'count_total' => false
) ); ) );
// If we found some users, loop through and display them // If we found some users, loop through and output them to the AJAX
if ( ! empty( $users_query->results ) ) { if ( ! empty( $users_query->results ) ) {
foreach ( (array) $users_query->results as $user ) { foreach ( (array) $users_query->results as $user ) {
printf( esc_html__( '%s - %s', 'bbpress' ), bbp_get_user_id( $user->ID ), bbp_get_user_nicename( $user->ID, array( 'force' => $user->user_nicename ) ) . "\n" ); printf( esc_html__( '%1$s - %2$s', 'bbpress' ), bbp_get_user_id( $user->ID ), bbp_get_user_nicename( $user->ID, array( 'force' => $user->user_nicename ) ) . "\n" );
} }
} }
die(); die();

Ver fichero

@@ -635,8 +635,17 @@ class BBP_Forums_Admin {
} }
} }
// simple hack to show the forum description under the title // Only show content if user can read it and there is no password
bbp_forum_content( $forum->ID ); if ( current_user_can( 'read_forum', $forum->ID ) && ! post_password_required( $forum ) ) {
// Get the forum description
$content = bbp_get_forum_content( $forum->ID );
// Only proceed if there is a description
if ( ! empty( $content ) ) {
echo '<div class="bbp-escaped-content">' . esc_html( wp_trim_excerpt( $content, $forum ) ) . '</div>';
}
}
// Sort & return // Sort & return
return $this->sort_row_actions( $actions ); return $this->sort_row_actions( $actions );

Ver fichero

@@ -163,6 +163,28 @@ function bbp_admin_get_settings_fields() {
'bbp_settings_features' => array( 'bbp_settings_features' => array(
// Allow auto embedding setting
'_bbp_use_autoembed' => array(
'title' => esc_html__( 'Auto-embed links', 'bbpress' ),
'callback' => 'bbp_admin_setting_callback_use_autoembed',
'sanitize_callback' => 'intval',
'args' => array()
),
// Set reply threading level
'_bbp_thread_replies_depth' => array(
'title' => esc_html__( 'Reply Threading', 'bbpress' ),
'callback' => 'bbp_admin_setting_callback_thread_replies_depth',
'sanitize_callback' => 'intval',
'args' => array()
),
// Allow threaded replies
'_bbp_allow_threaded_replies' => array(
'sanitize_callback' => 'intval',
'args' => array()
),
// Allow topic and reply revisions // Allow topic and reply revisions
'_bbp_allow_revisions' => array( '_bbp_allow_revisions' => array(
'title' => esc_html__( 'Revisions', 'bbpress' ), 'title' => esc_html__( 'Revisions', 'bbpress' ),
@@ -203,22 +225,6 @@ function bbp_admin_get_settings_fields() {
'args' => array() 'args' => array()
), ),
// Allow per-forum moderators
'_bbp_allow_forum_mods' => array(
'title' => esc_html__( 'Forum Moderators', 'bbpress' ),
'callback' => 'bbp_admin_setting_callback_forum_mods',
'sanitize_callback' => 'intval',
'args' => array()
),
// Allow moderators to edit users
'_bbp_allow_super_mods' => array(
'title' => esc_html__( 'Super Moderators', 'bbpress' ),
'callback' => 'bbp_admin_setting_callback_super_mods',
'sanitize_callback' => 'intval',
'args' => array()
),
// Allow topic tags // Allow topic tags
'_bbp_allow_search' => array( '_bbp_allow_search' => array(
'title' => esc_html__( 'Search', 'bbpress' ), 'title' => esc_html__( 'Search', 'bbpress' ),
@@ -235,25 +241,20 @@ function bbp_admin_get_settings_fields() {
'sanitize_callback' => 'intval' 'sanitize_callback' => 'intval'
), ),
// Allow auto embedding setting // Allow per-forum moderators
'_bbp_use_autoembed' => array( '_bbp_allow_forum_mods' => array(
'title' => esc_html__( 'Auto-embed links', 'bbpress' ), 'title' => esc_html__( 'Forum Moderators', 'bbpress' ),
'callback' => 'bbp_admin_setting_callback_use_autoembed', 'callback' => 'bbp_admin_setting_callback_forum_mods',
'sanitize_callback' => 'intval', 'sanitize_callback' => 'intval',
'args' => array() 'args' => array()
), ),
// Set reply threading level // Allow moderators to edit users
'_bbp_thread_replies_depth' => array( '_bbp_allow_super_mods' => array(
'title' => esc_html__( 'Reply Threading', 'bbpress' ), 'title' => esc_html__( 'Super Moderators', 'bbpress' ),
'callback' => 'bbp_admin_setting_callback_thread_replies_depth', 'callback' => 'bbp_admin_setting_callback_super_mods',
'sanitize_callback' => 'intval',
'args' => array()
),
// Allow threaded replies
'_bbp_allow_threaded_replies' => array(
'sanitize_callback' => 'intval', 'sanitize_callback' => 'intval',
'capability' => 'edit_users',
'args' => array() 'args' => array()
) )
), ),
@@ -837,6 +838,7 @@ function bbp_admin_setting_callback_forum_mods() {
<input name="_bbp_allow_forum_mods" id="_bbp_allow_forum_mods" type="checkbox" value="1" <?php checked( bbp_allow_forum_mods( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_forum_mods' ); ?> /> <input name="_bbp_allow_forum_mods" id="_bbp_allow_forum_mods" type="checkbox" value="1" <?php checked( bbp_allow_forum_mods( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_forum_mods' ); ?> />
<label for="_bbp_allow_forum_mods"><?php esc_html_e( 'Allow forums to have dedicated moderators', 'bbpress' ); ?></label> <label for="_bbp_allow_forum_mods"><?php esc_html_e( 'Allow forums to have dedicated moderators', 'bbpress' ); ?></label>
<p class="description"><?php esc_html_e( 'This does not include the ability to edit users.', 'bbpress' ); ?></p>
<?php <?php
} }
@@ -850,7 +852,8 @@ function bbp_admin_setting_callback_super_mods() {
?> ?>
<input name="_bbp_allow_super_mods" id="_bbp_allow_super_mods" type="checkbox" value="1" <?php checked( bbp_allow_super_mods( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_super_mods' ); ?> /> <input name="_bbp_allow_super_mods" id="_bbp_allow_super_mods" type="checkbox" value="1" <?php checked( bbp_allow_super_mods( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_super_mods' ); ?> />
<label for="_bbp_allow_super_mods"><?php esc_html_e( 'Allow moderators to edit other users', 'bbpress' ); ?></label> <label for="_bbp_allow_super_mods"><?php esc_html_e( 'Allow Moderators and Keymasters to edit users', 'bbpress' ); ?></label>
<p class="description"><?php esc_html_e( 'This includes roles, passwords, and email addresses.', 'bbpress' ); ?></p>
<?php <?php
} }
@@ -968,7 +971,7 @@ function bbp_admin_setting_callback_subtheme_id() {
if ( ! empty( $theme_options ) ) : ?> if ( ! empty( $theme_options ) ) : ?>
<select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options ?></select> <select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options; ?></select>
<label for="_bbp_theme_package_id"><?php esc_html_e( 'will serve all bbPress templates', 'bbpress' ); ?></label> <label for="_bbp_theme_package_id"><?php esc_html_e( 'will serve all bbPress templates', 'bbpress' ); ?></label>
<?php else : ?> <?php else : ?>
@@ -1464,7 +1467,7 @@ function bbp_admin_setting_callback_group_forums_root_id() {
// Button & text // Button & text
$button = '<a href="' . esc_url( $new_url ) . '">' . esc_html__( 'create a new one', 'bbpress' ) . '</a>'; $button = '<a href="' . esc_url( $new_url ) . '">' . esc_html__( 'create a new one', 'bbpress' ) . '</a>';
$text = esc_html__( 'Use %s to contain your group forums, or %s', 'bbpress' ); $text = esc_html__( 'Use %s to contain your group forums, or %s', 'bbpress' ); //phpcs:ignore
} else { } else {
$text = esc_html__( 'Use %s to contain your group forums', 'bbpress' ); $text = esc_html__( 'Use %s to contain your group forums', 'bbpress' );
} }
@@ -1517,7 +1520,7 @@ function bbp_admin_settings() {
?> ?>
<div class="wrap"> <div class="wrap">
<h1 class="wp-heading-inline"><?php esc_html_e( 'Forums Settings', 'bbpress' ) ?></h1> <h1 class="wp-heading-inline"><?php esc_html_e( 'Forums Settings', 'bbpress' ); ?></h1>
<hr class="wp-header-end"> <hr class="wp-header-end">
<form action="options.php" method="post"> <form action="options.php" method="post">
@@ -1567,7 +1570,7 @@ function bbp_converter_setting_callback_platform() {
$options .= '<option value="' . esc_attr( $name ) . '"' . selected( $name, $current, false ) . '>' . esc_html( $name ) . '</option>'; $options .= '<option value="' . esc_attr( $name ) . '"' . selected( $name, $current, false ) . '>' . esc_html( $name ) . '</option>';
} ?> } ?>
<select name="_bbp_converter_platform" id="_bbp_converter_platform"><?php echo $options ?></select> <select name="_bbp_converter_platform" id="_bbp_converter_platform"><?php echo $options; ?></select>
<p class="description"><?php esc_html_e( 'The previous forum software', 'bbpress' ); ?></p> <p class="description"><?php esc_html_e( 'The previous forum software', 'bbpress' ); ?></p>
<?php <?php
@@ -1792,7 +1795,7 @@ function bbp_converter_settings_page() {
// Starting or continuing? // Starting or continuing?
$progress_text = ! empty( $step ) $progress_text = ! empty( $step )
? sprintf( esc_html__( 'Previously stopped at step %d of %d', 'bbpress' ), $step, $max ) ? sprintf( esc_html__( 'Previously stopped at step %1$d of %2$d', 'bbpress' ), $step, $max )
: esc_html__( 'Ready to go.', 'bbpress' ); ?> : esc_html__( 'Ready to go.', 'bbpress' ); ?>
<div class="wrap"> <div class="wrap">

Ver fichero

@@ -462,7 +462,7 @@ function bbp_make_emails_clickable( $text = '' ) {
* @return string * @return string
*/ */
function bbp_make_mentions_clickable( $text = '' ) { function bbp_make_mentions_clickable( $text = '' ) {
return preg_replace_callback( '#@([0-9a-zA-Z-_]+)#i', 'bbp_make_mentions_clickable_callback', $text ); return preg_replace_callback( '#([\s>])@([0-9a-zA-Z-_]+)#i', 'bbp_make_mentions_clickable_callback', $text );
} }
/** /**
@@ -476,30 +476,49 @@ function bbp_make_mentions_clickable( $text = '' ) {
*/ */
function bbp_make_mentions_clickable_callback( $matches = array() ) { function bbp_make_mentions_clickable_callback( $matches = array() ) {
// Bail if the match is empty malformed
if ( empty( $matches[2] ) || ! is_string( $matches[2] ) ) {
return $matches[0];
}
// Get user; bail if not found // Get user; bail if not found
$user = get_user_by( 'slug', $matches[1] ); $user = get_user_by( 'slug', $matches[2] );
if ( empty( $user ) || bbp_is_user_inactive( $user->ID ) ) { if ( empty( $user ) || bbp_is_user_inactive( $user->ID ) ) {
return $matches[0]; return $matches[0];
} }
// Default anchor classes
$classes = array(
'bbp-user-mention',
'bbp-user-id-' . absint( $user->ID )
);
// Filter classes // Filter classes
$classes = (array) apply_filters( 'bbp_make_mentions_clickable_classes', array( $classes = (array) apply_filters( 'bbp_make_mentions_clickable_classes', $classes, $user );
'bbp-user-id-' . $user->ID,
'bbp-user-mention'
) );
// Escape & implode if not empty, otherwise an empty string // Escape & implode if not empty, otherwise an empty string
$class_str = ! empty( $classes ) $class_str = ! empty( $classes )
? implode( ' ', array_map( 'sanitize_html_class', $classes ) ) ? implode( ' ', array_map( 'sanitize_html_class', $classes ) )
: ''; : '';
// Setup as a variable to avoid a potentially empty class attribute
$class = ! empty( $class_str )
? ' class="' . esc_attr( $class_str ) . '"'
: '';
// Create the link to the user's profile // Create the link to the user's profile
$html = '<a href="%1$s"' . $class . '">%2$s</a>';
$url = bbp_get_user_profile_url( $user->ID ); $url = bbp_get_user_profile_url( $user->ID );
$clicky = '<a href="%1$s" class="' . esc_attr( $class_str ) . '">%2$s</a>'; $anchor = sprintf( $html, esc_url( $url ), esc_html( $matches[0] ) );
$anchor = sprintf( $clicky, esc_url( $url ), esc_html( $matches[0] ) );
// Prevent this link from being followed by bots
$link = bbp_rel_nofollow( $anchor ); $link = bbp_rel_nofollow( $anchor );
return $link; // Concatenate the matches into the return value
$retval = $matches[1] . $link;
// Return the link
return $retval;
} }
/** Numbers *******************************************************************/ /** Numbers *******************************************************************/

Ver fichero

@@ -671,16 +671,21 @@ class BBP_Shortcodes {
} }
// Set passed attribute to $search_terms for clarity // Set passed attribute to $search_terms for clarity
$search_terms = empty( $attr['search'] ) ? bbp_get_search_terms() : $attr['search']; $search_terms = empty( $attr['search'] )
? bbp_get_search_terms()
: $attr['search'];
// Get the rewrite ID (one time, to avoid repeated calls)
$rewrite_id = bbp_get_search_rewrite_id();
// Unset globals // Unset globals
$this->unset_globals(); $this->unset_globals();
// Set terms for query // Set terms for query
set_query_var( bbp_get_search_rewrite_id(), $search_terms ); set_query_var( $rewrite_id, $search_terms );
// Start output buffer // Start output buffer
$this->start( bbp_get_search_rewrite_id() ); $this->start( $rewrite_id );
// Output template // Output template
bbp_get_template_part( 'content', 'search' ); bbp_get_template_part( 'content', 'search' );

Ver fichero

@@ -134,11 +134,13 @@ function bbp_is_forum( $post_id = 0 ) {
* @return bool * @return bool
*/ */
function bbp_is_forum_archive() { function bbp_is_forum_archive() {
global $wp_query;
// Default to false // Default to false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// In forum archive // In forum archive
if ( is_post_type_archive( bbp_get_forum_post_type() ) || bbp_is_query_name( 'bbp_forum_archive' ) || ! empty( $wp_query->bbp_show_topics_on_root ) ) { if ( is_post_type_archive( bbp_get_forum_post_type() ) || bbp_is_query_name( 'bbp_forum_archive' ) || ! empty( $wp_query->bbp_show_topics_on_root ) ) {
$retval = true; $retval = true;
@@ -182,11 +184,14 @@ function bbp_is_single_forum() {
* @return bool True if it's the forum edit page, false if not * @return bool True if it's the forum edit page, false if not
*/ */
function bbp_is_forum_edit() { function bbp_is_forum_edit() {
global $wp_query, $pagenow; global $pagenow;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit === true ) ) { if ( ! empty( $wp_query->bbp_is_forum_edit ) && ( $wp_query->bbp_is_forum_edit === true ) ) {
$retval = true; $retval = true;
@@ -277,11 +282,14 @@ function bbp_is_topic_archive() {
* @return bool True if it's the topic edit page, false if not * @return bool True if it's the topic edit page, false if not
*/ */
function bbp_is_topic_edit() { function bbp_is_topic_edit() {
global $wp_query, $pagenow; global $pagenow;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit === true ) ) { if ( ! empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit === true ) ) {
$retval = true; $retval = true;
@@ -376,7 +384,7 @@ function bbp_is_topic_tag() {
* @return bool True if editing a topic tag, false if not * @return bool True if editing a topic tag, false if not
*/ */
function bbp_is_topic_tag_edit() { function bbp_is_topic_tag_edit() {
global $wp_query, $pagenow, $taxnow; global $pagenow, $taxnow;
// Bail if topic-tags are off // Bail if topic-tags are off
if ( ! bbp_allow_topic_tags() ) { if ( ! bbp_allow_topic_tags() ) {
@@ -386,6 +394,9 @@ function bbp_is_topic_tag_edit() {
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_topic_tag_edit ) && ( true === $wp_query->bbp_is_topic_tag_edit ) ) { if ( ! empty( $wp_query->bbp_is_topic_tag_edit ) && ( true === $wp_query->bbp_is_topic_tag_edit ) ) {
$retval = true; $retval = true;
@@ -456,11 +467,14 @@ function bbp_is_reply( $post_id = 0 ) {
* @return bool True if it's the reply edit page, false if not * @return bool True if it's the reply edit page, false if not
*/ */
function bbp_is_reply_edit() { function bbp_is_reply_edit() {
global $wp_query, $pagenow; global $pagenow;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_reply_edit ) && ( true === $wp_query->bbp_is_reply_edit ) ) { if ( ! empty( $wp_query->bbp_is_reply_edit ) && ( true === $wp_query->bbp_is_reply_edit ) ) {
$retval = true; $retval = true;
@@ -527,11 +541,13 @@ function bbp_is_single_reply() {
* @return bool True if it's the favorites page, false if not * @return bool True if it's the favorites page, false if not
*/ */
function bbp_is_favorites() { function bbp_is_favorites() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_favs ) && ( true === $wp_query->bbp_is_single_user_favs ) ) { if ( ! empty( $wp_query->bbp_is_single_user_favs ) && ( true === $wp_query->bbp_is_single_user_favs ) ) {
$retval = true; $retval = true;
@@ -549,11 +565,13 @@ function bbp_is_favorites() {
* @return bool True if it's the subscriptions page, false if not * @return bool True if it's the subscriptions page, false if not
*/ */
function bbp_is_subscriptions() { function bbp_is_subscriptions() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_subs ) && ( true === $wp_query->bbp_is_single_user_subs ) ) { if ( ! empty( $wp_query->bbp_is_single_user_subs ) && ( true === $wp_query->bbp_is_single_user_subs ) ) {
$retval = true; $retval = true;
@@ -572,11 +590,13 @@ function bbp_is_subscriptions() {
* @return bool True if it's the topics created page, false if not * @return bool True if it's the topics created page, false if not
*/ */
function bbp_is_topics_created() { function bbp_is_topics_created() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) ) { if ( ! empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) ) {
$retval = true; $retval = true;
@@ -595,11 +615,13 @@ function bbp_is_topics_created() {
* @return bool True if it's the replies created page, false if not * @return bool True if it's the replies created page, false if not
*/ */
function bbp_is_replies_created() { function bbp_is_replies_created() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) ) { if ( ! empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) ) {
$retval = true; $retval = true;
@@ -617,11 +639,13 @@ function bbp_is_replies_created() {
* @return bool True if it's the user's home, false if not * @return bool True if it's the user's home, false if not
*/ */
function bbp_is_user_home() { function bbp_is_user_home() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_home ) && ( true === $wp_query->bbp_is_single_user_home ) ) { if ( ! empty( $wp_query->bbp_is_single_user_home ) && ( true === $wp_query->bbp_is_single_user_home ) ) {
$retval = true; $retval = true;
@@ -659,11 +683,13 @@ function bbp_is_user_home_edit() {
* @return bool True if it's a user's profile page, false if not * @return bool True if it's a user's profile page, false if not
*/ */
function bbp_is_single_user() { function bbp_is_single_user() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user ) && ( true === $wp_query->bbp_is_single_user ) ) { if ( ! empty( $wp_query->bbp_is_single_user ) && ( true === $wp_query->bbp_is_single_user ) ) {
$retval = true; $retval = true;
@@ -681,11 +707,13 @@ function bbp_is_single_user() {
* @return bool True if it's a user's profile edit page, false if not * @return bool True if it's a user's profile edit page, false if not
*/ */
function bbp_is_single_user_edit() { function bbp_is_single_user_edit() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_edit ) && ( true === $wp_query->bbp_is_single_user_edit ) ) { if ( ! empty( $wp_query->bbp_is_single_user_edit ) && ( true === $wp_query->bbp_is_single_user_edit ) ) {
$retval = true; $retval = true;
@@ -703,11 +731,13 @@ function bbp_is_single_user_edit() {
* @return bool True if it's a user's profile page, false if not * @return bool True if it's a user's profile page, false if not
*/ */
function bbp_is_single_user_profile() { function bbp_is_single_user_profile() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_profile ) && ( true === $wp_query->bbp_is_single_user_profile ) ) { if ( ! empty( $wp_query->bbp_is_single_user_profile ) && ( true === $wp_query->bbp_is_single_user_profile ) ) {
$retval = true; $retval = true;
@@ -725,11 +755,13 @@ function bbp_is_single_user_profile() {
* @return bool True if it's a user's topics page, false if not * @return bool True if it's a user's topics page, false if not
*/ */
function bbp_is_single_user_topics() { function bbp_is_single_user_topics() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) ) { if ( ! empty( $wp_query->bbp_is_single_user_topics ) && ( true === $wp_query->bbp_is_single_user_topics ) ) {
$retval = true; $retval = true;
@@ -747,11 +779,13 @@ function bbp_is_single_user_topics() {
* @return bool True if it's a user's replies page, false if not * @return bool True if it's a user's replies page, false if not
*/ */
function bbp_is_single_user_replies() { function bbp_is_single_user_replies() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) ) { if ( ! empty( $wp_query->bbp_is_single_user_replies ) && ( true === $wp_query->bbp_is_single_user_replies ) ) {
$retval = true; $retval = true;
@@ -769,11 +803,13 @@ function bbp_is_single_user_replies() {
* @return bool True if it's a user's replies page, false if not * @return bool True if it's a user's replies page, false if not
*/ */
function bbp_is_single_user_engagements() { function bbp_is_single_user_engagements() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_single_user_engagements ) && ( true === $wp_query->bbp_is_single_user_engagements ) ) { if ( ! empty( $wp_query->bbp_is_single_user_engagements ) && ( true === $wp_query->bbp_is_single_user_engagements ) ) {
$retval = true; $retval = true;
@@ -792,11 +828,13 @@ function bbp_is_single_user_engagements() {
* @return bool Is it a view page? * @return bool Is it a view page?
*/ */
function bbp_is_single_view() { function bbp_is_single_view() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_view ) && ( true === $wp_query->bbp_is_view ) ) { if ( ! empty( $wp_query->bbp_is_view ) && ( true === $wp_query->bbp_is_view ) ) {
$retval = true; $retval = true;
@@ -820,7 +858,6 @@ function bbp_is_single_view() {
* @return bool Is it a search page? * @return bool Is it a search page?
*/ */
function bbp_is_search() { function bbp_is_search() {
global $wp_query;
// Bail if search is disabled // Bail if search is disabled
if ( ! bbp_allow_search() ) { if ( ! bbp_allow_search() ) {
@@ -830,18 +867,24 @@ function bbp_is_search() {
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Get the rewrite ID (one time, to avoid repeated calls)
$rewrite_id = bbp_get_search_rewrite_id();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_search ) && ( true === $wp_query->bbp_is_search ) ) { if ( ! empty( $wp_query->bbp_is_search ) && ( true === $wp_query->bbp_is_search ) ) {
$retval = true; $retval = true;
} }
// Check query name // Check query name
if ( empty( $retval ) && bbp_is_query_name( bbp_get_search_rewrite_id() ) ) { if ( empty( $retval ) && bbp_is_query_name( $rewrite_id ) ) {
$retval = true; $retval = true;
} }
// Check $_GET // Check $_GET
if ( empty( $retval ) && isset( $_REQUEST[ bbp_get_search_rewrite_id() ] ) && empty( $_REQUEST[ bbp_get_search_rewrite_id() ] ) ) { if ( empty( $retval ) && isset( $_REQUEST[ $rewrite_id ] ) && empty( $_REQUEST[ $rewrite_id ] ) ) {
$retval = true; $retval = true;
} }
@@ -858,7 +901,6 @@ function bbp_is_search() {
* @return bool Is it a search page? * @return bool Is it a search page?
*/ */
function bbp_is_search_results() { function bbp_is_search_results() {
global $wp_query;
// Bail if search is disabled // Bail if search is disabled
if ( ! bbp_allow_search() ) { if ( ! bbp_allow_search() ) {
@@ -868,6 +910,9 @@ function bbp_is_search_results() {
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_search_terms ) ) { if ( ! empty( $wp_query->bbp_search_terms ) ) {
$retval = true; $retval = true;
@@ -895,11 +940,13 @@ function bbp_is_search_results() {
* @return bool True if it's the edit page, false if not * @return bool True if it's the edit page, false if not
*/ */
function bbp_is_edit() { function bbp_is_edit() {
global $wp_query;
// Assume false // Assume false
$retval = false; $retval = false;
// Get the main query global
$wp_query = bbp_get_wp_query();
// Check query // Check query
if ( ! empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit === true ) ) { if ( ! empty( $wp_query->bbp_is_edit ) && ( $wp_query->bbp_is_edit === true ) ) {
$retval = true; $retval = true;
@@ -1102,9 +1149,15 @@ function bbp_has_shortcode( $text = '' ) {
*/ */
function is_bbpress() { function is_bbpress() {
// Defalt to false // Default to false
$retval = false; $retval = false;
// Bail if main query has not been populated.
if ( ! bbp_get_wp_query() ) {
_doing_it_wrong( __FUNCTION__, esc_html__( 'Conditional query tags do not work before the query is run. Before then, they always return false.', 'bbpress' ), '2.7.0' );
return $retval;
}
/** Archives **************************************************************/ /** Archives **************************************************************/
if ( bbp_is_forum_archive() ) { if ( bbp_is_forum_archive() ) {

Ver fichero

@@ -407,12 +407,15 @@ add_action( 'bbp_user_edit_after', 'bbp_user_edit_after' );
// Clean bbPress post caches when WordPress's is cleaned // Clean bbPress post caches when WordPress's is cleaned
add_action( 'clean_post_cache', 'bbp_clean_post_cache', 10, 2 ); add_action( 'clean_post_cache', 'bbp_clean_post_cache', 10, 2 );
// User Creation // User Registration
add_action( 'invite_user', 'bbp_user_add_role_on_invite', 10, 3 );
add_action( 'wpmu_activate_user', 'bbp_user_add_role_on_activate', 10, 3 );
add_action( 'bbp_user_register', 'bbp_user_add_role_on_register', 10, 1 );
add_action( 'added_existing_user', 'bbp_user_add_role_on_register', 10, 1 ); add_action( 'added_existing_user', 'bbp_user_add_role_on_register', 10, 1 );
add_action( 'register_new_user', 'bbp_user_add_role_on_register', 10, 1 ); add_action( 'bbp_user_register', 'bbp_user_add_role_on_register', 10, 1 );
// Invite a New User
add_action( 'invite_user', 'bbp_user_add_role_on_invite', 10, 3 );
// Multisite Activation (does not work in wp-activate.php)
add_action( 'wpmu_activate_user', 'bbp_user_add_role_on_activate', 10, 3 );
/** /**
* bbPress needs to redirect the user around in a few different circumstances: * bbPress needs to redirect the user around in a few different circumstances:
@@ -433,6 +436,9 @@ add_action( 'bbp_template_redirect', 'bbp_check_topic_edit', 10 );
add_action( 'bbp_template_redirect', 'bbp_check_reply_edit', 10 ); add_action( 'bbp_template_redirect', 'bbp_check_reply_edit', 10 );
add_action( 'bbp_template_redirect', 'bbp_check_topic_tag_edit', 10 ); add_action( 'bbp_template_redirect', 'bbp_check_topic_tag_edit', 10 );
// Must be after bbp_template_include_theme_compat
add_action( 'bbp_template_redirect', 'bbp_remove_adjacent_posts', 10 );
// Theme-side POST requests // Theme-side POST requests
add_action( 'bbp_post_request', 'bbp_do_ajax', 1 ); add_action( 'bbp_post_request', 'bbp_do_ajax', 1 );
add_action( 'bbp_post_request', 'bbp_edit_topic_tag_handler', 1 ); add_action( 'bbp_post_request', 'bbp_edit_topic_tag_handler', 1 );

Ver fichero

@@ -378,8 +378,8 @@ function bbp_post_request() {
return; return;
} }
// Bail if no action // Bail if no action, or if not a string (arrays not supported)
if ( empty( $_POST['action'] ) ) { if ( empty( $_POST['action'] ) || ! is_string( $_POST['action'] ) ) {
return; return;
} }
@@ -411,8 +411,8 @@ function bbp_get_request() {
return; return;
} }
// Bail if no action // Bail if no action, or if not a string (arrays not supported)
if ( empty( $_GET['action'] ) ) { if ( empty( $_GET['action'] ) || ! is_string( $_GET['action'] ) ) {
return; return;
} }

Ver fichero

@@ -535,13 +535,14 @@ function bbp_parse_query( $posts_query ) {
return; return;
} }
// Get query variables // Get query variables (default to null if not set)
$bbp_view = $posts_query->get( bbp_get_view_rewrite_id() ); $bbp_view = $posts_query->get( bbp_get_view_rewrite_id(), null );
$bbp_user = $posts_query->get( bbp_get_user_rewrite_id() ); $bbp_user = $posts_query->get( bbp_get_user_rewrite_id(), null );
$is_edit = $posts_query->get( bbp_get_edit_rewrite_id() ); $is_edit = $posts_query->get( bbp_get_edit_rewrite_id(), null );
$is_search = $posts_query->get( bbp_get_search_rewrite_id(), null );
// It is a user page - We'll also check if it is user edit // It is a user page - We'll also check if it is user edit
if ( ! empty( $bbp_user ) ) { if ( ! is_null( $bbp_user ) ) {
/** Find User *********************************************************/ /** Find User *********************************************************/
@@ -572,7 +573,7 @@ function bbp_parse_query( $posts_query ) {
$is_engagements = $posts_query->get( bbp_get_user_engagements_rewrite_id() ); $is_engagements = $posts_query->get( bbp_get_user_engagements_rewrite_id() );
// View or edit? // View or edit?
if ( ! empty( $is_edit ) ) { if ( ! is_null( $is_edit ) ) {
// We are editing a profile // We are editing a profile
$posts_query->bbp_is_single_user_edit = true; $posts_query->bbp_is_single_user_edit = true;
@@ -644,7 +645,7 @@ function bbp_parse_query( $posts_query ) {
bbpress()->displayed_user = $the_user; bbpress()->displayed_user = $the_user;
// View Page // View Page
} elseif ( ! empty( $bbp_view ) ) { } elseif ( ! is_null( $bbp_view ) ) {
// Check if the view exists by checking if there are query args are set // Check if the view exists by checking if there are query args are set
$view_args = bbp_get_view_query_args( $bbp_view ); $view_args = bbp_get_view_query_args( $bbp_view );
@@ -665,7 +666,7 @@ function bbp_parse_query( $posts_query ) {
$posts_query->bbp_is_404 = false; $posts_query->bbp_is_404 = false;
// Search Page // Search Page
} elseif ( isset( $posts_query->query_vars[ bbp_get_search_rewrite_id() ] ) ) { } elseif ( ! is_null( $is_search ) ) {
// Check if there are search query args set // Check if there are search query args set
$search_terms = bbp_get_search_terms(); $search_terms = bbp_get_search_terms();
@@ -683,7 +684,7 @@ function bbp_parse_query( $posts_query ) {
$posts_query->bbp_is_404 = false; $posts_query->bbp_is_404 = false;
// Forum/Topic/Reply Edit Page // Forum/Topic/Reply Edit Page
} elseif ( ! empty( $is_edit ) ) { } elseif ( ! is_null( $is_edit ) ) {
// Get the post type from the main query loop // Get the post type from the main query loop
$post_type = $posts_query->get( 'post_type' ); $post_type = $posts_query->get( 'post_type' );

Ver fichero

@@ -1026,3 +1026,25 @@ function bbp_force_comment_status( $open = false, $post_id = 0 ) {
// Filter & return // Filter & return
return (bool) apply_filters( 'bbp_force_comment_status', $retval, $open, $post_id, $post_type ); return (bool) apply_filters( 'bbp_force_comment_status', $retval, $open, $post_id, $post_type );
} }
/**
* Remove "prev" and "next" relational links from <head> on bbPress pages.
*
* WordPress automatically generates these relational links to the current
* page, but bbPress does not use these links, nor would they work the same.
*
* In this function, we remove these links when on a bbPress page. This also
* prevents additional, unnecessary queries from running.
*
* @since 2.6.0 bbPress (r7071)
*/
function bbp_remove_adjacent_posts() {
// Bail if not a bbPress page
if ( ! is_bbpress() ) {
return;
}
// Remove the WordPress core action for adjacent posts
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );
}

Ver fichero

@@ -297,8 +297,11 @@ function bbp_search_terms( $search_terms = '' ) {
} else { } else {
// Global // Global
if ( get_query_var( bbp_get_search_rewrite_id() ) ) { $search_terms = get_query_var( bbp_get_search_rewrite_id(), null );
$search_terms = get_query_var( bbp_get_search_rewrite_id() );
// Searching globally
if ( ! is_null( $search_terms ) ) {
$search_terms = wp_unslash( $search_terms );
// Other searches // Other searches
} else { } else {

Ver fichero

@@ -148,7 +148,7 @@ function bbp_map_primary_meta_caps( $caps = array(), $cap = '', $user_id = 0, $a
* *
* @param int $user_id * @param int $user_id
* *
* @return string * @return mixed False if no change. String of new role if changed.
*/ */
function bbp_set_user_role( $user_id = 0, $new_role = '' ) { function bbp_set_user_role( $user_id = 0, $new_role = '' ) {
@@ -159,15 +159,15 @@ function bbp_set_user_role( $user_id = 0, $new_role = '' ) {
// User exists // User exists
if ( ! empty( $user ) ) { if ( ! empty( $user ) ) {
// Get users forum role // Get user forum role
$role = bbp_get_user_role( $user_id ); $role = bbp_get_user_role( $user_id );
// User already has this role so no new role is set // User already has this role so no new role is set
if ( $new_role === $role ) { if ( $new_role === $role ) {
$new_role = false; $new_role = false;
// Users role is different than the new role // User role is different than the new (valid) role
} else { } elseif ( bbp_is_valid_role( $new_role ) ) {
// Remove the old role // Remove the old role
if ( ! empty( $role ) ) { if ( ! empty( $role ) ) {
@@ -306,6 +306,38 @@ function bbp_profile_update_role( $user_id = 0 ) {
bbp_set_user_role( $user_id, $new_role ); bbp_set_user_role( $user_id, $new_role );
} }
/**
* Check if a role string is valid
*
* @since 2.6.5
*
* @param string $role
*
* @return bool True if role is valid. False if role is not valid.
*/
function bbp_is_valid_role( $role = '' ) {
// Default return value
$retval = false;
// Skip if no role to check
if ( ! empty( $role ) && is_string( $role ) ) {
// Get the dynamic role IDs
$roles = array_keys( bbp_get_dynamic_roles() );
// Skip if no known role IDs
if ( ! empty( $roles ) ) {
// Is role in dynamic roles array?
$retval = in_array( $role, $roles, true );
}
}
// Filter & return
return (bool) apply_filters( 'bbp_is_valid_role', $retval, $role );
}
/** /**
* Add the default role to the current user if needed * Add the default role to the current user if needed
* *

Ver fichero

@@ -19,7 +19,11 @@ defined( 'ABSPATH' ) || exit;
* @since 2.6.0 bbPress (r6674) * @since 2.6.0 bbPress (r6674)
*/ */
function bbp_add_user_form_role_field() { function bbp_add_user_form_role_field() {
?>
// Bail if current user cannot promote users
if ( ! current_user_can( 'promote_users' ) ) {
return;
} ?>
<table class="form-table"> <table class="form-table">
<tr class="form-field"> <tr class="form-field">
@@ -66,21 +70,26 @@ function bbp_add_user_form_role_field() {
*/ */
function bbp_user_add_role_to_signup_meta( $meta = array() ) { function bbp_user_add_role_to_signup_meta( $meta = array() ) {
// Posted role // Bail if already added
$forum_role = isset( $_POST['bbp-forums-role'] ) if ( ! empty( $meta['bbp_new_role'] ) ) {
return $meta;
}
// Role to validate
$to_validate = ! empty( $_POST['bbp-forums-role'] ) && is_string( $_POST['bbp-forums-role'] )
? sanitize_key( $_POST['bbp-forums-role'] ) ? sanitize_key( $_POST['bbp-forums-role'] )
: bbp_get_default_role(); : '';
// Role keys // Validate the signup role
$roles = array_keys( bbp_get_dynamic_roles() ); $valid_role = bbp_validate_registration_role( $to_validate );
// Bail if posted role is not in dynamic roles // Bail if errors
if ( empty( $forum_role ) || ! in_array( $forum_role, $roles, true ) ) { if ( bbp_has_errors() ) {
return $meta; return $meta;
} }
// Add role to meta // Add role to meta
$meta['bbp_new_role'] = $forum_role; $meta['bbp_new_role'] = $valid_role;
// Return meta // Return meta
return $meta; return $meta;
@@ -97,16 +106,16 @@ function bbp_user_add_role_to_signup_meta( $meta = array() ) {
*/ */
function bbp_user_add_role_on_invite( $user_id = '', $role = '', $newuser_key = '' ) { function bbp_user_add_role_on_invite( $user_id = '', $role = '', $newuser_key = '' ) {
// Posted role // Role to validate
$forum_role = isset( $_POST['bbp-forums-role'] ) $to_validate = ! empty( $_POST['bbp-forums-role'] ) && is_string( $_POST['bbp-forums-role'] )
? sanitize_key( $_POST['bbp-forums-role'] ) ? sanitize_key( $_POST['bbp-forums-role'] )
: bbp_get_default_role(); : '';
// Role keys // Validate the signup role
$roles = array_keys( bbp_get_dynamic_roles() ); $valid_role = bbp_validate_registration_role( $to_validate );
// Bail if posted role is not in dynamic roles // Bail if errors
if ( empty( $forum_role ) || ! in_array( $forum_role, $roles, true ) ) { if ( bbp_has_errors() ) {
return; return;
} }
@@ -117,7 +126,7 @@ function bbp_user_add_role_on_invite( $user_id = '', $role = '', $newuser_key =
$user_option = get_option( $option_key, array() ); $user_option = get_option( $option_key, array() );
// Add the new role // Add the new role
$user_option['bbp_new_role'] = $forum_role; $user_option['bbp_new_role'] = $valid_role;
// Update the invitation // Update the invitation
update_option( $option_key, $user_option ); update_option( $option_key, $user_option );
@@ -132,21 +141,21 @@ function bbp_user_add_role_on_invite( $user_id = '', $role = '', $newuser_key =
*/ */
function bbp_user_add_role_on_register( $user_id = '' ) { function bbp_user_add_role_on_register( $user_id = '' ) {
// Posted role // Role to validate
$forum_role = isset( $_POST['bbp-forums-role'] ) $to_validate = ! empty( $_POST['bbp-forums-role'] ) && is_string( $_POST['bbp-forums-role'] )
? sanitize_key( $_POST['bbp-forums-role'] ) ? sanitize_key( $_POST['bbp-forums-role'] )
: bbp_get_default_role(); : '';
// Role keys // Validate the signup role
$roles = array_keys( bbp_get_dynamic_roles() ); $valid_role = bbp_validate_registration_role( $to_validate );
// Bail if posted role is not in dynamic roles // Bail if errors
if ( empty( $forum_role ) || ! in_array( $forum_role, $roles, true ) ) { if ( bbp_has_errors() ) {
return; return;
} }
// Set the user role // Set the user role
bbp_set_user_role( $user_id, $forum_role ); bbp_set_user_role( $user_id, $valid_role );
} }
/** /**
@@ -158,19 +167,97 @@ function bbp_user_add_role_on_register( $user_id = '' ) {
*/ */
function bbp_user_add_role_on_activate( $user_id = 0, $password = '', $meta = array() ) { function bbp_user_add_role_on_activate( $user_id = 0, $password = '', $meta = array() ) {
// Posted role // Role to validate
$forum_role = isset( $meta['bbp_new_role'] ) $to_validate = ! empty( $meta['bbp_new_role'] ) && is_string( $meta['bbp_new_role'] )
? sanitize_key( $meta['bbp_new_role'] ) ? sanitize_key( $meta['bbp_new_role'] )
: bbp_get_default_role(); : '';
// Sanitize role // Validate the signup role
$roles = array_keys( bbp_get_dynamic_roles() ); $valid_role = bbp_validate_activation_role( $to_validate );
// Bail if posted role is not in dynamic roles // Bail if errors
if ( empty( $forum_role ) || ! in_array( $forum_role, $roles, true ) ) { if ( bbp_has_errors() ) {
return; return;
} }
// Set the user role // Set the user role
bbp_set_user_role( $user_id, $forum_role ); bbp_set_user_role( $user_id, $valid_role );
}
/** Validators ****************************************************************/
/**
* Validate the Forum role during signup
*
* This helper function performs a number of generic checks, and encapsulates
* the logic used to validate if a Forum Role is valid, typically during new
* user registration, but also when adding an existing user to a site in
* Multisite installations.
*
* @since 2.6.5
*
* @param string $to_validate A role ID to validate
* @return string A valid role ID, or empty string on error
*/
function bbp_validate_signup_role( $to_validate = '' ) {
// Default return value
$retval = '';
// Add error if role is empty
if ( empty( $to_validate ) ) {
bbp_add_error( 'bbp_signup_role_empty', __( '<strong>ERROR</strong>: Empty role.', 'bbpress' ) );
}
// Add error if posted role is not a valid role
if ( ! bbp_is_valid_role( $to_validate ) ) {
bbp_add_error( 'bbp_signup_role_invalid', __( '<strong>ERROR</strong>: Invalid role.', 'bbpress' ) );
}
// If no errors, set return value to the role to validate
if ( ! bbp_has_errors() ) {
$retval = $to_validate;
}
// Filter & return
return (string) apply_filters( 'bbp_validate_signup_role', $retval, $to_validate );
}
/**
* Validate the Forum role during the registration process
*
* @since 2.6.5
*
* @param string $to_validate A well-formed (string) role ID to validate
* @return string A valid role ID, or empty string on error
*/
function bbp_validate_registration_role( $to_validate = '' ) {
// Default return value
$retval = bbp_get_default_role();
// Conditionally handle posted values for capable users
if ( is_admin() && current_user_can( 'create_users' ) ) {
$retval = $to_validate;
}
// Validate & return
return bbp_validate_signup_role( $retval );
}
/**
* Validate the Forum role during activation
*
* This function exists simply for parity with registrations, and to maintain an
* intentional layer of abstraction from the more generic function it uses.
*
* @since 2.6.5
*
* @param string $to_validate A well-formed (string) role ID to validate
* @return string A valid role ID, or empty string on error
*/
function bbp_validate_activation_role( $to_validate = '' ) {
// Validate & return
return bbp_validate_signup_role( $to_validate );
} }

Ver fichero

@@ -1,12 +1,12 @@
=== bbPress === === bbPress ===
Contributors: matt, johnjamesjacoby, jmdodd, netweb, sergeybiryukov Contributors: matt, johnjamesjacoby, jmdodd, netweb, sergeybiryukov
Tags: forum, forums, discussion, support Tags: forum, forums, discussion, support
Requires at least: 4.7
Tested up to: 5.4 Tested up to: 5.4
Stable tag: 2.6.4 Stable tag: 2.6.5
License: GPLv2 or later License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires PHP: 5.6.20 Requires PHP: 5.6.20
Requires at least: 4.7
bbPress is forum software for WordPress. bbPress is forum software for WordPress.

Ver fichero

@@ -3,7 +3,7 @@
* Plugin Name: Code Syntax Block * Plugin Name: Code Syntax Block
* Plugin URI: https://github.com/mkaz/code-syntax-block * Plugin URI: https://github.com/mkaz/code-syntax-block
* Description: A plugin to extend Gutenberg code block with syntax highlighting * Description: A plugin to extend Gutenberg code block with syntax highlighting
* Version: 1.3.2 * Version: 1.3.3
* Author: Marcus Kazmierczak * Author: Marcus Kazmierczak
* Author URI: https://mkaz.blog/ * Author URI: https://mkaz.blog/
* License: GPL2 * License: GPL2
@@ -14,7 +14,7 @@
*/ */
// version added, used in URL // version added, used in URL
define( 'MKAZ_CODE_SYNTAX_BLOCK_VERSION', '1.3.2' ); define( 'MKAZ_CODE_SYNTAX_BLOCK_VERSION', '1.3.3' );
require dirname( __FILE__ ) . '/prism-languages.php'; require dirname( __FILE__ ) . '/prism-languages.php';
/** /**
@@ -188,3 +188,16 @@ function mkaz_prism_theme_css_ver() {
} }
return MKAZ_CODE_SYNTAX_BLOCK_VERSION; return MKAZ_CODE_SYNTAX_BLOCK_VERSION;
} }
// extend code tag to allow lang attribute
add_filter( 'wp_kses_allowed_html', function( $tags ) {
if ( is_array( $tags['code'] ) ) {
$tags['code']['lang'] = array();
} else {
$tags['code'] = array(
'lang' => array(),
);
}
return $tags;
}, 10, 2);

Ver fichero

@@ -5,7 +5,7 @@ Tags: code, code syntax, syntax highlight, code highlighting
Requires at least: 5.0 Requires at least: 5.0
Tested up to: 5.4 Tested up to: 5.4
Requires PHP: 5.2.4 Requires PHP: 5.2.4
Stable tag: 1.3.2 Stable tag: 1.3.3
License: GPLv2 or later License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -109,6 +109,10 @@ Example:
== Changelog == == Changelog ==
= 1.3.3 =
Fix block validation error for user roles with restricted permissions.
= 1.3.2 = = 1.3.2 =
Fix issue with PHP warning when no posts Fix issue with PHP warning when no posts

Ver fichero

@@ -3,11 +3,11 @@
* Plugin Name: Email Subscribers & Newsletters * Plugin Name: Email Subscribers & Newsletters
* Plugin URI: https://www.icegram.com/ * Plugin URI: https://www.icegram.com/
* Description: Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published. * Description: Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published.
* Version: 4.4.8 * Version: 4.4.10
* Author: Icegram * Author: Icegram
* Author URI: https://www.icegram.com/ * Author URI: https://www.icegram.com/
* Requires at least: 3.9 * Requires at least: 3.9
* Tested up to: 5.4.1 * Tested up to: 5.4.2
* Requires PHP: 5.6 * Requires PHP: 5.6
* Text Domain: email-subscribers * Text Domain: email-subscribers
* Domain Path: /lite/languages/ * Domain Path: /lite/languages/
@@ -156,7 +156,7 @@ if ( $is_premium ) {
/* ***************************** Initial Compatibility Work (End) ******************* */ /* ***************************** Initial Compatibility Work (End) ******************* */
if ( ! defined( 'ES_PLUGIN_VERSION' ) ) { if ( ! defined( 'ES_PLUGIN_VERSION' ) ) {
define( 'ES_PLUGIN_VERSION', '4.4.8' ); define( 'ES_PLUGIN_VERSION', '4.4.10' );
} }
// Plugin Folder Path. // Plugin Folder Path.

Ver fichero

@@ -567,7 +567,7 @@ class Email_Subscribers_Admin {
public function count_contacts_by_list() { public function count_contacts_by_list() {
$list_id = (int) ig_es_get_request_data( 'list_id', 0 ); $list_id = ig_es_get_request_data( 'list_id', 0 );
$status = ig_es_get_request_data( 'status', 'all' ); $status = ig_es_get_request_data( 'status', 'all' );
if ( $list_id == 0 ) { if ( $list_id == 0 ) {

Ver fichero

@@ -1845,7 +1845,10 @@ div.broadcast_main_content{
div.broadcast_side_content{ div.broadcast_side_content{
width: 30% ; width: 30% ;
} }
#ig_es_post_notification_list_ids+.select2-container{
position: absolute;
width: 75% !important;
}
.es-preview.broadcast-preview p { .es-preview.broadcast-preview p {
margin : 1em 0 !important; margin : 1em 0 !important;
} }
@@ -1854,3 +1857,8 @@ div.broadcast_side_content{
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
#es-shortcode{
-webkit-user-select: all;
-ms-user-select: all;
user-select: all;
}

Algunos archivos no se mostraron porque demasiados archivos han cambiado en esta diferencia Ver más