Improve error page
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1 +1,3 @@
 | 
			
		||||
email
 | 
			
		||||
 | 
			
		||||
errors/img/
 | 
			
		||||
 
 | 
			
		||||
@@ -17,8 +17,9 @@
 | 
			
		||||
        #respond "{http.error.status_code} {http.error.status_text}"
 | 
			
		||||
 | 
			
		||||
        templates
 | 
			
		||||
        root * /var/www/errors
 | 
			
		||||
        file_server
 | 
			
		||||
        rewrite * /index.html
 | 
			
		||||
        root * /etc/caddy/errors
 | 
			
		||||
        file_server
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								conf.d/errors.boba.best
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								conf.d/errors.boba.best
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
# vim: ft=caddyfile
 | 
			
		||||
 | 
			
		||||
errors.boba.best {
 | 
			
		||||
    root * /etc/caddy/errors/img
 | 
			
		||||
    file_server
 | 
			
		||||
    import basicerrors
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										5
									
								
								errors/dl.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										5
									
								
								errors/dl.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
mkdir -p img/
 | 
			
		||||
cd img/
 | 
			
		||||
curl https://http.cat | grep -oE '[0-9]{3}\.jpg' | sort | uniq | parallel $@ 'wget -q https://http.cat/{} && echo "DL {}"'
 | 
			
		||||
							
								
								
									
										11
									
								
								errors/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								errors/index.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
<html>
 | 
			
		||||
    <head>
 | 
			
		||||
        <title>{{placeholder "http.error.status_code"}} {{placeholder "http.error.status_text"}}</title>
 | 
			
		||||
    </head>
 | 
			
		||||
    <body bgcolor="black" text="white">
 | 
			
		||||
        <center>
 | 
			
		||||
            <h1>{{placeholder "http.error.status_code"}} {{placeholder "http.error.status_text"}}</h1>
 | 
			
		||||
            <img src='https://errors.boba.best/{{placeholder "http.error.status_code"}}.jpg' alt="cat" />
 | 
			
		||||
        </center>
 | 
			
		||||
    </body>
 | 
			
		||||
</html>
 | 
			
		||||
		Reference in New Issue
	
	Block a user