]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Error page stylesheets
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 15 Sep 2008 14:29:36 +0000 (02:29 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 15 Sep 2008 14:29:36 +0000 (02:29 +1200)
* Adds %l option for adding CSS code to HTML output
* Adds error_stylesheet option to squid.conf for a filename to use
* Installs default CSS file errorpage.css in config directory
* Adds CSS tags and %l to all error templates
  (in a way that keeps the %l from causing trouble to older Squid)

Code portion loads the CSS file on startup, and merges the CSS as inline
with HTML wherever the %l option is present in HTML error files.

39 files changed:
errors/Makefile.am
errors/templates/ERR_ACCESS_DENIED
errors/templates/ERR_CACHE_ACCESS_DENIED
errors/templates/ERR_CACHE_MGR_ACCESS_DENIED
errors/templates/ERR_CANNOT_FORWARD
errors/templates/ERR_CONNECT_FAIL
errors/templates/ERR_DNS_FAIL
errors/templates/ERR_ESI
errors/templates/ERR_FORWARDING_DENIED
errors/templates/ERR_FTP_DISABLED
errors/templates/ERR_FTP_FAILURE
errors/templates/ERR_FTP_FORBIDDEN
errors/templates/ERR_FTP_NOT_FOUND
errors/templates/ERR_FTP_PUT_CREATED
errors/templates/ERR_FTP_PUT_ERROR
errors/templates/ERR_FTP_PUT_MODIFIED
errors/templates/ERR_FTP_UNAVAILABLE
errors/templates/ERR_ICAP_FAILURE
errors/templates/ERR_INVALID_REQ
errors/templates/ERR_INVALID_RESP
errors/templates/ERR_INVALID_URL
errors/templates/ERR_LIFETIME_EXP
errors/templates/ERR_NO_RELAY
errors/templates/ERR_ONLY_IF_CACHED_MISS
errors/templates/ERR_READ_ERROR
errors/templates/ERR_READ_TIMEOUT
errors/templates/ERR_SECURE_CONNECT_FAIL
errors/templates/ERR_SHUTTING_DOWN
errors/templates/ERR_SOCKET_FAILURE
errors/templates/ERR_TOO_BIG
errors/templates/ERR_UNSUP_REQ
errors/templates/ERR_URN_RESOLVE
errors/templates/ERR_WRITE_ERROR
errors/templates/ERR_ZERO_SIZE_OBJECT
errors/templates/generic
src/Makefile.am
src/cf.data.pre
src/errorpage.cc
src/structs.h

index 77bdb6bf48ccd1764de10387c1a423186179da2a..0644cc288d6545072dcb0db87d855f437a8047ac 100644 (file)
@@ -9,6 +9,8 @@ errordir = $(datadir)/errors
 ##dist-hook eveything
 
 DEFAULT_ERROR_DIR      = $(errordir)
+DEFAULT_STYLESHEET     = $(sysconfigdir)/errorpage.css
+
 
 # List of automated translations possible:
 TRANSLATIONS = \
@@ -69,7 +71,15 @@ install-data-local:
                        $(INSTALL_DATA) $$f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l; \
                done; \
          fi \
-       done
+       done; \
+        $(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET).default; \
+        @if test -f $(DESTDIR)$(DEFAULT_STYLESHEET) ; then \
+                echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_STYLESHEET)" ; \
+        else \
+                echo "$(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET)"; \
+                $(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET); \
+        fi
+
 
 uninstall-local:
        @ for l in $(LANGUAGES); do \
@@ -83,7 +93,8 @@ uninstall-local:
                        rm -f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; \
                done; \
          fi \
-       done
+       done; \
+       rm -f $(DEFAULT_STYLESHEET).default
 
 # undocumented hack.  You can use this target to create multi-lingual
 # error pages.  For example:
@@ -129,7 +140,8 @@ dist-hook:
                cp -p $(srcdir)/$$lang/ERR_*  $(distdir)/$$lang \
                  || exit 1; \
          fi; \
