Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pagekite/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@

# Create our service-domain matching regexp
import re
SERVICE_DOMAIN_RE = re.compile('\.(' + '|'.join(SERVICE_DOMAINS) + ')$')
SERVICE_DOMAIN_RE = re.compile(r'\.(' + '|'.join(SERVICE_DOMAINS) + ')$')
SERVICE_SUBDOMAIN_RE = re.compile(r'^([A-Za-z0-9_-]+\.)*[A-Za-z0-9_-]+$')


Expand Down
2 changes: 1 addition & 1 deletion pagekite/pk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ def FindCACerts(self, use_curl_bundle=False):
return self.pyfile # Fall back to distributed CA certs

ACL_SHORTHAND = {
'localhost': '((::ffff:)?127\..*|::1)',
'localhost': r'((::ffff:)?127\..*|::1)',
'any': '.*'
}
def CheckAcls(self, acls, address, which, conn=None):
Expand Down
10 changes: 5 additions & 5 deletions pagekite/proto/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def filter_connected(self, tunnel, sid, data):
class HttpHeaderFilter(TunnelFilter):
"""Filter that adds X-Forwarded-For and X-Forwarded-Proto to requests."""
FILTERS = ('data_in')
HTTP_HEADER = re.compile('(?ism)^(([A-Z]+) ([^\n]+) HTTP/\d+\.\d+\s*)$')
HTTP_HEADER = re.compile('(?ism)^(([A-Z]+) ([^\n]+) HTTP/\\d+\\.\\d+\\s*)$')
DISABLE = 'rawheaders'

def filter_data_in(self, tunnel, sid, data):
Expand Down Expand Up @@ -213,15 +213,15 @@ class HttpSecurityFilter(HttpHeaderFilter):
'((?:/+(?:xampp/|security/|licenses/|webalizer/|server-(?:status|info)|adm)'
'|[^\n]*/'
# WordPress admin pages
'(?:wp-admin/(?!admin-ajax|css/)|wp-config\.php'
r'(?:wp-admin/(?!admin-ajax|css/)|wp-config\.php'
# Hackzor tricks
'|system32/|\.\.|\.ht(?:access|pass)'
r'|system32/|\.\.|\.ht(?:access|pass)'
# phpMyAdmin and similar tools
'|(?:php|sql)?my(?:sql)?(?:adm|manager)'
# Setup pages for common PHP tools
'|(?:adm[^\n]*|install[^\n]*|setup)\.php)'
'|(?:adm[^\n]*|install[^\n]*|setup)\\.php)'
')[^\n]*)'
' HTTP/\d+\.\d+\s*)$')
r' HTTP/\d+\.\d+\s*)$')
REJECT = 'PAGEKITE_REJECT_'

def filter_header_data_in(self, http_hdr, data, info):
Expand Down
2 changes: 1 addition & 1 deletion pagekite/proto/selectables.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ def ProcessLine(self, line, lines):
TLS_CLIENTHELLO = '%c' % 0o26
SSL_CLIENTHELLO = '\x80'
XML_PREAMBLE = '<?xml'
XMPP_REGEXP = re.compile("<[^>]+\sto=([^\s>]+)[^>]*>")
XMPP_REGEXP = re.compile(r"<[^>]+\sto=([^\s>]+)[^>]*>")

class MagicProtocolParser(LineParser):
"""A Selectable which recognizes HTTP, TLS or XMPP preambles."""
Expand Down
4 changes: 2 additions & 2 deletions pagekite/ui/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class BasicUi(NullUi):
DAEMON_FRIENDLY = False
WANTS_STDERR = True
EMAIL_RE = re.compile(r'^[a-z0-9!#$%&\'\*\+\/=?^_`{|}~-]+'
'(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@'
'(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*'
'(?:\\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@'
r'(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*'
'(?:[a-zA-Z]{2,16})$')
def Notify(self, message, prefix=' ',
popup=False, color=None, now=None, alignright=''):
Expand Down
4 changes: 2 additions & 2 deletions pagekite/ui/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class RemoteUi(NullUi):
ALLOWS_INPUT = True
WANTS_STDERR = True
EMAIL_RE = re.compile(r'^[a-z0-9!#$%&\'\*\+\/=?^_`{|}~-]+'
'(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@'
'(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*'
'(?:\\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@'
r'(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*'
'(?:[a-zA-Z]{2,4}|museum)$')

def __init__(self, welcome=None, wfile=sys.stderr, rfile=sys.stdin):
Expand Down