* Adjusted connect configuration
* work on cli-ui
This commit is contained in:
parent
bed6475e1b
commit
1203bb2b7a
@ -408,6 +408,7 @@ class OnionrCommunicatorDaemon:
|
|||||||
try:
|
try:
|
||||||
self.getPeerProfileInstance(peer).addScore(-10)
|
self.getPeerProfileInstance(peer).addScore(-10)
|
||||||
self.removeOnlinePeer(peer)
|
self.removeOnlinePeer(peer)
|
||||||
|
if action != 'ping':
|
||||||
self.getOnlinePeers() # Will only add a new peer to pool if needed
|
self.getOnlinePeers() # Will only add a new peer to pool if needed
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
# Imports some useful libraries
|
# Imports some useful libraries
|
||||||
import logger, config, threading, time, uuid
|
import logger, config, threading, time, uuid, subprocess
|
||||||
from onionrblockapi import Block
|
from onionrblockapi import Block
|
||||||
|
|
||||||
plugin_name = 'cliui'
|
plugin_name = 'cliui'
|
||||||
@ -30,7 +30,42 @@ class OnionrCLIUI:
|
|||||||
self.api = apiInst
|
self.api = apiInst
|
||||||
self.myCore = apiInst.get_core()
|
self.myCore = apiInst.get_core()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def subCommand(self, command):
|
||||||
|
try:
|
||||||
|
subprocess.run(["./onionr.py", command])
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
'''Main CLI UI interface menu'''
|
||||||
|
showMenu = True
|
||||||
|
while showMenu:
|
||||||
|
print('''\n1. Flow (Anonymous public chat, use at your own risk)
|
||||||
|
2. Mail (Secure email-like service)
|
||||||
|
3. File Sharing
|
||||||
|
4. User Settings
|
||||||
|
5. Quit
|
||||||
|
''')
|
||||||
|
try:
|
||||||
|
choice = input(">").strip().lower()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
choice = "quit"
|
||||||
|
|
||||||
|
if choice in ("flow", "1"):
|
||||||
|
self.subCommand("flow")
|
||||||
|
elif choice in ("2", "mail"):
|
||||||
|
self.subCommand("mail")
|
||||||
|
elif choice in ("4", "user settings", "settings"):
|
||||||
|
try:
|
||||||
|
self.setName()
|
||||||
|
except (KeyboardInterrupt, EOFError) as e:
|
||||||
|
pass
|
||||||
|
elif choice in ("5", "quit"):
|
||||||
|
showMenu = False
|
||||||
|
return
|
||||||
|
|
||||||
|
def setName(self):
|
||||||
name = input("Enter your name: ")
|
name = input("Enter your name: ")
|
||||||
self.myCore.insertBlock("userInfo-" + str(uuid.uuid1()), sign=True, header='userInfo', meta={'name': name})
|
self.myCore.insertBlock("userInfo-" + str(uuid.uuid1()), sign=True, header='userInfo', meta={'name': name})
|
||||||
return
|
return
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
"peers":{
|
"peers":{
|
||||||
"minimumScore": -100,
|
"minimumScore": -100,
|
||||||
"maxStoredPeers": 5000,
|
"maxStoredPeers": 5000,
|
||||||
"maxConnect": 5
|
"maxConnect": 10
|
||||||
},
|
},
|
||||||
"timers":{
|
"timers":{
|
||||||
"lookupBlocks": 25,
|
"lookupBlocks": 25,
|
||||||
|
Loading…
Reference in New Issue
Block a user