-       done
+       done; \
+       cp $(srcdir)/errorpage.css  $(distdir)/errorpage.css
 
 translate:
        @ if test "$(PO2HTML)" != "" ; then \
index 901f37c557a8f1df93208a409f26cb6a453df4e4..97c9c94adf1c4593a3937eefd760792e7d51343f 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Access Denied.</b></p>
 </blockquote>
 
index 54415cf7a5090b163e370311dd76d440c9c6b8fd..04f8dd5dec8b9b5c9207c141c89ee1d398f156d2 100644 (file)
@@ -2,7 +2,7 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: Cache Access Denied</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head>
 <body>
 <h1>ERROR</h1>
@@ -10,7 +10,7 @@
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Cache Access Denied.</b></p>
 </blockquote>
 
@@ -18,7 +18,7 @@
 
 <p>Please contact the <a href="mailto:%w%W">cache administrator</a> if you have difficulties authenticating yourself or <a href="http://%h/cgi-bin/chpasswd.cgi">change</a> your default password.</p>
 
-<br>   
+<br>
 <hr> 
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 3458b67fbb4b377c8a4fefc09bcab33b5cdb839a..b5d8588c44ae809f0a0392f60599b3ef6cbd3131 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: Cache Manager Access Denied</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>Cache Manager Access Denied.</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Cache Manager Access Denied.</b></p>
 </blockquote>
 
@@ -17,7 +17,7 @@
 
 <p>Please contact the <a href="mailto:%w%W">cache administrator</a> if you have difficulties authenticating yourself or, if you <em>are</em> the administrator, read Squid documentation on cache manager interface and check cache log for more detailed error messages.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 06dfea2d2044a12276d1780b02954a9f7641a7fe..2e11aecfd9945acb84361a1d3e8a900aa4ccb24b 100644 (file)
@@ -2,7 +2,7 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head>
 <body>
 <h1>ERROR</h1>
@@ -10,7 +10,7 @@
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Unable to forward this request at this time.</b></p>
 </blockquote>
 
@@ -18,7 +18,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index f10d19693b470b2d1d6725cf6123d789a3b85c25..c25f747e94fe3842352ac81d7cf94b4643c152cc 100644 (file)
@@ -2,22 +2,24 @@
 <html><head>
 <meta http-equiv="Content-Type" CONTENT="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
-<blockquote>
+
+<blockquote id="error">
 <p><b>Connection to %I failed.</b></p>
 </blockquote>
 
-<p>The system returned: <i>%E</i></p>
+<p id="sysmsg">The system returned: <i>%E</i></p>
 
 <p>The remote host or network may be down.  Please try the request again.</p>
+
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index fc7e09368ca52e452f8031e4cca8638ef565e299..eff729bba6031ef08f487768f07ecd4cad9a3d08 100644 (file)
@@ -2,26 +2,27 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Unable to determine IP address from host name <q>%H</q></b></p>
 </blockquote>
 
 <p>The DNS server returned:</p>
-<blockquote>
+<blockquote id="data">
 <pre>%z</pre>
 </blockquote>
 
 <p>This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.</p>
+
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 401bd40c78fb4e84d0286c818e6431443c2eb028..53928bcc96098d757fdb8365ab9f1555e4b8b856 100644 (file)
@@ -2,19 +2,19 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>ESI Processing failed.</b></p>
 </blockquote>
 
 <p>The ESI processor returned:</p>
-<blockquote>
+<blockquote id="data">
 <pre>%Z</pre>
 </blockquote>
 
@@ -22,7 +22,7 @@
 
 <p>Your webmaster is <a href="mailto:%w">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 2ed04b320c68282ac85fe7f601d85c9ac4bed64c..e025f62d741eec429353b150b127dbfc25a48dcb 100644 (file)
