Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Update documentation (#28234) #24

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Here is a list of the main goals the new GetTor should accomplish:
and to add new providers for storing packages and generate links.


How does the new GetTor works?
How does the new GetTor work?
==============================

Below are some specifications and core concepts on how the new GetTor works.
Expand Down Expand Up @@ -105,7 +105,7 @@ links files. The script should consider the following steps:
What is the current status of the new GetTor?
=============================================

Deployed and working.
Deployed and working. #28232 is the parent for current development.


How can I help?
Expand All @@ -119,16 +119,16 @@ should use the trac[0] and select the GetTor component. Some neat ideas we
could use are the following:

* Report bugs!
* Create script for new providers, namely: Google Drive, Github. Check
providers.txt
* Create scripts for new providers (see providers.txt)
* Create a new module for distributing links. Check distribution_methods.txt
* Finish the Twitter module.
* Propose code/behaviour improvements.
* Update the specs.

* Improve the messages (#9036) and translate them (#28233).
* Propose code/behaviour improvements (#28152).
* Update the spec (#3781).
* Implement encryption (#13878).
* Make log messages more useful (#17588).

References
===========

[0] https://trac.torproject.org/projects/tor/query?status=accepted&status=assigned&status=needs_information&status=needs_review&status=needs_revision&status=new&status=reopened&component=GetTor&col=id&col=summary&col=component&col=status&col=type&col=priority&col=milestone&order=priority
[0] https://trac.torproject.org/projects/tor/query?status=!closed&component=Applications/GetTor

106 changes: 66 additions & 40 deletions create_gh_mirrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
import gettor.core


def create_readme(tpl_path, md_path, version, links):
def create_readme(tpl_path, md_path, tb_version, links):
"""Create README file with links stored in github.links.

:param: tpl_path (string) path to file used as template.
:param: md_path (string) path to file generated.
:param: version (string) tor browser version.
:param: tb_version (string) tor browser version.
:param: links (object) github links.

"""
Expand Down Expand Up @@ -75,77 +75,103 @@ def create_readme(tpl_path, md_path, version, links):
"%LINUX64_{}_SIG%".format(lc), linux64_sig
)

content_md = content_md.replace("%VERSION%", version)
content_md = content_md.replace("%TB_VERSION%", tb_version)
md_file.write(content_md)

print "README generated with version %s" % version
print "README generated with Tor Browser %s" % tb_version


def create_landing_html(tpl_path, html_path, version, links):
def create_landing_html(tpl_path, html_path, tb_version, links):
"""Create README file with links stored in github.links.

:param: tpl_path (string) path to file used as template.
:param: html_path (string) path to file generated.
:param: version (string) tor browser version.
:param: tb_version (string) tor browser version.
:param: links (object) github links.

"""
win_link = links.get('windows', 'en')
win_pkg, win_sig, win_sha = [e for e in win_link.split("$") if e]

osx_link = links.get('osx', 'en')
osx_pkg, osx_sig, osx_sha = [e for e in osx_link.split("$") if e]

linux_links = links.get('linux', 'en')
linux32_link, linux64_link = linux_links.split(',')
linux32_pkg, linux32_sig, linux32_sha = [
e for e in linux32_link.split("$") if e
]
linux64_pkg, linux64_sig, linux64_sha = [
e for e in linux64_link.split("$") if e
]
lcs = ['FA', 'ZH', 'TR', 'EN']

html_file = open(html_path, 'w')
with open(tpl_path, 'r') as tpl_file:
content_tpl = tpl_file.read().replace('\n', '')
content_html = ''
content_html = tpl_file.read().replace('\n', '')

content_html = content_tpl.replace("%WINDOWS%", win_pkg)
content_html = content_html.replace("%WINDOWS_SIG%", win_sig)

content_html = content_html.replace("%OSX%", osx_pkg)
content_html = content_html.replace("%OSX_SIG%", osx_sig)
for lc in lcs:
win_link = links.get('windows', lc.lower())
win_pkg, win_sig, win_sha = [e for e in win_link.split("$") if e]

content_html = content_html.replace("%LINUX32%", linux32_pkg)
content_html = content_html.replace("%LINUX32_SIG%", linux32_sig)
content_html = content_html.replace("%LINUX64%", linux64_pkg)
content_html = content_html.replace("%LINUX64_SIG%", linux64_sig)
osx_link = links.get('osx', lc.lower())
osx_pkg, osx_sig, osx_sha = [e for e in osx_link.split("$") if e]

content_html = content_html.replace("%VERSION%", version)
linux_links = links.get('linux', lc.lower())
linux32_link, linux64_link = linux_links.split(',')
linux32_pkg, linux32_sig, linux32_sha = [
e for e in linux32_link.split("$") if e
]
linux64_pkg, linux64_sig, linux64_sha = [
e for e in linux64_link.split("$") if e
]

content_html = content_html.replace(
"%WINDOWS_{}%".format(lc), win_pkg
)
"""
content_html = content_html.replace(
"%WINDOWS_{}_SIG%".format(lc), win_sig
)
"""
content_html = content_html.replace(
"%OSX_{}%".format(lc), osx_pkg
)
"""
content_html = content_html.replace(
"%OSX_{}_SIG%".format(lc), osx_sig
)
"""
content_html = content_html.replace(
"%LINUX32_{}%".format(lc), linux32_pkg
)
"""
content_html = content_html.replace(
"%LINUX32_{}_SIG%".format(lc), linux32_sig
)
"""
content_html = content_html.replace(
"%LINUX64_{}%".format(lc), linux64_pkg
)
"""
content_html = content_html.replace(
"%LINUX64_{}_SIG%".format(lc), linux64_sig
)
"""

content_html = content_html.replace(
"%TB_VERSION%", tb_version
)
html_file.write(content_html)

print "HTML generated with version %s" % version
print "HTML generated with Tor Browser %s" % tb_version


def main():
"""Generate HTML and md files and update it in Github."""
github_links = 'providers/github.links'
tbb_version_path = 'latest_torbrowser.cfg'
tb_version_path = 'latest_torbrowser.cfg'
md_path = 'upload/readme_gh.md'
html_path = 'upload/landing_gh.html'
md_tpl_path = 'upload/readme_gh.tpl'
html_tpl_path = 'upload/landing_gh.tpl'
github_access_token = ''

tbb_version_config = ConfigParser.ConfigParser()
tbb_version_config.read(tbb_version_path)
version = tbb_version_config.get('version', 'current')
tb_version_config = ConfigParser.ConfigParser()
tb_version_config.read(tb_version_path)
tb_version = tb_version_config.get('version', 'current')

links = ConfigParser.ConfigParser()
links.read(github_links)

create_landing_html(html_tpl_path, html_path, version, links)
create_readme(md_tpl_path, md_path, version, links)
create_landing_html(html_tpl_path, html_path, tb_version, links)
create_readme(md_tpl_path, md_path, tb_version, links)

landing = open(html_path, 'r')
content_landing = landing.read().replace('\n', '')
Expand All @@ -157,7 +183,7 @@ def main():
repo_landing = gh.repository('thetorproject', 'gettor')
repo_readme = gh.repository('thetorproject', 'gettorbrowser')

file_landing_gh = repo_landing.file_contents('index.html')
file_landing_gh = repo_landing.file_contents('index.html', 'gh-pages')
file_readme_gh = repo_readme.file_contents('README.md')

data_landing = {
Expand Down
10 changes: 10 additions & 0 deletions css/bootstrap.min.css

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions css/gettor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/* Fonts */
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 400;
src: local('Lato Regular'), local('Lato-Regular'), url('../fonts/lato-regular.woff') format('woff');
}
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 700;
src: local('Lato Bold'), local('Lato-Bold'), url('../fonts/lato-bold.woff') format('woff');
}
@font-face {
font-family: 'Lato';
font-style: italic;
font-weight: 400;
src: local('Lato Italic'), local('Lato-Italic'), url('../fonts/lato-italic.woff') format('woff');
}

body {
padding-bottom: 20px;
/*background-color: #4ba027;*/
}

footer {
color: #aaa;
}

a:link, a:visited {
color: #AF02D7;
text-decoration: none;
}

a:hover {
color: #65007D;
}

#main {
background-color: #fff;
margin: 5% 0;
font-family: "Lato";
font-size: 16px;
font-weight: lighter;
}

#main h2 {
color: #8500A3;
}

#head-title {
color: #fff !important;
font-size: 23px;
}

#head-link {
text-align: right;
}

