From 0a5e6007da97ee74ad935f184302c5755b02e64c Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Thu, 30 Jun 2011 23:10:08 +0000 Subject: [PATCH] - Proxy error pages and CSS. Needs a little help still. --- build.xml | 4 +++ res/drawable/itoopie_sm.png | Bin 0 -> 4866 bytes res/raw/ahelper_conflict_header_ht | 27 ++++++++++++++++ res/raw/ahelper_new_header_ht | 24 +++++++++++++++ res/raw/android_css | 13 ++++++++ res/raw/auth_header_ht | 24 +++++++++++++++ res/raw/denied_header_ht | 19 ++++++++++++ res/raw/dnf_header_ht | 22 +++++++++++++ res/raw/dnfb_header_ht | 23 ++++++++++++++ res/raw/dnfh_header_ht | 26 ++++++++++++++++ res/raw/dnfp_header_ht | 25 +++++++++++++++ res/raw/localhost_header_ht | 18 +++++++++++ res/raw/noproxy_header_ht | 20 ++++++++++++ res/raw/protocol_header_ht | 20 ++++++++++++ src/net/i2p/android/apps/EepGetFetcher.java | 2 +- .../router/activity/I2PWebViewClient.java | 2 +- src/net/i2p/android/router/service/Init.java | 29 ++++++++++++++++++ 17 files changed, 296 insertions(+), 2 deletions(-) create mode 100644 res/drawable/itoopie_sm.png create mode 100644 res/raw/ahelper_conflict_header_ht create mode 100644 res/raw/ahelper_new_header_ht create mode 100644 res/raw/android_css create mode 100644 res/raw/auth_header_ht create mode 100644 res/raw/denied_header_ht create mode 100644 res/raw/dnf_header_ht create mode 100644 res/raw/dnfb_header_ht create mode 100644 res/raw/dnfh_header_ht create mode 100644 res/raw/dnfp_header_ht create mode 100644 res/raw/localhost_header_ht create mode 100644 res/raw/noproxy_header_ht create mode 100644 res/raw/protocol_header_ht diff --git a/build.xml b/build.xml index 70b77d953..639fe1989 100644 --- a/build.xml +++ b/build.xml @@ -156,6 +156,8 @@ <target name="copy-i2p-resources" depends="findI2PSource, -dirs" > <copy file="LICENSE.txt" tofile="res/raw/license_app_txt" /> <copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="res/drawable/" /> + <copy file="${i2pbase}/installer/resources/themes/console/light/images/header.png" todir="res/drawable/" /> + <copy file="${i2pbase}/installer/resources/themes/console/light/console.css" tofile="res/raw/console_css" /> <copy file="${i2pbase}/installer/resources/blocklist.txt" tofile="res/raw/blocklist_txt" /> <copy file="${i2pbase}/installer/resources/hosts.txt" tofile="res/raw/hosts_txt" /> <copy file="${i2pbase}/licenses/LICENSE-ElGamalDSA.txt" tofile="res/raw/license_elgamaldsa_txt" /> @@ -199,6 +201,8 @@ <target name="distclean" depends="clean"> <delete dir="${jar.libs.dir}" verbose="${verbose}" /> <delete file="res/drawable/i2plogo.png" verbose="${verbose}"/> + <delete file="res/drawable/header.png" verbose="${verbose}"/> + <delete file="res/raw/console_css" verbose="${verbose}"/> <delete file="res/raw/blocklist_txt" verbose="${verbose}" /> <delete file="res/raw/hosts_txt" verbose="${verbose}" /> <delete file="res/raw/license_app_txt" /> diff --git a/res/drawable/itoopie_sm.png b/res/drawable/itoopie_sm.png new file mode 100644 index 0000000000000000000000000000000000000000..3c9b87d573bdff9a98db1fb8da68ffec4140d2e6 GIT binary patch literal 4866 zcmV+d6aDOoP)<h;3K|Lk000e1NJLTq001@s002Y?1^@s7y{Ptq00009a7bBm000id z000id0mpBsWB>pXv`IukRCt`lI|+1DRkHPZO(#u4Is~&oAR!2ZM3z7R1%ko+4~RJ< z1c!s8-w_YQ(KrYMg9sS#$jBIlfxrR%gQN0AKxBzB!y-7y7ULk%NMr|@#00XDPIr3C z{Z+T$dvtfYJDsph!R`0n-Rjn@x^=7S-T=4*bNx`rxeWg^xk92_lcpwMb~`VS(yf-C ze-5Bj@*W6O^drzuS5UD^7zH}9t^*sY;Ge>+Zg+ja4#FT-1bvx85SZL@;lhQHiIWp+ z6bc2Hj3&5#^!lLJUw^$!Nfk0OGSZ3)ifTVu^GU?bOE(wA#l@M^)6?U5%W2c5DF+T5 z*q5URXvI{6Eib!LGum?!Brs7yZ7nd1<yHkgcC8kvKxk|P&}iDW)Qi){u%cVnIt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4Nsr(XLJ%5$|oq#KZgoKpj<m9}DPp_8+#5-wp^Ug@e9ds;FS664;xN)ORx&uwz zq1$(KWvnZSp0|z&wr$(?@R>7b7W*pq2G}1B%z-oP-{SQEoanRJ+1dGh`t)h=R}Tp^ z<JcRKd&FTn0x?N{+!BQB>_Qwvs>A3|4Y{T6$RPexARZt!<Cq(9-BB{4@R=o1BhJxm z66f^dGZ-7_NLd7W(eGXYbDks7agIq$Wak;n%gfCuRSvfSi(*N~sX<6Nx=xB9WUo%l z(}-tDbYj`z{qJ^x2*HP)G$W3~BAr>00zok}H8eD|(Atvf`#rM)ks!|`5lD$NCVrEj z<a&4}&@&KDi?K+8RyuT}m?Wt^XSWW19!3cXu;L`!NX^qb7FqqBkp(PbL}+DYr4lui zO08C_!~;4aNF^T7DRJgx0_g;po|q@lI}t1OMT3`!!E%0rNC8%SCk4}reQ|<t-P5-n zC&-RC?9I*1_L!I$M<9oNcVz7l(J0#j?t=<MEZ|lk;7kf|>-bv01uf&kZ%!EfkwRl* oBSXuE6NeMWuswgj-IL1y2jw)q$#2Ymj{pDw07*qoM6N<$g4<Lv#sB~S literal 0 HcmV?d00001 diff --git a/res/raw/ahelper_conflict_header_ht b/res/raw/ahelper_conflict_header_ht new file mode 100644 index 000000000..75738da36 --- /dev/null +++ b/res/raw/ahelper_conflict_header_ht @@ -0,0 +1,27 @@ +HTTP/1.1 409 Conflict +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Warning: Destination key conflict</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=logo> + <img src="file:///data/data/net.i2p.android.router/files/docs/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"> +</div> +<div class=warning id=warning> +<h3>Warning: Destination Key Conflict</h3> +The addresshelper link you followed specifies a different destination key +than a host entry in your host database. +Someone could be trying to impersonate another eepsite, +or people have given two eepsites identical names. +<p> +You can resolve the conflict by considering which key you trust, +and either discarding the addresshelper link, +discarding the host entry from your host database, +or naming one of them differently. +<p> diff --git a/res/raw/ahelper_new_header_ht b/res/raw/ahelper_new_header_ht new file mode 100644 index 000000000..96d512e89 --- /dev/null +++ b/res/raw/ahelper_new_header_ht @@ -0,0 +1,24 @@ +HTTP/1.1 409 New Address +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Information: New Host Name</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=logo> + <img src="file:///data/data/net.i2p.android.router/files/docs/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"> +</div> +<div class=warning id=warning> +<h3>Information: New Host Name with Address Helper</h3> +<p> +The address helper link you followed is for a new host name that is not in your address book. +You may save this host name to your local address book. +If you save it to your address book, you will not see this message again. +If you do not save it, the host name will be forgotten after the next router restart. +If you do not wish to visit this host, click the "back" button on your browser. +</p> diff --git a/res/raw/android_css b/res/raw/android_css new file mode 100644 index 000000000..a20a8ba6f --- /dev/null +++ b/res/raw/android_css @@ -0,0 +1,13 @@ +/* overrides of console.css */ + +div.logo { + margin: 0 auto; + float: none; +} + +/* proxy error messages */ + +div.warning { + margin: 20px; + min-width: 360px; +} diff --git a/res/raw/auth_header_ht b/res/raw/auth_header_ht new file mode 100644 index 000000000..220863462 --- /dev/null +++ b/res/raw/auth_header_ht @@ -0,0 +1,24 @@ +HTTP/1.1 407 Proxy Authorization Required +Content-Type: text/html; charset=UTF-8 +Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.5 +Proxy-Authenticate: Basic realm="I2P HTTP Proxy" +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>Proxy Authorization Required</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=warning id=warning> +<h3>I2P HTTP Proxy Authorization Required</h3> +This proxy is configured to require a username and password for access. +Please enter your username and password, or check your +router configuration +or +I2PTunnel configuration. +To disable authorization, remove the configuration +<code>i2ptunnel.proxy.auth=basic</code>, then stop and restart the HTTP Proxy tunnel. +</div> diff --git a/res/raw/denied_header_ht b/res/raw/denied_header_ht new file mode 100644 index 000000000..3c5e454cb --- /dev/null +++ b/res/raw/denied_header_ht @@ -0,0 +1,19 @@ +HTTP/1.1 403 Request Denied +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Warning: Request Denied</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=logo> + <img src="file:///data/data/net.i2p.android.router/files/docs/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"> +</div> +<div class=warning id=warning> +<h3>Warning: Request Denied</h3> +You attempted to connect to a non-I2P website or location. +</div> diff --git a/res/raw/dnf_header_ht b/res/raw/dnf_header_ht new file mode 100644 index 000000000..109d47418 --- /dev/null +++ b/res/raw/dnf_header_ht @@ -0,0 +1,22 @@ +HTTP/1.1 504 Gateway Timeout +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Warning: Eepsite not reachable</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=logo> + <img src="file:///data/data/net.i2p.android.router/files/docs/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"> +</div> +<div class=warning id=warning> +<h3>Warning: Eepsite Unreachable</h3> +The eepsite was not reachable. +The eepsite is offline, there is network congestion, +or your router is not yet well-integrated with peers. +You may want to retry. +<hr><b>Could not find the following destination:</b><BR><BR> diff --git a/res/raw/dnfb_header_ht b/res/raw/dnfb_header_ht new file mode 100644 index 000000000..cb094b9a3 --- /dev/null +++ b/res/raw/dnfb_header_ht @@ -0,0 +1,23 @@ +HTTP/1.1 400 Destination Not Found +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Warning: Invalid eepsite destination</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=logo> + <img src="file:///data/data/net.i2p.android.router/files/docs/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"> +</div> +<div class=warning id=warning> +<h3>Warning: Invalid Destination</h3> +The eepsite destination specified was not valid, or was +otherwise unreachable. Perhaps you pasted in the +wrong BASE64 string or the link you are following is +bad. The I2P host could also +be offline. You may want to retry. +<hr><b>Could not find the following destination:</b><BR><BR> diff --git a/res/raw/dnfh_header_ht b/res/raw/dnfh_header_ht new file mode 100644 index 000000000..659dcc200 --- /dev/null +++ b/res/raw/dnfh_header_ht @@ -0,0 +1,26 @@ +HTTP/1.1 404 Domain Not Found +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Warning: Eepsite unknown</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=logo> + <img src="file:///data/data/net.i2p.android.router/files/docs/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</div> +<div class=warning id=warning> +<h3>Warning: Eepsite Not Found in Addressbook</h3> +The eepsite was not found in your router's addressbook. +Check the link or find a BASE64 address. +If you have the BASE64 address, paste it into your userhosts.txt in +your address book, +use a BASE64 address helper, or use a jump service link below.<br><br> +Seeing this page often? See <a href="http://www.i2p2.i2p/faq.html#subscriptions">the FAQ</a> +for help in adding some subscriptions +to your addressbook.<hr> +<b>Could not find the following destination:</b><BR><BR> diff --git a/res/raw/dnfp_header_ht b/res/raw/dnfp_header_ht new file mode 100644 index 000000000..d97fe272e --- /dev/null +++ b/res/raw/dnfp_header_ht @@ -0,0 +1,25 @@ +HTTP/1.1 504 Gateway Timeout +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Warning: Outproxy Not Found</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=logo> + <img src="file:///data/data/net.i2p.android.router/files/docs/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</div> +<div class=warning id=warning> +<h3>Warning: I2P Proxy Not Found</h3> +The WWW Outproxy was not found. +It is offline, there is network congestion, +or your router is not yet well-integrated with peers. +You may want to retry +as this will randomly reselect an outproxy from the pool you have defined +(if you have more than one configured). +If you continue to have trouble you may want to edit your outproxy list. +<hr><b>Could not find the following destination:</b><BR><BR> diff --git a/res/raw/localhost_header_ht b/res/raw/localhost_header_ht new file mode 100644 index 000000000..9865fa377 --- /dev/null +++ b/res/raw/localhost_header_ht @@ -0,0 +1,18 @@ +HTTP/1.1 403 Access Denied +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Error: Request Denied</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</head> +<body> + +<div class=warning id=warning> +<h3>Error: Local Access</h3> +Your browser is misconfigured. Do not use the proxy to access the router console, +localhost, or local LAN destinations. +</div> diff --git a/res/raw/noproxy_header_ht b/res/raw/noproxy_header_ht new file mode 100644 index 000000000..f14524230 --- /dev/null +++ b/res/raw/noproxy_header_ht @@ -0,0 +1,20 @@ +HTTP/1.1 503 Service Unavailable +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Warning: No outproxy configured</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=logo> + <img src="file:///data/data/net.i2p.android.router/files/docs/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"> +</div> +<div class=warning id=warning> +<h3>Warning: No Outproxy Configured</h3> +Your request was for a site outside of I2P, but you have no +HTTP outproxy configured. Please configure an outproxy in I2PTunnel. +</div> diff --git a/res/raw/protocol_header_ht b/res/raw/protocol_header_ht new file mode 100644 index 000000000..299cc69a5 --- /dev/null +++ b/res/raw/protocol_header_ht @@ -0,0 +1,20 @@ +HTTP/1.1 403 Bad Protocol +Content-Type: text/html; charset=UTF-8 +Cache-control: no-cache +Connection: close +Proxy-Connection: close + +<html><head> +<title>I2P Warning: Non-HTTP Protocol</title> +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/console.css" rel="stylesheet" type="text/css" > +<link href="file:///data/data/net.i2p.android.router/files/docs/themes/console/light/android.css" rel="stylesheet" type="text/css" > +</head> +<body> +<div class=logo> + <img src="file:///data/data/net.i2p.android.router/files/docs/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"> +</div> +<div class=warning id=warning> +<h3>Warning: Non-HTTP Protocol</h3> +The request uses a bad protocol. +The I2P HTTP Proxy supports http:// requests ONLY. Other protocols such as https:// and ftp:// are not allowed. +</div> diff --git a/src/net/i2p/android/apps/EepGetFetcher.java b/src/net/i2p/android/apps/EepGetFetcher.java index 6c8ee6a33..983bf400d 100644 --- a/src/net/i2p/android/apps/EepGetFetcher.java +++ b/src/net/i2p/android/apps/EepGetFetcher.java @@ -27,7 +27,7 @@ public class EepGetFetcher implements EepGet.StatusListener { private static final String ERROR_HEADER = "<html><head><title>Not Found</title></head><body>"; private static final String ERROR_URL = "<p>Unable to load URL: "; - private static final String ERROR_ROUTER = "<p>Your router does not appear to be up.</p>"; + private static final String ERROR_ROUTER = "<p>Your router (or the HTTP proxy) does not appear to be running.</p>"; private static final String ERROR_FOOTER = "</body></html>"; /** diff --git a/src/net/i2p/android/router/activity/I2PWebViewClient.java b/src/net/i2p/android/router/activity/I2PWebViewClient.java index d2def71be..8c9ecc15f 100644 --- a/src/net/i2p/android/router/activity/I2PWebViewClient.java +++ b/src/net/i2p/android/router/activity/I2PWebViewClient.java @@ -38,7 +38,7 @@ class I2PWebViewClient extends WebViewClient { private static final String HEADER = "<html><head></head><body>"; private static final String FOOTER = "</body></html>"; private static final String ERROR_URL = "<p>Unable to load URL: "; - private static final String ERROR_ROUTER = "<p>Your router does not appear to be up.</p>"; + private static final String ERROR_ROUTER = "<p>Your router (or the HTTP proxy) does not appear to be running.</p>"; public I2PWebViewClient(Context ctx) { super(); diff --git a/src/net/i2p/android/router/service/Init.java b/src/net/i2p/android/router/service/Init.java index 01434538e..6e9f76d24 100644 --- a/src/net/i2p/android/router/service/Init.java +++ b/src/net/i2p/android/router/service/Init.java @@ -72,10 +72,39 @@ class Init { mergeResourceToFile(R.raw.hosts_txt, "hosts.txt", null); mergeResourceToFile(R.raw.more_hosts_txt, "hosts.txt", null); copyResourceToFile(R.raw.blocklist_txt, "blocklist.txt"); + File abDir = new File(myDir, "addressbook"); abDir.mkdir(); copyResourceToFile(R.raw.subscriptions_txt, "addressbook/subscriptions.txt"); mergeResourceToFile(R.raw.addressbook_config_txt, "addressbook/config.txt", null); + + File docsDir = new File(myDir, "docs"); + docsDir.mkdir(); + copyResourceToFile(R.raw.ahelper_conflict_header_ht, "docs/ahelper-conflict-header.ht"); + copyResourceToFile(R.raw.ahelper_new_header_ht, "docs/ahelper-new-header.ht"); + copyResourceToFile(R.raw.auth_header_ht, "docs/auth-header.ht"); + copyResourceToFile(R.raw.denied_header_ht, "docs/denied-header.ht"); + copyResourceToFile(R.raw.dnf_header_ht, "docs/dnf-header.ht"); + copyResourceToFile(R.raw.dnfb_header_ht, "docs/dnfb-header.ht"); + copyResourceToFile(R.raw.dnfh_header_ht, "docs/dnfh-header.ht"); + copyResourceToFile(R.raw.dnfp_header_ht, "docs/dnfp-header.ht"); + copyResourceToFile(R.raw.localhost_header_ht, "docs/localhost-header.ht"); + copyResourceToFile(R.raw.noproxy_header_ht, "docs/noproxy-header.ht"); + copyResourceToFile(R.raw.protocol_header_ht, "docs/protocol-header.ht"); + + File cssDir = new File(docsDir, "themes/console/light"); + cssDir.mkdirs(); + copyResourceToFile(R.raw.console_css, "docs/themes/console/light/console.css"); + copyResourceToFile(R.raw.android_css, "docs/themes/console/light/android.css"); + + File imgDir = new File(docsDir, "themes/console/images"); + imgDir.mkdir(); + copyResourceToFile(R.drawable.i2plogo, "docs/themes/console/images/i2plogo.png"); + copyResourceToFile(R.drawable.itoopie_sm, "docs/themes/console/images/itoopie_sm.png"); + + File img2Dir = new File(cssDir, "images"); + img2Dir.mkdir(); + copyResourceToFile(R.drawable.header, "docs/themes/console/light/images/header.png"); } deleteOldFiles(); -- GitLab