@@ -2,21 +2,22 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Forwarding Denied.</b></p>
 </blockquote>
 
 <p>This cache will not forward your request because it is trying to enforce a sibling relationship.  Perhaps the client at %i is a cache which has been misconfigured.</p>
+
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 8dacb6c9d1c18b0cb315cf1fd985b270ed3c8cc7..4f3d7005d459b421bb54d1afdc4aa4f794151a68 100644 (file)
@@ -2,21 +2,22 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>FTP is Disabled</b></p>
 </blockquote>
 
 <p>This cache does not support FTP.</p>
+
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 562002cabae015ed5bf75486e901942fa3460fac..277db453914d33556127917819856f4d9b7fd9dd 100644 (file)
@@ -2,7 +2,7 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <p>An FTP protocol error occurred while trying to retrieve the URL: <a href="%U">%U</a></p>
 
 <p>Squid sent the following FTP command:</p>
-<blockquote>
+<blockquote id="data">
 <pre>%f</pre>
 </blockquote>
 
 <p>The server responded with:</p>
-<blockquote>
+<blockquote id="error">
 <pre>%F</pre>
 <pre>%g</pre>
 </blockquote>
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 33154d45184d24c3ab9560a60a069b345eed4ddf..9a38c1364e3440b0766b558717f34a018a782d2d 100644 (file)
@@ -2,7 +2,7 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <p>An FTP authentication failure occurred while trying to retrieve the URL: <a href="%U">%U</a></p>
 
 <p>Squid sent the following FTP command:</p>
-<blockquote>
+<blockquote id="data">
 <pre>%f</pre>
 </blockquote>
 
 <p>The server responded with:</p>
-<blockquote>
+<blockquote id="sysmsg">
 <pre>%F</pre>
 <pre>%g</pre>
 </blockquote>
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 9048dfe95a93d66ce87c39e951bc228fcedf91dd..fd1542fb6f0162987100c1c803536a0b9e848362 100644 (file)
@@ -2,7 +2,7 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <p>The following URL could not be retrieved: <a href="%U">%U</a></p>
 
 <p>Squid sent the following FTP command:</p>
-<blockquote>
+<blockquote id="data">
 <pre>%f</pre>
 </blockquote>
 
 <p>The server responded with:</p>
-<blockquote>
+<blockquote id="sysmsg">
 <pre>%F</pre>
 <pre>%g</pre>
 </blockquote>
@@ -24,7 +24,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 0fc4c112326944f414231b6a0c09c9e2645a9abb..f53722be2c584fc800de08a3261b1ab0b22ed004 100644 (file)
@@ -2,13 +2,13 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>FTP PUT Successful: File Created</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
-<h1 style="background-color:#00ff00; width:100%">Operation successful</h1>
+<h1 id="ftpsuccess">Operation successful</h1>
 <h2>File created</h2>
 <hr>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index ae016f2e8ea8ae99c1144ad70a98618825c6e03f..d0accc56d0e7085a9a7a7272b1d35d9bbc08eb62 100644 (file)
@@ -2,7 +2,7 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: FTP upload failed</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>FTP PUT/upload failed</h2>
 <p>While trying to PUT the following URL: <a href="%U">%U</a></p>
 
 <p>Squid sent the following FTP command:</p>
-<blockquote>
+<blockquote id="data">
 <pre>%f</pre>
 </blockquote>
 
 <p>The server responded with:</p>
-<blockquote>
+<blockquote id="sysmsg">
 <pre>%F</pre>
 </blockquote>
 
@@ -23,7 +23,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 3a4e410ffd494bab717997b4ceb0983591edc806..c4a369d98b7cf9cf067c6c6c4eea170a86fd168f 100644 (file)
@@ -2,13 +2,13 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>FTP PUT Successful: File updated</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
-<h1 style="background-color:#00ff00; width:100%">Operation successful</h1>
+<h1 id="ftpsuccess">Operation successful</h1>
 <h2>File updated</h2>
 <hr>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index fc1a54c424fb8aa3bd2622ec63f80c11e6685ae2..b367faff46df1a742ab3482f2d6d29f94d91c582 100644 (file)
