From bbeea90150e2ee4f2295bd7b043803cfd9d24511 Mon Sep 17 00:00:00 2001 From: traumschule Date: Thu, 4 Oct 2018 02:57:43 +0200 Subject: [PATCH 1/4] globalist: Improve README intro, document default ControlPort --- globalist/README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/globalist/README.md b/globalist/README.md index ba098cc7a..a0ff6458b 100644 --- a/globalist/README.md +++ b/globalist/README.md @@ -1,16 +1,24 @@ # Globalist -Idea: distributed githubless repository sharing. Yes, this is the official home ;-) +Globalist provides distributed sharing of repositories without the need of central instances (like GitHub). -Globalist is an attempt to ease the distribution of git repos, away from central points of failure. +This is an attempt to ease the distribution of git repos, to overcome the risk of a central points of failure. Globalist stands for "Global List" and aims at replacing any EtherPads of more than transient value. -Globalist is also meant to evolve into an experimental distributed asynchronous wiki facility. +It is also meant to evolve into an experimental distributed asynchronous wiki facility. Nodes can come and go, and network topology only depends on the peers entries in the nodes' config files. Changes that are merged by one's peers propagate by diffusion. +The official repository can be found at https://notabug.org/themusicgod1/cloudflare-tor + ## Usage +To use Globalist.py python3 is needed. Either run it from globalist directory with `python3 Globalist.py` or or install it as described below. + +Per default an open tor ControlPort at 9151 without authentication is expected. You can choose another port with `-C`. For a list of option see `--help`. + +### Create repository + Make a new directory and put this in the file ./repo.cfg (when creating a new repository instead of cloning from a peer, the list or indeed the repo.cfg file can remain empty) ``` @@ -22,6 +30,8 @@ For a public repository, no authentication is needed (option -X). In case authen For each shared repo, Globalist will create one .onion service. Note that it is possible to use either bare repos or not-bare repos. +### Clone a repository + To clone a bare repo: ``` From 2daa8328802ac0c8b369364a5eb8e13181513b2d Mon Sep 17 00:00:00 2001 From: traumschule Date: Thu, 4 Oct 2018 03:00:23 +0200 Subject: [PATCH 2/4] globalist: IDEA to implement Tor ControlPort authentication --- globalist/globalist/__init__.py | 7 +++++++ .../__pycache__/__init__.cpython-36.pyc | Bin 0 -> 9716 bytes 2 files changed, 7 insertions(+) create mode 100644 globalist/globalist/__pycache__/__init__.cpython-36.pyc diff --git a/globalist/globalist/__init__.py b/globalist/globalist/__init__.py index a2e7e5f0d..172edfb21 100755 --- a/globalist/globalist/__init__.py +++ b/globalist/globalist/__init__.py @@ -336,6 +336,12 @@ def main(args=[]): opt.add_option("-C", "--control-port", dest="a_controlport", action="store", type="int", default=9151, metavar="PORT", help="Tor controlport") +# opt.add_option("-CP", "--control-password", dest="a_controlpassword", action="store", type="int", +# default="", help="Tor Control Password") + +# opt.add_option("-CC", "--control-cookie", dest="a_controlcookie", action="store", type="int", +# default="", help="Tor Control Cookie") + opt.add_option("-a", "--await", dest="o_ap", action="store_true", default=False, help="await publication of .onion in DHT before proceeding") @@ -362,6 +368,7 @@ def main(args=[]): options.a_controlport = DEFAULT_CONTROLPORT # Extract socksport via c.get_conf and use this (-P in torsocks) + # TODO implement authentication token / cookie controller = Controller.from_port(port = options.a_controlport) controller.authenticate() STATUS['socksport'] = controller.get_conf('SocksPort').split(" ",1)[0] diff --git a/globalist/globalist/__pycache__/__init__.cpython-36.pyc b/globalist/globalist/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc0520c6102cead251f5d4810b495b750663d946 GIT binary patch literal 9716 zcmcgyO>7)TcJ9BK>G>f=krX9SvfP&SH?n3Z$+9dnk}O$2wk$2hSoF$n%RAegYLY!1 zc8{uy5~p`)EJ6p87f_(XBFVv61VOMs0t5*Xgrdoe%?>L_m$op8Y*47_Ya@>)0*}l+P1$U>X-0~{~d+UT&-IXx-inH1H>!-iPVzrs7 zo|djep^{O%?aSaFU)Qv%k>)zSFXOZrN6qE96G_$7i5hYcyTByIn*52sdq z5qMLpu`j2T^j25m=F)20pHh*WYPO?QvC#IUU!&K>b~Nv`gIH~=H5x$}s79mS>B<}! zUZwe2C^Tb4=a#_|XeoL8cnQZ)$(Epumf5nn%=I*3Y#1B*B7Uv>28mz8vdkGbr=r#7 zQZkO!)r9A-L}ATeqaCV6%hiG;zOsNKHKI7RI-Xie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20SKWpD%6KWFJc&)}mk#Er?|h+T|16(FS4tJZpMiZ!bW)0>oJ&LSb2IZ(e5qEk$w^vTAy==Y?VG zn?%ozPeCG&e-@R;MvH(iec;C7r0EcVdp7aS!u)X4O-p`aZoB0+7+56e78lwadQu3@ znUR~D!$wNkKtpQcA`MtI-A-Z+KAPZ(^|`I!6mnPs2v2snwK};3!oR155mcuEd?^8f zN#Ky5+toUl&)~WMdqKCgjYe8(G*%*k{}Ob0{kashmpEsui8xkU|xOJ_UF zf$}oFaj8Qs7txMoy-JU_ahu<9E7?`%tS8}&-4a3P z8S3qpI@H#nEz6?zyEFua?rFKPd6G36?0+D1n0{);-8jw1N?V;Nk_P>ieeb&@z#uJA2sHcLrrknX$=UoaD? z>(Oc`7$RYCBh9TWhmio>vV@IgNY2fZycRk%Nl#_MzelV;r-BlQEcw1nH9{j;6D02~ zD>2!ao1bH`vq;<`Jj+$Skd~aS2h{5)R1CC=ad^H~V;1S#SyF(10Vmur7!@eu_kXwnChUcO+rJLu zMgm9;Fq?5oHwi^Vx@qI?7#JebPr6MW#k+w-w9>C1G)lNdrdtdkk+@UdkJMV}j+yup5}8qgH*qiNB@=3jnM{`Rpu@Xv=ZPLzIKES=i}8VQ${yAO%_S7Px?kSM zLq4E_)Wfad0LCRcE39;F>~2==5XDU@7(a=L)@sGLmtuHDa$nNidjAB^v~rbtd`Jan ztDK_}a*|1t5=@5YGp%8TAqXWCJ*yK Date: Thu, 3 Jan 2019 21:37:22 -0500 Subject: [PATCH 3/4] Catch when SocksPort is empty. --- globalist/globalist/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/globalist/globalist/__init__.py b/globalist/globalist/__init__.py index 12bad40a1..73c6fe38e 100755 --- a/globalist/globalist/__init__.py +++ b/globalist/globalist/__init__.py @@ -371,7 +371,10 @@ def main(args=[]): # TODO implement authentication token / cookie controller = Controller.from_port(port = options.a_controlport) controller.authenticate() - STATUS['socksport'] = controller.get_conf('SocksPort').split(" ",1)[0] + if controller.get_conf('SocksPort'): + STATUS['socksport'] = controller.get_conf('SocksPort').split(" ",1)[0] + else: + STATUS['socksport'] = 9050 controller.close() config = cp.ConfigParser() From 820023341b53321de6a4c2b12a319235e2d5e87f Mon Sep 17 00:00:00 2001 From: ts Date: Thu, 3 Jan 2019 23:51:56 -0500 Subject: [PATCH 4/4] Convert port to string. --- globalist/globalist/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/globalist/globalist/__init__.py b/globalist/globalist/__init__.py index 73c6fe38e..d1326dc03 100755 --- a/globalist/globalist/__init__.py +++ b/globalist/globalist/__init__.py @@ -248,7 +248,7 @@ def clone(config): where += ".git" how = ["--bare", "--mirror"] - cloneproc = subprocess.Popen(["torsocks", "-P", STATUS['socksport'], "git", "clone"] + how + [what, where]) + cloneproc = subprocess.Popen(["torsocks", "-P", str(STATUS['socksport']), "git", "clone"] + how + [what, where]) if cloneproc.wait() != 0: print ("Error cloning, exiting.") return -1