mirror of https://gitlab.com/bashrc2/epicyon
Configuration for a secondary i2p domain alongside clearnet
parent
6084fbcce9
commit
b8de97a9c3
|
@ -7336,7 +7336,8 @@ def runDaemon(blogsInstance: bool, mediaInstance: bool,
|
||||||
enableSharedInbox: bool, registration: bool,
|
enableSharedInbox: bool, registration: bool,
|
||||||
language: str, projectVersion: str,
|
language: str, projectVersion: str,
|
||||||
instanceId: str, clientToServer: bool,
|
instanceId: str, clientToServer: bool,
|
||||||
baseDir: str, domain: str, onionDomain: str,
|
baseDir: str, domain: str,
|
||||||
|
onionDomain: str, i2pDomain: str,
|
||||||
port=80, proxyPort=80, httpPrefix='https',
|
port=80, proxyPort=80, httpPrefix='https',
|
||||||
fedList=[], maxMentions=10, maxEmoji=10,
|
fedList=[], maxMentions=10, maxEmoji=10,
|
||||||
authenticatedFetch=False,
|
authenticatedFetch=False,
|
||||||
|
@ -7379,6 +7380,7 @@ def runDaemon(blogsInstance: bool, mediaInstance: bool,
|
||||||
httpd.domainBlocklist = getDomainBlocklist(baseDir)
|
httpd.domainBlocklist = getDomainBlocklist(baseDir)
|
||||||
|
|
||||||
httpd.onionDomain = onionDomain
|
httpd.onionDomain = onionDomain
|
||||||
|
httpd.i2pDomain = i2pDomain
|
||||||
httpd.useBlurHash = useBlurHash
|
httpd.useBlurHash = useBlurHash
|
||||||
httpd.mediaInstance = mediaInstance
|
httpd.mediaInstance = mediaInstance
|
||||||
httpd.blogsInstance = blogsInstance
|
httpd.blogsInstance = blogsInstance
|
||||||
|
|
24
epicyon.py
24
epicyon.py
|
@ -97,6 +97,10 @@ parser.add_argument('-o', '--onion', dest='onion', type=str,
|
||||||
default=None,
|
default=None,
|
||||||
help='Onion domain name of the server if ' +
|
help='Onion domain name of the server if ' +
|
||||||
'primarily on clearnet')
|
'primarily on clearnet')
|
||||||
|
parser.add_argument('--i2pDomain', dest='i2pDomain', type=str,
|
||||||
|
default=None,
|
||||||
|
help='i2p domain name of the server if ' +
|
||||||
|
'primarily on clearnet')
|
||||||
parser.add_argument('-p', '--port', dest='port', type=int,
|
parser.add_argument('-p', '--port', dest='port', type=int,
|
||||||
default=None,
|
default=None,
|
||||||
help='Port number to run on')
|
help='Port number to run on')
|
||||||
|
@ -467,6 +471,16 @@ if args.onion:
|
||||||
onionDomain = args.onion
|
onionDomain = args.onion
|
||||||
setConfigParam(baseDir, 'onion', onionDomain)
|
setConfigParam(baseDir, 'onion', onionDomain)
|
||||||
|
|
||||||
|
i2pDomain = None
|
||||||
|
if args.i2pDomain:
|
||||||
|
if not args.i2pDomain.endswith('.i2p'):
|
||||||
|
print(args.i2pDomain + ' does not look like an i2p domain')
|
||||||
|
sys.exit()
|
||||||
|
if '://' in args.i2pDomain:
|
||||||
|
args.onion = args.onion.split('://')[1]
|
||||||
|
i2pDomain = args.i2pDomain
|
||||||
|
setConfigParam(baseDir, 'i2pDomain', i2pDomain)
|
||||||
|
|
||||||
if not args.language:
|
if not args.language:
|
||||||
languageCode = getConfigParam(baseDir, 'language')
|
languageCode = getConfigParam(baseDir, 'language')
|
||||||
if languageCode:
|
if languageCode:
|
||||||
|
@ -532,6 +546,13 @@ if configOnionDomain:
|
||||||
else:
|
else:
|
||||||
onionDomain = None
|
onionDomain = None
|
||||||
|
|
||||||
|
# get i2p domain name from configuration
|
||||||
|
configi2pDomain = getConfigParam(baseDir, 'i2pDomain')
|
||||||
|
if configi2pDomain:
|
||||||
|
i2pDomain = configi2pDomain
|
||||||
|
else:
|
||||||
|
i2pDomain = None
|
||||||
|
|
||||||
# get port number from configuration
|
# get port number from configuration
|
||||||
configPort = getConfigParam(baseDir, 'port')
|
configPort = getConfigParam(baseDir, 'port')
|
||||||
if configPort:
|
if configPort:
|
||||||
|
@ -1659,7 +1680,8 @@ runDaemon(args.blogsinstance, args.mediainstance,
|
||||||
not args.nosharedinbox,
|
not args.nosharedinbox,
|
||||||
registration, args.language, __version__,
|
registration, args.language, __version__,
|
||||||
instanceId, args.client, baseDir,
|
instanceId, args.client, baseDir,
|
||||||
domain, onionDomain, port, proxyPort, httpPrefix,
|
domain, onionDomain, i2pDomain,
|
||||||
|
port, proxyPort, httpPrefix,
|
||||||
federationList, args.maxMentions,
|
federationList, args.maxMentions,
|
||||||
args.maxEmoji, args.authenticatedFetch,
|
args.maxEmoji, args.authenticatedFetch,
|
||||||
args.noreply, args.nolike, args.nopics,
|
args.noreply, args.nolike, args.nopics,
|
||||||
|
|
12
tests.py
12
tests.py
|
@ -273,9 +273,11 @@ def createServerAlice(path: str, domain: str, port: int,
|
||||||
maxMentions = 10
|
maxMentions = 10
|
||||||
maxEmoji = 10
|
maxEmoji = 10
|
||||||
onionDomain = None
|
onionDomain = None
|
||||||
|
i2pDomain = None
|
||||||
print('Server running: Alice')
|
print('Server running: Alice')
|
||||||
runDaemon(False, False, 5, True, True, 'en', __version__,
|
runDaemon(False, False, 5, True, True, 'en', __version__,
|
||||||
"instanceId", False, path, domain, onionDomain, port, port,
|
"instanceId", False, path, domain,
|
||||||
|
onionDomain, i2pDomain, port, port,
|
||||||
httpPrefix, federationList, maxMentions, maxEmoji, False,
|
httpPrefix, federationList, maxMentions, maxEmoji, False,
|
||||||
noreply, nolike, nopics, noannounce, cw, ocapAlways,
|
noreply, nolike, nopics, noannounce, cw, ocapAlways,
|
||||||
useTor, maxReplies,
|
useTor, maxReplies,
|
||||||
|
@ -334,9 +336,11 @@ def createServerBob(path: str, domain: str, port: int,
|
||||||
maxMentions = 10
|
maxMentions = 10
|
||||||
maxEmoji = 10
|
maxEmoji = 10
|
||||||
onionDomain = None
|
onionDomain = None
|
||||||
|
i2pDomain = None
|
||||||
print('Server running: Bob')
|
print('Server running: Bob')
|
||||||
runDaemon(False, False, 5, True, True, 'en', __version__,
|
runDaemon(False, False, 5, True, True, 'en', __version__,
|
||||||
"instanceId", False, path, domain, onionDomain, port, port,
|
"instanceId", False, path, domain,
|
||||||
|
onionDomain, i2pDomain, port, port,
|
||||||
httpPrefix, federationList, maxMentions, maxEmoji, False,
|
httpPrefix, federationList, maxMentions, maxEmoji, False,
|
||||||
noreply, nolike, nopics, noannounce, cw, ocapAlways,
|
noreply, nolike, nopics, noannounce, cw, ocapAlways,
|
||||||
useTor, maxReplies,
|
useTor, maxReplies,
|
||||||
|
@ -372,9 +376,11 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
||||||
maxMentions = 10
|
maxMentions = 10
|
||||||
maxEmoji = 10
|
maxEmoji = 10
|
||||||
onionDomain = None
|
onionDomain = None
|
||||||
|
i2pDomain = None
|
||||||
print('Server running: Eve')
|
print('Server running: Eve')
|
||||||
runDaemon(False, False, 5, True, True, 'en', __version__,
|
runDaemon(False, False, 5, True, True, 'en', __version__,
|
||||||
"instanceId", False, path, domain, onionDomain, port, port,
|
"instanceId", False, path, domain,
|
||||||
|
onionDomain, i2pDomain, port, port,
|
||||||
httpPrefix, federationList, maxMentions, maxEmoji, False,
|
httpPrefix, federationList, maxMentions, maxEmoji, False,
|
||||||
noreply, nolike, nopics, noannounce, cw, ocapAlways,
|
noreply, nolike, nopics, noannounce, cw, ocapAlways,
|
||||||
useTor, maxReplies, allowDeletion, True, True, False,
|
useTor, maxReplies, allowDeletion, True, True, False,
|
||||||
|
|
Loading…
Reference in New Issue