#head-link a:link {
color: #ccc;
}

#head-link a:hover {
color: #fff;
text-decoration: none;
}

.navbar {
background-color: #770093 !important;
}

.pad-big-left {
padding-left: 110px;
}

.pad-big-right {
padding-right: 110px;
}

.big-link {
font-size: 26px;
}
18 changes: 15 additions & 3 deletions distribution_methods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,30 @@

* SMTP: this one is ready and tested.

* XMPP: this one is ready and tested. We'll probably deploy SMTP first, tough.

================================== IN DEVELOPMENT =============================

* XMPP: the bot needs to be fixed (#23072) and should provide OTR (#18750)
and OMEMO (#28092).

* Twitter: This one is half done. I forked a twitter bot from wfn's gsoc work
on BridgeDB, but I got confused with some Twitter policies. I thought that the
bot *had* to follow someone back to send him/her DMs, but it turns out that you
just need to be followed, not follow back (thanks to mrphs for pointing out
this).
this). See #20116 and #27330.

================================== (CRAZY) IDEAS ==============================

See the parent #28231.

* Duckduckgo: This is just a thought, I haven't done proper research. What if
someone could ask for gettor links like this: "!gettor"?

* bitmessage (#19951)

* Tox (#19952)

* Facebook (#21382)

* Telegram (#22011)

* Archive.org (#22665)
Binary file added fonts/glyphicons-halflings-regular.eot
Binary file not shown.
Loading