add disable-plugin-list, --store-plaintext and --dev-mode run arguments

fixes #6
This commit is contained in:
Kevin Froman 2020-10-16 06:30:59 +00:00
parent fcfecaff7e
commit 989692c6ac
2 changed files with 26 additions and 1 deletions

View File

@ -85,6 +85,21 @@ parser.add_argument(
parser.add_argument( parser.add_argument(
'--use-upload-mixing', help='Re-upload blocks uploaded to us. Slow but more secure', '--use-upload-mixing', help='Re-upload blocks uploaded to us. Slow but more secure',
type=int, default=0) type=int, default=0)
parser.add_argument(
'--dev-mode',
help='Developer mode makes restarting and testing Onionr less tedious during development',
type=int, default=0)
parser.add_argument(
'--disable-plugin-list',
help='plugins to disable by name, separate with commas',
type=str, default='chat'
)
parser.add_argument(
'--store-plaintext',
help='store plaintext blocks or not. note that encrypted blocks may not really be encrypted, but we cannot detect that',
type=int, default=1
)
args = parser.parse_args() args = parser.parse_args()
p = Popen([sub_script, 'version'], stdout=DEVNULL) p = Popen([sub_script, 'version'], stdout=DEVNULL)
@ -105,6 +120,15 @@ if args.private_key:
f.write(',' + pub.decode() + ',' + priv) f.write(',' + pub.decode() + ',' + priv)
config['general']['public_key'] = pub config['general']['public_key'] = pub
config['plugins']['disabled'] = args.disable_plugin_list.split(',')
config['general']['dev_mode'] = False
config['general']['store_plaintext_blocks'] = True
if not args.store_plaintext:
config['general']['store_plaintext_blocks'] = False
if args.dev_mode:
config['general']['dev_mode'] = True
if not args.onboarding: if not args.onboarding:
config['onboarding']['done'] = True config['onboarding']['done'] = True
if not args.random_localhost_ip: if not args.random_localhost_ip:

View File

@ -27,11 +27,12 @@ function sidebarAddPeerRegister(){
if (! resp.ok){ if (! resp.ok){
if (resp.status == 409){ if (resp.status == 409){
PNotify.notice({text: "Peer already added"}) PNotify.notice({text: "Peer already added"})
return throw new Error("Could not add peer " + newPeer + " already added")
} }
PNotify.error({text: "Could not add peer. Is your input valid?"}) PNotify.error({text: "Could not add peer. Is your input valid?"})
throw new Error("Could not add peer " + newPeer) throw new Error("Could not add peer " + newPeer)
} }
return resp
}) })
.then((resp) => resp.text()) .then((resp) => resp.text())
.then(function(data) { .then(function(data) {