From e56ef03e65e800cecb158d9b6935f84d952d1ccb Mon Sep 17 00:00:00 2001 From: quadrismegistus Date: Tue, 29 Sep 2020 14:09:56 +0100 Subject: [PATCH] renaming in comrad? --- LICENSE | 2 +- README.md | 90 ++--- bin/komrade-activate | 6 +- bin/komrade-apocalype | 6 +- bin/komrade-app | 8 +- bin/komrade-cli | 8 +- bin/komrade-op | 8 +- bin/komrade-reset | 2 +- bin/komrade-update | 2 +- {komrade => comrad}/.builtin.keys | 0 {komrade => comrad}/__init__.py | 0 {komrade => comrad}/app/__init__.py | 0 .../app/assets/Hammer_and_sickle.png | Bin .../app/assets/Hammer_and_sickle.xcf | Bin {komrade => comrad}/app/assets/PeyoteHand.png | Bin {komrade => comrad}/app/assets/Strengthen.ttf | Bin {komrade => comrad}/app/assets/avatar.jpg | Bin .../app/assets/avatars/Keymaker.png | Bin .../app/assets/avatars/Operator.png | Bin .../app/assets/avatars/Telephone.jpg | Bin .../app/assets/avatars/Telephone.png | Bin .../app/assets/avatars/britney.jpg | Bin .../app/assets/avatars/britney2.jpg | Bin .../app/assets/avatars/elonely.png | Bin .../app/assets/avatars/marxbot.png | Bin .../app/assets/avatars/marxxx.png | Bin {komrade => comrad}/app/assets/avatars/mz.jpg | Bin .../app/assets/avatars/zuckbot.png | Bin .../app/assets/bg-brightblue.png | Bin {komrade => comrad}/app/assets/bg-brown.png | Bin {komrade => comrad}/app/assets/bg-green.png | Bin .../app/assets/bg-greenblue.png | Bin {komrade => comrad}/app/assets/bg-purple.png | Bin {komrade => comrad}/app/assets/bg-purple2.png | Bin .../app/assets/bg-russiangreen.png | Bin {komrade => comrad}/app/assets/bg.png | Bin .../clenched-fist-vector-publicdomain.eps | Bin .../clenched-fist-vector-publicdomain.xcf | Bin {komrade => comrad}/app/assets/cover.jpg | Bin {komrade => comrad}/app/assets/fist.png | Bin {komrade => comrad}/app/assets/fist.xcf | Bin {komrade => comrad}/app/assets/fist2.png | Bin {komrade => comrad}/app/assets/fist3.png | Bin {komrade => comrad}/app/assets/font.otf | Bin .../app/assets/komrade-peek-2.gif | Bin .../app/assets/komrade-screen-peek.gif | Bin .../komrade-screen-preview-2020-08-23.gif | Bin .../komrade-screen-preview-2020-09-27.gif | Bin ...ade-terminal-preview--2020-09-16--meet.gif | Bin ...rade-terminal-preview--2020-09-16--msg.gif | Bin ...terminal-preview--2020-09-16--register.gif | Bin ...-terminal-preview--2020-09-19--posting.gif | Bin ...terminal-preview--2020-09-20--install1.gif | Bin ...terminal-preview--2020-09-20--install2.gif | Bin ...rade-terminal-preview--2020-09-20--tor.gif | Bin {komrade => comrad}/app/assets/komrade.png | Bin {komrade => comrad}/app/assets/komrade2.png | Bin {komrade => comrad}/app/assets/komrade2.xcf | Bin .../app/assets/logo (copy).png | Bin {komrade => comrad}/app/assets/logo.png | Bin {komrade => comrad}/app/assets/output.png | Bin .../app/assets/overpass-mono-bold.otf | Bin .../app/assets/overpass-mono-light.otf | Bin .../app/assets/overpass-mono-regular.otf | Bin .../app/assets/overpass-mono-semibold.otf | Bin .../app/assets/screen-feed.png | Bin .../app/assets/screen-login.png | Bin .../app/assets/screen-post.png | Bin {komrade => comrad}/app/assets/spiral2.png | Bin {komrade => comrad}/app/assets/spiral3.png | Bin {komrade => comrad}/app/assets/spiral3b.png | Bin {komrade => comrad}/app/assets/spiral4.png | Bin {komrade => comrad}/app/assets/spiral4b.png | Bin {komrade => comrad}/app/config.py | 0 {komrade => comrad}/app/main.py | 81 ++--- {komrade => comrad}/app/misc.py | 0 {komrade => comrad}/app/pub | Bin {komrade => comrad}/app/root.kv | 0 {komrade => comrad}/app/run.sh | 0 {komrade => comrad}/app/screens/base.py | 4 +- {komrade => comrad}/app/screens/dialog.py | 0 {komrade => comrad}/app/screens/feed/feed.kv | 0 {komrade => comrad}/app/screens/feed/feed.py | 4 +- .../app/screens/login/login.kv | 2 +- .../app/screens/login/login.py | 64 ++-- {komrade => comrad}/app/screens/map.py | 11 +- .../app/screens/messages/messages.kv | 0 .../app/screens/messages/messages.py | 2 +- .../screens/notifications/notifications.kv | 0 .../screens/notifications/notifications.py | 2 +- {komrade => comrad}/app/screens/post/post.kv | 0 {komrade => comrad}/app/screens/post/post.py | 6 +- .../app/screens/profile/profile.kv | 0 .../app/screens/profile/profile.py | 6 +- {komrade => comrad}/app/watcher.py | 2 +- {komrade => comrad}/art.py | 0 {komrade => comrad}/backend/__init__.py | 2 +- {komrade => comrad}/backend/callers.py | 10 +- .../komrades.py => comrad/backend/comrads.py | 86 ++--- {komrade => comrad}/backend/crypt.py | 12 +- {komrade => comrad}/backend/ether.py | 0 {komrade => comrad}/backend/keymaker.py | 98 +++--- {komrade => comrad}/backend/mazes.py | 6 +- {komrade => comrad}/backend/messages.py | 12 +- {komrade => comrad}/backend/operators.py | 42 +-- {komrade => comrad}/backend/phonelines.py | 26 +- {komrade => comrad}/backend/reset.sh | 0 {komrade => comrad}/backend/switchboard.py | 8 +- {komrade => comrad}/backend/the_operator.py | 68 ++-- {komrade => comrad}/backend/the_telephone.py | 26 +- {komrade => comrad}/cli/__init__.py | 0 {komrade => comrad}/cli/artcode.py | 0 {komrade => comrad}/cli/box.txt | 0 {komrade => comrad}/cli/cli.py | 130 +++---- {komrade => comrad}/cli/cli_curses.py | 24 +- {komrade => comrad}/cli/data/basemap.csv | 0 .../cli/data/world-countries.json | 0 {komrade => comrad}/cli/tab_completer.py | 0 {komrade => comrad}/cli/worldmap.py | 0 {komrade => comrad}/cli/worldmap_curses.py | 6 +- {komrade => comrad}/constants.py | 16 +- {komrade => comrad}/utils.py | 10 +- docs/comparisons.ipynb | 148 ++++---- docs/comparisons.md | 4 +- docs/www/README-static.md | 14 +- docs/www/index.html | 44 +-- komrade/__init__.pyc | Bin 823 -> 0 bytes komrade/app/screens/base.pyc | Bin 1232 -> 0 bytes komrade/backend/crypt0.py | 319 ------------------ komrade/backend/operators.pyc | Bin 8388 -> 0 bytes ...lKomrade.app.zip => InstallComrad.app.zip} | Bin script/install | 62 ++-- script/install-mac | 2 +- script/micro_installer | 8 +- 134 files changed, 591 insertions(+), 908 deletions(-) rename {komrade => comrad}/.builtin.keys (100%) rename {komrade => comrad}/__init__.py (100%) rename {komrade => comrad}/app/__init__.py (100%) rename {komrade => comrad}/app/assets/Hammer_and_sickle.png (100%) rename {komrade => comrad}/app/assets/Hammer_and_sickle.xcf (100%) rename {komrade => comrad}/app/assets/PeyoteHand.png (100%) rename {komrade => comrad}/app/assets/Strengthen.ttf (100%) rename {komrade => comrad}/app/assets/avatar.jpg (100%) rename {komrade => comrad}/app/assets/avatars/Keymaker.png (100%) rename {komrade => comrad}/app/assets/avatars/Operator.png (100%) rename {komrade => comrad}/app/assets/avatars/Telephone.jpg (100%) rename {komrade => comrad}/app/assets/avatars/Telephone.png (100%) rename {komrade => comrad}/app/assets/avatars/britney.jpg (100%) rename {komrade => comrad}/app/assets/avatars/britney2.jpg (100%) rename {komrade => comrad}/app/assets/avatars/elonely.png (100%) rename {komrade => comrad}/app/assets/avatars/marxbot.png (100%) rename {komrade => comrad}/app/assets/avatars/marxxx.png (100%) rename {komrade => comrad}/app/assets/avatars/mz.jpg (100%) rename {komrade => comrad}/app/assets/avatars/zuckbot.png (100%) rename {komrade => comrad}/app/assets/bg-brightblue.png (100%) rename {komrade => comrad}/app/assets/bg-brown.png (100%) rename {komrade => comrad}/app/assets/bg-green.png (100%) rename {komrade => comrad}/app/assets/bg-greenblue.png (100%) rename {komrade => comrad}/app/assets/bg-purple.png (100%) rename {komrade => comrad}/app/assets/bg-purple2.png (100%) rename {komrade => comrad}/app/assets/bg-russiangreen.png (100%) rename {komrade => comrad}/app/assets/bg.png (100%) rename {komrade => comrad}/app/assets/clenched-fist-vector-publicdomain.eps (100%) rename {komrade => comrad}/app/assets/clenched-fist-vector-publicdomain.xcf (100%) rename {komrade => comrad}/app/assets/cover.jpg (100%) rename {komrade => comrad}/app/assets/fist.png (100%) rename {komrade => comrad}/app/assets/fist.xcf (100%) rename {komrade => comrad}/app/assets/fist2.png (100%) rename {komrade => comrad}/app/assets/fist3.png (100%) rename {komrade => comrad}/app/assets/font.otf (100%) rename {komrade => comrad}/app/assets/komrade-peek-2.gif (100%) rename {komrade => comrad}/app/assets/komrade-screen-peek.gif (100%) rename {komrade => comrad}/app/assets/komrade-screen-preview-2020-08-23.gif (100%) rename {komrade => comrad}/app/assets/komrade-screen-preview-2020-09-27.gif (100%) rename {komrade => comrad}/app/assets/komrade-terminal-preview--2020-09-16--meet.gif (100%) rename {komrade => comrad}/app/assets/komrade-terminal-preview--2020-09-16--msg.gif (100%) rename {komrade => comrad}/app/assets/komrade-terminal-preview--2020-09-16--register.gif (100%) rename {komrade => comrad}/app/assets/komrade-terminal-preview--2020-09-19--posting.gif (100%) rename {komrade => comrad}/app/assets/komrade-terminal-preview--2020-09-20--install1.gif (100%) rename {komrade => comrad}/app/assets/komrade-terminal-preview--2020-09-20--install2.gif (100%) rename {komrade => comrad}/app/assets/komrade-terminal-preview--2020-09-20--tor.gif (100%) rename {komrade => comrad}/app/assets/komrade.png (100%) rename {komrade => comrad}/app/assets/komrade2.png (100%) rename {komrade => comrad}/app/assets/komrade2.xcf (100%) rename {komrade => comrad}/app/assets/logo (copy).png (100%) rename {komrade => comrad}/app/assets/logo.png (100%) rename {komrade => comrad}/app/assets/output.png (100%) rename {komrade => comrad}/app/assets/overpass-mono-bold.otf (100%) rename {komrade => comrad}/app/assets/overpass-mono-light.otf (100%) rename {komrade => comrad}/app/assets/overpass-mono-regular.otf (100%) rename {komrade => comrad}/app/assets/overpass-mono-semibold.otf (100%) rename {komrade => comrad}/app/assets/screen-feed.png (100%) rename {komrade => comrad}/app/assets/screen-login.png (100%) rename {komrade => comrad}/app/assets/screen-post.png (100%) rename {komrade => comrad}/app/assets/spiral2.png (100%) rename {komrade => comrad}/app/assets/spiral3.png (100%) rename {komrade => comrad}/app/assets/spiral3b.png (100%) rename {komrade => comrad}/app/assets/spiral4.png (100%) rename {komrade => comrad}/app/assets/spiral4b.png (100%) rename {komrade => comrad}/app/config.py (100%) rename {komrade => comrad}/app/main.py (91%) rename {komrade => comrad}/app/misc.py (100%) rename {komrade => comrad}/app/pub (100%) rename {komrade => comrad}/app/root.kv (100%) rename {komrade => comrad}/app/run.sh (100%) rename {komrade => comrad}/app/screens/base.py (90%) rename {komrade => comrad}/app/screens/dialog.py (100%) rename {komrade => comrad}/app/screens/feed/feed.kv (100%) rename {komrade => comrad}/app/screens/feed/feed.py (99%) rename {komrade => comrad}/app/screens/login/login.kv (98%) rename {komrade => comrad}/app/screens/login/login.py (86%) rename {komrade => comrad}/app/screens/map.py (97%) rename {komrade => comrad}/app/screens/messages/messages.kv (100%) rename {komrade => comrad}/app/screens/messages/messages.py (80%) rename {komrade => comrad}/app/screens/notifications/notifications.kv (100%) rename {komrade => comrad}/app/screens/notifications/notifications.py (90%) rename {komrade => comrad}/app/screens/post/post.kv (100%) rename {komrade => comrad}/app/screens/post/post.py (98%) rename {komrade => comrad}/app/screens/profile/profile.kv (100%) rename {komrade => comrad}/app/screens/profile/profile.py (97%) rename {komrade => comrad}/app/watcher.py (98%) rename {komrade => comrad}/art.py (100%) rename {komrade => comrad}/backend/__init__.py (93%) rename {komrade => comrad}/backend/callers.py (75%) rename komrade/backend/komrades.py => comrad/backend/comrads.py (90%) rename {komrade => comrad}/backend/crypt.py (95%) rename {komrade => comrad}/backend/ether.py (100%) rename {komrade => comrad}/backend/keymaker.py (84%) rename {komrade => comrad}/backend/mazes.py (99%) rename {komrade => comrad}/backend/messages.py (96%) rename {komrade => comrad}/backend/operators.py (89%) rename {komrade => comrad}/backend/phonelines.py (86%) rename {komrade => comrad}/backend/reset.sh (100%) rename {komrade => comrad}/backend/switchboard.py (90%) rename {komrade => comrad}/backend/the_operator.py (91%) rename {komrade => comrad}/backend/the_telephone.py (89%) rename {komrade => comrad}/cli/__init__.py (100%) rename {komrade => comrad}/cli/artcode.py (100%) rename {komrade => comrad}/cli/box.txt (100%) rename {komrade => comrad}/cli/cli.py (89%) rename {komrade => comrad}/cli/cli_curses.py (95%) rename {komrade => comrad}/cli/data/basemap.csv (100%) rename {komrade => comrad}/cli/data/world-countries.json (100%) rename {komrade => comrad}/cli/tab_completer.py (100%) rename {komrade => comrad}/cli/worldmap.py (100%) rename {komrade => comrad}/cli/worldmap_curses.py (98%) rename {komrade => comrad}/constants.py (96%) rename {komrade => comrad}/utils.py (98%) delete mode 100644 komrade/__init__.pyc delete mode 100644 komrade/app/screens/base.pyc delete mode 100644 komrade/backend/crypt0.py delete mode 100644 komrade/backend/operators.pyc rename script/{InstallKomrade.app.zip => InstallComrad.app.zip} (100%) diff --git a/LICENSE b/LICENSE index bdf7b94..e62ac62 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ ANTI-CAPITALIST SOFTWARE LICENSE (v 1.4) -Copyright © 2020 Komrades +Copyright © 2020 Comrads This is anti-capitalist software, released for free use by individuals and organizations that do not operate by capitalist principles. diff --git a/README.md b/README.md index 4c69950..6d07ebe 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Komrade +# Comrad -Komrade is a socialist network. It seizes the means of digital production. +Comrad is a socialist network. It seizes the means of digital production. ## Why another social network? @@ -16,7 +16,7 @@ All of your data are strongly encrypted end-to-end: only you and those you write ### Untraceable -All network traffic is routed through Tor, a "deep web" of computers so dense even the FBI can't follow you through it. Komrade's "Operator" or central server is accessible only from Tor. It's impossible to tell who is sending what to whom, or even who is using the app at all. +All network traffic is routed through Tor, a "deep web" of computers so dense even the FBI can't follow you through it. Comrad's "Operator" or central server is accessible only from Tor. It's impossible to tell who is sending what to whom, or even who is using the app at all. ### Unmonetizable @@ -28,7 +28,7 @@ Group accounts or 'collectives', like @portland or @socialists, grow as existing ### (Semi-)decentralized -Data is deleted as soon as possible from Komrade. Komrade's "Operator" simply sorts and holds the mail temporarily: as soon as users log in to download their mail, the messages are deleted from the server and network forever. +Data is deleted as soon as possible from Comrad. Comrad's "Operator" simply sorts and holds the mail temporarily: as soon as users log in to download their mail, the messages are deleted from the server and network forever. ### Anti-profit @@ -67,19 +67,19 @@ We present a simplified set of social media features drawn from everything that' ## How is this different from ...? -See ["Comparison of alternative social networks" on the wiki](https://github.com/Komrade/Komrade/wiki/Comparison-of-alternative-social-networks) for an attempt at a systematic comparison. (And please help edit, if you can! The data there is a little incomplete and probably a little inaccurate.) But here are some imagined differences: +See ["Comparison of alternative social networks" on the wiki](https://github.com/Comrad/Comrad/wiki/Comparison-of-alternative-social-networks) for an attempt at a systematic comparison. (And please help edit, if you can! The data there is a little incomplete and probably a little inaccurate.) But here are some imagined differences: -* **It's not (fully) decentralized.** Who's afraid of a little central planning? In contrast to [Secure Scuttlebutt](https://scuttlebutt.nz/) and [Cabal Chat](https://cabal.chat/), which are 100% decentralized, subsisting only through peer-to-peer connections, Komrade sticks with the old, client/server model. Why? +* **It's not (fully) decentralized.** Who's afraid of a little central planning? In contrast to [Secure Scuttlebutt](https://scuttlebutt.nz/) and [Cabal Chat](https://cabal.chat/), which are 100% decentralized, subsisting only through peer-to-peer connections, Comrad sticks with the old, client/server model. Why? -* **It *is* anonymous.** Because P2P networks almost always expose your IP address: they privilege decentralization over anonymity -- and, potentially, safety. By contrast, lying hidden within the deep web of Tor, accessible only from this application and its built-in Tor client, Komrade will never reveal who is accessing it and its encrypted information. This is important for komrades organizing protests against the surveillance state, and to protect our social media traffic from being harvested and monetized by surveillance capitalism. +* **It *is* anonymous.** Because P2P networks almost always expose your IP address: they privilege decentralization over anonymity -- and, potentially, safety. By contrast, lying hidden within the deep web of Tor, accessible only from this application and its built-in Tor client, Comrad will never reveal who is accessing it and its encrypted information. This is important for comrads organizing protests against the surveillance state, and to protect our social media traffic from being harvested and monetized by surveillance capitalism. -* **It's 100% end-to-end encrypted.** Unlike [Mastodon](https://joinmastodon.org/) or [Diaspora](https://diasporafoundation.org/), direct messages between users and within groups remain encrypted 1:1 end-to-end among users. Posts to the public are encrypted to @komrades, a special account which automatically re-encrypts its messages back to any key-registered requester of them. +* **It's 100% end-to-end encrypted.** Unlike [Mastodon](https://joinmastodon.org/) or [Diaspora](https://diasporafoundation.org/), direct messages between users and within groups remain encrypted 1:1 end-to-end among users. Posts to the public are encrypted to @comrads, a special account which automatically re-encrypts its messages back to any key-registered requester of them. -* **It verifies identities.** Komrade's server, "The Operator", keeps a permanent record of one thing only: every komrade's name and public key, and requires that new komrades choose a unique name. Whenever you send or receive mail, the Operator will make sure that the name and public key on the letter matches what it has on file, verifying the identity of both parties. +* **It verifies identities.** Comrad's server, "The Operator", keeps a permanent record of one thing only: every comrad's name and public key, and requires that new comrads choose a unique name. Whenever you send or receive mail, the Operator will make sure that the name and public key on the letter matches what it has on file, verifying the identity of both parties. * **It's (semi-)ephemeral.** Data, like all natural things, should not last forever. Direct messages auto-delete from the server as soon as they are downloaded. Group messages are sent as direct messages through the "web of trust" of the group membership network. Posts to the world auto-delete in however many days you specify. By contrast, data on both [SSB](https://scuttlebutt.nz/) and [Matrix](https://matrix.org/) is undeletable. -* **It's easy to use.** No invitation or server is needed on startup, unlike [SSB](https://scuttlebutt.nz/), [Mastodon](https://joinmastodon.org/), [Diaspora](https://diasporafoundation.org/), or [Briar](https://briarproject.org/). It's basically a Twitter clone, but one where you can also post to a universal feed shared by the entire world (@komrades), so that you can make yourself known, participate in general discussions, find new contacts, and organize new groups. +* **It's easy to use.** No invitation or server is needed on startup, unlike [SSB](https://scuttlebutt.nz/), [Mastodon](https://joinmastodon.org/), [Diaspora](https://diasporafoundation.org/), or [Briar](https://briarproject.org/). It's basically a Twitter clone, but one where you can also post to a universal feed shared by the entire world (@comrads), so that you can make yourself known, participate in general discussions, find new contacts, and organize new groups. @@ -90,30 +90,30 @@ See ["Comparison of alternative social networks" on the wiki](https://github.com #### Registering and connecting through Tor -GIF animation +GIF animation #### Navigating posts -GIF animation +GIF animation ### Animations from terminal app #### Connecting through Tor -GIF animation of Tor connection +GIF animation of Tor connection #### "Meeting" (exchanging public keys) -GIF animation of meeting process +GIF animation of meeting process #### Messaging -GIF animation of messaging +GIF animation of messaging ### Posting -GIF animation of posting +GIF animation of posting ## Usage @@ -122,17 +122,17 @@ See ["Comparison of alternative social networks" on the wiki](https://github.com #### ...on Mac OSX -Download and run [this installer](https://github.com/Komrade/Komrade/raw/master/script/InstallKomrade.app.zip). +Download and run [this installer](https://github.com/Comrad/Comrad/raw/master/script/InstallComrad.app.zip). #### ...on Linux or Windows Open a terminal in Linux, or a [Cygwin shell](https://cygwin.com/install.html) in Windows, and copy and paste the following line into it: ``` -bash <(curl -s https://komrade.app/run) +bash <(curl -s https://comrad.app/run) ``` -[That](https://komrade.app/run)'s a shortcut to [this auto-installer script](https://github.com/Komrade/Komrade/blob/master/script/install). It installs Komrade in a virtual Python environment in the folder "komrade" in your home directory. +[That](https://comrad.app/run)'s a shortcut to [this auto-installer script](https://github.com/Comrad/Comrad/blob/master/script/install). It installs Comrad in a virtual Python environment in the folder "comrad" in your home directory. ### Run @@ -140,7 +140,7 @@ bash <(curl -s https://komrade.app/run) Install [as above](#on-mac-osx). -Run "Komrade.app" in your Applications folder. +Run "Comrad.app" in your Applications folder. #### ...on Linux or Windows @@ -148,23 +148,23 @@ Run "Komrade.app" in your Applications folder. Open a terminal in Linux, or a [Cygwin shell](https://cygwin.com/install.html) in Windows, and type: ``` -komrade-app +comrad-app ``` If that doesn't work, try: ``` -~/komrade/code/bin/komrade-app +~/comrad/code/bin/comrad-app ``` If that still doesn't work, try pasting the following lines: ``` -source ~/komrade/lib/miniconda3/etc/profile.d/conda.sh -export PATH="~/komrade/lib/miniconda3/bin:$PATH" -conda activate ~/komrade/code/venv -python -m pip install -r ~/komrade/code/requirements.txt -python ~/komrade/code/komrade/app/main.py +source ~/comrad/lib/miniconda3/etc/profile.d/conda.sh +export PATH="~/comrad/lib/miniconda3/bin:$PATH" +conda activate ~/comrad/code/venv +python -m pip install -r ~/comrad/code/requirements.txt +python ~/comrad/code/comrad/app/main.py ``` #### Running terminal client @@ -172,17 +172,17 @@ python ~/komrade/code/komrade/app/main.py For the terminal client (which may be broken at the moment), run: ``` -komrade-cli # or: ~/komrade/code/bin/komrade-cli +comrad-cli # or: ~/comrad/code/bin/comrad-cli ``` or, if necessary, paste the following lines: ``` -source ~/komrade/lib/miniconda3/etc/profile.d/conda.sh -export PATH="~/komrade/lib/miniconda3/bin:$PATH" -conda activate ~/komrade/code/venv -python -m pip install -r ~/komrade/code/requirements.txt -python ~/komrade/code/komrade/cli/cli.py +source ~/comrad/lib/miniconda3/etc/profile.d/conda.sh +export PATH="~/comrad/lib/miniconda3/bin:$PATH" +conda activate ~/comrad/code/venv +python -m pip install -r ~/comrad/code/requirements.txt +python ~/comrad/code/comrad/cli/cli.py ``` #### Running server (development only) @@ -191,17 +191,17 @@ python ~/komrade/code/komrade/cli/cli.py To run The Operator server (for development purposes only), run: ``` -komrade-op # or: ~/komrade/code/bin/komrade-op +comrad-op # or: ~/comrad/code/bin/comrad-op ``` or, if necessary, paste the following lines: ``` -source ~/komrade/lib/miniconda3/etc/profile.d/conda.sh -export PATH="~/komrade/lib/miniconda3/bin:$PATH" -conda activate ~/komrade/code/venv -python -m pip install -r ~/komrade/code/requirements.txt -python ~/komrade/code/komrade/backend/switchboard.py +source ~/comrad/lib/miniconda3/etc/profile.d/conda.sh +export PATH="~/comrad/lib/miniconda3/bin:$PATH" +conda activate ~/comrad/code/venv +python -m pip install -r ~/comrad/code/requirements.txt +python ~/comrad/code/comrad/backend/switchboard.py ``` @@ -211,17 +211,17 @@ python ~/komrade/code/komrade/backend/switchboard.py #### Mobile/desktop -The mobile/desktop app is made with [KivyMD](https://github.com/kivymd/KivyMD), a variant of [Kivy](https://kivy.org/), a cross-platform app development framework in Python. Python is an easy and versatile progamming language to learn, which keeps the code accessible to as many people as possible. Code for the app is in [komrade/app](komrade/app). +The mobile/desktop app is made with [KivyMD](https://github.com/kivymd/KivyMD), a variant of [Kivy](https://kivy.org/), a cross-platform app development framework in Python. Python is an easy and versatile progamming language to learn, which keeps the code accessible to as many people as possible. Code for the app is in [comrad/app](comrad/app). #### Terminal app -Vanilla Python. Code is in [komrade/cli](komrade/cli). +Vanilla Python. Code is in [comrad/cli](comrad/cli). ### Backend #### API -Plain old object-oriented code in Python. The root entity is a "Keymaker": anyone from @Telephone, to @Operator, to users, to groups, who has a public/private key pair. The database uses a simple file-based key-value store using the Redis protocol: [rlite](https://github.com/seppo0010/rlite), via its [rlite-py](https://github.com/seppo0010/rlite-py) Python bindings. All code for backend/API is in [komrade/backend](komrade/backend). +Plain old object-oriented code in Python. The root entity is a "Keymaker": anyone from @Telephone, to @Operator, to users, to groups, who has a public/private key pair. The database uses a simple file-based key-value store using the Redis protocol: [rlite](https://github.com/seppo0010/rlite), via its [rlite-py](https://github.com/seppo0010/rlite-py) Python bindings. All code for backend/API is in [comrad/backend](comrad/backend). #### Cryptography @@ -229,9 +229,9 @@ We are using [Themis](https://github.com/cossacklabs/themis), a high-level cross Crypto-related code is primarily in: - * [komrade/backend/keymaker.py](komrade/backend/keymaker.py) + * [comrad/backend/keymaker.py](comrad/backend/keymaker.py) - * [komrade/backend/komrades.py](komrade/backend/komrades.py) + * [comrad/backend/comrads.py](comrad/backend/comrads.py) - * [komrade/backend/phonelines.py](komrade/backend/phonelines.py) + * [comrad/backend/phonelines.py](comrad/backend/phonelines.py) diff --git a/bin/komrade-activate b/bin/komrade-activate index 8b0f861..4cb9ea4 100755 --- a/bin/komrade-activate +++ b/bin/komrade-activate @@ -1,6 +1,6 @@ -path_conda="`realpath ~/komrade/lib/miniconda3`" -path_venv="`realpath ~/komrade/code/venv`" -path_repo="`realpath ~/komrade/code`" +path_conda="`realpath ~/comrad/lib/miniconda3`" +path_venv="`realpath ~/comrad/code/venv`" +path_repo="`realpath ~/comrad/code`" source $path_conda/etc/profile.d/conda.sh export PATH="$path_conda/bin:$PATH" diff --git a/bin/komrade-apocalype b/bin/komrade-apocalype index 2dbd4ec..017070b 100755 --- a/bin/komrade-apocalype +++ b/bin/komrade-apocalype @@ -14,8 +14,8 @@ if [ ! "$y_n" = "y" ]; then else rm -r $path #echo "Reregistering..." - #komrade-cli /register + #comrad-cli /register cd $path_code - python -c "from komrade import *; create_phonelines()" - komrade-update + python -c "from comrad import *; create_phonelines()" + comrad-update fi \ No newline at end of file diff --git a/bin/komrade-app b/bin/komrade-app index 29f7dfe..9d42dea 100755 --- a/bin/komrade-app +++ b/bin/komrade-app @@ -10,12 +10,12 @@ realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" } -path_conda="`realpath ~/komrade/lib/miniconda3`" -path_venv="`realpath ~/komrade/code/venv`" -path_repo="`realpath ~/komrade/code`" +path_conda="`realpath ~/comrad/lib/miniconda3`" +path_venv="`realpath ~/comrad/code/venv`" +path_repo="`realpath ~/comrad/code`" source $path_conda/etc/profile.d/conda.sh export PATH=\"$path_conda/bin:\$PATH\" conda activate $path_venv python -m pip install -r $path_repo/requirements.txt -python $path_repo/komrade/app/main.py \ No newline at end of file +python $path_repo/comrad/app/main.py \ No newline at end of file diff --git a/bin/komrade-cli b/bin/komrade-cli index 04e1683..3e06e89 100755 --- a/bin/komrade-cli +++ b/bin/komrade-cli @@ -7,12 +7,12 @@ realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" } -path_conda="`realpath ~/komrade/lib/miniconda3`" -path_venv="`realpath ~/komrade/code/venv`" -path_repo="`realpath ~/komrade/code`" +path_conda="`realpath ~/comrad/lib/miniconda3`" +path_venv="`realpath ~/comrad/code/venv`" +path_repo="`realpath ~/comrad/code`" source $path_conda/etc/profile.d/conda.sh export PATH="$path_conda/bin:$PATH" conda activate $path_venv python -m pip install -r $path_repo/requirements.txt -python $path_repo/komrade/cli/cli.py \ No newline at end of file +python $path_repo/comrad/cli/cli.py \ No newline at end of file diff --git a/bin/komrade-op b/bin/komrade-op index dd80a91..06612db 100755 --- a/bin/komrade-op +++ b/bin/komrade-op @@ -7,13 +7,13 @@ realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" } -path_conda="`realpath ~/komrade/lib/miniconda3`" -path_venv="`realpath ~/komrade/code/venv`" -path_repo="`realpath ~/komrade/code`" +path_conda="`realpath ~/comrad/lib/miniconda3`" +path_venv="`realpath ~/comrad/code/venv`" +path_repo="`realpath ~/comrad/code`" source $path_conda/etc/profile.d/conda.sh export PATH="$path_conda/bin:$PATH" conda activate $path_venv python -m pip install -r $path_repo/requirements.txt -python $path_repo/komrade/backend/switchboard.py +python $path_repo/comrad/backend/switchboard.py diff --git a/bin/komrade-reset b/bin/komrade-reset index 8535690..a6b9455 100755 --- a/bin/komrade-reset +++ b/bin/komrade-reset @@ -13,5 +13,5 @@ if [ ! "$y_n" = "y" ]; then else rm -r $path #echo "Reregistering..." - #komrade-cli /register + #comrad-cli /register fi \ No newline at end of file diff --git a/bin/komrade-update b/bin/komrade-update index 5dd2410..1c86c0f 100755 --- a/bin/komrade-update +++ b/bin/komrade-update @@ -5,6 +5,6 @@ path=`realpath "$SCRIPTPATH/.."` cd $path git pull git add . -git commit -m 'komrade update!' +git commit -m 'comrad update!' git push cd $wd diff --git a/komrade/.builtin.keys b/comrad/.builtin.keys similarity index 100% rename from komrade/.builtin.keys rename to comrad/.builtin.keys diff --git a/komrade/__init__.py b/comrad/__init__.py similarity index 100% rename from komrade/__init__.py rename to comrad/__init__.py diff --git a/komrade/app/__init__.py b/comrad/app/__init__.py similarity index 100% rename from komrade/app/__init__.py rename to comrad/app/__init__.py diff --git a/komrade/app/assets/Hammer_and_sickle.png b/comrad/app/assets/Hammer_and_sickle.png similarity index 100% rename from komrade/app/assets/Hammer_and_sickle.png rename to comrad/app/assets/Hammer_and_sickle.png diff --git a/komrade/app/assets/Hammer_and_sickle.xcf b/comrad/app/assets/Hammer_and_sickle.xcf similarity index 100% rename from komrade/app/assets/Hammer_and_sickle.xcf rename to comrad/app/assets/Hammer_and_sickle.xcf diff --git a/komrade/app/assets/PeyoteHand.png b/comrad/app/assets/PeyoteHand.png similarity index 100% rename from komrade/app/assets/PeyoteHand.png rename to comrad/app/assets/PeyoteHand.png diff --git a/komrade/app/assets/Strengthen.ttf b/comrad/app/assets/Strengthen.ttf similarity index 100% rename from komrade/app/assets/Strengthen.ttf rename to comrad/app/assets/Strengthen.ttf diff --git a/komrade/app/assets/avatar.jpg b/comrad/app/assets/avatar.jpg similarity index 100% rename from komrade/app/assets/avatar.jpg rename to comrad/app/assets/avatar.jpg diff --git a/komrade/app/assets/avatars/Keymaker.png b/comrad/app/assets/avatars/Keymaker.png similarity index 100% rename from komrade/app/assets/avatars/Keymaker.png rename to comrad/app/assets/avatars/Keymaker.png diff --git a/komrade/app/assets/avatars/Operator.png b/comrad/app/assets/avatars/Operator.png similarity index 100% rename from komrade/app/assets/avatars/Operator.png rename to comrad/app/assets/avatars/Operator.png diff --git a/komrade/app/assets/avatars/Telephone.jpg b/comrad/app/assets/avatars/Telephone.jpg similarity index 100% rename from komrade/app/assets/avatars/Telephone.jpg rename to comrad/app/assets/avatars/Telephone.jpg diff --git a/komrade/app/assets/avatars/Telephone.png b/comrad/app/assets/avatars/Telephone.png similarity index 100% rename from komrade/app/assets/avatars/Telephone.png rename to comrad/app/assets/avatars/Telephone.png diff --git a/komrade/app/assets/avatars/britney.jpg b/comrad/app/assets/avatars/britney.jpg similarity index 100% rename from komrade/app/assets/avatars/britney.jpg rename to comrad/app/assets/avatars/britney.jpg diff --git a/komrade/app/assets/avatars/britney2.jpg b/comrad/app/assets/avatars/britney2.jpg similarity index 100% rename from komrade/app/assets/avatars/britney2.jpg rename to comrad/app/assets/avatars/britney2.jpg diff --git a/komrade/app/assets/avatars/elonely.png b/comrad/app/assets/avatars/elonely.png similarity index 100% rename from komrade/app/assets/avatars/elonely.png rename to comrad/app/assets/avatars/elonely.png diff --git a/komrade/app/assets/avatars/marxbot.png b/comrad/app/assets/avatars/marxbot.png similarity index 100% rename from komrade/app/assets/avatars/marxbot.png rename to comrad/app/assets/avatars/marxbot.png diff --git a/komrade/app/assets/avatars/marxxx.png b/comrad/app/assets/avatars/marxxx.png similarity index 100% rename from komrade/app/assets/avatars/marxxx.png rename to comrad/app/assets/avatars/marxxx.png diff --git a/komrade/app/assets/avatars/mz.jpg b/comrad/app/assets/avatars/mz.jpg similarity index 100% rename from komrade/app/assets/avatars/mz.jpg rename to comrad/app/assets/avatars/mz.jpg diff --git a/komrade/app/assets/avatars/zuckbot.png b/comrad/app/assets/avatars/zuckbot.png similarity index 100% rename from komrade/app/assets/avatars/zuckbot.png rename to comrad/app/assets/avatars/zuckbot.png diff --git a/komrade/app/assets/bg-brightblue.png b/comrad/app/assets/bg-brightblue.png similarity index 100% rename from komrade/app/assets/bg-brightblue.png rename to comrad/app/assets/bg-brightblue.png diff --git a/komrade/app/assets/bg-brown.png b/comrad/app/assets/bg-brown.png similarity index 100% rename from komrade/app/assets/bg-brown.png rename to comrad/app/assets/bg-brown.png diff --git a/komrade/app/assets/bg-green.png b/comrad/app/assets/bg-green.png similarity index 100% rename from komrade/app/assets/bg-green.png rename to comrad/app/assets/bg-green.png diff --git a/komrade/app/assets/bg-greenblue.png b/comrad/app/assets/bg-greenblue.png similarity index 100% rename from komrade/app/assets/bg-greenblue.png rename to comrad/app/assets/bg-greenblue.png diff --git a/komrade/app/assets/bg-purple.png b/comrad/app/assets/bg-purple.png similarity index 100% rename from komrade/app/assets/bg-purple.png rename to comrad/app/assets/bg-purple.png diff --git a/komrade/app/assets/bg-purple2.png b/comrad/app/assets/bg-purple2.png similarity index 100% rename from komrade/app/assets/bg-purple2.png rename to comrad/app/assets/bg-purple2.png diff --git a/komrade/app/assets/bg-russiangreen.png b/comrad/app/assets/bg-russiangreen.png similarity index 100% rename from komrade/app/assets/bg-russiangreen.png rename to comrad/app/assets/bg-russiangreen.png diff --git a/komrade/app/assets/bg.png b/comrad/app/assets/bg.png similarity index 100% rename from komrade/app/assets/bg.png rename to comrad/app/assets/bg.png diff --git a/komrade/app/assets/clenched-fist-vector-publicdomain.eps b/comrad/app/assets/clenched-fist-vector-publicdomain.eps similarity index 100% rename from komrade/app/assets/clenched-fist-vector-publicdomain.eps rename to comrad/app/assets/clenched-fist-vector-publicdomain.eps diff --git a/komrade/app/assets/clenched-fist-vector-publicdomain.xcf b/comrad/app/assets/clenched-fist-vector-publicdomain.xcf similarity index 100% rename from komrade/app/assets/clenched-fist-vector-publicdomain.xcf rename to comrad/app/assets/clenched-fist-vector-publicdomain.xcf diff --git a/komrade/app/assets/cover.jpg b/comrad/app/assets/cover.jpg similarity index 100% rename from komrade/app/assets/cover.jpg rename to comrad/app/assets/cover.jpg diff --git a/komrade/app/assets/fist.png b/comrad/app/assets/fist.png similarity index 100% rename from komrade/app/assets/fist.png rename to comrad/app/assets/fist.png diff --git a/komrade/app/assets/fist.xcf b/comrad/app/assets/fist.xcf similarity index 100% rename from komrade/app/assets/fist.xcf rename to comrad/app/assets/fist.xcf diff --git a/komrade/app/assets/fist2.png b/comrad/app/assets/fist2.png similarity index 100% rename from komrade/app/assets/fist2.png rename to comrad/app/assets/fist2.png diff --git a/komrade/app/assets/fist3.png b/comrad/app/assets/fist3.png similarity index 100% rename from komrade/app/assets/fist3.png rename to comrad/app/assets/fist3.png diff --git a/komrade/app/assets/font.otf b/comrad/app/assets/font.otf similarity index 100% rename from komrade/app/assets/font.otf rename to comrad/app/assets/font.otf diff --git a/komrade/app/assets/komrade-peek-2.gif b/comrad/app/assets/komrade-peek-2.gif similarity index 100% rename from komrade/app/assets/komrade-peek-2.gif rename to comrad/app/assets/komrade-peek-2.gif diff --git a/komrade/app/assets/komrade-screen-peek.gif b/comrad/app/assets/komrade-screen-peek.gif similarity index 100% rename from komrade/app/assets/komrade-screen-peek.gif rename to comrad/app/assets/komrade-screen-peek.gif diff --git a/komrade/app/assets/komrade-screen-preview-2020-08-23.gif b/comrad/app/assets/komrade-screen-preview-2020-08-23.gif similarity index 100% rename from komrade/app/assets/komrade-screen-preview-2020-08-23.gif rename to comrad/app/assets/komrade-screen-preview-2020-08-23.gif diff --git a/komrade/app/assets/komrade-screen-preview-2020-09-27.gif b/comrad/app/assets/komrade-screen-preview-2020-09-27.gif similarity index 100% rename from komrade/app/assets/komrade-screen-preview-2020-09-27.gif rename to comrad/app/assets/komrade-screen-preview-2020-09-27.gif diff --git a/komrade/app/assets/komrade-terminal-preview--2020-09-16--meet.gif b/comrad/app/assets/komrade-terminal-preview--2020-09-16--meet.gif similarity index 100% rename from komrade/app/assets/komrade-terminal-preview--2020-09-16--meet.gif rename to comrad/app/assets/komrade-terminal-preview--2020-09-16--meet.gif diff --git a/komrade/app/assets/komrade-terminal-preview--2020-09-16--msg.gif b/comrad/app/assets/komrade-terminal-preview--2020-09-16--msg.gif similarity index 100% rename from komrade/app/assets/komrade-terminal-preview--2020-09-16--msg.gif rename to comrad/app/assets/komrade-terminal-preview--2020-09-16--msg.gif diff --git a/komrade/app/assets/komrade-terminal-preview--2020-09-16--register.gif b/comrad/app/assets/komrade-terminal-preview--2020-09-16--register.gif similarity index 100% rename from komrade/app/assets/komrade-terminal-preview--2020-09-16--register.gif rename to comrad/app/assets/komrade-terminal-preview--2020-09-16--register.gif diff --git a/komrade/app/assets/komrade-terminal-preview--2020-09-19--posting.gif b/comrad/app/assets/komrade-terminal-preview--2020-09-19--posting.gif similarity index 100% rename from komrade/app/assets/komrade-terminal-preview--2020-09-19--posting.gif rename to comrad/app/assets/komrade-terminal-preview--2020-09-19--posting.gif diff --git a/komrade/app/assets/komrade-terminal-preview--2020-09-20--install1.gif b/comrad/app/assets/komrade-terminal-preview--2020-09-20--install1.gif similarity index 100% rename from komrade/app/assets/komrade-terminal-preview--2020-09-20--install1.gif rename to comrad/app/assets/komrade-terminal-preview--2020-09-20--install1.gif diff --git a/komrade/app/assets/komrade-terminal-preview--2020-09-20--install2.gif b/comrad/app/assets/komrade-terminal-preview--2020-09-20--install2.gif similarity index 100% rename from komrade/app/assets/komrade-terminal-preview--2020-09-20--install2.gif rename to comrad/app/assets/komrade-terminal-preview--2020-09-20--install2.gif diff --git a/komrade/app/assets/komrade-terminal-preview--2020-09-20--tor.gif b/comrad/app/assets/komrade-terminal-preview--2020-09-20--tor.gif similarity index 100% rename from komrade/app/assets/komrade-terminal-preview--2020-09-20--tor.gif rename to comrad/app/assets/komrade-terminal-preview--2020-09-20--tor.gif diff --git a/komrade/app/assets/komrade.png b/comrad/app/assets/komrade.png similarity index 100% rename from komrade/app/assets/komrade.png rename to comrad/app/assets/komrade.png diff --git a/komrade/app/assets/komrade2.png b/comrad/app/assets/komrade2.png similarity index 100% rename from komrade/app/assets/komrade2.png rename to comrad/app/assets/komrade2.png diff --git a/komrade/app/assets/komrade2.xcf b/comrad/app/assets/komrade2.xcf similarity index 100% rename from komrade/app/assets/komrade2.xcf rename to comrad/app/assets/komrade2.xcf diff --git a/komrade/app/assets/logo (copy).png b/comrad/app/assets/logo (copy).png similarity index 100% rename from komrade/app/assets/logo (copy).png rename to comrad/app/assets/logo (copy).png diff --git a/komrade/app/assets/logo.png b/comrad/app/assets/logo.png similarity index 100% rename from komrade/app/assets/logo.png rename to comrad/app/assets/logo.png diff --git a/komrade/app/assets/output.png b/comrad/app/assets/output.png similarity index 100% rename from komrade/app/assets/output.png rename to comrad/app/assets/output.png diff --git a/komrade/app/assets/overpass-mono-bold.otf b/comrad/app/assets/overpass-mono-bold.otf similarity index 100% rename from komrade/app/assets/overpass-mono-bold.otf rename to comrad/app/assets/overpass-mono-bold.otf diff --git a/komrade/app/assets/overpass-mono-light.otf b/comrad/app/assets/overpass-mono-light.otf similarity index 100% rename from komrade/app/assets/overpass-mono-light.otf rename to comrad/app/assets/overpass-mono-light.otf diff --git a/komrade/app/assets/overpass-mono-regular.otf b/comrad/app/assets/overpass-mono-regular.otf similarity index 100% rename from komrade/app/assets/overpass-mono-regular.otf rename to comrad/app/assets/overpass-mono-regular.otf diff --git a/komrade/app/assets/overpass-mono-semibold.otf b/comrad/app/assets/overpass-mono-semibold.otf similarity index 100% rename from komrade/app/assets/overpass-mono-semibold.otf rename to comrad/app/assets/overpass-mono-semibold.otf diff --git a/komrade/app/assets/screen-feed.png b/comrad/app/assets/screen-feed.png similarity index 100% rename from komrade/app/assets/screen-feed.png rename to comrad/app/assets/screen-feed.png diff --git a/komrade/app/assets/screen-login.png b/comrad/app/assets/screen-login.png similarity index 100% rename from komrade/app/assets/screen-login.png rename to comrad/app/assets/screen-login.png diff --git a/komrade/app/assets/screen-post.png b/comrad/app/assets/screen-post.png similarity index 100% rename from komrade/app/assets/screen-post.png rename to comrad/app/assets/screen-post.png diff --git a/komrade/app/assets/spiral2.png b/comrad/app/assets/spiral2.png similarity index 100% rename from komrade/app/assets/spiral2.png rename to comrad/app/assets/spiral2.png diff --git a/komrade/app/assets/spiral3.png b/comrad/app/assets/spiral3.png similarity index 100% rename from komrade/app/assets/spiral3.png rename to comrad/app/assets/spiral3.png diff --git a/komrade/app/assets/spiral3b.png b/comrad/app/assets/spiral3b.png similarity index 100% rename from komrade/app/assets/spiral3b.png rename to comrad/app/assets/spiral3b.png diff --git a/komrade/app/assets/spiral4.png b/comrad/app/assets/spiral4.png similarity index 100% rename from komrade/app/assets/spiral4.png rename to comrad/app/assets/spiral4.png diff --git a/komrade/app/assets/spiral4b.png b/comrad/app/assets/spiral4b.png similarity index 100% rename from komrade/app/assets/spiral4b.png rename to comrad/app/assets/spiral4b.png diff --git a/komrade/app/config.py b/comrad/app/config.py similarity index 100% rename from komrade/app/config.py rename to comrad/app/config.py diff --git a/komrade/app/main.py b/comrad/app/main.py similarity index 91% rename from komrade/app/main.py rename to comrad/app/main.py index ed3c121..707fc1c 100644 --- a/komrade/app/main.py +++ b/comrad/app/main.py @@ -3,7 +3,7 @@ #(needs to be external to allow tor routing) from config import * import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * +from comrad import * import logging logger=logging.getLogger(__name__) @@ -60,6 +60,7 @@ sys.path.append("..") # Adds higher directory to python modules path. from kivy.event import * import threading,asyncio,sys +from requests.exceptions import ReadTimeout # raise Exception(str(Window.size)) Window.size = WINDOW_SIZE @@ -100,19 +101,19 @@ class MyLayout(MDBoxLayout): def refresh(self,*x,**yy): async def go(): - if not hasattr(self.app,'is_logged_in') or not self.app.is_logged_in or not hasattr(self.app,'komrade') or not self.app.komrade: + if not hasattr(self.app,'is_logged_in') or not self.app.is_logged_in or not hasattr(self.app,'comrad') or not self.app.comrad: self.change_screen('login') self.app.log('changing screen???') return None - logger.info(f'REFRESH: {self.app.is_logged_in}, {self.app.komrade.name}') + logger.info(f'REFRESH: {self.app.is_logged_in}, {self.app.comrad.name}') self.app.log('<--',x,yy) if not hasattr(self.app,'map') or not self.app.map: - from komrade.app.screens.map import MapWidget + from comrad.app.screens.map import MapWidget self.app.map=MapWidget() self.app.map.open() - await self.app.komrade.get_updates() + await self.app.comrad.get_updates() self.app.map.dismiss() self.app.map=None asyncio.create_task(go()) @@ -120,7 +121,7 @@ class MyLayout(MDBoxLayout): -from komrade.app.screens.dialog import MDDialog2 +from comrad.app.screens.dialog import MDDialog2 @@ -172,11 +173,11 @@ class TextInputPopupCard(MDDialog2): return self.response - def __init__(self,msg,password=False,input_name='',komrade_name='',*x,**y): + def __init__(self,msg,password=False,input_name='',comrad_name='',*x,**y): self.ok_to_continue=False self.response=None title=msg - from komrade.app.screens.login.login import UsernameField,PasswordField,UsernameLayout,UsernameLabel + from comrad.app.screens.login.login import UsernameField,PasswordField,UsernameLayout,UsernameLabel self.layout=MDBoxLayout() self.layout.orientation='vertical' @@ -407,7 +408,7 @@ def route(uri): # DEFAULT_SCREEN = route(DEFAULT_URI) class MainApp(MDApp, Logger): - title = 'Komrade' + title = 'Comrad' logged_in=False login_expiry = 60 * 60 * 24 * 7 # once a week texture = ObjectProperty() @@ -424,7 +425,7 @@ class MainApp(MDApp, Logger): @property def crypt(self): if not hasattr(self,'_crypt'): - from komrade.backend.crypt import Crypt + from comrad.backend.crypt import Crypt self._crypt = Crypt( fn=PATH_CRYPT_CA_DATA, encrypt_values=False, @@ -437,7 +438,7 @@ class MainApp(MDApp, Logger): self.loop=asyncio.get_event_loop() # connect to API - self.komrade=None + self.comrad=None self._name='' @@ -471,13 +472,13 @@ class MainApp(MDApp, Logger): ipinfo_access_token = '90df1baf7c373a' self.ipinfo_handler = ipinfo.getHandler(ipinfo_access_token) - from komrade.app.screens.map import MapWidget + from comrad.app.screens.map import MapWidget self.map = MapWidget() return self.root # def boot(self,username): - # kommie = Komrade(username) + # kommie = Comrad(username) # if self.exists_locally_as_contact() @property @@ -490,21 +491,25 @@ class MainApp(MDApp, Logger): async def callback_on_hop(self,rtr): if not hasattr(self,'hops'): self.hops=[] if not hasattr(self,'map') or not self.map: - from komrade.app.screens.map import MapWidget + from comrad.app.screens.map import MapWidget self.map=MapWidget() if not self.map.opened: self.map.open() # self.map.draw() - deets = self.ipinfo_handler.getDetails(rtr.ip) - self.hops.append((rtr,deets)) - lat,long=tuple(float(_) for _ in deets.loc.split(',')) - flag=f'{deets.city}, {deets.country_name} ({rtr.nickname})' - - self.map.add_point(lat,long,flag) - self.map.draw() - # await asyncio.sleep(2) - # logger.info('CALLBACK ON HOP: ' + flag) + try: + deets = self.ipinfo_handler.getDetails(rtr.ip) + self.hops.append((rtr,deets)) + lat,long=tuple(float(_) for _ in deets.loc.split(',')) + flag=f'{deets.city}, {deets.country_name} ({rtr.nickname})' + + self.map.add_point(lat,long,flag) + self.map.draw() + # await asyncio.sleep(2) + # logger.info('CALLBACK ON HOP: ' + flag) + except ReadTimeout as e: + self.log('!! read time out:',e) + return def load_store(self): if not self.store.exists('user'): return @@ -605,15 +610,15 @@ class MainApp(MDApp, Logger): @property def keys(self): - contacts_obj = self.komrade.contacts() + contacts_obj = self.comrad.contacts() contacts = [p.name for p in contacts_obj] return contacts async def get_post(self,post_id): - return self.komrade.read_post() + return self.comrad.read_post() def get_posts(self,uri=b'/inbox/world'): - return self.komrade.posts() + return self.comrad.posts() async def get_channel_posts(self,channel,prefix='inbox'): @@ -630,7 +635,7 @@ class MainApp(MDApp, Logger): return await self.get_channel_posts(channel=channel,prefix='outbox') async def get_my_posts(self): - return await self.komrade.posts() + return await self.comrad.posts() @@ -663,17 +668,17 @@ class MainApp(MDApp, Logger): self.dialog.open() #stop - async def get_input(self,msg,komrade_name='Telephone',get_pass=False,yesno=False,**y): - from komrade.app.screens.feed.feed import PostCardInputPopup + async def get_input(self,msg,comrad_name='Telephone',get_pass=False,yesno=False,**y): + from comrad.app.screens.feed.feed import PostCardInputPopup if hasattr(self,'msg_dialog') and self.msg_dialog:# and hasattr(self.msg_dialog,'card') and self.msg_dialog.card: self.msg_dialog0=self.msg_dialog self.msg_dialog0.dismiss() self.msg_dialog0=None if yesno: - self.msg_dialog = BooleanInputPopupCard(msg,komrade_name=komrade_name,**y) + self.msg_dialog = BooleanInputPopupCard(msg,comrad_name=comrad_name,**y) else: - self.msg_dialog = TextInputPopupCard(msg,password=get_pass,komrade_name=komrade_name,**y) + self.msg_dialog = TextInputPopupCard(msg,password=get_pass,comrad_name=comrad_name,**y) response = await self.msg_dialog.open() logger.info(f'get_input got user response {response}') @@ -684,8 +689,8 @@ class MainApp(MDApp, Logger): return response async def ring_ring(self,*x,kommie=None,**y): - if not kommie: kommie=self.komrade - from komrade.app.screens.map import MapWidget + if not kommie: kommie=self.comrad + from comrad.app.screens.map import MapWidget self.map=MapWidget() self.map.open() resp_msg_d = await kommie.ring_ring(*x,**y) @@ -696,8 +701,8 @@ class MainApp(MDApp, Logger): async def get_updates(self,*x,kommie=None,**y): - if not kommie: kommie=self.komrade - from komrade.app.screens.map import MapWidget + if not kommie: kommie=self.comrad + from comrad.app.screens.map import MapWidget self.map=MapWidget() self.map.open() await kommie.get_updates(*x,**y) @@ -707,8 +712,8 @@ class MainApp(MDApp, Logger): - async def stat(self,msg,komrade_name='Telephone',pause=False,get_pass=False,**y): - from komrade.app.screens.feed.feed import PostCard,PostCardPopup + async def stat(self,msg,comrad_name='Telephone',pause=False,get_pass=False,**y): + from comrad.app.screens.feed.feed import PostCard,PostCardPopup if hasattr(self,'msg_dialog') and self.msg_dialog:# and hasattr(self.msg_dialog,'card') and self.msg_dialog.card: self.msg_dialog0=self.msg_dialog self.msg_dialog0.dismiss() @@ -720,7 +725,7 @@ class MainApp(MDApp, Logger): # self.msg_dialog.ids.msg_label.text=msg self.msg_dialog.card = postcard = PostCardPopup({ - 'author':komrade_name, + 'author':comrad_name, 'author_prefix':'@', 'to_name':'me', 'content':msg, diff --git a/komrade/app/misc.py b/comrad/app/misc.py similarity index 100% rename from komrade/app/misc.py rename to comrad/app/misc.py diff --git a/komrade/app/pub b/comrad/app/pub similarity index 100% rename from komrade/app/pub rename to comrad/app/pub diff --git a/komrade/app/root.kv b/comrad/app/root.kv similarity index 100% rename from komrade/app/root.kv rename to comrad/app/root.kv diff --git a/komrade/app/run.sh b/comrad/app/run.sh similarity index 100% rename from komrade/app/run.sh rename to comrad/app/run.sh diff --git a/komrade/app/screens/base.py b/comrad/app/screens/base.py similarity index 90% rename from komrade/app/screens/base.py rename to comrad/app/screens/base.py index 900899a..816d557 100644 --- a/komrade/app/screens/base.py +++ b/comrad/app/screens/base.py @@ -5,7 +5,7 @@ from kivymd.uix.label import MDLabel from kivy.app import App import asyncio from kivymd.uix.dialog import MDDialog -from komrade.app.screens.dialog import MDDialog2 +from comrad.app.screens.dialog import MDDialog2 ### Layout @@ -49,7 +49,7 @@ class BaseScreen(MDScreen): class ProtectedScreen(BaseScreen): def on_pre_enter(self): super().on_pre_enter() - if not hasattr(self.app,'is_logged_in') or not self.app.is_logged_in or not hasattr(self.app,'komrade') or not self.app.komrade: + if not hasattr(self.app,'is_logged_in') or not self.app.is_logged_in or not hasattr(self.app,'comrad') or not self.app.comrad: self.root.change_screen('login') self.log('changing screen???') return None diff --git a/komrade/app/screens/dialog.py b/comrad/app/screens/dialog.py similarity index 100% rename from komrade/app/screens/dialog.py rename to comrad/app/screens/dialog.py diff --git a/komrade/app/screens/feed/feed.kv b/comrad/app/screens/feed/feed.kv similarity index 100% rename from komrade/app/screens/feed/feed.kv rename to comrad/app/screens/feed/feed.kv diff --git a/komrade/app/screens/feed/feed.py b/comrad/app/screens/feed/feed.py similarity index 99% rename from komrade/app/screens/feed/feed.py rename to comrad/app/screens/feed/feed.py index 36313d3..071076a 100644 --- a/komrade/app/screens/feed/feed.py +++ b/comrad/app/screens/feed/feed.py @@ -1,5 +1,5 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * +from comrad import * from kivymd.uix.label import MDLabel @@ -284,7 +284,7 @@ class FeedScreen(ProtectedScreen): if self.app.map: self.app.map.dismiss() self.root.remove_widget(self.app.map) - if not hasattr(self,'get_posts'): self.get_posts=self.app.komrade.posts + if not hasattr(self,'get_posts'): self.get_posts=self.app.comrad.posts for post in self.posts: self.ids.post_carousel.remove_widget(post) diff --git a/komrade/app/screens/login/login.kv b/comrad/app/screens/login/login.kv similarity index 98% rename from komrade/app/screens/login/login.kv rename to comrad/app/screens/login/login.kv index 098be30..fb4f0e3 100644 --- a/komrade/app/screens/login/login.kv +++ b/comrad/app/screens/login/login.kv @@ -44,7 +44,7 @@ # md_bg_color:1,1,0,1 : - # text: 'Enter, Komrade' + # text: 'Enter, Comrad' halign: 'center' size_hint_x: 1 theme_text_color: 'Custom' diff --git a/komrade/app/screens/login/login.py b/comrad/app/screens/login/login.py similarity index 86% rename from komrade/app/screens/login/login.py rename to comrad/app/screens/login/login.py index 7bda27a..e4ba87a 100644 --- a/komrade/app/screens/login/login.py +++ b/comrad/app/screens/login/login.py @@ -1,5 +1,5 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * +from comrad import * from screens.base import * from kivymd.uix.boxlayout import * from kivymd.uix.textfield import * @@ -69,7 +69,7 @@ class LoginScreen(BaseScreen): self.layout_username = UsernameLayout() - self.label_username = UsernameLabel(text="Komrade @") + self.label_username = UsernameLabel(text="Comrad @") self.username_field = UsernameField() self.username_field.line_color_focus=rgb(*COLOR_TEXT) @@ -163,7 +163,7 @@ class LoginScreen(BaseScreen): return self.password_field.text if not passphrase else passphrase async def boot(self,un,pw=None): - # await self.stat('hello',img_src='/home/ryan/komrade/data/contacts/marxxx.png',komrade_name='Keymaker') + # await self.stat('hello',img_src='/home/ryan/comrad/data/contacts/marxxx.png',comrad_name='Keymaker') # await self.app.get_input('hello?',get_pass=True,title='gimme your passwrdd') # await self.app.get_input('hello?',get_pass=False,title='gimme your fav color bitch') @@ -191,10 +191,10 @@ class LoginScreen(BaseScreen): # return name=un - from komrade.backend import Komrade + from comrad.backend import Comrad - kommie = Komrade(un) + kommie = Comrad(un) self.log('KOMMIE!?!?',kommie) self.log('wtf',PATH_CRYPT_CA_KEYS) @@ -208,10 +208,10 @@ class LoginScreen(BaseScreen): # self.login_status.text='You should be able to log into this account.' if kommie.privkey: logger.info(f'passkey login succeeded') - self.login_status.text=f'Welcome back, Komrade @{un}' + self.login_status.text=f'Welcome back, Comrad @{un}' self.app.is_logged_in=True self.app.username=kommie.name - self.app.komrade=kommie + self.app.comrad=kommie self.root.change_screen('feed') else: logger.info(f'passkey login failed') @@ -221,12 +221,12 @@ class LoginScreen(BaseScreen): # self.layout.add_widget(self.layout_password) elif kommie.exists_locally_as_contact(): await self.app.stat('This is a contact of yours') - self.login_status.text='Komrade exists as a contact of yours.' + self.login_status.text='Comrad exists as a contact of yours.' # self.app.change_screen('feed') self.app.change_screen('login') else: # await self.app.stat('Account does not exist on hardware, maybe not on server. Try to register?') - # self.login_status.text='Komrade not known on this device. Registering...' + # self.login_status.text='Comrad not known on this device. Registering...' ### REGISTER self.remove_widget(self.layout) @@ -236,7 +236,7 @@ class LoginScreen(BaseScreen): self.login_status.text='Registered' self.app.is_logged_in=True self.app.username=kommie.name - self.app.komrade=kommie + self.app.comrad=kommie self.remove_widget(self.layout) self.app.change_screen('feed') else: @@ -247,10 +247,10 @@ class LoginScreen(BaseScreen): async def register(self,name): async def logfunc(*x,**y): - if not 'komrade_name' in y: y['komrade_name']='Keymaker' + if not 'comrad_name' in y: y['comrad_name']='Keymaker' await self.app.stat(*x,**y) - kommie = Komrade(name) + kommie = Comrad(name) # already have it? if kommie.exists_locally_as_account(): @@ -259,31 +259,31 @@ class LoginScreen(BaseScreen): return {'success':False, 'status':'This is already a contact of yours'} # - await logfunc(f'Hello, this is Komrade @{name}. I would like to join the socialist network.',pause=True,komrade_name=name) + await logfunc(f'Hello, this is Comrad @{name}. I would like to join the socialist network.',pause=True,comrad_name=name) - await logfunc(f'Welcome, Komrade @{name}. To help us communicate safely, I have cut for you a matching pair of encryption keys.',pause=True,clear=True,komrade_name='Keymaker') + await logfunc(f'Welcome, Comrad @{name}. To help us communicate safely, I have cut for you a matching pair of encryption keys.',pause=True,clear=True,comrad_name='Keymaker') # ## 2) Make pub public/private keys - from komrade.backend.keymaker import KomradeAsymmetricKey - from komrade.cli.artcode import ART_KEY_PAIR - keypair = KomradeAsymmetricKey() + from comrad.backend.keymaker import ComradAsymmetricKey + from comrad.cli.artcode import ART_KEY_PAIR + keypair = ComradAsymmetricKey() logger.info('cut keypair!') pubkey,privkey = keypair.pubkey_obj,keypair.privkey_obj uri_id = pubkey.data_b64 uri_s = pubkey.data_b64_s fnfn = kommie.save_uri_as_qrcode(uri_id=uri_id,name=name) - # await logfunc(f'Here. I have cut for you a private and public asymmetric key pair, using the iron-clad Elliptic curve algorithm:',komrade_name='Keymaker') + # await logfunc(f'Here. I have cut for you a private and public asymmetric key pair, using the iron-clad Elliptic curve algorithm:',comrad_name='Keymaker') - await logfunc(f'The first is your "public key", which you can share with anyone. With it, someone can write you an encrypted message.',komrade_name='Keymaker') + await logfunc(f'The first is your "public key", which you can share with anyone. With it, someone can write you an encrypted message.',comrad_name='Keymaker') # delete qr! os.remove(fnfn) - # await logfunc(f'(1) {pubkey} -- and -- (2) {privkey}',clear=True,pause=True,komrade_name='Keymaker') + # await logfunc(f'(1) {pubkey} -- and -- (2) {privkey}',clear=True,pause=True,comrad_name='Keymaker') # await logfunc(f'(1) You may store your public key both on your device hardware, as well as share it with anyone you wish: {pubkey.data_b64_s}') #\n\nIt will also be stored as a QR code on your device:\n{qr_str}',pause=True,clear=True) @@ -292,7 +292,7 @@ class LoginScreen(BaseScreen): kommie._keychain['pubkey']=pubkey kommie._keychain['privkey']=privkey - from komrade.utils import dict_format + from comrad.utils import dict_format self.log('My keychain now looks like:' + dict_format(kommie.keychain())) # return @@ -313,22 +313,22 @@ class LoginScreen(BaseScreen): passhash = hasher(passphrase) - privkey_decr = KomradeSymmetricKeyWithPassphrase(passhash=passhash) + privkey_decr = ComradSymmetricKeyWithPassphrase(passhash=passhash) print() # await logfunc(f'''We immediately whatever you typed through a 1-way hashing algorithm (SHA-256), scrambling it into (redacted):\n{make_key_discreet_str(passhash)}''',pause=True,clear=False) privkey_encr = privkey_decr.encrypt(privkey.data) - privkey_encr_obj = KomradeEncryptedAsymmetricPrivateKey(privkey_encr) + privkey_encr_obj = ComradEncryptedAsymmetricPrivateKey(privkey_encr) kommie._keychain['privkey_encr']=privkey_encr_obj self.log('My keychain now looks like v2:',dict_format(kommie.keychain())) # await logfunc(f'With this scrambled password we can encrypt your super-sensitive private key, from this:\n{privkey.discreet}to this:\n{privkey_encr_obj.discreet}',pause=True,clear=False) # ### PUBLIC KEY - await logfunc('You must now register your username and public key with Komrade @Operator on the remote server.',pause=False,clear=False) + await logfunc('You must now register your username and public key with Comrad @Operator on the remote server.',pause=False,clear=False) - await logfunc('Connecting you to the @Operator...',komrade_name='Telephone') + await logfunc('Connecting you to the @Operator...',comrad_name='Telephone') ## CALL OP WITH PUBKEY # self.app.open_dialog('Calling @Operator...') @@ -346,10 +346,10 @@ class LoginScreen(BaseScreen): # print() - await logfunc(resp_msg_d.get('status'),komrade_name='Operator',pause=True) + await logfunc(resp_msg_d.get('status'),comrad_name='Operator',pause=True) if not resp_msg_d.get('success'): - self.app.komrade=None + self.app.comrad=None self.app.is_logged_in=False self.app.username='' @@ -360,7 +360,7 @@ class LoginScreen(BaseScreen): return # clear_screen() - await logfunc('Great. Komrade @Operator now has your name and public key on file (and nothing else!).',pause=True,clear=True) + await logfunc('Great. Comrad @Operator now has your name and public key on file (and nothing else!).',pause=True,clear=True) @@ -383,16 +383,16 @@ class LoginScreen(BaseScreen): # store privkey pieces kommie.crypt_keys.set(uri_id, privkey_encr_obj.data, prefix='/privkey_encr/') # just to show we used a passphrase --> - kommie.crypt_keys.set(uri_id, KomradeSymmetricKeyWithPassphrase.__name__, prefix='/privkey_decr/') + kommie.crypt_keys.set(uri_id, ComradSymmetricKeyWithPassphrase.__name__, prefix='/privkey_decr/') # save qr too: _fnfn=kommie.save_uri_as_qrcode(uri_id) # await logfunc(f'Saving public key, encrypted private key, and login secret to hardware-only database. Also saving public key as QR code to: {_fnfn}.',pause=True,clear=False,use_prefix=False) - await logfunc(f'You can share it by pasting it to someone in a secure message:\n{uri_s}',komrade_name='Keymaker') + await logfunc(f'You can share it by pasting it to someone in a secure message:\n{uri_s}',comrad_name='Keymaker') - await logfunc(f'You can also share it IRL, phone to phone, as a QR code. It is saved to {fnfn} and looks like this.',img_src=fnfn,komrade_name='Keymaker') + await logfunc(f'You can also share it IRL, phone to phone, as a QR code. It is saved to {fnfn} and looks like this.',img_src=fnfn,comrad_name='Keymaker') await logfunc(f"(2) Your PRIVATE encryption key, on the other hand, will be stored encrypted on your device hardware. Do not it this with anyone or across any network whatsoever.") @@ -412,7 +412,7 @@ class LoginScreen(BaseScreen): # await logfunc('Returning...') - from komrade.app.screens.map import MapWidget + from comrad.app.screens.map import MapWidget if self.app.map: self.app.map.dismiss() self.app.map=None diff --git a/komrade/app/screens/map.py b/comrad/app/screens/map.py similarity index 97% rename from komrade/app/screens/map.py rename to comrad/app/screens/map.py index c45dfcd..c145b8b 100644 --- a/komrade/app/screens/map.py +++ b/comrad/app/screens/map.py @@ -1,5 +1,5 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..','..'))) -from komrade.app.screens.dialog import MDDialog2 +from comrad.app.screens.dialog import MDDialog2 import cartopy import cartopy.crs as ccrs import matplotlib.pyplot as plt @@ -8,8 +8,8 @@ from kivymd.uix.gridlayout import MDGridLayout from kivymd.uix.button import MDFlatButton from kivymd.uix.label import MDLabel print('\n'.join(sys.path)) -from komrade.constants import * -# from komrade.app.main import rgb +from comrad.constants import * +# from comrad.app.main import rgb import io from kivy.core.image import Image as CoreImage from kivy.uix.image import Image,AsyncImage @@ -139,7 +139,7 @@ class MapWidget(MDDialog2): # buf = io.BytesIO() # plt.ion() - from komrade.constants import PATH_MAPS + from comrad.constants import PATH_MAPS odir=PATH_MAPS if not os.path.exists(odir): os.makedirs(odir) ofn=os.path.join(odir,f't_{len(self.points)}.png') @@ -189,7 +189,7 @@ class MapWidget(MDDialog2): # transform=self.projection # ) import random - from komrade.constants import ALL_COLORS + from comrad.constants import ALL_COLORS color = random.choice(ALL_COLORS) self.points+=[(lat,long,desc)] @@ -206,6 +206,7 @@ class MapWidget(MDDialog2): # line if self.last_lat and self.last_long: + self.ax.lines = [] plt.plot( [self.last_long, long], [self.last_lat, lat], diff --git a/komrade/app/screens/messages/messages.kv b/comrad/app/screens/messages/messages.kv similarity index 100% rename from komrade/app/screens/messages/messages.kv rename to comrad/app/screens/messages/messages.kv diff --git a/komrade/app/screens/messages/messages.py b/comrad/app/screens/messages/messages.py similarity index 80% rename from komrade/app/screens/messages/messages.py rename to comrad/app/screens/messages/messages.py index 4d82be4..0b47c09 100644 --- a/komrade/app/screens/messages/messages.py +++ b/comrad/app/screens/messages/messages.py @@ -6,5 +6,5 @@ class MessagesScreen(FeedScreen): def on_pre_enter(self): if not super().on_pre_enter(): return - self.get_posts = self.app.komrade.messages + self.get_posts = self.app.comrad.messages diff --git a/komrade/app/screens/notifications/notifications.kv b/comrad/app/screens/notifications/notifications.kv similarity index 100% rename from komrade/app/screens/notifications/notifications.kv rename to comrad/app/screens/notifications/notifications.kv diff --git a/komrade/app/screens/notifications/notifications.py b/comrad/app/screens/notifications/notifications.py similarity index 90% rename from komrade/app/screens/notifications/notifications.py rename to comrad/app/screens/notifications/notifications.py index 03e7d03..7c2b6d3 100644 --- a/komrade/app/screens/notifications/notifications.py +++ b/comrad/app/screens/notifications/notifications.py @@ -1,6 +1,6 @@ from screens.base import ProtectedScreen import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * +from comrad import * class NotificationsScreen(ProtectedScreen): pass diff --git a/komrade/app/screens/post/post.kv b/comrad/app/screens/post/post.kv similarity index 100% rename from komrade/app/screens/post/post.kv rename to comrad/app/screens/post/post.kv diff --git a/komrade/app/screens/post/post.py b/comrad/app/screens/post/post.py similarity index 98% rename from komrade/app/screens/post/post.py rename to comrad/app/screens/post/post.py index 91e9e56..fb3ef93 100644 --- a/komrade/app/screens/post/post.py +++ b/comrad/app/screens/post/post.py @@ -1,5 +1,5 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * +from comrad import * from screens.base import ProtectedScreen,BaseScreen @@ -164,7 +164,7 @@ class PostScreen(ProtectedScreen): # self.post_card.author_section_layout.add_widget(self.tmp_msg,1) self.post_card.author_section_layout.add_widget(self.to_whom_btn,1) - from komrade.constants import WORLD_NAME + from comrad.constants import WORLD_NAME self.to_whom_btn.ids.txt_input.text = '@'+WORLD_NAME #self.to_whom_btn.adaptive_height = True self.to_whom_btn.ids.txt_input.word_list = ['@'+k for k in self.app.keys if k != self.app.username] @@ -325,7 +325,7 @@ class PostScreen(ProtectedScreen): file_ext = self.img_ext if hasattr(self,'img_ext') else None #await self.app.post(content=content, channel = channel, file_id=file_id, file_ext=file_ext) # post? - await self.app.komrade.post(content) + await self.app.comrad.post_async(content) import time self.close_dialog() if hasattr(self.app,'map') and self.app.map: diff --git a/komrade/app/screens/profile/profile.kv b/comrad/app/screens/profile/profile.kv similarity index 100% rename from komrade/app/screens/profile/profile.kv rename to comrad/app/screens/profile/profile.kv diff --git a/komrade/app/screens/profile/profile.py b/comrad/app/screens/profile/profile.py similarity index 97% rename from komrade/app/screens/profile/profile.py rename to comrad/app/screens/profile/profile.py index ff45ca4..e7ec48c 100644 --- a/komrade/app/screens/profile/profile.py +++ b/comrad/app/screens/profile/profile.py @@ -1,5 +1,5 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * +from comrad import * from screens.base import BaseScreen from kivymd.uix.boxlayout import MDBoxLayout @@ -243,7 +243,7 @@ class ProfileScreen(ProtectedScreen): ## author info self.author_info_layout = AuthorInfoLayout() #self.app.name_irl = 'Marx Zuckerberg' - self.app.name_irl = 'Komrade @'+self.app.username + self.app.name_irl = 'Comrad @'+self.app.username if hasattr(self.app,'name_irl'): self.author_name_irl = AuthorName(text=self.app.name_irl) @@ -276,7 +276,7 @@ class ProfileScreen(ProtectedScreen): ## Followers self.follower_layout = FollowerLayout() # self.author_followers = AuthorFollowers(label='13 followers',icon='account-arrow-left') - self.author_following = AuthorFollowing(label='13 komrades',icon='account-multiple') + self.author_following = AuthorFollowing(label='13 comrads',icon='account-multiple') ## add to layout diff --git a/komrade/app/watcher.py b/comrad/app/watcher.py similarity index 98% rename from komrade/app/watcher.py rename to comrad/app/watcher.py index c59b5fc..9b3dd29 100644 --- a/komrade/app/watcher.py +++ b/comrad/app/watcher.py @@ -13,7 +13,7 @@ def run_command(): p = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) class Watcher: - DIRECTORY_TO_WATCH = '.' #os.path.join(os.path.expanduser('~'),"/github/Komrade/") + DIRECTORY_TO_WATCH = '.' #os.path.join(os.path.expanduser('~'),"/github/Comrad/") def __init__(self): self.observer = Observer() diff --git a/komrade/art.py b/comrad/art.py similarity index 100% rename from komrade/art.py rename to comrad/art.py diff --git a/komrade/backend/__init__.py b/comrad/backend/__init__.py similarity index 93% rename from komrade/backend/__init__.py rename to comrad/backend/__init__.py index 320b2be..596837f 100644 --- a/komrade/backend/__init__.py +++ b/comrad/backend/__init__.py @@ -15,7 +15,7 @@ from .callers import * from .phonelines import * from .messages import * -from .komrades import * +from .comrads import * ## define default entities OPERATOR = None diff --git a/komrade/backend/callers.py b/comrad/backend/callers.py similarity index 75% rename from komrade/backend/callers.py rename to comrad/backend/callers.py index 0af1936..23293bd 100644 --- a/komrade/backend/callers.py +++ b/comrad/backend/callers.py @@ -1,10 +1,10 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * -from komrade.cli import * -# from komrade.backend.the_telephone import * +from comrad import * +from comrad.backend import * +from comrad.cli import * +# from comrad.backend.the_telephone import * -# from komrade.backend.the_telephone import * +# from comrad.backend.the_telephone import * class Caller(Operator): diff --git a/komrade/backend/komrades.py b/comrad/backend/comrads.py similarity index 90% rename from komrade/backend/komrades.py rename to comrad/backend/comrads.py index 18b284b..b7c8947 100644 --- a/komrade/backend/komrades.py +++ b/comrad/backend/comrads.py @@ -1,8 +1,8 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * -from komrade.backend.keymaker import * -from komrade.backend.messages import Message +from comrad import * +from comrad.backend import * +from comrad.backend.keymaker import * +from comrad.backend.messages import Message import logging,asyncio logger = logging.getLogger(__name__) @@ -12,10 +12,10 @@ logger = logging.getLogger(__name__) -class KomradeX(Caller): +class ComradX(Caller): def __init__(self, name=None, pubkey=None, callbacks={}, getpass_func=None): - # logger.info('booting KomradeX with getpass_func:',getpass_func) + # logger.info('booting ComradX with getpass_func:',getpass_func) super().__init__(name=name, callbacks=callbacks, getpass_func=getpass_func) self.log(f'Starting up with callbacks: {self._callbacks}') # self.boot(create=False) @@ -26,8 +26,8 @@ class KomradeX(Caller): with open(PATH_SUPER_SECRET_OP_KEY,'rb') as f: #pass_encr=f.read() opk1,opk2,privkey_decr,privkey_encr = b64dec(f.read()).split(BSEP) - privkey_decr_obj = KomradeSymmetricKeyWithoutPassphrase(privkey_decr) - privkey_encr_obj = KomradeEncryptedAsymmetricPrivateKey(privkey_encr) + privkey_decr_obj = ComradSymmetricKeyWithoutPassphrase(privkey_decr) + privkey_encr_obj = ComradEncryptedAsymmetricPrivateKey(privkey_encr) self._keychain['privkey_decr']=privkey_decr_obj self._keychain['privkey_encr']=privkey_encr_obj @@ -146,18 +146,18 @@ class KomradeX(Caller): if SHOW_STATUS and show_intro: self.name = name = self.cli.status_keymaker_part1(name) elif not name: - self.name = name = input('\nHello, this is Komrade @') - logfunc('I would like to sign up for the socialist network revolution.',flush=True,komrade_name=name,pause=True) + self.name = name = input('\nHello, this is Comrad @') + logfunc('I would like to sign up for the socialist network revolution.',flush=True,comrad_name=name,pause=True) # do_pause() else: - logfunc(f'Hello, this is Komrade @{name}.\n\nI would like to sign up for the socialist network revolution.',pause=True,komrade_name=name) + logfunc(f'Hello, this is Comrad @{name}.\n\nI would like to sign up for the socialist network revolution.',pause=True,comrad_name=name) # do_pause() # clear_screen() - logfunc(f'Excellent. But to communicate with komrades securely, you must first cut your public & private encryption keys.',pause=True,clear=True) + logfunc(f'Excellent. But to communicate with comrads securely, you must first cut your public & private encryption keys.',pause=True,clear=True) # do_pause() ## 2) Make pub public/private keys - keypair = KomradeAsymmetricKey() + keypair = ComradAsymmetricKey() pubkey,privkey = keypair.pubkey_obj,keypair.privkey_obj logfunc(f'I have cut for you a private and public asymmetric key pair, using the iron-clad Elliptic curve algorithm:\n\n(1) {pubkey}\n\n(2) {privkey}{ART_KEY_PAIR}',clear=True,pause=True) self._keychain['pubkey']=pubkey @@ -168,14 +168,14 @@ class KomradeX(Caller): ### PUBLIC KEY qr_str=self.qr_str(pubkey.data_b64) logfunc(f'(1) You may store your public key both on your device hardware, as well as share it with anyone you wish:\n\n{pubkey.data_b64_s}\n\nIt will also be stored as a QR code on your device:\n{qr_str}',pause=True,clear=True) - logfunc('You must also register your username and public key with Komrade @Operator on the remote server.\n\nShall Komrade @Telephone send them over?',pause=False,clear=False)#),dict_format(data,tab=2),pause=True) + logfunc('You must also register your username and public key with Comrad @Operator on the remote server.\n\nShall Comrad @Telephone send them over?',pause=False,clear=False)#),dict_format(data,tab=2),pause=True) ok_to_send = 'y' #input(f'\n@{name}: [Y/n] ') if ok_to_send.strip().lower()=='n': logfunc('Cancelling registration.') return else: print() - logfunc('Connecting you to the @Operator...',komrade_name='Telephone') + logfunc('Connecting you to the @Operator...',comrad_name='Telephone') # print() # time.sleep(1) @@ -189,7 +189,7 @@ class KomradeX(Caller): )) # print() clear_screen() - logfunc(resp_msg_d.get('status')+ART_OLDPHONE4,komrade_name='Operator',pause=True) + logfunc(resp_msg_d.get('status')+ART_OLDPHONE4,comrad_name='Operator',pause=True) print() if not resp_msg_d.get('success'): @@ -197,7 +197,7 @@ class KomradeX(Caller): return # clear_screen() - logfunc('Great. Komrade @Operator now has your name and public key on file (and nothing else!).',pause=True,clear=True) + logfunc('Great. Comrad @Operator now has your name and public key on file (and nothing else!).',pause=True,clear=True) logfunc(f"(2) Your PRIVATE key, on the other hand, must be stored only on your device hardware.",pause=True) logfunc('''Your private key is so sensitive we'll even encrypt it before storing it.''',pause=True,use_prefix=False) @@ -219,12 +219,12 @@ class KomradeX(Caller): ## 4) Get hashed password passhash = hasher(passphrase) - privkey_decr = KomradeSymmetricKeyWithPassphrase(passhash=passhash) + privkey_decr = ComradSymmetricKeyWithPassphrase(passhash=passhash) print() logfunc(f'''Let's immediately run whatever you typed through a 1-way hashing algorithm (SHA-256), inflating it to (redacted):\n\n{make_key_discreet_str(passhash)}''',pause=True,clear=False) privkey_encr = privkey_decr.encrypt(privkey.data) - privkey_encr_obj = KomradeEncryptedAsymmetricPrivateKey(privkey_encr) + privkey_encr_obj = ComradEncryptedAsymmetricPrivateKey(privkey_encr) self._keychain['privkey_encr']=privkey_encr_obj self.log('My keychain now looks like v2:',dict_format(self.keychain())) @@ -262,7 +262,7 @@ class KomradeX(Caller): # store privkey pieces self.crypt_keys.set(uri_id, privkey_encr_obj.data, prefix='/privkey_encr/') # just to show we used a passphrase --> - self.crypt_keys.set(uri_id, KomradeSymmetricKeyWithPassphrase.__name__, prefix='/privkey_decr/') + self.crypt_keys.set(uri_id, ComradSymmetricKeyWithPassphrase.__name__, prefix='/privkey_decr/') # save qr too: @@ -310,12 +310,12 @@ class KomradeX(Caller): # check hardware if not 'pubkey' in keys or not self.pubkey: - emsg='''Login impossible. I do not have this komrade's public key, much less private one.''' + emsg='''Login impossible. I do not have this comrad's public key, much less private one.''' # self.log() return {'success':False, 'status':emsg} if not 'privkey_encr' in keys: - emsg='''Login impossible. I do not have this komrade's private key on this hardware.''' + emsg='''Login impossible. I do not have this comrad's private key on this hardware.''' self.log(emsg) return {'success':False, 'status':emsg} @@ -372,7 +372,7 @@ class KomradeX(Caller): qr_names = sorted([ fn.split('.png')[0] for fn in os.listdir(PATH_QRCODES) ]) - ppl = [Komrade(name) for name in qr_names] + ppl = [Comrad(name) for name in qr_names] ppl = [p for p in ppl if p.exists_locally_as_contact()] return ppl @@ -461,7 +461,7 @@ class KomradeX(Caller): async def msg_async(self,someone,something): # find or boot - someone = Komrade(someone) + someone = Comrad(someone) self.log(f'found {someone}') # can we? @@ -530,7 +530,7 @@ class KomradeX(Caller): # self.log('something_b_signed_b64 =',something_b_signed_b64) # encrypt package to world (or op?) - world=Komrade(WORLD_NAME) + world=Comrad(WORLD_NAME) something_b_signed_encr4world = SMessage( self.privkey.data, world.pubkey.data @@ -550,7 +550,7 @@ class KomradeX(Caller): # post_pkg_b_encr4world = SMessage( # self.privkey.data, - # Komrade(WORLD_NAME).pubkey.data + # Comrad(WORLD_NAME).pubkey.data # ).wrap(post_pkg_b) # self.log(post_pkg_b_encr4world) @@ -593,7 +593,7 @@ class KomradeX(Caller): self.crypt_data.set( post_id, post, - prefix=post_prefix, + prefix=f'{post_prefix}{self.name}/', override=True ) @@ -719,12 +719,12 @@ class KomradeX(Caller): posts.append(post) return posts - def read_post(self,post_id,post_encr=None): + def read_post(self,post_id,post_encr=None,post_prefix='/post/'): # get post if not post_encr: post_encr = self.crypt_data.get( post_id, - prefix='/post/' + prefix=f'{post_prefix}{self.name}/', ) self.log('found encrypted post store:',post_encr) @@ -768,7 +768,7 @@ class KomradeX(Caller): post_obj = Message( { 'from':post_from_uri,'from_name':post_from_name, - 'to':Komrade(WORLD_NAME).uri, 'to_name':WORLD_NAME, + 'to':Comrad(WORLD_NAME).uri, 'to_name':WORLD_NAME, 'msg':post_data, 'timestamp':post_timestamp } @@ -826,12 +826,12 @@ class KomradeX(Caller): self.log('read_db.values 2',read_db.values) - def read_msg(self,post_id=None,post_encr=None): + def read_msg(self,post_id=None,post_encr=None,post_prefix='/post/'): # get post if not post_encr: post_encr = self.crypt_data.get( post_id, - prefix='/post/' + prefix=f'{post_prefix}{self.name}/', ) self.log('found encrypted post store:',post_encr) @@ -866,7 +866,7 @@ class KomradeX(Caller): } else: # print(msg_from_op) - raise KomradeException('Why am I getting this msg? '+str(msg_from_op)) + raise ComradException('Why am I getting this msg? '+str(msg_from_op)) return # now try to decrypt? @@ -951,32 +951,32 @@ def test_register(): import random num = random.choice(list(range(0,1000))) botname=f'marx{str(num).zfill(3)}' - marxbot = Komrade(botname) - # marxbot=Komrade() + marxbot = Comrad(botname) + # marxbot=Comrad() marxbot.register(passphrase='boo') def test_msg(): - b = Komrade('bez') + b = Comrad('bez') b.inbox() # b.read_msg(b'YWY3NDUxZjNjYjdhNDFmNmIyNDI2NzU3YTI4ZTA0OWM=') #b.login() #print(b.download_msgs()) - # z = Komrade('zuckbot') + # z = Comrad('zuckbot') # b.msg(z,'you ssssssuck') def test_loading(): - z1 = Komrade('elon') + z1 = Comrad('elon') # z1.register() print(z1.keychain()) # exit() - z2 = Komrade(b'VUVDMgAAAC08BCMVA+0dMJXc66/W7hty669+3/3S61Q1yjmgJW8I0k3lqfDi') + z2 = Comrad(b'VUVDMgAAAC08BCMVA+0dMJXc66/W7hty669+3/3S61Q1yjmgJW8I0k3lqfDi') print(z2) print(z2.keychain()) @@ -989,9 +989,9 @@ def test_loading(): def test_sign(): from pythemis import smessage - b = Komrade('bez') - m = Komrade('marx') - z = Komrade('zuckbot') + b = Comrad('bez') + m = Comrad('marx') + z = Comrad('zuckbot') msg = b'this is cool. --bez' @@ -1003,7 +1003,7 @@ def test_sign(): print(verified_msg) def test_send(): - z = Komrade('zuckbot') + z = Comrad('zuckbot') if __name__=='__main__': test_msg() \ No newline at end of file diff --git a/komrade/backend/crypt.py b/comrad/backend/crypt.py similarity index 95% rename from komrade/backend/crypt.py rename to comrad/backend/crypt.py index 1a6f9dd..036597c 100644 --- a/komrade/backend/crypt.py +++ b/comrad/backend/crypt.py @@ -2,7 +2,7 @@ Storage for both keys and data """ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * +from comrad import * # from simplekv.fs import FilesystemStore # from simplekv.memory.redisstore import RedisStore # import redis @@ -38,7 +38,7 @@ class Crypt(Logger): if use_secret and path_secret: if not os.path.exists(path_secret): self.secret = get_random_binary_id() - from komrade.backend.keymaker import make_key_discreet + from comrad.backend.keymaker import make_key_discreet self.log('shhh! creating secret:',make_key_discreet(self.secret)) with open(path_secret,'wb') as of: of.write(self.secret) @@ -49,8 +49,8 @@ class Crypt(Logger): self.secret = b'' self.encrypt_values = encrypt_values if self.secret and encrypt_values and (not encryptor_func or not decryptor_func): - from komrade.backend.keymaker import KomradeSymmetricKeyWithPassphrase - self.key = KomradeSymmetricKeyWithPassphrase( + from comrad.backend.keymaker import ComradSymmetricKeyWithPassphrase + self.key = ComradSymmetricKeyWithPassphrase( passphrase=self.secret ) encryptor_func = self.key.encrypt @@ -82,10 +82,6 @@ class Crypt(Logger): def package_key(self,k,prefix=''): if not k: return b'' - # @DANGEROUS!?!!!!! - name=self.name if self.name else '?' - prefix=f'''{prefix}@{name}/''' - k_b = self.force_binary(k) k_b2 = self.force_binary(prefix) + k_b return k_b2 diff --git a/komrade/backend/ether.py b/comrad/backend/ether.py similarity index 100% rename from komrade/backend/ether.py rename to comrad/backend/ether.py diff --git a/komrade/backend/keymaker.py b/comrad/backend/keymaker.py similarity index 84% rename from komrade/backend/keymaker.py rename to comrad/backend/keymaker.py index 3d57738..b009809 100644 --- a/komrade/backend/keymaker.py +++ b/comrad/backend/keymaker.py @@ -1,6 +1,6 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend.crypt import * +from comrad import * +from comrad.backend.crypt import * from abc import ABC, abstractmethod # common external imports @@ -14,7 +14,7 @@ import logging logger=logging.getLogger(__name__) -class KomradeKey(ABC,Logger): +class ComradKey(ABC,Logger): @abstractmethod def encrypt(self,msg,**kwargs): pass @abstractmethod @@ -32,7 +32,7 @@ class KomradeKey(ABC,Logger): return repr(self) -class KomradeSymmetricKey(KomradeKey): +class ComradSymmetricKey(ComradKey): def encrypt(self,msg,**kwargs): if hasattr(msg,'data'): msg=msg.data # print('??? dec',msg,kwargs) @@ -60,7 +60,7 @@ def getpass_status(passphrase=None): # get_pass_func = getpass_status if SHOW_STATUS else getpass from getpass import getpass -class KomradeSymmetricKeyWithPassphrase(KomradeSymmetricKey): +class ComradSymmetricKeyWithPassphrase(ComradSymmetricKey): def hash(self,x): return self.crypt_keys.hash(x) @property @@ -96,7 +96,7 @@ class KomradeSymmetricKeyWithPassphrase(KomradeSymmetricKey): return self._cell -class KomradeSymmetricKeyWithoutPassphrase(KomradeSymmetricKey): +class ComradSymmetricKeyWithoutPassphrase(ComradSymmetricKey): def __init__(self,key=None): self.key = GenerateSymmetricKey() if not key else key @property @@ -110,7 +110,7 @@ class KomradeSymmetricKeyWithoutPassphrase(KomradeSymmetricKey): -class KomradeAsymmetricKey(KomradeKey): +class ComradAsymmetricKey(ComradKey): def __init__(self,pubkey=None,privkey=None): if not pubkey or not privkey: keypair = GenerateKeyPair(KEY_PAIR_TYPE.EC) @@ -118,23 +118,23 @@ class KomradeAsymmetricKey(KomradeKey): pubkey = keypair.export_public_key() self.pubkey=pubkey self.privkey=privkey - self.privkey_obj = KomradeAsymmetricPrivateKey(privkey,pubkey) - self.pubkey_obj = KomradeAsymmetricPublicKey(pubkey,privkey) + self.privkey_obj = ComradAsymmetricPrivateKey(privkey,pubkey) + self.pubkey_obj = ComradAsymmetricPublicKey(pubkey,privkey) def encrypt(self,msg,pubkey=None,privkey=None): - if issubclass(type(msg), KomradeKey) or issubclass(type(msg), KomradeEncryptedKey): msg=msg.data + if issubclass(type(msg), ComradKey) or issubclass(type(msg), ComradEncryptedKey): msg=msg.data pubkey=pubkey if pubkey else self.pubkey privkey=privkey if privkey else self.privkey return SMessage(privkey,pubkey).wrap(msg) def decrypt(self,msg,pubkey=None,privkey=None): - if issubclass(type(msg), KomradeKey) or issubclass(type(msg), KomradeEncryptedKey): msg=msg.data + if issubclass(type(msg), ComradKey) or issubclass(type(msg), ComradEncryptedKey): msg=msg.data pubkey=pubkey if pubkey else self.pubkey privkey=privkey if privkey else self.privkey return SMessage(privkey.data,pubkey.data).unwrap(msg) @property def data(self): return self.key -class KomradeAsymmetricPublicKey(KomradeAsymmetricKey): +class ComradAsymmetricPublicKey(ComradAsymmetricKey): def __init__(self,pubkey,privkey=None): self.pubkey=pubkey self.privkey=privkey @@ -144,7 +144,7 @@ class KomradeAsymmetricPublicKey(KomradeAsymmetricKey): def data(self): return self.pubkey def __repr__(self): return f'''[Asymmetric Public Key]\n({self.data_b64.decode()})''' -class KomradeAsymmetricPrivateKey(KomradeAsymmetricKey): +class ComradAsymmetricPrivateKey(ComradAsymmetricKey): def __init__(self,privkey,pubkey=None): self.pubkey=pubkey self.privkey=privkey @@ -180,7 +180,7 @@ def make_key_discreet1(data,len_start=10,len_end=10,ellipsis='.',show_len=True): if len_end: dstr+=data[-len_end:] return f'{dstr}' #' (+{len(data)-len_start-len_end})' -class KomradeEncryptedKey(Logger): +class ComradEncryptedKey(Logger): def __init__(self,data): self.data=data @property def data_b64(self): return b64encode(self.data).decode() @@ -190,43 +190,43 @@ class KomradeEncryptedKey(Logger): def __str__(self): return repr(self) -class KomradeEncryptedAsymmetricPrivateKey(KomradeEncryptedKey): +class ComradEncryptedAsymmetricPrivateKey(ComradEncryptedKey): def __repr__(self): return f'[Encrypted Asymmetric Private Key]\n({self.discreet})' -class KomradeEncryptedAsymmetricPublicKey(KomradeEncryptedKey): +class ComradEncryptedAsymmetricPublicKey(ComradEncryptedKey): def __repr__(self): return f'[Encrypted Asymmetric Public Key]\n({self.discreet})' -class KomradeEncryptedSymmetricKey(KomradeEncryptedKey): +class ComradEncryptedSymmetricKey(ComradEncryptedKey): def __repr__(self): return f'[Encrypted Symmetric Key]\n({self.discreet})' KEYMAKER_DEFAULT_KEY_TYPES = { - 'pubkey':KomradeAsymmetricPublicKey, - 'privkey':KomradeAsymmetricPrivateKey, - 'adminkey':KomradeSymmetricKeyWithoutPassphrase, + 'pubkey':ComradAsymmetricPublicKey, + 'privkey':ComradAsymmetricPrivateKey, + 'adminkey':ComradSymmetricKeyWithoutPassphrase, - 'pubkey_decr':KomradeSymmetricKeyWithoutPassphrase, - 'privkey_decr':KomradeSymmetricKeyWithPassphrase, - 'adminkey_decr':KomradeSymmetricKeyWithPassphrase, + 'pubkey_decr':ComradSymmetricKeyWithoutPassphrase, + 'privkey_decr':ComradSymmetricKeyWithPassphrase, + 'adminkey_decr':ComradSymmetricKeyWithPassphrase, - 'pubkey_decr_decr':KomradeSymmetricKeyWithoutPassphrase, - 'privkey_decr_decr':KomradeSymmetricKeyWithPassphrase, - 'adminkey_decr_decr':KomradeSymmetricKeyWithPassphrase, + 'pubkey_decr_decr':ComradSymmetricKeyWithoutPassphrase, + 'privkey_decr_decr':ComradSymmetricKeyWithPassphrase, + 'adminkey_decr_decr':ComradSymmetricKeyWithPassphrase, - 'pubkey_encr_decr':KomradeSymmetricKeyWithoutPassphrase, - 'privkey_encr_decr':KomradeSymmetricKeyWithPassphrase, - 'adminkey_encr_decr':KomradeSymmetricKeyWithPassphrase, + 'pubkey_encr_decr':ComradSymmetricKeyWithoutPassphrase, + 'privkey_encr_decr':ComradSymmetricKeyWithPassphrase, + 'adminkey_encr_decr':ComradSymmetricKeyWithPassphrase, # encrypted keys - 'pubkey_encr':KomradeEncryptedAsymmetricPublicKey, - 'privkey_encr':KomradeEncryptedAsymmetricPrivateKey, - 'adminkey_encr':KomradeEncryptedSymmetricKey, - 'pubkey_encr_encr':KomradeEncryptedSymmetricKey, - 'privkey_encr_encr':KomradeEncryptedSymmetricKey, - 'adminkey_encr_encr':KomradeEncryptedSymmetricKey, - 'pubkey_decr_encr':KomradeEncryptedSymmetricKey, - 'privkey_decr_encr':KomradeEncryptedSymmetricKey, - 'adminkey_decr_encr':KomradeEncryptedSymmetricKey + 'pubkey_encr':ComradEncryptedAsymmetricPublicKey, + 'privkey_encr':ComradEncryptedAsymmetricPrivateKey, + 'adminkey_encr':ComradEncryptedSymmetricKey, + 'pubkey_encr_encr':ComradEncryptedSymmetricKey, + 'privkey_encr_encr':ComradEncryptedSymmetricKey, + 'adminkey_encr_encr':ComradEncryptedSymmetricKey, + 'pubkey_decr_encr':ComradEncryptedSymmetricKey, + 'privkey_decr_encr':ComradEncryptedSymmetricKey, + 'adminkey_decr_encr':ComradEncryptedSymmetricKey } @@ -238,10 +238,10 @@ def get_key_obj(keyname,data,key_types=KEYMAKER_DEFAULT_KEY_TYPES,getpass_func=N # print('get_key_obj',keyname,data)#,key_types) try: data_s = data.decode() - if data_s in {KEY_TYPE_SYMMETRIC_WITH_PASSPHRASE,KomradeSymmetricKeyWithPassphrase.__name__}: - return KomradeSymmetricKeyWithPassphrase(getpass_func=getpass_func,passphrase=passphrase) + if data_s in {KEY_TYPE_SYMMETRIC_WITH_PASSPHRASE,ComradSymmetricKeyWithPassphrase.__name__}: + return ComradSymmetricKeyWithPassphrase(getpass_func=getpass_func,passphrase=passphrase) except UnicodeDecodeError: - return KomradeSymmetricKeyWithoutPassphrase(data) + return ComradSymmetricKeyWithoutPassphrase(data) return key_types[keyname](data) @@ -285,7 +285,7 @@ class Keymaker(Logger): if not name: name=self.name if self.name==name and 'pubkey' in self._keychain and self._keychain['pubkey']: pk=self._keychain['pubkey'] - return KomradeAsymmetricPublicKey(b64dec(pk)) if type(pk)==bytes else pk + return ComradAsymmetricPublicKey(b64dec(pk)) if type(pk)==bytes else pk res = self.crypt_keys.get(name, prefix='/pubkey/') # self.log(f'crypt_keys({name}) -->',res) @@ -293,11 +293,11 @@ class Keymaker(Logger): res = self.load_qr(self.name) # self.log(f'load_qr({name}) -->',res) if not res: return - key = KomradeAsymmetricPublicKey(b64dec(res)) + key = ComradAsymmetricPublicKey(b64dec(res)) # self.log('-->',key) return key # self.log('I don\'t know my public key! Do I need to register?') - # raise KomradeException(f'I don\'t know my public key!\n{self}\n{self._keychain}') + # raise ComradException(f'I don\'t know my public key!\n{self}\n{self._keychain}') # return res def find_name(self,pubkey_b64): @@ -447,7 +447,7 @@ class Keymaker(Logger): def save_uri_as_qrcode(self,uri_id=None,name=None): if not uri_id: uri_id = self.uri_id - if not uri_id and not self.uri_id: raise KomradeException('Need URI id to save!') + if not uri_id and not self.uri_id: raise ComradException('Need URI id to save!') if not name: name=self.name # gen @@ -468,7 +468,7 @@ class Keymaker(Logger): self._uri_id = uri_id # filter for transfer for k,v in keychain.items(): - if issubclass(type(v),KomradeKey): + if issubclass(type(v),ComradKey): v=v.data keychain[k]=v @@ -476,13 +476,13 @@ class Keymaker(Logger): keys_saved_d={} for keyname in keys_to_save: if not '_' in keyname and keyname!='pubkey': - self.log('there is no private property in a socialist network! all keys must be split between komrades',keyname) + self.log('there is no private property in a socialist network! all keys must be split between comrads',keyname) if keyname in keychain: # uri = uri_id uri = uri_id if keyname!='pubkey' else name - if not uri: raise KomradeException('invalid URI! {uri}') + if not uri: raise ComradException('invalid URI! {uri}') val = keychain[keyname] - if issubclass(type(keychain[keyname]), KomradeKey) or issubclass(type(keychain[keyname]), KomradeEncryptedKey): + if issubclass(type(keychain[keyname]), ComradKey) or issubclass(type(keychain[keyname]), ComradEncryptedKey): val = val.data self.crypt_keys.set(uri,val,prefix=f'/{keyname}/') keys_saved_d[keyname] = keychain[keyname] diff --git a/komrade/backend/mazes.py b/comrad/backend/mazes.py similarity index 99% rename from komrade/backend/mazes.py rename to comrad/backend/mazes.py index b503786..4e0410b 100644 --- a/komrade/backend/mazes.py +++ b/comrad/backend/mazes.py @@ -1,5 +1,5 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * +from comrad import * # import requests_async as requests log=print @@ -54,7 +54,7 @@ class MazeWalker(Handler): -# def komrade_request(url,allow_clearnet = ALLOW_CLEARNET): +# def comrad_request(url,allow_clearnet = ALLOW_CLEARNET): # if '.onion' in url or not allow_clearnet: # return tor_request(url) # return requests.get(url,timeout=600) @@ -218,7 +218,7 @@ from torpy.http.urlopener import do_request as urllib_request logging.getLogger('requests').setLevel(logging.CRITICAL) logging.basicConfig(format='[%(asctime)s] [%(threadName)-16s] %(message)s', level=logging.DEBUG) -logger = logging.getLogger('komrade') +logger = logging.getLogger('comrad') HS_BASIC_HOST = os.getenv('HS_BASIC_HOST') diff --git a/komrade/backend/messages.py b/comrad/backend/messages.py similarity index 96% rename from komrade/backend/messages.py rename to comrad/backend/messages.py index 482328a..f60a6a7 100644 --- a/komrade/backend/messages.py +++ b/comrad/backend/messages.py @@ -1,6 +1,6 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * +from comrad import * +from comrad.backend import * def is_valid_msg_d(msg_d): if not type(msg_d)==dict: return False @@ -113,13 +113,13 @@ on: {timestr} @property def from_whom(self): - # from komrade.backend.komrades import Komrade - return Komrade(self.from_name, pubkey=self.from_pubkey) + # from comrad.backend.comrads import Comrad + return Comrad(self.from_name, pubkey=self.from_pubkey) @property def to_whom(self): - # from komrade.backend.komrades import Komrade - return Komrade(self.to_name, pubkey=self.to_pubkey) + # from comrad.backend.comrads import Comrad + return Comrad(self.to_name, pubkey=self.to_pubkey) def decrypt(self,recursive=False): diff --git a/komrade/backend/operators.py b/comrad/backend/operators.py similarity index 89% rename from komrade/backend/operators.py rename to comrad/backend/operators.py index 506b8ea..81db721 100644 --- a/komrade/backend/operators.py +++ b/comrad/backend/operators.py @@ -1,7 +1,7 @@ # internal imports import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * +from comrad import * +from comrad.backend import * # BEGIN PHONE BOOK (in memory singleton mapping) @@ -9,20 +9,20 @@ PHONEBOOK = {} CALLBACKS = {} # Factory constructor -def Komrade(name=None,pubkey=None,*x,**y): +def Comrad(name=None,pubkey=None,*x,**y): if issubclass(type(name),Operator): return name if name and not pubkey and type(name)==bytes: pubkey=b64enc(name) name=None - from komrade.backend.the_operator import TheOperator - from komrade.backend.the_telephone import TheTelephone - from komrade.backend.komrades import KomradeX + from comrad.backend.the_operator import TheOperator + from comrad.backend.the_telephone import TheTelephone + from comrad.backend.comrads import ComradX global PHONEBOOK # already have? - if not name and not pubkey: return KomradeX() + if not name and not pubkey: return ComradX() if name in PHONEBOOK: return PHONEBOOK[name] pk64 = None if not pubkey else b64enc(pubkey) @@ -33,7 +33,7 @@ def Komrade(name=None,pubkey=None,*x,**y): callbacks = callbacks if callbacks else CALLBACKS CALLBACKS = callbacks - # print(f'finding Komrade {name} / {pubkey} for the first time!') + # print(f'finding Comrad {name} / {pubkey} for the first time!') # operator? if name==OPERATOR_NAME: kommie = TheOperator(callbacks=callbacks) #(*x,**y) @@ -41,7 +41,7 @@ def Komrade(name=None,pubkey=None,*x,**y): kommie = TheTelephone(callbacks=callbacks) #(*x,**y) else: # print('booting new kommie') - kommie = KomradeX(name,*x,**y) + kommie = ComradX(name,*x,**y) @@ -57,7 +57,7 @@ def Komrade(name=None,pubkey=None,*x,**y): -# from komrade.constants import OPERATOR_ROUTES +# from comrad.constants import OPERATOR_ROUTES class Operator(Keymaker): ROUTES = [ 'register_new_user', @@ -113,7 +113,7 @@ class Operator(Keymaker): @property def phone(self): - from komrade.backend.the_telephone import TheTelephone + from comrad.backend.the_telephone import TheTelephone if type(self)==TheTelephone: return self if hasattr(self,'_phone'): return self._phone @@ -127,7 +127,7 @@ class Operator(Keymaker): @property def op(self): - from komrade.backend.the_operator import TheOperator + from comrad.backend.the_operator import TheOperator if type(self)==TheOperator: return self if hasattr(self,'_op'): return self._op @@ -142,10 +142,10 @@ class Operator(Keymaker): def compose_msg_to(self,msg,another): if not self.privkey or not self.pubkey: - raise KomradeException('I appear not yet to have an encryption keypair.',self,self.name,self.pubkey,self.privkey,self.keychain()) + raise ComradException('I appear not yet to have an encryption keypair.',self,self.name,self.pubkey,self.privkey,self.keychain()) if not another.name or not another.pubkey: self.log(f'I {self} failed to compose a message to {another} ?') - raise KomradeException('I do not know the Komrade I am writing to.') + raise ComradException('I do not know the Comrad I am writing to.') # otherwise create msg frompub = self.pubkey.data if hasattr(self.pubkey,'data') else self.pubkey @@ -160,7 +160,7 @@ class Operator(Keymaker): 'timestamp':time.time() } self.log(f'I am {self} packaging a message to {another}: {msg_d}') - from komrade.backend.messages import Message + from comrad.backend.messages import Message msg_obj = Message(msg_d) @@ -203,7 +203,7 @@ class Operator(Keymaker): if msg_obj.route: data,route = msg_obj.data, msg_obj.route if not hasattr(self,route) or route not in self.ROUTES: - raise KomradeException(f'Not a valid route!: {route}') + raise ComradException(f'Not a valid route!: {route}') # route it! self.log(f'Routing msg to {self}.{route}():\n\n{dict_format(msg_obj.data,tab=4)}') @@ -224,8 +224,8 @@ class Operator(Keymaker): # time to turn around and encrypt # @unsure?`` - # from komrade.backend.komrades import Komrade - # if self != self.phone and type(self)!=Komrade: + # from comrad.backend.comrads import Comrad + # if self != self.phone and type(self)!=Comrad: # # if client, let the request rest # return msg_obj @@ -252,11 +252,11 @@ class Operator(Keymaker): async def ring_ring(self,msg,to_whom,get_resp_from=None,route=None,caller=None): # ring ring - from komrade.cli.artcode import ART_PHONE_SM1 + from comrad.cli.artcode import ART_PHONE_SM1 import textwrap as tw if caller!=self: - from komrade.cli.artcode import ART_PHONE_SM1 + from comrad.cli.artcode import ART_PHONE_SM1 self.log(f'ring ring! I the {self} have received a message from {caller},\n which I will now encrypt and send along to {to_whom}.\n {ART_PHONE_SM1} ') else: pass @@ -321,7 +321,7 @@ class Operator(Keymaker): inbox_crypt = CryptList( crypt=self.crypt_data, keyname=uri, - prefix=prefix + prefix=f'{prefix}{self.name}/', ) self.log('-->',inbox_crypt) return inbox_crypt diff --git a/komrade/backend/phonelines.py b/comrad/backend/phonelines.py similarity index 86% rename from komrade/backend/phonelines.py rename to comrad/backend/phonelines.py index b0b5e1e..39a2134 100644 --- a/komrade/backend/phonelines.py +++ b/comrad/backend/phonelines.py @@ -1,6 +1,6 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * +from comrad import * +from comrad.backend import * @@ -11,21 +11,21 @@ def create_phonelines(): # print(keycrypt.fn) # Operator - op_keypair = KomradeAsymmetricKey() + op_keypair = ComradAsymmetricKey() op_pubkey,op_privkey = op_keypair.pubkey_obj,op_keypair.privkey_obj op_uri = op_pubkey.data_b64 - op_privkey_decr = KomradeSymmetricKeyWithoutPassphrase() - op_privkey_encr = KomradeEncryptedAsymmetricPrivateKey( + op_privkey_decr = ComradSymmetricKeyWithoutPassphrase() + op_privkey_encr = ComradEncryptedAsymmetricPrivateKey( data=op_privkey_decr.encrypt(op_privkey.data) ) ## world - world_keypair = KomradeAsymmetricKey() + world_keypair = ComradAsymmetricKey() world_pubkey,world_privkey = world_keypair.pubkey_obj,world_keypair.privkey_obj world_uri = world_pubkey.data_b64 - world_privkey_decr = KomradeSymmetricKeyWithoutPassphrase() - world_privkey_encr = KomradeEncryptedAsymmetricPrivateKey( + world_privkey_decr = ComradSymmetricKeyWithoutPassphrase() + world_privkey_encr = ComradEncryptedAsymmetricPrivateKey( data=world_privkey_decr.encrypt(world_privkey.data) ) @@ -45,7 +45,7 @@ def create_phonelines(): of.write(op_pubkey.data_b64_s) ## Telephone - phone_keypair = KomradeAsymmetricKey() + phone_keypair = ComradAsymmetricKey() phone_pubkey,phone_privkey = phone_keypair.pubkey_obj,phone_keypair.privkey_obj phone_uri = phone_pubkey.data_b64 keycrypt.set(TELEPHONE_NAME,phone_pubkey.data,prefix='/pubkey/') @@ -82,7 +82,7 @@ def create_phonelines(): from base64 import b64encode builtin_keys_b = pickle.dumps(builtin_keys) - # omega_key = KomradeSymmetricKeyWithoutPassphrase() + # omega_key = ComradSymmetricKeyWithoutPassphrase() # builtin_keys_b_encr = omega_key.encrypt(builtin_keys_b) # builtin_keys_b_encr_with_key = omega_key.data + BSEP + builtin_keys_b_encr # builtin_keys_b_encr_with_key_b64 = b64encode(builtin_keys_b_encr_with_key) @@ -125,7 +125,7 @@ def check_phonelines(): builtin_keys_b64 = f.read() # builtin_keys_encr = b64decode(builtin_keys_encr_b64) # omega_key_b,builtin_keys_encr = builtin_keys_encr.split(BSEP) - # omega_key = KomradeSymmetricKeyWithoutPassphrase(omega_key_b) + # omega_key = ComradSymmetricKeyWithoutPassphrase(omega_key_b) # builtin_keys_b = omega_key.decrypt(builtin_keys_encr) builtin_keys = pickle.loads(b64decode(builtin_keys_b64)) # print(builtin_keys) @@ -161,8 +161,8 @@ def check_phonelines(): def test_phonelines(): - from komrade.backend.the_telephone import TheTelephone - from komrade.backend.the_operator import TheOperator + from comrad.backend.the_telephone import TheTelephone + from comrad.backend.the_operator import TheOperator from getpass import getpass phone = TheTelephone() op = TheOperator(passphrase=getpass()) diff --git a/komrade/backend/reset.sh b/comrad/backend/reset.sh similarity index 100% rename from komrade/backend/reset.sh rename to comrad/backend/reset.sh diff --git a/komrade/backend/switchboard.py b/comrad/backend/switchboard.py similarity index 90% rename from komrade/backend/switchboard.py rename to comrad/backend/switchboard.py index 89c9183..cb9a4ba 100644 --- a/komrade/backend/switchboard.py +++ b/comrad/backend/switchboard.py @@ -1,7 +1,7 @@ # internal imports import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * +from comrad import * +from comrad.backend import * from getpass import getpass # external imports @@ -16,7 +16,7 @@ class TheSwitchboard(FlaskView, Logger): @property def op(self): global OP_PASS - from komrade.backend.the_operator import TheOperator + from comrad.backend.the_operator import TheOperator if type(self)==TheOperator: return self if hasattr(self,'_op'): return self._op global OPERATOR,OPERATOR_KEYCHAIN @@ -27,7 +27,7 @@ class TheSwitchboard(FlaskView, Logger): def get(self,data_b64_str_esc): clear_screen() - from komrade.cli.artcode import ART_OLDPHONE4 + from comrad.cli.artcode import ART_OLDPHONE4 # self.log(f'Incoming call!: {data_b64_str_esc}') if not data_b64_str_esc: self.log('empty request!') diff --git a/komrade/backend/the_operator.py b/comrad/backend/the_operator.py similarity index 91% rename from komrade/backend/the_operator.py rename to comrad/backend/the_operator.py index 0a1f63d..44ee614 100644 --- a/komrade/backend/the_operator.py +++ b/comrad/backend/the_operator.py @@ -4,15 +4,15 @@ Running on node prime. """ # internal imports import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * -from komrade.backend.messages import Message +from comrad import * +from comrad.backend import * +from comrad.backend.messages import Message # print(PATH_OPERATOR_WEB_KEYS_URL) # def TheOperator(*x,**y): -# from komrade.backend.operators import Komrade -# return Komrade(OPERATOR_NAME,*x,**y) +# from comrad.backend.operators import Comrad +# return Comrad(OPERATOR_NAME,*x,**y) class TheOperator(Operator): """ @@ -21,7 +21,7 @@ class TheOperator(Operator): @property def phone(self): global TELEPHONE - from komrade.backend.the_telephone import TheTelephone + from comrad.backend.the_telephone import TheTelephone if not TELEPHONE: TELEPHONE=TheTelephone() return TELEPHONE @@ -37,32 +37,32 @@ class TheOperator(Operator): path_crypt_data=PATH_CRYPT_OP_DATA, callbacks=callbacks ) - from komrade.backend.phonelines import check_phonelines + from comrad.backend.phonelines import check_phonelines keychain = check_phonelines()[OPERATOR_NAME] self._keychain = {**self.load_keychain_from_bytes(keychain)} if not keychain.get('pubkey'): - raise KomradeException('Operator cannot find its own public key? Shutting down.') + raise ComradException('Operator cannot find its own public key? Shutting down.') # check I match what's on op page - # pub_web = komrade_request(PATH_OPERATOR_WEB_KEYS_URL) + # pub_web = comrad_request(PATH_OPERATOR_WEB_KEYS_URL) # if pub_web.status_code!=200: - # raise KomradeException("Can't verify Komrade Operator. Shutting down.") - # print('Public key on komrade.app/pub: ',pub_web.text) + # raise ComradException("Can't verify Comrad Operator. Shutting down.") + # print('Public key on comrad.app/pub: ',pub_web.text) # print('Public key hardcoded in client: ',keychain.get('pubkey').data_b64_s) # if pub_web.text == keychain.get('pubkey').data_b64_s: # # print('Pubs match') # pass # else: - # raise KomradeException('Public key for Operator on app and one at {PATH_OPERATOR_WEB_KEYS_URL} do not match. Shutting down.') + # raise ComradException('Public key for Operator on app and one at {PATH_OPERATOR_WEB_KEYS_URL} do not match. Shutting down.') if os.path.exists(PATH_SUPER_SECRET_OP_KEY): print('Dare I claim to be the one true Operator?') with open(PATH_SUPER_SECRET_OP_KEY,'rb') as f: #pass_encr=f.read() privkey_decr,privkey_encr,wk1,wk2 = b64dec(f.read()).split(BSEP) - privkey_decr_obj = KomradeSymmetricKeyWithoutPassphrase(privkey_decr) - privkey_encr_obj = KomradeEncryptedAsymmetricPrivateKey(privkey_encr) + privkey_decr_obj = ComradSymmetricKeyWithoutPassphrase(privkey_decr) + privkey_encr_obj = ComradEncryptedAsymmetricPrivateKey(privkey_encr) self._keychain['privkey_decr']=privkey_decr_obj self._keychain['privkey_encr']=privkey_encr_obj @@ -94,7 +94,7 @@ class TheOperator(Operator): # ends the ring_ring() chain def answer_phone(self,data_b): # route incoming call from the switchboard - from komrade.cli.artcode import ART_OLDPHONE4 + from comrad.cli.artcode import ART_OLDPHONE4 self.log(f'''Hello, this is the Operator.{ART_OLDPHONE4}I heard you say:\n\n {b64enc_s(data_b)}''') @@ -226,7 +226,7 @@ class TheOperator(Operator): if success: return { 'success': True, - 'status':f'Welcome back, Komrade @{name.decode()}.', + 'status':f'Welcome back, Comrad @{name.decode()}.', 'status_type':'login', 'name':name_record.decode(), 'pubkey':pubkey_record @@ -248,7 +248,7 @@ class TheOperator(Operator): if self.has_user(name=name,pubkey=pubkey): return { 'success':False, - 'status': f"{OPERATOR_INTRO}I'm sorry, but I can't register the name of {name}. This komrade already exists." + 'status': f"{OPERATOR_INTRO}I'm sorry, but I can't register the name of {name}. This comrad already exists." } # generate shared secret @@ -301,13 +301,13 @@ class TheOperator(Operator): # # cvb64=cv_b64#b64encode(cv).decode() # qrstr=self.qr_str(cvb64) - # res['status']=self.status(f'''{OPERATOR_INTRO}I have successfully registered Komrade {name}. + # res['status']=self.status(f'''{OPERATOR_INTRO}I have successfully registered Comrad {name}. # If you're interested, here's what I did. I stored the public key you gave me, {cvb64}, under the name of "{name}". However, I never save that name directly, but record it only in a disguised, "hashed" form: {ck}. I scrambled "{name}" by running it through a 1-way hashing function, which will always yield the same result: provided you know which function I'm using, and what the secret "salt" is that I add to all the input, a string of text which I keep protected and encrypted on my local hard drive. # The content of your data will therefore not only be encrypted, but its location in my database is obscured even to me. There's no way for me to reverse-engineer the name of {name} from the record I stored it under, {ck}. Unless you explictly ask me for the public key of {name}, I will have no way of accessing that information. - # Your name ({name}) and your public key ({cvb64}) are the first two pieces of information you've given me about yourself. Your public key is your 'address' in Komrade: in order for anyone to write to you, or for them to receive messages from you, they'll need to know your public key (and vise versa). The Komrade app should store your public key on your device as a QR code, under ~/.komrade/.contacts/{name}.png. It will look something like this:{qrstr}You can then send this image to anyone by a secure channel (Signal, IRL, etc), or tell them the code directly ({cvb64}). + # Your name ({name}) and your public key ({cvb64}) are the first two pieces of information you've given me about yourself. Your public key is your 'address' in Comrad: in order for anyone to write to you, or for them to receive messages from you, they'll need to know your public key (and vise versa). The Comrad app should store your public key on your device as a QR code, under ~/.comrad/.contacts/{name}.png. It will look something like this:{qrstr}You can then send this image to anyone by a secure channel (Signal, IRL, etc), or tell them the code directly ({cvb64}). # By default, if anyone asks me what your public key is, I won't tell them--though I won't be able to avoid hinting that a user exists under this name should someone try to register under that name and I deny them). Instead, if the person who requested your public key insists, I will send you a message (encrypted end-to-end so only you can read it) that the user who met someone would like to introduce themselves to you; I will then send you their name and public key. It's now your move: up to you whether to save them back your public key. @@ -317,7 +317,7 @@ class TheOperator(Operator): def validate_msg(self,msg_d): - from komrade.backend.messages import is_valid_msg_d + from comrad.backend.messages import is_valid_msg_d if not is_valid_msg_d(msg_d): return False # alleged @@ -384,7 +384,7 @@ class TheOperator(Operator): # is valid? if not self.validate_msg(deliver_msg_d): res = { - 'status':'Message was not valid. Records between Komrade and Operator do not match.', + 'status':'Message was not valid. Records between Comrad and Operator do not match.', 'success':False } self.log('-->',res) @@ -433,7 +433,7 @@ class TheOperator(Operator): def deliver_post(self,msg_to_op): # This self.log('<--',msg_to_op.msg_d) - world = Komrade(WORLD_NAME) + world = Comrad(WORLD_NAME) # attached msg attached_msg = msg_to_op.msg.get('data') @@ -482,7 +482,7 @@ class TheOperator(Operator): self.log('seen =',seen) # get index - world=Komrade(WORLD_NAME) + world=Comrad(WORLD_NAME) self.log('world name??',WORLD_NAME,'??????') @@ -504,7 +504,7 @@ class TheOperator(Operator): msg_to_op.from_pubkey, prefix=b'/seen/' + post_id + b'/' ): - self.log('skipping: komrade has already seen!') + self.log('skipping: comrad has already seen!') continue @@ -535,14 +535,14 @@ class TheOperator(Operator): # 'status':'Records do not match.' # } - # decrypt from post author komrade + # decrypt from post author comrad post_b_signed = SMessage( world.privkey.data, b64dec(from_uri) ).unwrap(post_b_signed_encr4world) self.log('post_b_signed',post_b_signed) - # re-encrypt for the post requester komrade + # re-encrypt for the post requester comrad post_pkg_d2 = { 'post':post_b_signed, 'post_from':from_uri, @@ -583,13 +583,13 @@ class TheOperator(Operator): # # is valid? # if not self.validate_msg(deliver_msg_d): # res = { - # 'status':'Message was not valid. Records between Komrade and Operator do not match.', + # 'status':'Message was not valid. Records between Comrad and Operator do not match.', # 'success':False # } # self.log('-->',res) # # package - # from komrade.backend.messages import Message + # from comrad.backend.messages import Message # msg_from_op = Message( # from_whom=self, # msg_d = { @@ -654,7 +654,7 @@ class TheOperator(Operator): ### # LETS SIMPLIFY THIS - # Komrade -> Op: get_updates() + # Comrad -> Op: get_updates() # gets new DMs, new posts, # both index/inbox and content/body ### @@ -804,7 +804,7 @@ class TheOperator(Operator): if not meet_pubkey: return { 'success':False, - 'status':'Are you sure this komrade exists? If you are, try contacting them by another secure channel and asking for their public key there.' + 'status':'Are you sure this comrad exists? If you are, try contacting them by another secure channel and asking for their public key there.' } self.log('found in crypt:',meet_pubkey) @@ -815,9 +815,9 @@ class TheOperator(Operator): returning = data.get('returning') if returning: - txt=f'''Komrade @{meet_from_name} has agreed to make your acquaintance.\n\nTheir public key is:\n{meet_from_uri.decode()}.''' + txt=f'''Comrad @{meet_from_name} has agreed to make your acquaintance.\n\nTheir public key is:\n{meet_from_uri.decode()}.''' else: - txt=f'''Komrade @{meet_from_name} would like to make your acquaintance.\n\nTheir public key is:\n{meet_from_uri.decode()}.''' + txt=f'''Comrad @{meet_from_name} would like to make your acquaintance.\n\nTheir public key is:\n{meet_from_uri.decode()}.''' # txt_encr = SMessage( # self.privkey.data, @@ -865,7 +865,7 @@ class TheOperator(Operator): def test_op(): - from komrade.backend.the_telephone import TheTelephone + from comrad.backend.the_telephone import TheTelephone from getpass import getpass op = TheOperator() @@ -878,7 +878,7 @@ def test_op(): # phone.boot() keychain_ph = phone.keychain() - world = Komrade(WORLD_NAME) + world = Comrad(WORLD_NAME) keychain_w = world.keychain() diff --git a/komrade/backend/the_telephone.py b/comrad/backend/the_telephone.py similarity index 89% rename from komrade/backend/the_telephone.py rename to comrad/backend/the_telephone.py index ea35ddb..8d76d76 100644 --- a/komrade/backend/the_telephone.py +++ b/comrad/backend/the_telephone.py @@ -1,15 +1,15 @@ # internal imports import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * -from komrade.backend.phonelines import * -from komrade.backend.operators import CALLBACKS +from comrad import * +from comrad.backend import * +from comrad.backend.phonelines import * +from comrad.backend.operators import CALLBACKS import requests from torpy.cell_socket import TorSocketConnectError from requests.exceptions import ConnectionError # def TheTelephone(*x,**y): -# return Komrade(TELEPHONE_NAME,*x,**y) +# return Comrad(TELEPHONE_NAME,*x,**y) ### ACTUAL PHONE CONNECTIONS class TheTelephone(Operator): @@ -19,7 +19,7 @@ class TheTelephone(Operator): def __init__(self, caller=None, callbacks={}): super().__init__(name=TELEPHONE_NAME,callbacks=callbacks) self.caller=caller - from komrade.backend.phonelines import check_phonelines + from comrad.backend.phonelines import check_phonelines keychain = check_phonelines()[TELEPHONE_NAME] self._keychain ={**self.load_keychain_from_bytes(keychain)} @@ -45,7 +45,7 @@ class TheTelephone(Operator): # assert that people can speak only with operator in their first enclosed message! # if so, dropping the "to" if msg_d['to'] != self.op.pubkey.data: - raise KomradeException('Komrades must communicate securely with Operator first.') + raise ComradException('Comrads must communicate securely with Operator first.') # opp = Operator(pubkey=msg_d['to']) # self.log('got opp:',opp.pubkey.data == msg_d['to'], self.op.pubkey.data == msg_d['to']) @@ -68,7 +68,7 @@ class TheTelephone(Operator): URL = self.api_url + msg_b64_str_esc + '/' self.log("DIALING THE OPERATOR:",URL) - # phonecall=await self.komrade_request_async(URL) + # phonecall=await self.comrad_request_async(URL) # import asyncio # loop = asyncio.get_event_loop() texec = ThreadExecutor() @@ -77,8 +77,8 @@ class TheTelephone(Operator): for n_attempt in range(n_attempts): self.log('making first attempt to connect via Tor') try: - # phonecall=self.komrade_request(URL) - phonecall = await texec(self.komrade_request, URL) + # phonecall=self.comrad_request(URL) + phonecall = await texec(self.comrad_request, URL) break except (TorSocketConnectError,ConnectionError) as e: self.log(f'!! {e} trying again?') @@ -99,7 +99,7 @@ class TheTelephone(Operator): # self.log('unpickled:',resp_msg_d) # unseal - from komrade.backend.messages import Message + from comrad.backend.messages import Message resp_msg_obj = Message(resp_msg_d) # res = resp_msg_b_unsealed # self.log('Decoding binary, message discovered:\n',resp_msg_obj) @@ -121,12 +121,12 @@ class TheTelephone(Operator): ) ### Requests functionality - def komrade_request(self,url,allow_clearnet = ALLOW_CLEARNET): + def comrad_request(self,url,allow_clearnet = ALLOW_CLEARNET): if '.onion' in url or not allow_clearnet: return self.tor_request(url) return requests.get(url,timeout=600) - async def komrade_request_async(self,url,allow_clearnet=ALLOW_CLEARNET): + async def comrad_request_async(self,url,allow_clearnet=ALLOW_CLEARNET): import requests_async as requests if '.onion' in url or not allow_clearnet: return await self.tor_request_async(url) diff --git a/komrade/cli/__init__.py b/comrad/cli/__init__.py similarity index 100% rename from komrade/cli/__init__.py rename to comrad/cli/__init__.py diff --git a/komrade/cli/artcode.py b/comrad/cli/artcode.py similarity index 100% rename from komrade/cli/artcode.py rename to comrad/cli/artcode.py diff --git a/komrade/cli/box.txt b/comrad/cli/box.txt similarity index 100% rename from komrade/cli/box.txt rename to comrad/cli/box.txt diff --git a/komrade/cli/cli.py b/comrad/cli/cli.py similarity index 89% rename from komrade/cli/cli.py rename to comrad/cli/cli.py index 25e9686..b804b9e 100644 --- a/komrade/cli/cli.py +++ b/comrad/cli/cli.py @@ -1,6 +1,6 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * +from comrad import * +from comrad.backend import * import art import textwrap as tw import readline,logging @@ -26,9 +26,9 @@ CLI_HEIGHT = get_terminal_size().lines-1 class CLI(Logger): ROUTES = { 'help':'seek help', - 'register':'join the komrades', + 'register':'join the comrads', 'login':'log back in', - 'meet':'meet a komrade', + 'meet':'meet a comrad', 'who':'show contacts or info', 'dm':'write people', 'refresh':'refresh feed/DMs', @@ -37,7 +37,7 @@ class CLI(Logger): 'verbose':'show/hide log output', 'post':'post to world', 'feed':'fetch posts', - 'exit':'exit komrade', + 'exit':'exit comrad', 'clearnet':'switch to clearnet', 'tor':'switch to tor', } @@ -45,7 +45,7 @@ class CLI(Logger): def __init__(self,name='',cmd='',persona=None): self.name=name self.cmd=cmd - self.komrade=None + self.comrad=None self.loggedin=False self.tabber=tabber self.log('ROUTES:',self.ROUTES) @@ -57,7 +57,7 @@ class CLI(Logger): readline.set_completer(tabber.listCompleter) # logging - from komrade.backend.mazes import MazeWalker + from comrad.backend.mazes import MazeWalker self.walker=MazeWalker(callbacks=self.callbacks) self.torpy_logger = logging.getLogger('torpy') self.torpy_logger.propagate=False @@ -89,7 +89,7 @@ class CLI(Logger): except (KeyboardInterrupt,EOFError) as e: self.stat('Goodbye.') exit() - except KomradeException as e: + except ComradException as e: self.stat(f'I could not handle your request. {e}\n') #await asyncio.sleep(0.5) self.walker.walk=[] # reset logger's walk? @@ -106,14 +106,14 @@ class CLI(Logger): f=getattr(self,cmd) try: res=f(dat) - except KomradeException as e: + except ComradException as e: self.stat('Message not sent.',str(e),'\n') - def stat(self,*msgs,use_prefix=True,prefix=None,komrade_name=None,pause=False,clear=False,min_prefix_len=12,**kwargs): + def stat(self,*msgs,use_prefix=True,prefix=None,comrad_name=None,pause=False,clear=False,min_prefix_len=12,**kwargs): if not prefix: - if not komrade_name: komrade_name='Telephone' - # prefix='Komrade @'+komrade_name+': ' - prefix='@'+komrade_name+': ' + if not comrad_name: comrad_name='Telephone' + # prefix='Comrad @'+comrad_name+': ' + prefix='@'+comrad_name+': ' # wrap msg total_msg=wrapp( *msgs, @@ -155,18 +155,18 @@ class CLI(Logger): @property def post_status_str(self): - if not self.komrade: return '' + if not self.comrad: return '' return self.status_str( - unr=self.komrade.num_unread_posts, - tot=self.komrade.num_posts + unr=self.comrad.num_unread_posts, + tot=self.comrad.num_posts ) @property def msg_status_str(self): - if not self.komrade: return '' + if not self.comrad: return '' return self.status_str( - unr=self.komrade.num_unread_msgs, - tot=self.komrade.num_msgs + unr=self.comrad.num_unread_msgs, + tot=self.comrad.num_msgs ) def clearnet(self,_=''): @@ -186,7 +186,7 @@ class CLI(Logger): if not self.logged_in: HELPSTR=f""" /login [name] --> log back in -/register [name] --> new komrade""" +/register [name] --> new comrad""" else: HELPSTR=f""" /refresh --> get new data @@ -228,7 +228,7 @@ class CLI(Logger): def who(self,whom): if self.with_required_login(): - contacts_obj = self.komrade.contacts() + contacts_obj = self.comrad.contacts() contacts = [p.name for p in contacts_obj] self.print(' ' + '\n '.join(contacts)) @@ -269,7 +269,7 @@ class CLI(Logger): # self.stat( # msg, - # komrade_name='Tor' + # comrad_name='Tor' # ) # print() # input('pausing on callback: '+msg) @@ -281,60 +281,60 @@ class CLI(Logger): def register(self,name=None): if not name: name=input('name: ') if not name: return - self.komrade = Komrade(name,callbacks=self.callbacks) + self.comrad = Comrad(name,callbacks=self.callbacks) was_off=self.off # if was_off: self.show_log() - def logfunc(*x,komrade_name='Keymaker',**y): - self.stat(*x,komrade_name=komrade_name,**y) + def logfunc(*x,comrad_name='Keymaker',**y): + self.stat(*x,comrad_name=comrad_name,**y) - res=self.komrade.register(logfunc=logfunc) + res=self.comrad.register(logfunc=logfunc) # if was_off: self.toggle_log() if res and type(res)==dict and 'success' in res and res['success']: - self.name=self.komrade.name + self.name=self.comrad.name self.loggedin=True self.help() - # self.stat(f'Welcome, Komrade @{self.name}.') + # self.stat(f'Welcome, Comrad @{self.name}.') else: self.name=None self.loggedin=False - self.komrade=None + self.comrad=None self.help() if res and 'status' in res: # self.boot() - self.stat(res.get('status','?'),komrade_name='Operator') + self.stat(res.get('status','?'),comrad_name='Operator') def login(self,name): - # self.print(self,name,self.name,self.komrade,self.loggedin) + # self.print(self,name,self.name,self.comrad,self.loggedin) if not name: name=input('name: ') if not name: return - self.komrade=Komrade(name,callbacks=self.callbacks) + self.comrad=Comrad(name,callbacks=self.callbacks) return self.refresh() - # res = self.komrade.login() + # res = self.comrad.login() # return self.do_login(res) def do_login(self,res): # print('got login res:',res) - self.log('<- komrade.login() <-',res) + self.log('<- comrad.login() <-',res) if res and type(res)==dict and 'success' in res and res['success']: self.name=res['name'] - self.komrade=Komrade(res['name'],callbacks=self.callbacks) + self.comrad=Comrad(res['name'],callbacks=self.callbacks) self.loggedin=True else: self.name=None self.loggedin=False - self.komrade=None + self.comrad=None if res and 'status' in res: self.boot(scan=False) self.help() - self.stat(res.get('status','?'),komrade_name='Operator') + self.stat(res.get('status','?'),comrad_name='Operator') return bool(res.get('success')) @property def logged_in(self): - return (self.loggedin and self.komrade and self.name) + return (self.loggedin and self.comrad and self.name) def with_required_login(self,quiet=False): @@ -352,7 +352,7 @@ class CLI(Logger): self.stat('Meet whom?') return name_or_pubkey = datl[0] - res = self.komrade.meet(name_or_pubkey,returning=returning) + res = self.comrad.meet(name_or_pubkey,returning=returning) status=res.get('status') self.stat(status) @@ -386,13 +386,13 @@ class CLI(Logger): msg_s = datl[1] self.log(f'Composed msg to {name_or_pubkey}: {msg_s}') - msg_obj = self.komrade.msg( + msg_obj = self.comrad.msg( name_or_pubkey, msg_s ) self.log(f'Sent msg obj to {name_or_pubkey}: {msg_obj}') print() - self.stat(f'Message successfully sent to @{name_or_pubkey}.',komrade_name='Operator',pause=True) + self.stat(f'Message successfully sent to @{name_or_pubkey}.',comrad_name='Operator',pause=True) @@ -404,10 +404,10 @@ class CLI(Logger): ## get updates # this does login, msgs, and posts in one req time.sleep(0.25) - res = self.komrade.get_updates() + res = self.comrad.get_updates() #print(res.get('success')) if not res.get('success'): - self.stat(res.get('status'),komrade_name='') + self.stat(res.get('status'),comrad_name='') return self.stat('@Telephone: Patching you through to the @Operator. One moment please...') @@ -424,7 +424,7 @@ class CLI(Logger): # check logged in res_login=res.get('res_login',{}) if not self.do_login(res_login): return - self.stat('',res['status'],komrade_name='Operator',**statd) + self.stat('',res['status'],comrad_name='Operator',**statd) return res @@ -439,9 +439,9 @@ class CLI(Logger): # do_pause() meet_name = msg.data.get('meet_name') meet_uri = msg.data.get('meet') - qrstr=self.komrade.qr_str(meet_uri) + qrstr=self.comrad.qr_str(meet_uri) self.stat(f"Add @{meet_name}'s public key to your address book?",f'It will allow you and @{meet_name} to read and write encrypted messages to one another.') - do_adduser = input(f'''\n{self.komrade} [y/N]: ''') + do_adduser = input(f'''\n{self.comrad} [y/N]: ''') if do_adduser.strip().lower()=='y': import pyqrcode @@ -460,11 +460,11 @@ class CLI(Logger): # if not msg.data.get('returning'): # bit hacky way to tell if this has been returned or not! if 'has agreed' not in msg.data.get('txt',''): - self.stat('Send this komrade your public key as well?') - do_senduser = input(f'''\n{self.komrade} [y/N]: ''') + self.stat('Send this comrad your public key as well?') + do_senduser = input(f'''\n{self.comrad} [y/N]: ''') if do_senduser.strip().lower()=='y': - res = self.komrade.meet(meet_name,returning=True) + res = self.comrad.meet(meet_name,returning=True) if res.get('success'): self.log('res?!',res) self.stat('Returning the invitation:',f'"{res.get("res",{}).get("msg_d",{}).get("msg",{}).get("txt","[?]")}"',use_prefix=True) @@ -476,11 +476,11 @@ class CLI(Logger): clear_screen() print(msg) self.stat('Type "r" to reply to this message, "d" to delete it, or hit Enter to continue.',use_prefix=False) - do = input(f'\n{self.komrade}: ') + do = input(f'\n{self.comrad}: ') do=do.strip().lower() if do=='d': # self.print('del',msg.post_id) - res=self.komrade.delete_post(msg.post_id) + res=self.comrad.delete_post(msg.post_id) if res.get('success'): self.stat('Deleted message.') else: @@ -491,18 +491,18 @@ class CLI(Logger): return self.dm(msg.from_name) else: # seen this msg! - self.komrade.seen_msg(msg) + self.comrad.seen_msg(msg) pass def dms(self,dat=''): if self.with_required_login(): - msgs=self.komrade.messages() + msgs=self.comrad.messages() return self.read(msgs) def feed(self,dat=''): if self.with_required_login(): - posts=self.komrade.posts() + posts=self.comrad.posts() return self.read(posts) def read(self,msgs): @@ -547,12 +547,12 @@ class CLI(Logger): return self.log(f'Post written: {msg_s}') - msg_obj = self.komrade.post( + msg_obj = self.comrad.post( msg_s ) self.log(f'Posted: {msg_obj}') print() - self.stat(f'Post sent to @{WORLD_NAME}.',komrade_name='Operator',pause=True) + self.stat(f'Post sent to @{WORLD_NAME}.',comrad_name='Operator',pause=True) @@ -576,18 +576,18 @@ class CLI(Logger): nm=name if name else '?' self.status( - f'\n\n\n@{nm}: Uh yes hello, Operator? I would like to join Komrade, the socialist network. Could you patch me through?',clear=False) + f'\n\n\n@{nm}: Uh yes hello, Operator? I would like to join Comrad, the socialist network. Could you patch me through?',clear=False) while not name: - name=self.status(('name','@TheTelephone: Of course, Komrade...?\n@')).get('vals').get('name').strip() + name=self.status(('name','@TheTelephone: Of course, Comrad...?\n@')).get('vals').get('name').strip() self.print() self.status( - f'@TheTelephone: Of course, Komrade @{name}. A fine name.', + f'@TheTelephone: Of course, Comrad @{name}. A fine name.', '''@TheTelephone: However, I'm just the local operator who lives on your device; my only job is to communicate with the remote operator securely.''', - '''Komrade @TheOperator lives on the deep web. She's the one you want to speak with.''', + '''Comrad @TheOperator lives on the deep web. She's the one you want to speak with.''', None,{ART_OLDPHONE4},f'''@{name}: Hm, ok. Well, could you patch me through to the remote operator then?''', @@ -603,9 +603,9 @@ class CLI(Logger): self.status(None,{tw.indent(ART_KEY,' '*5)+'\n',True},3) #,clear=False,indent=10,pause=False) # convo self.status( - f'\n@{name}: Hello, Komrade @Keymaker? I would like help forging a new set of keys.', + f'\n@{name}: Hello, Comrad @Keymaker? I would like help forging a new set of keys.', - f'@Keymaker: Of course, Komrade @{name}.', + f'@Keymaker: Of course, Comrad @{name}.', ) self.status( @@ -643,7 +643,7 @@ class CLI(Logger): # None,{ART_KEY_PAIR2A+'\nA matching set of keys have been generated.'+'\n'}, # 'First, I have made a "public key" which you can share with anyone:', # f'(1) {pubkey.data_b64.decode()}', - # 'This key is a randomly-generated binary string, which acts as your "address" on Komrade.', + # 'This key is a randomly-generated binary string, which acts as your "address" on Comrad.', # 'With it, someone can write you an encrypted message which only you can read.' # ) # self.status( @@ -680,7 +680,7 @@ class CLI(Logger): 'And it looks like you haven\'t yet chosen a password.', 3,"Don't tell it to me! Never tell it to anyone.", "Ideally, don't even save it on your computer; just remember it, or write it down on paper.", - "Instead, whisper it to Komrade @Hasher, who scrambles information '1-way', like a blender.", + "Instead, whisper it to Comrad @Hasher, who scrambles information '1-way', like a blender.", ) res = self.status(None, @@ -743,7 +743,7 @@ class CLI(Logger): 'However, this means that you will be unable to log in to your account from any other device.', 'This limitation provides yet another level of hardware protection against network attacks.', 'However, you can always choose (not recommended) to the secret file with another device by a secure channel.', - 3,f'But, please excuse me Komrade @{name} -- I digress.' + 3,f'But, please excuse me Comrad @{name} -- I digress.' ) while not passphrase: diff --git a/komrade/cli/cli_curses.py b/comrad/cli/cli_curses.py similarity index 95% rename from komrade/cli/cli_curses.py rename to comrad/cli/cli_curses.py index 3500782..08abcb5 100644 --- a/komrade/cli/cli_curses.py +++ b/comrad/cli/cli_curses.py @@ -1,6 +1,6 @@ import os,sys; sys.path.append(os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')),'..'))) -from komrade import * -from komrade.backend import * +from comrad import * +from comrad.backend import * import art import textwrap as tw import curses,time,random @@ -124,7 +124,7 @@ class CLI(Logger): self.status(None,) def register(self,dat): - self.komrade = Komrade(self.name) + self.comrad = Comrad(self.name) self.persona.register() @@ -138,18 +138,18 @@ class CLI(Logger): nm=name if name else '?' self.status( - f'\n\n\n@{nm}: Uh yes hello, Operator? I would like to join Komrade, the socialist network. Could you patch me through?',clear=False) + f'\n\n\n@{nm}: Uh yes hello, Operator? I would like to join Comrad, the socialist network. Could you patch me through?',clear=False) while not name: - name=self.status(('name','@TheTelephone: Of course, Komrade...?\n@')).get('vals').get('name').strip() + name=self.status(('name','@TheTelephone: Of course, Comrad...?\n@')).get('vals').get('name').strip() print() self.status( - f'@TheTelephone: Of course, Komrade @{name}. A fine name.', + f'@TheTelephone: Of course, Comrad @{name}. A fine name.', '''@TheTelephone: However, I'm just the local operator who lives on your device; my only job is to communicate with the remote operator securely.''', - '''Komrade @TheOperator lives on the deep web. She's the one you want to speak with.''', + '''Comrad @TheOperator lives on the deep web. She's the one you want to speak with.''', None,{ART_OLDPHONE4},f'''@{name}: Hm, ok. Well, could you patch me through to the remote operator then?''', @@ -165,9 +165,9 @@ class CLI(Logger): self.status(None,{tw.indent(ART_KEY,' '*5)+'\n',True},3) #,clear=False,indent=10,pause=False) # convo self.status( - f'\n@{name}: Hello, Komrade @Keymaker? I would like help forging a new set of keys.', + f'\n@{name}: Hello, Comrad @Keymaker? I would like help forging a new set of keys.', - f'@Keymaker: Of course, Komrade @{name}.', + f'@Keymaker: Of course, Comrad @{name}.', ) self.status( @@ -205,7 +205,7 @@ class CLI(Logger): # None,{ART_KEY_PAIR2A+'\nA matching set of keys have been generated.'+'\n'}, # 'First, I have made a "public key" which you can share with anyone:', # f'(1) {pubkey.data_b64.decode()}', - # 'This key is a randomly-generated binary string, which acts as your "address" on Komrade.', + # 'This key is a randomly-generated binary string, which acts as your "address" on Comrad.', # 'With it, someone can write you an encrypted message which only you can read.' # ) # self.status( @@ -241,7 +241,7 @@ class CLI(Logger): 'And it looks like you haven\'t yet chosen a password.', 3,"Don't tell it to me! Never tell it to anyone.", "Ideally, don't even save it on your computer; just remember it, or write it down on paper.", - "Instead, whisper it to Komrade @Hasher, who scrambles information '1-way', like a blender.", + "Instead, whisper it to Comrad @Hasher, who scrambles information '1-way', like a blender.", ) res = self.status(None, @@ -304,7 +304,7 @@ class CLI(Logger): 'However, this means that you will be unable to log in to your account from any other device.', 'This limitation provides yet another level of hardware protection against network attacks.', 'However, you can always choose (not recommended) to the secret file with another device by a secure channel.', - 3,f'But, please excuse me Komrade @{name} -- I digress.' + 3,f'But, please excuse me Comrad @{name} -- I digress.' ) while not passphrase: diff --git a/komrade/cli/data/basemap.csv b/comrad/cli/data/basemap.csv similarity index 100% rename from komrade/cli/data/basemap.csv rename to comrad/cli/data/basemap.csv diff --git a/komrade/cli/data/world-countries.json b/comrad/cli/data/world-countries.json similarity index 100% rename from komrade/cli/data/world-countries.json rename to comrad/cli/data/world-countries.json diff --git a/komrade/cli/tab_completer.py b/comrad/cli/tab_completer.py similarity index 100% rename from komrade/cli/tab_completer.py rename to comrad/cli/tab_completer.py diff --git a/komrade/cli/worldmap.py b/comrad/cli/worldmap.py similarity index 100% rename from komrade/cli/worldmap.py rename to comrad/cli/worldmap.py diff --git a/komrade/cli/worldmap_curses.py b/comrad/cli/worldmap_curses.py similarity index 98% rename from komrade/cli/worldmap_curses.py rename to comrad/cli/worldmap_curses.py index 4063ba8..6233354 100644 --- a/komrade/cli/worldmap_curses.py +++ b/comrad/cli/worldmap_curses.py @@ -10,7 +10,7 @@ from shapely import ops import pyproj,math,os import rtree import curses,random,time -from komrade.utils import Logger +from comrad.utils import Logger import pandas as pd import numpy as np @@ -55,13 +55,13 @@ class Map(Logger): @property def width(self): return get_terminal_size().columns - 1 - # from komrade.constants import CLI_WIDTH + # from comrad.constants import CLI_WIDTH # return CLI_WIDTH @property def height(self): return get_terminal_size().lines - 1 - # from komrade.constants import CLI_HEIGHT + # from comrad.constants import CLI_HEIGHT # return CLI_HEIGHT def precompute_basemap(self,countries=[]): diff --git a/komrade/constants.py b/comrad/constants.py similarity index 96% rename from komrade/constants.py rename to comrad/constants.py index 3591785..eedc57c 100644 --- a/komrade/constants.py +++ b/comrad/constants.py @@ -12,10 +12,10 @@ OPERATOR_API_URL = OPERATOR_API_URL_TOR # paths import os PATH_USER_HOME = os.path.join(os.path.expanduser('~')) -PATH_KOMRADE = os.path.abspath(os.path.join(os.path.expanduser('~'),'komrade','data')) +PATH_KOMRADE = os.path.abspath(os.path.join(os.path.expanduser('~'),'comrad','data')) PATH_KOMRADE_KEYS = os.path.join(PATH_KOMRADE,'.keys') PATH_KOMRADE_DATA = os.path.join(PATH_KOMRADE,'.data') -PATH_KOMRADE_LIB = os.path.abspath(os.path.join(os.path.expanduser('~'),'komrade','lib')) +PATH_KOMRADE_LIB = os.path.abspath(os.path.join(os.path.expanduser('~'),'comrad','lib')) PATH_CRYPT_OP_KEYS = os.path.join(PATH_KOMRADE_KEYS,'.op.db.keys.crypt') PATH_CRYPT_OP_DATA = os.path.join(PATH_KOMRADE_DATA,'.op.db.data.crypt') @@ -27,7 +27,7 @@ PATH_CRYPT_CA_DATA = PATH_CRYPT_OP_DATA PATH_QRCODES = os.path.join(PATH_KOMRADE,'contacts') # PATH_SECRETS = os.path.join(PATH_KOMRADE,'.secrets') PATH_SECRETS = PATH_SUPER_SECRETS = os.path.join(PATH_USER_HOME,'.secrets') -PATH_SUPER_SECRET_OP_KEY = os.path.join(PATH_SUPER_SECRETS,'.komrade.op.key') +PATH_SUPER_SECRET_OP_KEY = os.path.join(PATH_SUPER_SECRETS,'.comrad.op.key') PATH_MAPS = os.path.join(PATH_KOMRADE,'maps') @@ -49,20 +49,20 @@ BSEP3=b'##########' OPERATOR_NAME = 'Operator' TELEPHONE_NAME = 'Telephone' -WORLD_NAME = 'komrades' +WORLD_NAME = 'comrads' PATH_REPO = os.path.abspath( os.path.join( os.path.dirname(__file__), '..' ) ) -PATH_GUI = os.path.join(PATH_REPO,'komrade','app') +PATH_GUI = os.path.join(PATH_REPO,'comrad','app') PATH_GUI_ASSETS = os.path.join(PATH_GUI,'assets') PATH_DEFAULT_AVATAR = os.path.join(PATH_GUI_ASSETS,'avatars','britney2.jpg') PATH_REPO = PATH_APP = os.path.abspath(os.path.dirname(__file__)) -# PATH_APP = os.path.join(PATH_REPO,'komrade') +# PATH_APP = os.path.join(PATH_REPO,'comrad') # PATH_BUILTIN_KEYCHAINS_ENCR = os.path.join(PATH_APP,'.builtin.keychains.encr') PATH_BUILTIN_KEYCHAIN = os.path.join(PATH_APP,'.builtin.keys') PATH_OMEGA_KEY = os.path.join(PATH_APP,'.omega.key') @@ -143,9 +143,9 @@ TELEPHONE = None -PATH_OPERATOR_WEB_KEYS_FILE = f'/home/ryan/www/website-komrade/pub' +PATH_OPERATOR_WEB_KEYS_FILE = f'/home/ryan/www/website-comrad/pub' PATH_OPERATOR_WEB_KEYS_URL = f'http://{KOMRADE_URL}/pub' -# PATH_OPERATOR_WEB_CONTACTS_DIR = '/home/ryan/www/website-komrade/.contacts' +# PATH_OPERATOR_WEB_CONTACTS_DIR = '/home/ryan/www/website-comrad/.contacts' # PATH_OPERATOR_WEB_CONTACT_OP_URL = f'http://{KOMRADE_URL}/.contacts/TheOperator.png' # PATH_OPERATOR_WEB_CONTACT_PH_URL = f'http://{KOMRADE_URL}/.contacts/TheTelephone.png' diff --git a/komrade/utils.py b/comrad/utils.py similarity index 98% rename from komrade/utils.py rename to comrad/utils.py index 7c88626..9828d30 100644 --- a/komrade/utils.py +++ b/comrad/utils.py @@ -1,6 +1,6 @@ -class KomradeException(Exception): pass +class ComradException(Exception): pass -# make sure komrade is on path +# make sure comrad is on path import sys,os sys.path.append(os.path.dirname(__file__)) @@ -54,7 +54,7 @@ def log(*x,off=False,**y): with open(path_log,'a') as of: of.write('\n'+tolog+'\n') -from komrade.constants import CLI_WIDTH +from comrad.constants import CLI_WIDTH def wrapp(*msgs,prefix='',min_prefix_len=0,width=CLI_WIDTH,use_prefix=False): blank=' '*(len(prefix) if len(prefix)>min_prefix_len else min_prefix_len) total_msg=[] @@ -112,7 +112,7 @@ def dict_format(d, tab=0): return ''.join(s) import inspect,time -from komrade.constants import * +from comrad.constants import * class Logger(object): def __init__(self,callbacks={}): self._callbacks=callbacks @@ -288,7 +288,7 @@ def hashish(binary_data): def create_secret(): if not os.path.exists(PATH_CRYPT_SECRET): secret = get_random_binary_id() - from komrade.backend.keymaker import make_key_discreet + from comrad.backend.keymaker import make_key_discreet print('shhh! creating secret:',make_key_discreet(secret)) with open(PATH_CRYPT_SECRET,'wb') as of: of.write(secret) diff --git a/docs/comparisons.ipynb b/docs/comparisons.ipynb index 942eeed..a6995f2 100644 --- a/docs/comparisons.ipynb +++ b/docs/comparisons.ipynb @@ -98,7 +98,7 @@ " \n", " \n", " \n", - " *[Komrade](http://komrade.app)*\n", + " *[Comrad](http://comrad.app)*\n", " *Social network*\n", " *Twitter*\n", " ❌ *No (central server on Tor)*\n", @@ -192,7 +192,7 @@ "text/plain": [ " What is it? \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* *Social network* \n", + "*[Comrad](http://comrad.app)* *Social network* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) Social network \n", "[Diaspora](https://diasporafoundation.org/) Social network \n", "[Mastodon](https://joinmastodon.org/) Social network \n", @@ -203,7 +203,7 @@ "\n", " Kind of like... \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* *Twitter* \n", + "*[Comrad](http://comrad.app)* *Twitter* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) Twitter / Facebook \n", "[Diaspora](https://diasporafoundation.org/) Twitter \n", "[Mastodon](https://joinmastodon.org/) Twitter \n", @@ -214,7 +214,7 @@ "\n", " Decentralized? (P2P?) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ❌ *No (central server on Tor)* \n", + "*[Comrad](http://comrad.app)* ❌ *No (central server on Tor)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ Fully (P2P) \n", "[Diaspora](https://diasporafoundation.org/) ⭕ Halfway (federated) \n", "[Mastodon](https://joinmastodon.org/) ⭕ Halfway (federated) \n", @@ -225,7 +225,7 @@ "\n", " Anonymous? (IP hidden?) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ *Yes (everything routed via Tor)* \n", + "*[Comrad](http://comrad.app)* ✔️ *Yes (everything routed via Tor)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ❌ No (P2P reveals IP; friend networks public) \n", "[Diaspora](https://diasporafoundation.org/) ⭕ No (unless via Tor Browser) \n", "[Mastodon](https://joinmastodon.org/) ⭕ No (unless via Tor Browser) \n", @@ -236,7 +236,7 @@ "\n", " Confidential? (100% E2EE?) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ *Yes (100% E2EE)* \n", + "*[Comrad](http://comrad.app)* ✔️ *Yes (100% E2EE)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ⭕ Partly (private E2EE, public unencrypted) \n", "[Diaspora](https://diasporafoundation.org/) ❌ No (unencrypted?) \n", "[Mastodon](https://joinmastodon.org/) ❌ No (unencrypted?) \n", @@ -247,7 +247,7 @@ "\n", " Data robustness? \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ⭕ *Minimal server (deleted ASAP)* \n", + "*[Comrad](http://comrad.app)* ⭕ *Minimal server (deleted ASAP)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ Distributed across friend networks? \n", "[Diaspora](https://diasporafoundation.org/) ✔️ \n", "[Mastodon](https://joinmastodon.org/) ✔️ \n", @@ -258,7 +258,7 @@ "\n", " Identity verification? \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ *Yes (central public key repository)* \n", + "*[Comrad](http://comrad.app)* ✔️ *Yes (central public key repository)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ Yes? (federated key exchange?) \n", "[Diaspora](https://diasporafoundation.org/) ? \n", "[Mastodon](https://joinmastodon.org/) ? \n", @@ -269,7 +269,7 @@ "\n", " Requires invitation/server? \n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ *No (works like twitter)* \n", + "*[Comrad](http://comrad.app)* ✔️ *No (works like twitter)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ❌ Yes (need initial pub) \n", "[Diaspora](https://diasporafoundation.org/) ❌ Yes (need 'pod' server) \n", "[Mastodon](https://joinmastodon.org/) ❌ Yes (need 'instance' server) \n", @@ -339,7 +339,7 @@ " \n", " \n", " \n", - " *[Komrade](http://komrade.app)*\n", + " *[Comrad](http://comrad.app)*\n", " ✔️\n", " ❌?\n", " ✔️\n", @@ -433,7 +433,7 @@ "text/plain": [ " DM users (E2EE) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ \n", + "*[Comrad](http://comrad.app)* ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ \n", "[Diaspora](https://diasporafoundation.org/) ❌? \n", "[Mastodon](https://joinmastodon.org/) ❌? \n", @@ -444,7 +444,7 @@ "\n", " Group chat (E2EE) Post to world \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ❌? ✔️ \n", + "*[Comrad](http://comrad.app)* ❌? ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ❌? ❌ \n", "[Diaspora](https://diasporafoundation.org/) ❌? ❌? \n", "[Mastodon](https://joinmastodon.org/) ❌? ❌? \n", @@ -455,7 +455,7 @@ "\n", " Post to friends/ties \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ \n", + "*[Comrad](http://comrad.app)* ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ \n", "[Diaspora](https://diasporafoundation.org/) ✔️ \n", "[Mastodon](https://joinmastodon.org/) ✔️ \n", @@ -466,7 +466,7 @@ "\n", " Symmetric ties (friends) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ \n", + "*[Comrad](http://comrad.app)* ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ \n", "[Diaspora](https://diasporafoundation.org/) ❌ \n", "[Mastodon](https://joinmastodon.org/) ❌ \n", @@ -477,7 +477,7 @@ "\n", " Asymmetric ties (followers) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ \n", + "*[Comrad](http://comrad.app)* ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ \n", "[Diaspora](https://diasporafoundation.org/) ✔️ \n", "[Mastodon](https://joinmastodon.org/) ✔️ \n", @@ -488,7 +488,7 @@ "\n", " Like posts Repost posts \n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️? ❌ \n", + "*[Comrad](http://comrad.app)* ✔️? ❌ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ ❌? \n", "[Diaspora](https://diasporafoundation.org/) ✔️ ✔️? \n", "[Mastodon](https://joinmastodon.org/) ✔️ ✔️? \n", @@ -593,7 +593,7 @@ " \n", " \n", " \n", - " *[Komrade](http://komrade.app)*\n", + " *[Comrad](http://comrad.app)*\n", " *Social network*\n", " *Twitter*\n", " ❌ *No (central server on Tor)*\n", @@ -751,7 +751,7 @@ "text/plain": [ " What is it? \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* *Social network* \n", + "*[Comrad](http://comrad.app)* *Social network* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) Social network \n", "[Diaspora](https://diasporafoundation.org/) Social network \n", "[Mastodon](https://joinmastodon.org/) Social network \n", @@ -762,7 +762,7 @@ "\n", " Kind of like... \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* *Twitter* \n", + "*[Comrad](http://comrad.app)* *Twitter* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) Twitter / Facebook \n", "[Diaspora](https://diasporafoundation.org/) Twitter \n", "[Mastodon](https://joinmastodon.org/) Twitter \n", @@ -773,7 +773,7 @@ "\n", " Decentralized? (P2P?) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ❌ *No (central server on Tor)* \n", + "*[Comrad](http://comrad.app)* ❌ *No (central server on Tor)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ Fully (P2P) \n", "[Diaspora](https://diasporafoundation.org/) ⭕ Halfway (federated) \n", "[Mastodon](https://joinmastodon.org/) ⭕ Halfway (federated) \n", @@ -784,7 +784,7 @@ "\n", " Anonymous? (IP hidden?) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ *Yes (everything routed via Tor)* \n", + "*[Comrad](http://comrad.app)* ✔️ *Yes (everything routed via Tor)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ❌ No (P2P reveals IP; friend networks public) \n", "[Diaspora](https://diasporafoundation.org/) ⭕ No (unless via Tor Browser) \n", "[Mastodon](https://joinmastodon.org/) ⭕ No (unless via Tor Browser) \n", @@ -795,7 +795,7 @@ "\n", " Confidential? (100% E2EE?) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ *Yes (100% E2EE)* \n", + "*[Comrad](http://comrad.app)* ✔️ *Yes (100% E2EE)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ⭕ Partly (private E2EE, public unencrypted) \n", "[Diaspora](https://diasporafoundation.org/) ❌ No (unencrypted?) \n", "[Mastodon](https://joinmastodon.org/) ❌ No (unencrypted?) \n", @@ -806,7 +806,7 @@ "\n", " Data robustness? \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ⭕ *Minimal server (deleted ASAP)* \n", + "*[Comrad](http://comrad.app)* ⭕ *Minimal server (deleted ASAP)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ Distributed across friend networks? \n", "[Diaspora](https://diasporafoundation.org/) ✔️ \n", "[Mastodon](https://joinmastodon.org/) ✔️ \n", @@ -817,7 +817,7 @@ "\n", " Identity verification? \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ *Yes (central public key repository)* \n", + "*[Comrad](http://comrad.app)* ✔️ *Yes (central public key repository)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ Yes? (federated key exchange?) \n", "[Diaspora](https://diasporafoundation.org/) ? \n", "[Mastodon](https://joinmastodon.org/) ? \n", @@ -828,7 +828,7 @@ "\n", " Requires invitation/server? \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ *No (works like twitter)* \n", + "*[Comrad](http://comrad.app)* ✔️ *No (works like twitter)* \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ❌ Yes (need initial pub) \n", "[Diaspora](https://diasporafoundation.org/) ❌ Yes (need 'pod' server) \n", "[Mastodon](https://joinmastodon.org/) ❌ Yes (need 'instance' server) \n", @@ -839,7 +839,7 @@ "\n", " DM users (E2EE) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ \n", + "*[Comrad](http://comrad.app)* ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ \n", "[Diaspora](https://diasporafoundation.org/) ❌? \n", "[Mastodon](https://joinmastodon.org/) ❌? \n", @@ -850,7 +850,7 @@ "\n", " Group chat (E2EE) Post to world \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ❌? ✔️ \n", + "*[Comrad](http://comrad.app)* ❌? ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ❌? ❌ \n", "[Diaspora](https://diasporafoundation.org/) ❌? ❌? \n", "[Mastodon](https://joinmastodon.org/) ❌? ❌? \n", @@ -861,7 +861,7 @@ "\n", " Post to friends/ties \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ \n", + "*[Comrad](http://comrad.app)* ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ \n", "[Diaspora](https://diasporafoundation.org/) ✔️ \n", "[Mastodon](https://joinmastodon.org/) ✔️ \n", @@ -872,7 +872,7 @@ "\n", " Symmetric ties (friends) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ \n", + "*[Comrad](http://comrad.app)* ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ \n", "[Diaspora](https://diasporafoundation.org/) ❌ \n", "[Mastodon](https://joinmastodon.org/) ❌ \n", @@ -883,7 +883,7 @@ "\n", " Asymmetric ties (followers) \\\n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️ \n", + "*[Comrad](http://comrad.app)* ✔️ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ \n", "[Diaspora](https://diasporafoundation.org/) ✔️ \n", "[Mastodon](https://joinmastodon.org/) ✔️ \n", @@ -894,7 +894,7 @@ "\n", " Like posts Repost posts \n", "Other cool thing \n", - "*[Komrade](http://komrade.app)* ✔️? ❌ \n", + "*[Comrad](http://comrad.app)* ✔️? ❌ \n", "[Secure Scuttlebutt](https://scuttlebutt.nz/) ✔️ ❌? \n", "[Diaspora](https://diasporafoundation.org/) ✔️ ✔️? \n", "[Mastodon](https://joinmastodon.org/) ✔️ ✔️? \n", @@ -921,7 +921,7 @@ { "data": { "text/plain": [ - "(['*[Komrade](http://komrade.app)*',\n", + "(['*[Comrad](http://comrad.app)*',\n", " '[Secure Scuttlebutt](https://scuttlebutt.nz/)',\n", " '[Diaspora](https://diasporafoundation.org/)',\n", " '[Mastodon](https://joinmastodon.org/)',\n", @@ -1004,7 +1004,7 @@ " \n", " \n", " \n", - " Komrade\n", + " Comrad\n", " *Social network*\n", " *Twitter*\n", " ❌ *No (central server on Tor)*\n", @@ -1161,7 +1161,7 @@ ], "text/plain": [ " What is it? Kind of like... \\\n", - "Komrade *Social network* *Twitter* \n", + "Comrad *Social network* *Twitter* \n", "SecureScuttlebutt Social network Twitter / Facebook \n", "Diaspora Social network Twitter \n", "Mastodon Social network Twitter \n", @@ -1171,7 +1171,7 @@ "Signal Messenger WhatsApp \n", "\n", " Decentralized? (P2P?) \\\n", - "Komrade ❌ *No (central server on Tor)* \n", + "Comrad ❌ *No (central server on Tor)* \n", "SecureScuttlebutt ✔️ Fully (P2P) \n", "Diaspora ⭕ Halfway (federated) \n", "Mastodon ⭕ Halfway (federated) \n", @@ -1181,7 +1181,7 @@ "Signal ❌ No? \n", "\n", " Anonymous? (IP hidden?) \\\n", - "Komrade ✔️ *Yes (everything routed via Tor)* \n", + "Comrad ✔️ *Yes (everything routed via Tor)* \n", "SecureScuttlebutt ❌ No (P2P reveals IP; friend networks public) \n", "Diaspora ⭕ No (unless via Tor Browser) \n", "Mastodon ⭕ No (unless via Tor Browser) \n", @@ -1191,7 +1191,7 @@ "Signal ❌ No \n", "\n", " Confidential? (100% E2EE?) \\\n", - "Komrade ✔️ *Yes (100% E2EE)* \n", + "Comrad ✔️ *Yes (100% E2EE)* \n", "SecureScuttlebutt ⭕ Partly (private E2EE, public unencrypted) \n", "Diaspora ❌ No (unencrypted?) \n", "Mastodon ❌ No (unencrypted?) \n", @@ -1201,7 +1201,7 @@ "Signal ✔️ Yes (E2EE, and audited) \n", "\n", " Data robustness? \\\n", - "Komrade ⭕ *Minimal server (deleted ASAP)* \n", + "Comrad ⭕ *Minimal server (deleted ASAP)* \n", "SecureScuttlebutt ✔️ Distributed across friend networks? \n", "Diaspora ✔️ \n", "Mastodon ✔️ \n", @@ -1211,7 +1211,7 @@ "Signal ? \n", "\n", " Identity verification? \\\n", - "Komrade ✔️ *Yes (central public key repository)* \n", + "Comrad ✔️ *Yes (central public key repository)* \n", "SecureScuttlebutt ✔️ Yes? (federated key exchange?) \n", "Diaspora ? \n", "Mastodon ? \n", @@ -1221,7 +1221,7 @@ "Signal ? \n", "\n", " Requires invitation/server? DM users (E2EE) \\\n", - "Komrade ✔️ *No (works like twitter)* ✔️ \n", + "Comrad ✔️ *No (works like twitter)* ✔️ \n", "SecureScuttlebutt ❌ Yes (need initial pub) ✔️ \n", "Diaspora ❌ Yes (need 'pod' server) ❌? \n", "Mastodon ❌ Yes (need 'instance' server) ❌? \n", @@ -1231,7 +1231,7 @@ "Signal ✔️ ✔️ \n", "\n", " Group chat (E2EE) Post to world Post to friends/ties \\\n", - "Komrade ❌? ✔️ ✔️ \n", + "Comrad ❌? ✔️ ✔️ \n", "SecureScuttlebutt ❌? ❌ ✔️ \n", "Diaspora ❌? ❌? ✔️ \n", "Mastodon ❌? ❌? ✔️ \n", @@ -1241,7 +1241,7 @@ "Signal ✔️ ❌ ❌ \n", "\n", " Symmetric ties (friends) Asymmetric ties (followers) \\\n", - "Komrade ✔️ ✔️ \n", + "Comrad ✔️ ✔️ \n", "SecureScuttlebutt ✔️ ✔️ \n", "Diaspora ❌ ✔️ \n", "Mastodon ❌ ✔️ \n", @@ -1251,7 +1251,7 @@ "Signal ✔️ ❌ \n", "\n", " Like posts Repost posts \n", - "Komrade ✔️? ❌ \n", + "Comrad ✔️? ❌ \n", "SecureScuttlebutt ✔️ ❌? \n", "Diaspora ✔️ ✔️? \n", "Mastodon ✔️ ✔️? \n", @@ -1331,7 +1331,7 @@ " \n", " \n", " \n", - " Komrade\n", + " Comrad\n", " *Social network*\n", " *Twitter*\n", " ❌ *No (central server on Tor)*\n", @@ -1488,7 +1488,7 @@ ], "text/plain": [ " What is it? Kind of like... \\\n", - "Komrade *Social network* *Twitter* \n", + "Comrad *Social network* *Twitter* \n", "SecureScuttlebutt Social network Twitter / Facebook \n", "Diaspora Social network Twitter \n", "Mastodon Social network Twitter \n", @@ -1498,7 +1498,7 @@ "Signal Messenger WhatsApp \n", "\n", " Decentralized? (P2P?) \\\n", - "Komrade ❌ *No (central server on Tor)* \n", + "Comrad ❌ *No (central server on Tor)* \n", "SecureScuttlebutt ✔️ Fully (P2P) \n", "Diaspora ⭕ Halfway (federated) \n", "Mastodon ⭕ Halfway (federated) \n", @@ -1508,7 +1508,7 @@ "Signal ❌ No? \n", "\n", " Anonymous? (IP hidden?) \\\n", - "Komrade ✔️ *Yes (everything routed via Tor)* \n", + "Comrad ✔️ *Yes (everything routed via Tor)* \n", "SecureScuttlebutt ❌ No (P2P reveals IP; friend networks public) \n", "Diaspora ⭕ No (unless via Tor Browser) \n", "Mastodon ⭕ No (unless via Tor Browser) \n", @@ -1518,7 +1518,7 @@ "Signal ❌ No \n", "\n", " Confidential? (100% E2EE?) \\\n", - "Komrade ✔️ *Yes (100% E2EE)* \n", + "Comrad ✔️ *Yes (100% E2EE)* \n", "SecureScuttlebutt ⭕ Partly (private E2EE, public unencrypted) \n", "Diaspora ❌ No (unencrypted?) \n", "Mastodon ❌ No (unencrypted?) \n", @@ -1528,7 +1528,7 @@ "Signal ✔️ Yes (E2EE, and audited) \n", "\n", " Data robustness? \\\n", - "Komrade ⭕ *Minimal server (deleted ASAP)* \n", + "Comrad ⭕ *Minimal server (deleted ASAP)* \n", "SecureScuttlebutt ✔️ Distributed across friend networks? \n", "Diaspora ✔️ \n", "Mastodon ✔️ \n", @@ -1538,7 +1538,7 @@ "Signal ? \n", "\n", " Identity verification? \\\n", - "Komrade ✔️ *Yes (central public key repository)* \n", + "Comrad ✔️ *Yes (central public key repository)* \n", "SecureScuttlebutt ✔️ Yes? (federated key exchange?) \n", "Diaspora ? \n", "Mastodon ? \n", @@ -1548,7 +1548,7 @@ "Signal ? \n", "\n", " Requires invitation/server? DM users (E2EE) \\\n", - "Komrade ✔️ *No (works like twitter)* ✔️ \n", + "Comrad ✔️ *No (works like twitter)* ✔️ \n", "SecureScuttlebutt ❌ Yes (need initial pub) ✔️ \n", "Diaspora ❌ Yes (need 'pod' server) ❌? \n", "Mastodon ❌ Yes (need 'instance' server) ❌? \n", @@ -1558,7 +1558,7 @@ "Signal ✔️ ✔️ \n", "\n", " Group chat (E2EE) Post to world Post to friends/ties \\\n", - "Komrade ❌? ✔️ ✔️ \n", + "Comrad ❌? ✔️ ✔️ \n", "SecureScuttlebutt ❌? ❌ ✔️ \n", "Diaspora ❌? ❌? ✔️ \n", "Mastodon ❌? ❌? ✔️ \n", @@ -1568,7 +1568,7 @@ "Signal ✔️ ❌ ❌ \n", "\n", " Symmetric ties (friends) Asymmetric ties (followers) \\\n", - "Komrade ✔️ ✔️ \n", + "Comrad ✔️ ✔️ \n", "SecureScuttlebutt ✔️ ✔️ \n", "Diaspora ❌ ✔️ \n", "Mastodon ❌ ✔️ \n", @@ -1578,7 +1578,7 @@ "Signal ✔️ ❌ \n", "\n", " Like posts Repost posts \n", - "Komrade ✔️? ❌ \n", + "Comrad ✔️? ❌ \n", "SecureScuttlebutt ✔️ ❌? \n", "Diaspora ✔️ ✔️? \n", "Mastodon ✔️ ✔️? \n", @@ -1650,7 +1650,7 @@ " \n", " \n", " \n", - " Komrade\n", + " Comrad\n", " 0\n", " 1\n", " 1\n", @@ -1791,7 +1791,7 @@ ], "text/plain": [ " Decentralized? (P2P?) Anonymous? (IP hidden?) \\\n", - "Komrade 0 1 \n", + "Comrad 0 1 \n", "SecureScuttlebutt 1 0 \n", "Diaspora 0 0 \n", "Mastodon 0 0 \n", @@ -1801,7 +1801,7 @@ "Signal 0 0 \n", "\n", " Confidential? (100% E2EE?) Data robustness? \\\n", - "Komrade 1 0 \n", + "Comrad 1 0 \n", "SecureScuttlebutt 0 1 \n", "Diaspora 0 1 \n", "Mastodon 0 1 \n", @@ -1811,7 +1811,7 @@ "Signal 1 0 \n", "\n", " Identity verification? Requires invitation/server? \\\n", - "Komrade 1 1 \n", + "Comrad 1 1 \n", "SecureScuttlebutt 1 0 \n", "Diaspora 0 0 \n", "Mastodon 0 0 \n", @@ -1821,7 +1821,7 @@ "Signal 0 1 \n", "\n", " DM users (E2EE) Group chat (E2EE) Post to world \\\n", - "Komrade 1 0 1 \n", + "Comrad 1 0 1 \n", "SecureScuttlebutt 1 0 0 \n", "Diaspora 0 0 0 \n", "Mastodon 0 0 0 \n", @@ -1831,7 +1831,7 @@ "Signal 1 1 0 \n", "\n", " Post to friends/ties Symmetric ties (friends) \\\n", - "Komrade 1 1 \n", + "Comrad 1 1 \n", "SecureScuttlebutt 1 1 \n", "Diaspora 1 0 \n", "Mastodon 1 0 \n", @@ -1841,7 +1841,7 @@ "Signal 0 1 \n", "\n", " Asymmetric ties (followers) Like posts Repost posts \n", - "Komrade 1 1 0 \n", + "Comrad 1 1 0 \n", "SecureScuttlebutt 1 1 0 \n", "Diaspora 1 1 1 \n", "Mastodon 1 1 1 \n", @@ -1931,7 +1931,7 @@ " \n", " \n", " \n", - " Komrade\n", + " Comrad\n", " SecureScuttlebutt\n", " Diaspora\n", " Mastodon\n", @@ -1943,7 +1943,7 @@ " \n", " \n", " \n", - " Komrade\n", + " Comrad\n", " 0.000000\n", " 2.449490\n", " 3.000000\n", @@ -2035,8 +2035,8 @@ "" ], "text/plain": [ - " Komrade SecureScuttlebutt Diaspora Mastodon Matrix \\\n", - "Komrade 0.000000 2.449490 3.000000 3.000000 2.449490 \n", + " Comrad SecureScuttlebutt Diaspora Mastodon Matrix \\\n", + "Comrad 0.000000 2.449490 3.000000 3.000000 2.449490 \n", "SecureScuttlebutt 2.449490 0.000000 2.236068 2.236068 2.449490 \n", "Diaspora 3.000000 2.236068 0.000000 0.000000 3.000000 \n", "Mastodon 3.000000 2.236068 0.000000 0.000000 3.000000 \n", @@ -2046,7 +2046,7 @@ "Signal 2.645751 3.000000 3.162278 3.162278 1.732051 \n", "\n", " BriarMessenger CabalChat Signal \n", - "Komrade 2.645751 3.316625 2.645751 \n", + "Comrad 2.645751 3.316625 2.645751 \n", "SecureScuttlebutt 2.645751 2.645751 3.000000 \n", "Diaspora 3.162278 2.449490 3.162278 \n", "Mastodon 3.162278 2.449490 3.162278 \n", @@ -2289,10 +2289,10 @@ " \n", " \n", " \n", - " Komrade\n", + " Comrad\n", " -108.958252\n", " -208.941483\n", - " Komrade\n", + " Comrad\n", " \n", " \n", " SecureScuttlebutt\n", @@ -2342,7 +2342,7 @@ ], "text/plain": [ " tsne_V1 tsne_V2 label\n", - "Komrade -108.958252 -208.941483 Komrade\n", + "Comrad -108.958252 -208.941483 Comrad\n", "SecureScuttlebutt 186.487061 -98.103249 SecureScuttlebutt\n", "Diaspora 19.245832 160.858780 Diaspora\n", "Mastodon 170.658829 75.445076 Mastodon\n", @@ -2389,18 +2389,18 @@ }, "data": [ { - "hovertemplate": "color=Komrade
0=%{x}
1=%{y}
text=%{text}", - "legendgroup": "Komrade", + "hovertemplate": "color=Comrad
0=%{x}
1=%{y}
text=%{text}", + "legendgroup": "Comrad", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "markers+text", - "name": "Komrade", + "name": "Comrad", "orientation": "v", "showlegend": true, "text": [ - "Komrade" + "Comrad" ], "type": "scatter", "x": [ @@ -3695,7 +3695,7 @@ } }, "text/html": [ - "