@@ -2,7 +2,7 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 
 <p>Squid sent the following FTP command:</p>
 
-<blockquote>
+<blockquote id="data">
 <pre>%f</pre>
 </blockquote>
 
 <p>The server responded with:</p>
-<blockquote>
+<blockquote id="sysmsg">
 <pre>%F</pre>
 <pre>%g</pre>
 </blockquote>
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 259f1c7e1965c1a45197e6e288e438e6226573a0..3e95873dc1c9d1cb37d8c7b22ea0d62d2364693b 100644 (file)
@@ -2,18 +2,18 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff; font-family:verdana,sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>ICAP protocol error.</b></p>
 </blockquote>
 
-<p>The system returned: <i>%E</i></p>
+<p id="sysmsg">The system returned: <i>%E</i></p>
 
 <p>This means that some aspect of the ICAP communication failed.</p>
 
@@ -23,7 +23,7 @@
 <li><p>An Illegal response was received from the ICAP server.</p></li>
 </ul>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 70f700d2172e8d1b4be561f7cb852028561517a9..07813f7863e2b24e4fe79dbf3310c9bf4575bb56 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p><b>Invalid Request</b> error was encountered while trying to process the request:</p>
 
-<blockquote>
+<blockquote id="data">
 <pre>%R</pre>
 </blockquote>
 
@@ -25,7 +25,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index ffa8f66be66afca05fe29ef0cd56cde817e5c35c..8b754577e1f1b28781c477385df8715a670e6f93 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p><b>Invalid Response</b> error was encountered while trying to process the request:</p>
 
-<blockquote>
+<blockquote id="data">
 <pre>%R</pre>
 </blockquote>
 
@@ -19,7 +19,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 27a986b02b8ff2bdda927cd3519597d23dc007c5..eac579c4eb215a0eabd9af3782094cee88f57055 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Invalid URL</b></p>
 </blockquote>
 
@@ -25,7 +25,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 7f49de57f9429b9645e4116c7afb42ba6556d031..d2c6b46b8ff1af8265a90c97d45e5617048fbd57 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Connection Lifetime Expired</b></p>
 </blockquote>
 
@@ -17,7 +17,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 399ee7490c354ef052c9551f6535b4da56757fe6..992497a56148192b253ff6e146047c77397fb42f 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>No Wais Relay</b></p>
 </blockquote>
 
@@ -17,7 +17,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 7aac50cf73971b2323c8b1a1fd402042ca829b36..99200a0961e1119637c80f28d085f01d436c3b7a 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Valid document was not found in the cache and <q>only-if-cached</q> directive was specified.</b></p>
 </blockquote>
 
@@ -17,7 +17,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index a5fd0ca90552bcbff6c0655e4f0b11d7f15c2d65..56633bd436c761447b5d6f6c38455eb0c582c0e3 100644 (file)
@@ -2,24 +2,24 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Read Error</b></p>
 </blockquote>
 
-<p>The system returned: <i>%E</i></p>
+<p id="sysmsg">The system returned: <i>%E</i></p>
 
 <p>An error condition occurred while reading data from the network.  Please retry your request.</p>
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 3f36f83e13a4b6fd1b293ca62a9abf72c0a0aca2..6b9642490c962f7317c085e73aa83dae429b4fa1 100644 (file)
@@ -2,24 +2,24 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Read Timeout</b></p>
 </blockquote>
 
-<p>The system returned: <i>%E</i></p>
+<p id="sysmsg">The system returned: <i>%E</i></p>
 
 <p>A Timeout occurred while waiting to read data from the network.  The network or server may be down or congested.  Please retry your request.</p>
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index eb33c93019417c36231c18cf4663b2e6f08d033c..f6bc7787193795dfb48704c6a9f4bef11be96863 100644 (file)
@@ -2,24 +2,24 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Failed to establish a secure connection to %I</b></p>
 </blockquote>
 
