2
0
mirror of https://github.com/ComradCollective/Comrad synced 2024-11-05 21:20:51 +00:00
Comrad/komrade/constants.py

168 lines
5.5 KiB
Python
Raw Normal View History

2020-09-05 16:26:37 +00:00
# addresses
2020-09-05 19:00:29 +00:00
KOMRADE_URL = 'komrade.app'
KOMRADE_ONION = 'u7spnj3dmwumzoa4.onion'
KOMRADE_ONION2 = 'rwg4zcnpwshv4laq.onion' #'128.232.229.63' #'komrade.app'
2020-09-07 17:27:46 +00:00
# OPERATOR_API_URL = f'http://{KOMRADE_ONION}/op/'
OPERATOR_API_URL = f'http://{KOMRADE_URL}/op/'
2020-09-05 16:26:37 +00:00
# paths
import os
PATH_KOMRADE = os.path.abspath(os.path.join(os.path.expanduser('~'),'.komrade'))
2020-09-06 09:25:13 +00:00
PATH_KOMRADE_KEYS = os.path.join(PATH_KOMRADE,'.keys')
PATH_KOMRADE_DATA = os.path.join(PATH_KOMRADE,'.data')
2020-09-08 07:13:48 +00:00
2020-09-06 09:25:13 +00:00
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.encr')
2020-09-06 19:24:36 +00:00
# PATH_CRYPT_CA_KEYS = os.path.join(PATH_KOMRADE_KEYS,'.ca.db.keys.crypt')
# PATH_CRYPT_CA_DATA = os.path.join(PATH_KOMRADE_DATA,'.ca.db.data.encr')
PATH_CRYPT_CA_KEYS = PATH_CRYPT_OP_KEYS
PATH_CRYPT_CA_DATA = PATH_CRYPT_OP_DATA
2020-09-08 07:13:48 +00:00
PATH_QRCODES = os.path.join(PATH_KOMRADE,'.contacts')
2020-09-12 20:46:49 +00:00
PATH_SECRETS = os.path.join(PATH_KOMRADE,'.secret')
for x in [PATH_KOMRADE,PATH_KOMRADE_DATA,PATH_KOMRADE_KEYS,PATH_QRCODES,PATH_SECRETS]:
2020-09-08 07:13:48 +00:00
if not os.path.exists(x):
os.makedirs(x)
2020-09-05 16:26:37 +00:00
2020-09-10 09:00:11 +00:00
CRYPT_USE_SECRET = True
2020-09-12 20:46:49 +00:00
PATH_CRYPT_SECRET = os.path.join(PATH_SECRETS,'.salt')
PATH_CRYPT_SECRET_KEY = os.path.join(PATH_SECRETS,'.key')
2020-09-10 09:00:11 +00:00
2020-09-05 16:26:37 +00:00
# etc
BSEP=b'||||||||||'
BSEP2=b'@@@@@@@@@@'
BSEP3=b'##########'
2020-09-05 22:06:48 +00:00
2020-09-12 18:18:37 +00:00
OPERATOR_NAME = 'Operator'
TELEPHONE_NAME = 'Telephone'
2020-09-12 16:47:23 +00:00
WORLD_NAME = 'komrades'
2020-09-06 15:32:12 +00:00
PATH_APP = os.path.abspath(os.path.dirname(__file__))
# 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')
# PATH_BUILTIN_KEYCHAINS_DECR = os.path.join(PATH_APP,'.builtin.keychains.decr')
2020-09-06 06:50:23 +00:00
2020-09-05 22:06:48 +00:00
2020-09-05 16:26:37 +00:00
# key names
KEYNAMES = [
'pubkey','privkey','adminkey',
'pubkey_encr','privkey_encr','adminkey_encr',
'pubkey_decr','privkey_decr','adminkey_decr',
'pubkey_encr_encr','privkey_encr_encr','adminkey_encr_encr',
'pubkey_encr_decr','privkey_encr_decr','adminkey_encr_decr',
'pubkey_decr_encr','privkey_decr_encr','adminkey_decr_encr',
'pubkey_decr_decr','privkey_decr_decr','adminkey_decr_decr'
]
2020-09-05 21:11:42 +00:00
2020-09-06 13:07:27 +00:00
OPERATOR_INTERCEPT_MESSAGE = "If you'd like to make a call, please hang up and try again. If you need help, hang up, and then dial your operator."
# KEYMAKER_DEFAULT_KEYS_TO_SAVE = ['pubkey_encr', 'privkey_encr', 'adminkey_encr']
2020-09-06 15:14:55 +00:00
# KEYMAKER_DEFAULT_KEYS_TO_RETURN = ['pubkey_decr_encr', 'privkey_decr_encr', 'adminkey_decr_encr']
# defaults oriented to Callers
2020-09-08 09:14:42 +00:00
# kept on server
KEYMAKER_DEFAULT_KEYS_TO_SAVE_ON_SERVER = ['pubkey'] # stored under QR URI
# kept on client
2020-09-10 14:20:08 +00:00
KEYMAKER_DEFAULT_KEYS_TO_SAVE_ON_CLIENT = ['privkey_encr','privkey_decr']
2020-09-08 09:14:42 +00:00
#'pubkey' # as QR
2020-09-10 14:20:08 +00:00
# 'privkey_encr',
# 'adminkey_encr',
# 'privkey_decr'],
2020-09-09 15:41:55 +00:00
#'privkey_decr_encr',
#'privkey_decr_decr',
2020-09-10 14:20:08 +00:00
# 'adminkey_decr_encr',
# 'adminkey_decr_decr']
2020-09-10 14:20:08 +00:00
# KEYMAKER_DEFAULT_KEYS_TO_GEN = ['pubkey','privkey','adminkey',
# 'pubkey_decr','privkey_decr', 'adminkey_decr']
2020-09-10 14:21:04 +00:00
KEYMAKER_DEFAULT_KEYS_TO_GEN = ['pubkey','privkey']
2020-09-08 09:17:09 +00:00
KEYMAKER_DEFAULT_KEYS_TO_GEN += KEYMAKER_DEFAULT_KEYS_TO_SAVE_ON_SERVER
KEYMAKER_DEFAULT_KEYS_TO_GEN += KEYMAKER_DEFAULT_KEYS_TO_SAVE_ON_CLIENT
2020-09-06 15:14:55 +00:00
KEYMAKER_DEFAULT_KEYS_TO_GEN = list(set(KEYMAKER_DEFAULT_KEYS_TO_GEN))
KEYMAKER_DEFAULT_KEYS_TO_GEN.sort(key=lambda x: x.count('_'))
2020-09-06 14:45:40 +00:00
2020-09-09 18:31:36 +00:00
# print('KEYMAKER_DEFAULT_KEYS_TO_SAVE_ON_SERVER',KEYMAKER_DEFAULT_KEYS_TO_SAVE_ON_SERVER)
# print('KEYMAKER_DEFAULT_KEYS_TO_SAVE_ON_CLIENT',KEYMAKER_DEFAULT_KEYS_TO_SAVE_ON_CLIENT)
# print('KEYMAKER_DEFAULT_KEYS_TO_GEN',KEYMAKER_DEFAULT_KEYS_TO_GEN)
2020-09-06 13:07:27 +00:00
KEY_TYPE_ASYMMETRIC_PUBKEY = 'asymmetric_pubkey'
KEY_TYPE_ASYMMETRIC_PRIVKEY = 'asymmetric_privkey'
KEY_TYPE_SYMMETRIC_WITHOUT_PASSPHRASE = 'symmetric_key_without_passphrase'
KEY_TYPE_SYMMETRIC_WITH_PASSPHRASE = 'symmetric_key_with_passphrase'
ENCRYPTED_KEY = 'encrypted_key'
2020-09-12 14:32:03 +00:00
KEYMAKER_DEFAULT_ALL_KEY_NAMES = KEYNAMES
WHY_MSG = 'What is the password of memory for this account? '
2020-09-06 15:47:45 +00:00
2020-09-07 16:26:03 +00:00
TELEPHONE_KEYCHAIN = None
OPERATOR_KEYCHAIN = None
2020-09-10 09:54:47 +00:00
WORLD_KEYCHAIN = None
2020-09-07 17:11:52 +00:00
OMEGA_KEY = None
OPERATOR = None
TELEPHONE = None
PATH_OPERATOR_WEB_KEYS_FILE = f'/home/ryan/www/website-komrade/.builtin.keys'
PATH_OPERATOR_WEB_KEYS_URL = f'http://{KOMRADE_URL}/.builtin.keys'
2020-09-08 07:26:49 +00:00
PATH_OPERATOR_WEB_CONTACTS_DIR = '/home/ryan/www/website-komrade/.contacts'
2020-09-08 08:13:35 +00:00
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'
2020-09-07 17:27:46 +00:00
# dangerous! leave on only if absolutely necessary for initial dev
2020-09-08 07:20:42 +00:00
ALLOW_CLEARNET = True
2020-09-10 21:32:59 +00:00
DEBUG_DEFAULT_PASSPHRASE = None # 'all your base are belong to us'
2020-09-09 10:58:00 +00:00
2020-09-12 18:18:37 +00:00
ROUTE_KEYNAME = 'request'
2020-09-10 11:12:29 +00:00
OPERATOR_ROUTES = [
'forge_new_keys',
'does_username_exist',
'hello_world',
'register_new_user'
2020-09-10 12:52:07 +00:00
]
2020-09-10 15:28:54 +00:00
OPERATOR_INTRO = 'Hello, this is the Operator speaking. '
VISIBILITY_TYPE_PUBLIC = 'VISIBILITY_TYPE_PUBLIC' # visible to the world
VISIBILITY_TYPE_SEMIPUBLIC = 'VISIBILITY_TYPE_SEMIPUBLIC' # visible to the world
VISIBILITY_TYPE_PRIVATE = 'VISIBILITY_TYPE_PRIVATE' # visible to the world
DEFAULT_USER_SETTINGS = {
'visibility':VISIBILITY_TYPE_SEMIPUBLIC
2020-09-10 17:54:49 +00:00
}
2020-09-11 14:35:47 +00:00
SHOW_LOG = 1
2020-09-12 07:55:23 +00:00
SHOW_STATUS = 0
2020-09-13 06:37:21 +00:00
PAUSE_LOGGER = 1
2020-09-10 21:32:59 +00:00
CLI_TITLE = 'KOMRADE'
2020-09-11 14:35:47 +00:00
CLI_FONT = 'clr5x6'#'colossal'
2020-09-12 07:55:23 +00:00
CLI_WIDTH = STATUS_LINE_WIDTH = 50