Version 1.9

pull/50/head
sud0nick 2018-12-25 18:31:37 -05:00
parent 299d105b22
commit a55c302c83
4 changed files with 26 additions and 18 deletions

View File

@ -0,0 +1,5 @@
Dec 25, 2018
<br /><br />
- Moved captive portal test page to AWS S3<br />
- Added exception handling to CSS parser<br />
- Fixed typo in PortalCloner.py

View File

@ -153,23 +153,26 @@ class PortalCloner:
# Search for CSS files linked with the @import statement and remove
for style in self.soup.find_all("style"):
parser = tinycss.make_parser('page3')
stylesheet = parser.parse_stylesheet(style.string)
for rule in stylesheet.rules:
if rule.at_keyword == "@import":
# Get the name of the resource
fname = str(rule.uri).split("/")[-1]
try:
stylesheet = parser.parse_stylesheet(style.string)
for rule in stylesheet.rules:
if rule.at_keyword == "@import":
# Download the resource
resourceURLs.append([rul.uri, fname])
# Parse the CSS to get image links
_key = "resources/" + fname
self.css_urls[_key] = self.parseCSS(urlparse.urljoin(self.url, rule.uri))
# Replace the old link of the CSS with the new one
modStyle = style.string
style.string.replace_with(modStyle.replace(rule.uri, "resources/" + fname))
# Get the name of the resource
fname = str(rule.uri).split("/")[-1]
# Download the resource
resourceURLs.append([rule.uri, fname])
# Parse the CSS to get image links
_key = "resources/" + fname
self.css_urls[_key] = self.parseCSS(urlparse.urljoin(self.url, rule.uri))
# Replace the old link of the CSS with the new one
modStyle = style.string
style.string.replace_with(modStyle.replace(rule.uri, "resources/" + fname))
except:
pass
# Find and download all images and CSS files linked with <link>

View File

@ -113,7 +113,7 @@ registerController('PortalAuthController', ['$api', '$scope', '$sce', '$interval
configs['dataExpected'] = $scope.dataExpected;
configs['p_archive'] = $scope.portalArchive;
} else {
configs['testSite'] = "https://www.puffycode.com/cptest.html";
configs['testSite'] = "https://portalauth.s3.us-east-2.amazonaws.com/cptest.html";
configs['dataExpected'] = "No Captive Portal";
configs['p_archive'] = "/root/portals/";
}

View File

@ -6,5 +6,5 @@
"tetra"
],
"title": "Portal Auth",
"version": "1.8"
"version": "1.9"
}