-<p>The system returned: <i>%E</i></p>
+<p id="sysmsg">The system returned: <i>%E</i></p>
 
 <p>This proxy and the remote host failed to negotiate a mutually acceptable security settings for handling your request. It is possible that the remote host does not support secure connections, or the proxy is not satisfied with the host security credentials.</p>
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index a14cdec2b0b5c9f7283adfae06bb8312cda667f9..6b0e5c012e3d8cf67e2096bc3af10e8205e53eab 100644 (file)
@@ -2,7 +2,7 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
@@ -13,7 +13,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index e4349df6b526695f1857b3d286035157b5316327..c4d2adeb099c36a6411ca438e7bdc912b98d6bc5 100644 (file)
@@ -2,24 +2,24 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Socket Failure</b></p>
 </blockquote>
 
-<p>The system returned: <i>%E</i></p>
+<p id="sysmsg">The system returned: <i>%E</i></p>
 
 <p>Squid is unable to create a TCP socket, presumably due to excessive load. Please retry your request.</p>
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index ed529d118069b79b486eb3e99cab184a36d4440d..bfb95b625792e16f4e49fbbe6c48ffac66674f0d 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>The request or reply is too large.</b></p>
 </blockquote>
 
@@ -19,7 +19,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 584a63d69f2532a0140a37d3372a614b69b5a5da..b4768a3a9af2f7133d97ad09b9a6754ee1bbe93c 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Unsupported Request Method and Protocol</b></p>
 </blockquote>
 
@@ -17,7 +17,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 4af5fe46ff0afdd7c4cfa19e35393e819efca2e7..e71ecd7136b802da4807aed1a8ed384ae6b48c8b 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URN not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>A URL for the requested URN could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URN: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Cannot Resolve URN</b></p>
 </blockquote>
 
@@ -17,7 +17,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index bb258953e2f582798df230a34ddfc083fb6e48a1..78b9b13d25572b8a16fb3666ed84148cbbc931a5 100644 (file)
@@ -2,24 +2,24 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Write Error</b></p>
 </blockquote>
 
-<p>The system returned: <i>%E</i></p>
+<p id="sysmsg">The system returned: <i>%E</i></p>
 
 <p>An error condition occurred while writing to the network.  Please retry your request.</p>
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index e86067b65b2ad863bc5ad42baab2b9b9c3230c74..85cc32420e54c3165ef70c8113cb086ed84897b1 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>Zero Sized Reply</b></p>
 </blockquote>
 
@@ -17,7 +17,7 @@
 
 <p>Your cache administrator is <a href="mailto:%w%W">%w</a>.</p>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index 26f369180a19385aa3a416c09c6e46b3c91a0e23..8990c472551198537dc1bac440c50b5d13c66dbc 100644 (file)
@@ -2,14 +2,14 @@
 <html><head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>ERROR: The requested URL could not be retrieved</title>
