+ added tor data deletion command

* better support multiple tor versions in tor bootstrap (latest broke on manjaro before this)
* reduced interval for upload block timer to 5 seconds
* show message if inbox is empty in webui mail
This commit is contained in:
Kevin Froman 2019-06-14 13:02:02 -05:00
parent faa79bb35c
commit f5b3406684
6 changed files with 43 additions and 8 deletions

View file

@ -22,4 +22,6 @@ openwebinterface.py: command to open the web interface (useful because it requir
plugincommands.py: commands to enable/disable/reload plugins
pubkeymanager.py: commands to generate a new onionr user id, change the active id, or add/remove/list friends
pubkeymanager.py: commands to generate a new onionr user id, change the active id, or add/remove/list friends
resettor.py: command to delete the Tor data directory

View file

@ -21,7 +21,7 @@
import webbrowser, sys
import logger
from . import pubkeymanager, onionrstatistics, daemonlaunch, filecommands, plugincommands, keyadders
from . import banblocks, exportblocks, openwebinterface
from . import banblocks, exportblocks, openwebinterface, resettor
def show_help(o_inst, command):
@ -128,7 +128,9 @@ def get_commands(onionr_inst):
'friend': onionr_inst.friendCmd,
'addid': onionr_inst.addID,
'add-id': onionr_inst.addID,
'change-id': onionr_inst.changeID
'change-id': onionr_inst.changeID,
'reset-tor': resettor.reset_tor
}
cmd_help = {
@ -159,5 +161,6 @@ cmd_help = {
'friend': '[add|remove] [public key/id]',
'add-id': 'Generate a new ID (key pair)',
'change-id': 'Change active ID',
'open-home': 'Open your node\'s home/info screen'
'open-home': 'Open your node\'s home/info screen',
'reset-tor': 'Delete the Tor data directory. Only do this if Tor never starts.'
}

View file

@ -0,0 +1,29 @@
'''
Onionr - Private P2P Communication
Command to delete the Tor data directory if its safe to do so
'''
'''
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/>.
'''
import os, shutil
import logger, core
def reset_tor():
c = core.Core()
tor_dir = c.dataDir + 'tordata'
if os.path.exists(tor_dir):
if c._utils.localCommand('/ping') == 'pong!':
logger.warn('Cannot delete Tor data while Onionr is running')
else:
shutil.rmtree(tor_dir)