From 15941530f484ec49038642b660102d512893a737 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 8 May 2015 10:39:43 +0200 Subject: generate FAQ for github, not good yet but better than nothing. --- main/misc/genFAQ.py | 56 ++++++++++++++++++++++++------------ main/misc/header.html | 44 ++++++++++++++++++++++++++++ main/src/main/res/values/strings.xml | 8 +++--- 3 files changed, 85 insertions(+), 23 deletions(-) create mode 100644 main/misc/header.html (limited to 'main') 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=""" - -This page is autogenerated. Do not edit - -= 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","

") + 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 = """

+ + %(title)s + +

+ %(verinfo)s + %(content)s + """ + + if verHeader: - out += "_%s_\n" % verHeader - - out += "%s\n" % getString(body,lang) + verinfo += "%s
\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 @@ + + + + + + + + + + + Ics-openvpn + + + + + +
+
+ View on GitHub + +

Ics-openvpn

+

OpenVPN for Android

+
+
+ + +
+
+%(content)s +
+
+ + + + + + + + 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 @@ PKCS12 File CA Certificate You must select a certificate - Source code and issue tracker available at https://github.com/schwabe/ics-openvpn + Source code and issue tracker available at https://github.com/schwabe/ics-openvpn/ This program uses the following components; see the source code for full details on the licenses About Profiles @@ -157,7 +157,7 @@ imported profile imported profile %d Broken Images - <p>Official HTC images are known to have a strange routing problem causing traffic not to flow through the tunnel (See also <a href="http://code.google.com/p/ics-openvpn/issues/detail?id=18">Issue 18</a> in the bug tracker.)</p><p>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 <a href="http://code.google.com/p/ics-openvpn/issues/detail?id=29">Issue 29</a> in the bug tracker.)</p><p>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.</p><p>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.</p> + <p>Official HTC images are known to have a strange routing problem causing traffic not to flow through the tunnel (See also <a href="https://github.com/schwabe/ics-openvpn/issues/18">Issue 18</a> in the bug tracker.)</p><p>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 <a href="https://github.com/schwabe/ics-openvpn/issues/29">Issue 29</a> in the bug tracker.)</p><p>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.</p><p>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.</p> PKCS12 File Encryption Key Private Key Password Password @@ -223,7 +223,7 @@ Import OpenVPN configuration Battery 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. <p> 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 <a href="http://developer.android.com/training/efficient-downloads/efficient-network-access.html#RadioStateMachine">The Radio State Machine | Android Developers</a>) <p> This keepalive setting cannot be changed on the client. Only the system administrator of the OpenVPN can change the setting. <p> 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 <a href="http://sites.inka.de/bigred/devel/tcp-tcp.html">Why TCP Over TCP Is A Bad Idea</a>) - 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 <a href=\"http://code.google.com/p/ics-openvpn/issues/detail?id=34\">issue #34</a> + 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 <a href=\"https://github.com/schwabe/ics-openvpn/issues/34\">issue #34</a> VPN and Tethering Connection retries Reconnection settings @@ -377,7 +377,7 @@ Persist tun mode %s and later Connections fails with SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure - 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. + 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. This profile has been added from an external app (%s) and has been marked as not user editable. Certificate Revocation List Restarting OpenVPN Service (App crashed probably crashed or killed for memory pressure) -- cgit v1.2.3