+ - Moved captive portal test page to AWS S3
+ - Added exception handling to CSS parser
+ - Fixed typo in PortalCloner.py
diff --git a/PortalAuth/includes/scripts/PortalCloner.py b/PortalAuth/includes/scripts/PortalCloner.py
index 4442ea4..c3a8b54 100755
--- a/PortalAuth/includes/scripts/PortalCloner.py
+++ b/PortalAuth/includes/scripts/PortalCloner.py
@@ -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
diff --git a/PortalAuth/js/module.js b/PortalAuth/js/module.js
index d776514..680a334 100755
--- a/PortalAuth/js/module.js
+++ b/PortalAuth/js/module.js
@@ -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/";
}
diff --git a/PortalAuth/module.info b/PortalAuth/module.info
index f27567e..ca97766 100755
--- a/PortalAuth/module.info
+++ b/PortalAuth/module.info
@@ -6,5 +6,5 @@
"tetra"
],
"title": "Portal Auth",
- "version": "1.8"
+ "version": "1.9"
}