2020-02-04 06:59:52 +00:00
""" Onionr - Private P2P Communication.
2018-06-19 07:01:59 +00:00
2020-02-04 06:59:52 +00:00
This file defines values and requirements used by Onionr
2019-10-24 08:20:06 +00:00
"""
2020-02-04 06:59:52 +00:00
import platform
import os
import filepaths
2019-10-24 08:20:06 +00:00
"""
2018-06-19 07:01:59 +00:00
This program is free software : you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program . If not , see < https : / / www . gnu . org / licenses / > .
2019-10-24 08:20:06 +00:00
"""
2019-10-08 00:02:12 +00:00
DENIABLE_PEER_ADDRESS = " OVPCZLOXD6DC5JHX4EQ3PSOGAZ3T24F75HQLIUZSDSMYPEOXCPFA "
2019-07-27 20:29:15 +00:00
PASSWORD_LENGTH = 25
2019-07-30 05:19:22 +00:00
ONIONR_TAGLINE = ' Private P2P Communication - GPLv3 - https://Onionr.net '
2020-02-08 10:24:19 +00:00
ONIONR_VERSION = ' 3.1.0 '
2020-02-06 02:31:38 +00:00
ONIONR_VERSION_CODENAME = ' Genesis '
2019-07-30 05:19:22 +00:00
ONIONR_VERSION_TUPLE = tuple ( ONIONR_VERSION . split ( ' . ' ) ) # (MAJOR, MINOR, VERSION)
2020-02-08 09:07:07 +00:00
API_VERSION = ' 1 ' # increments of 1; only change when something fundamental about how the API works changes. This way other nodes know how to communicate without learning too much information about you.
2019-10-24 08:20:06 +00:00
MIN_PY_VERSION = 7 # min version of 7 so we can take advantage of non-cyclic type hints
2019-10-04 21:49:35 +00:00
DEVELOPMENT_MODE = False
2019-10-24 08:20:06 +00:00
""" limit type length for a block (soft enforced, ignored if invalid but block still stored). """
2019-08-09 20:07:32 +00:00
MAX_BLOCK_TYPE_LENGTH = 15
2019-10-24 08:20:06 +00:00
""" limit clock timestamp for new blocks to be skewed in the future in seconds,
2 minutes to allow plenty of time for slow block insertion and slight clock inaccuracies """
2019-08-10 01:04:56 +00:00
MAX_BLOCK_CLOCK_SKEW = 120
2019-10-24 08:20:06 +00:00
""" Onionr user IDs are ed25519 keys, which are always 32 bytes in length """
2019-09-06 20:09:39 +00:00
MAIN_PUBLIC_KEY_SIZE = 32
2019-09-10 06:05:59 +00:00
ORIG_RUN_DIR_ENV_VAR = ' ORIG_ONIONR_RUN_DIR '
2019-08-09 20:07:32 +00:00
2019-10-29 05:36:56 +00:00
DATABASE_LOCK_TIMEOUT = 60
2019-09-17 01:16:06 +00:00
# Block creation anonymization requirements
MIN_BLOCK_UPLOAD_PEER_PERCENT = 0.1
2020-01-20 03:02:04 +00:00
WSGI_SERVER_REQUEST_TIMEOUT_SECS = 120
MAX_NEW_PEER_QUEUE = 1000
2020-02-08 09:07:07 +00:00
BLOCK_EXPORT_FILE_EXT = ' .dat '
2019-08-09 20:41:27 +00:00
# Begin OnionrValues migrated values
2020-02-04 02:08:06 +00:00
2019-10-24 08:20:06 +00:00
""" 30 days is plenty of time for someone to decide to renew a block """
2020-02-23 08:12:13 +00:00
DEFAULT_EXPIRE = 2678400
2019-10-24 08:20:06 +00:00
# Metadata header section length limits, in bytes
2020-03-03 11:55:50 +00:00
BLOCK_METADATA_LENGTHS = { ' meta ' : 1000 , ' sig ' : 200 , ' signer ' : 200 , ' time ' : 10 ,
' pow ' : 1000 , ' encryptType ' : 4 , ' expire ' : 14 }
2019-10-24 08:20:06 +00:00
2019-12-22 19:42:10 +00:00
# Pool Eligibility Max Age
BLOCK_POOL_MAX_AGE = 300
2019-10-24 08:20:06 +00:00
""" Public key that signs MOTD messages shown in the web UI """
2019-10-08 00:02:12 +00:00
MOTD_SIGN_KEY = " TRH763JURNY47QPBTTQ4LLPYCYQK6Q5YA33R6GANKZK5C5DKCIGQ "
2019-08-09 20:41:27 +00:00
2019-11-16 04:18:38 +00:00
""" Public key that signs update notifications. """
UPDATE_SIGN_KEY = " TRH763JURNY47QPBTTQ4LLPYCYQK6Q5YA33R6GANKZK5C5DKCIGQ "
2019-07-30 18:13:10 +00:00
platform = platform . system ( )
if platform == ' Windows ' :
SCRIPT_NAME = ' run-windows.bat '
else :
2019-09-20 16:25:12 +00:00
if os . path . exists ( filepaths . daemon_mark_file ) :
SCRIPT_NAME = ' start-daemon.sh '
else :
SCRIPT_NAME = ' onionr.sh '