summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2015-05-08 10:39:43 +0200
committerArne Schwabe <arne@rfc2549.org>2015-06-15 09:09:20 +0200
commit15941530f484ec49038642b660102d512893a737 (patch)
tree701b122df0b1fda8ee6d5bc5b21906a2b7f91999
parent519e2d26b74b47fbe19da4ad632d1f9d56648aac (diff)
generate FAQ for github, not good yet but better than nothing.
-rwxr-xr-xmain/misc/genFAQ.py56
-rw-r--r--main/misc/header.html44
-rwxr-xr-xmain/src/main/res/values/strings.xml8
3 files changed, 85 insertions, 23 deletions
diff --git a/main/misc/genFAQ.py b/main/misc/genFAQ.py
index d4ddf032..d69a5e6b 100755
--- a/main/misc/genFAQ.py
+++ b/main/misc/genFAQ.py
@@ -5,16 +5,12 @@ import codecs
import xml.dom.minidom as dom
import os.path
import re
+import HTMLParser
-faqpath = "/Users/arne/oss/ics-openvpn.wiki"
+faqpath = "/Users/arne/software/icsopenvpn.ghpages"
-header="""
-<wiki:comment>
-This page is autogenerated. Do not edit
-</wiki:comment>
-= Frequently aksed questions =
-"""
+template = open("misc/header.html").read()
def getString(strid,lang):
ostr=""
@@ -28,6 +24,7 @@ def getString(strid,lang):
ostr = ostr.replace("\\\"","\"")
ostr = ostr.replace("\\'","'")
ostr = ostr.replace("\\n","<p>")
+ ostr= HTMLParser.HTMLParser().unescape(ostr)
return ostr
def genPage(javafile, lang):
@@ -46,19 +43,40 @@ def genPage(javafile, lang):
(ver1, ver2, title, body) = m.groups()
verHeader = getVerHeader(ver1.strip(), ver2.strip(), lang)
- out += "== %s ==\n" % getString(title,lang)
+ section = """<h2>
+ <a name="%(titleid)s"></a>
+ %(title)s
+ <a href="#%(titleid)s" class="section_anchor"> </a>
+ </h2>
+ %(verinfo)s
+ %(content)s
+ """
+
+
if verHeader:
- out += "_%s_\n" % verHeader
-
- out += "%s\n" % getString(body,lang)
+ verinfo += "<small><i>%s</i></small> <br/>\n" % verHeader
+ else:
+ verinfo =""
+
+ content = "%s\n" % getString(body,lang)
if body == "faq_system_dialogs_title":
- out += "%s\n" % getString("faq_system_dialog_xposed",lang)
+ content += "%s\n" % getString("faq_system_dialog_xposed",lang)
+
- elif header:
+ c = {'titleid': title,
+ 'title': getString(title,lang),
+ 'verinfo': verinfo,
+ 'content': content
+ }
+
+ out+=section % c
+
+
+ else:
notmatched = l
- return header + out
+ return out
def getVerHeader(startVersion, endVersion, lang):
if startVersion == "Build.VERSION_CODES.ICE_CREAM_SANDWICH":
@@ -144,7 +162,7 @@ def main():
faqdom = open("src/main/java/de/blinkt/openvpn/fragments/FaqFragment.java").readlines()
faq= genPage(faqdom,"default")
- open(faqpath + "/FAQ.wiki","w").write(faq)
+ open(faqpath + "/FAQ.html","w").write(template % {'content': faq})
for directory in os.listdir("src/main/res"):
if directory.startswith("values-") and directory.find("-sw")==-1 and not directory.startswith("values-v"):
@@ -152,18 +170,18 @@ def main():
print lang
loadstrres("src/main/res/values-%s/strings.xml" % lang,lang)
- langdir= "%s/%s" %(faqpath,lang)
+ langdir= "%s/FAQ-%s" %(faqpath,lang)
if lang=="zh-rCN":
- langdir= "%s/%s" %(faqpath,"zh-Hans")
+ langdir= "%s/FAQ-%s" %(faqpath,"zh-Hans")
elif lang=="zh-rTW":
- langdir= "%s/%s" %(faqpath,"zh-Hant")
+ langdir= "%s/FAQ-%s" %(faqpath,"zh-Hant")
if not os.path.exists(langdir):
os.mkdir(langdir)
faq= genPage(faqdom,lang)
- open("%s/FAQ.wiki" % langdir,"w").write(faq.encode("utf-8"))
+ open("%s.html" % langdir,"w").write(faq.encode("utf-8"))
checkFormatString(lang)
diff --git a/main/misc/header.html b/main/misc/header.html
new file mode 100644
index 00000000..9fe689bf
--- /dev/null
+++ b/main/misc/header.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <meta charset='utf-8'>
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
+ <meta name="description" content="Ics-openvpn : OpenVPN for Android">
+
+ <link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
+
+ <title>Ics-openvpn</title>
+ </head>
+
+ <body>
+
+ <!-- HEADER -->
+ <div id="header_wrap" class="outer">
+ <header class="inner">
+ <a id="forkme_banner" href="https://github.com/schwabe/ics-openvpn">View on GitHub</a>
+
+ <h1 id="project_title">Ics-openvpn</h1>
+ <h2 id="project_tagline">OpenVPN for Android</h2>
+ </header>
+ </div>
+
+ <!-- MAIN CONTENT -->
+ <div id="main_content_wrap" class="outer">
+ <section id="main_content" class="inner">
+%(content)s
+ </section>
+ </div>
+
+ <!-- FOOTER -->
+ <div id="footer_wrap" class="outer">
+ <footer class="inner">
+ <p class="copyright">Ics-openvpn maintained by <a href="https://github.com/schwabe">schwabe</a></p>
+ <p>Published with <a href="https://pages.github.com">GitHub Pages</a></p>
+ </footer>
+ </div>
+
+
+
+ </body>
+</html>
diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml
index 6f64d2ba..6e2e04ca 100755
--- a/main/src/main/res/values/strings.xml
+++ b/main/src/main/res/values/strings.xml
@@ -18,7 +18,7 @@
<string name="client_pkcs12_title">PKCS12 File</string>
<string name="ca_title">CA Certificate</string>
<string name="no_certificate">You must select a certificate</string>
- <string name="copyright_guicode">Source code and issue tracker available at https://github.com/schwabe/ics-openvpn</string>
+ <string name="copyright_guicode">Source code and issue tracker available at https://github.com/schwabe/ics-openvpn/</string>
<string name="copyright_others">This program uses the following components; see the source code for full details on the licenses</string>
<string name="about">About</string>
<string name="vpn_list_title">Profiles</string>
@@ -157,7 +157,7 @@
<string name="converted_profile">imported profile</string>
<string name="converted_profile_i">imported profile %d</string>
<string name="broken_images">Broken Images</string>
- <string name="broken_images_faq">&lt;p&gt;Official HTC images are known to have a strange routing problem causing traffic not to flow through the tunnel (See also &lt;a href="http://code.google.com/p/ics-openvpn/issues/detail?id=18"&gt;Issue 18&lt;/a&gt; in the bug tracker.)&lt;/p&gt;&lt;p&gt;Older official SONY images from Xperia Arc S and Xperia Ray have been reported to be missing the VPNService completely from the image. (See also &lt;a href="http://code.google.com/p/ics-openvpn/issues/detail?id=29"&gt;Issue 29&lt;/a&gt; in the bug tracker.)&lt;/p&gt;&lt;p&gt;On custom build images the tun module might be missing or the rights of /dev/tun might be wrong. Some CM9 images need the "Fix ownership" option under "Device specific hacks" enabled.&lt;/p&gt;&lt;p&gt;Most importantly: If your device has a broken Android image, report it to your vendor. The more people who report an issue to the vendor, the more likely they are to fix it.&lt;/p&gt;</string>
+ <string name="broken_images_faq">&lt;p&gt;Official HTC images are known to have a strange routing problem causing traffic not to flow through the tunnel (See also &lt;a href="https://github.com/schwabe/ics-openvpn/issues/18"&gt;Issue 18&lt;/a&gt; in the bug tracker.)&lt;/p&gt;&lt;p&gt;Older official SONY images from Xperia Arc S and Xperia Ray have been reported to be missing the VPNService completely from the image. (See also &lt;a href="https://github.com/schwabe/ics-openvpn/issues/29"&gt;Issue 29&lt;/a&gt; in the bug tracker.)&lt;/p&gt;&lt;p&gt;On custom build images the tun module might be missing or the rights of /dev/tun might be wrong. Some CM9 images need the "Fix ownership" option under "Device specific hacks" enabled.&lt;/p&gt;&lt;p&gt;Most importantly: If your device has a broken Android image, report it to your vendor. The more people who report an issue to the vendor, the more likely they are to fix it.&lt;/p&gt;</string>
<string name="pkcs12_file_encryption_key">PKCS12 File Encryption Key</string>
<string name="private_key_password">Private Key Password</string>
<string name="password">Password</string>
@@ -223,7 +223,7 @@
<string name="import_config">Import OpenVPN configuration</string>
<string name="battery_consumption_title">Battery consumption</string>
<string name="baterry_consumption">In my personal tests the main reason for high battery consumption of OpenVPN are the keepalive packets. Most OpenVPN servers have a configuration directive like \'keepalive 10 60\' which causes the client and server to exchange keepalive packets every ten seconds. &lt;p&gt; While these packets are small and do not use much traffic, they keep the mobile radio network busy and increase the energy consumption. (See also &lt;a href="http://developer.android.com/training/efficient-downloads/efficient-network-access.html#RadioStateMachine"&gt;The Radio State Machine | Android Developers&lt;/a&gt;) &lt;p&gt; This keepalive setting cannot be changed on the client. Only the system administrator of the OpenVPN can change the setting. &lt;p&gt; Unfortunately using a keepalive larger than 60 seconds with UDP can cause some NAT gateways to drop the connection due to an inactivity timeout. Using TCP with a long keep alive timeout works, but tunneling TCP over TCP performs extremely poorly on connections with high packet loss. (See &lt;a href="http://sites.inka.de/bigred/devel/tcp-tcp.html"&gt;Why TCP Over TCP Is A Bad Idea&lt;/a&gt;)</string>
- <string name="faq_tethering">The Android Tethering feature (over WiFi, USB or Bluetooth) and the VPNService API (used by this program) do not work together. For more details see the &lt;a href=\"http://code.google.com/p/ics-openvpn/issues/detail?id=34\">issue #34&lt;/a></string>
+ <string name="faq_tethering">The Android Tethering feature (over WiFi, USB or Bluetooth) and the VPNService API (used by this program) do not work together. For more details see the &lt;a href=\"https://github.com/schwabe/ics-openvpn/issues/34\">issue #34&lt;/a></string>
<string name="vpn_tethering_title">VPN and Tethering</string>
<string name="connection_retries">Connection retries</string>
<string name="reconnection_settings">Reconnection settings</string>
@@ -377,7 +377,7 @@
<string name="ab_persist_tun_title">Persist tun mode</string>
<string name="version_and_later">%s and later</string>
<string name="tls_cipher_alert_title">Connections fails with SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure</string>
- <string name="tls_cipher_alert">Newer OpenVPN for Android versions (0.6.29/March 2015) use a more secure default for the allowed cipher suites (tls-cipher \"DEFAULT:!EXP:!PSK:!SRP:!kRSA\"). Unfortunately, omitting the less secure cipher suites and export cipher suites, especially the omission of cipher suites that do not support Perfect Forward Secrecy (Diffie-Hellman) causes some problems. This usually caused by an well-intentioned but poorly executed attempts to strengthen TLS security by setting tls-cipher on the server or some embedded OSes with stripped down SSL (e.g. MikroTik).\nTo solve this problem the problem, set the tls-cipher settings on the server to reasonable default like tls-cipher \"DEFAULT:!EXP:!PSK:!SRP:!kRSA\". To work around the problem on the client add the custom option tls-cipher DEFAULT on the Android client.</string>
+ <string name="tls_cipher_alert">Newer OpenVPN for Android versions (0.6.29/March 2015) use a more secure default for the allowed cipher suites (tls-cipher \"DEFAULT:!EXP:!PSK:!SRP:!kRSA\"). Unfortunately, omitting the less secure cipher suites and export cipher suites, especially the omission of cipher suites that do not support Perfect Forward Secrecy (Diffie-Hellman) causes some problems. This usually caused by an well-intentioned but poorly executed attempt to strengthen TLS security by setting tls-cipher on the server or some embedded OSes with stripped down SSL (e.g. MikroTik).\nTo solve this problem the problem, set the tls-cipher settings on the server to reasonable default like tls-cipher \"DEFAULT:!EXP:!PSK:!SRP:!kRSA\". To work around the problem on the client add the custom option tls-cipher DEFAULT on the Android client.</string>
<string name="message_no_user_edit">This profile has been added from an external app (%s) and has been marked as not user editable.</string>
<string name="crl_file">Certificate Revocation List</string>
<string name="service_restarted">Restarting OpenVPN Service (App crashed probably crashed or killed for memory pressure)</string>