-<style type="text/css"><!--BODY{background-color:#ffffff; font-family:verdana,sans-serif}--></style>
+<style type="text/css"><!-- %l --></style>
 </head><body>
 <h1>ERROR</h1>
 <h2>The requested URL could not be retrieved</h2>
 <hr>
 <p>The following error was encountered while trying to retrieve the URL: <a href="%U">%U</a></p>
 
-<blockquote>
+<blockquote id="error">
 <p><b>@SHORT_DESCRIPTION@</b></p>
 </blockquote>
 
@@ -20,7 +20,7 @@
     <p>@LONG_DESCRIPTION@</p>
 </blockquote>
 
-<br>   
-<hr> 
+<br>
+<hr>
 <div id="footer">Generated %T by %h (%s)</div>
 </body></html>
index ea6a27a9fced3b2ab6729a85834562af2ffeae85..434102bf7e5963106d27a8b44d47257785da44f2 100644 (file)
@@ -1041,6 +1041,7 @@ DEFAULT_HTTP_PORT = @CACHE_HTTP_PORT@
 DEFAULT_ICP_PORT       = @CACHE_ICP_PORT@
 DEFAULT_PREFIX         = $(prefix)
 DEFAULT_CONFIG_FILE     = $(sysconfdir)/squid.conf
+DEFAULT_CONFIG_DIR     = $(sysconfdir)
 DEFAULT_MIME_TABLE     = $(sysconfdir)/mime.conf
 DEFAULT_DNSSERVER       = $(libexecdir)/`echo dnsserver | sed '$(transform);s/$$/$(EXEEXT)/'`
 DEFAULT_LOG_PREFIX     = $(localstatedir)/logs
@@ -1114,6 +1115,7 @@ cf.data: cf.data.pre Makefile
        s%@DEFAULT_ICON_DIR@%$(DEFAULT_ICON_DIR)%g;\
        s%@DEFAULT_MIB_PATH@%$(DEFAULT_MIB_PATH)%g;\
        s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g;\
+       s%@DEFAULT_CONFIG_DIR@%$(DEFAULT_CONFIG_DIR)%g;\
        s%@DEFAULT_PREFIX@%$(DEFAULT_PREFIX)%g;\
        s%@DEFAULT_HOSTS@%$(DEFAULT_HOSTS)%g;\
        s%@[V]ERSION@%$(VERSION)%g;"\
index ffe060660240cd95169730723c751d9ee1d6485a..67f84d10d8574c731c537d89e9fc3b5d0d8099bd 100644 (file)
@@ -4750,6 +4750,16 @@ DOC_START
        http://wiki.squid-cache.org/Translations
 DOC_END
 
+NAME: err_page_stylesheet
+TYPE: string
+LOC: Config.errorStylesheet
+DEFAULT: @DEFAULT_CONFIG_DIR@/errorpage.css
+DOC_START
+       CSS Stylesheet to pattern the display of Squid default error pages.
+
+       For information on CSS see http://www.w3.org/Style/CSS/
+DOC_END
+
 NAME: err_html_text
 TYPE: eol
 LOC: Config.errHtmlText
index d4a39640072feb73d6320c0afcd8c3df427427f8..9e7e1181c9ecbe559ca35e6dceed11230447a634 100644 (file)
@@ -122,6 +122,9 @@ static char **error_text = NULL;
 /// \ingroup ErrorPageInternal
 static int error_page_count = 0;
 
+/// \ingroup ErrorPageInternal
+static MemBuf error_page_stylesheet_content;
+
 static char *errorTryLoadText(const char *page_name, const char *dir, bool silent = false);
 static char *errorLoadText(const char *page_name);
 static const char *errorFindHardText(err_type type);
@@ -182,6 +185,11 @@ errorInitialize(void)
             }
         }
     }
+
+    // look for and load stylesheet into global MemBuf for it.
+    if(Config.errorStylesheet) {
+        error_page_stylesheet_content = errorLoadText(Config.errorStylesheet);
+    }
 }
 
 void
@@ -674,6 +682,11 @@ ErrorState::Convert(char token)
 
         break;
 
+    case 'l':
+        mb.append(error_page_stylesheet_content.content(), error_page_stylesheet_content.contentSize());
+        do_quote = 0;
+        break;
+
     case 'L':
         if (Config.errHtmlText) {
             mb.Printf("%s", Config.errHtmlText);
index ba763e7ed125ecf843f11a4f6f574374a52080c7..eb34bf744e8e9c9d91452c53d846481e74b3b326 100644 (file)
@@ -551,6 +551,7 @@ struct SquidConfig
 #if USE_ERR_LOCALES
     char *errorDefaultLanguage;
 #endif
+    char *errorStylesheet;
 
     struct
     {