added command to reset tor transport

This commit is contained in:
Kevin Froman 2019-09-01 04:13:46 -05:00
parent 17d345824e
commit cf26232d61
5 changed files with 20 additions and 6 deletions

View File

@ -22,7 +22,7 @@ from .. import banblocks # Command to blacklist a block by its hash
from .. import filecommands # commands to share files with onionr from .. import filecommands # commands to share files with onionr
from .. import exportblocks # commands to export blocks from .. import exportblocks # commands to export blocks
from .. import pubkeymanager # commands to add or change id from .. import pubkeymanager # commands to add or change id
from .. import resettor # command to reset the tor data directory from .. import resettor # commands to reset the tor data directory or transport keypair
from .. import resetplugins # command to reinstall default plugins from .. import resetplugins # command to reinstall default plugins
import onionrexceptions import onionrexceptions
from onionrutils import importnewblocks # func to import new blocks from onionrutils import importnewblocks # func to import new blocks
@ -46,7 +46,8 @@ def get_arguments():
('addid', 'add-id'): pubkeymanager.add_ID, ('addid', 'add-id'): pubkeymanager.add_ID,
('changeid', 'change-id'): pubkeymanager.change_ID, ('changeid', 'change-id'): pubkeymanager.change_ID,
('resettor', 'reset-tor'): resettor.reset_tor, ('resettor', 'reset-tor'): resettor.reset_tor,
('resetplugins', 'reset-plugins'): resetplugins.reset ('resetplugins', 'reset-plugins'): resetplugins.reset,
('reset-tor-node-transport'): resettor.reset_tor_key_pair
} }
return args return args

View File

@ -20,11 +20,19 @@
import os, shutil import os, shutil
import logger import logger
from onionrutils import localcommand from onionrutils import localcommand
from utils import identifyhome
def reset_tor(): def __delete(directory):
tor_dir = c.dataDir + 'tordata' tor_dir = '%s/%s/' % (identifyhome.identify_home(), directory)
if os.path.exists(tor_dir): if os.path.exists(tor_dir):
if localcommand.local_command('/ping') == 'pong!': if localcommand.local_command('/ping') == 'pong!':
logger.warn('Cannot delete Tor data while Onionr is running', terminal=True) logger.warn('Cannot delete Tor data while Onionr is running', terminal=True)
else: else:
shutil.rmtree(tor_dir) shutil.rmtree(tor_dir)
logger.info('Tor reset', terminal=True)
def reset_tor():
__delete('tordata')
def reset_tor_key_pair():
__delete('hs')

View File

@ -0,0 +1 @@
3msj7fgyxgpfsjvvtcji7a4tkjbna6jmpealv6mun7435jjyptctfxyd.onion

View File

@ -98,7 +98,7 @@
Subject: <span id='subjectView'></span> Subject: <span id='subjectView'></span>
</div> </div>
<div> <div>
<button id='replyBtn' class='primaryBtn break-up'>Reply</button> <button id='replyBtn' class='button is-primary break-up'>Reply</button>
</div> </div>
<div id='signatureValidity'></div> <div id='signatureValidity'></div>
<div id='threadDisplay' class='pre messageContent'> <div id='threadDisplay' class='pre messageContent'>

View File

@ -33,4 +33,8 @@
.sentboxList{ .sentboxList{
padding-top: 1em; padding-top: 1em;
}
.messageContent{
padding-top: 1em;
} }