Skip to content

Commit 8beee04

Browse files
committed
messages and prompts
1 parent 894376e commit 8beee04

File tree

5 files changed

+52
-24
lines changed

5 files changed

+52
-24
lines changed

safebox/cli.py

+22-20
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,27 @@
1111
from time import sleep, time
1212
import qrcode
1313
from safebox.func_utils import recover_nsec_from_seed
14-
from safebox.constants import (
15-
WELCOME_MSG
14+
from safebox.prompts import (
15+
WELCOME_MSG,
16+
INFO_HELP,
17+
SET_HELP,
18+
NSEC_HELP,
19+
RELAYS_HELP,
20+
HOME_RELAY_HELP,
21+
MINTS_HELP
1622

1723
)
1824

19-
relays = [ "wss://relay.nimo.cash",
20-
"wss://nostr-pub.wellorder.net",
25+
relays = [ "wss://nostr-pub.wellorder.net",
2126
"wss://relay.damus.io",
2227
"wss://relay.primal.net",
2328
"wss://nos.lol"
2429
]
25-
mints = ["https://mint.nimo.cash"]
30+
mints = ["https://mint.coinos.io"]
2631
wallet = "default"
27-
default_home_relay = "wss://relay.openbalance.app"
32+
default_home_relay = "wss://nos.lol"
2833
replicate_relays = ["wss://relay.nimo.cash", "wss://nostr-pub.wellorder.net"]
29-
logging_level = 20
34+
logging_level = 10
3035

3136
# List of mints https://nostrapps.github.io/cashu/mints.json
3237

@@ -48,7 +53,7 @@ def write_config():
4853

4954
config_obj = { 'nsec': Keys().private_key_bech32(),
5055
'relays': relays,
51-
"home_relay": home_relay,
56+
"home_relay": default_home_relay,
5257
"mints": mints,
5358
"wallet": wallet,
5459
"replicate_relays": replicate_relays,
@@ -80,9 +85,10 @@ def write_config():
8085
def cli():
8186
pass
8287

83-
@click.command(help='display info')
88+
@click.command(help=INFO_HELP)
8489
@click.pass_context
8590
def info(ctx):
91+
8692
click.echo(WELCOME_MSG)
8793
click.echo("This is safebox. Retrieving wallet...")
8894
info_out = Wallet(nsec=NSEC, home_relay=HOME_RELAY, logging_level=LOGGING_LEVEL)
@@ -110,15 +116,14 @@ def init(profile, keepkey, longseed, homerelay):
110116

111117

112118

113-
@click.command(help="set local config options")
114-
@click.option('--nsec', '-n', default=None, help='set nsec')
115-
@click.option('--relays', '-r', default=None, help='set relays')
116-
@click.option('--home', '-h', default=None, help='set home relay')
117-
@click.option('--mints', '-m', default=None, help='set mints')
118-
@click.option('--wallet', '-w', default=None, help='set wallet')
119+
@click.command(help=SET_HELP)
120+
@click.option('--nsec', '-n', default=None, help=NSEC_HELP)
121+
@click.option('--relays', '-r', default=None, help=RELAYS_HELP)
122+
@click.option('--home', '-h', default=None, help=HOME_RELAY_HELP)
123+
@click.option('--mints', '-m', default=None, help=MINTS_HELP)
119124
@click.option('--xrelays', '-x', default=None, help='set replicate relays')
120125
@click.option('--logging', '-l', default=None, help='set logging level')
121-
def set(nsec, home, relays, mints, wallet, xrelays, logging: int):
126+
def set(nsec, home, relays, mints, xrelays, logging: int):
122127

123128
if nsec == None and relays == None and mints == None and home == None and wallet==None and xrelays==None and logging == None:
124129
click.echo(yaml.dump(config_obj, default_flow_style=False))
@@ -179,10 +184,7 @@ def set(nsec, home, relays, mints, wallet, xrelays, logging: int):
179184
else:
180185
config_obj['mints']=MINTS
181186

182-
if wallet != None:
183-
config_obj['wallet'] = wallet
184-
else:
185-
config_obj['wallet'] = WALLET
187+
186188

187189
wallet_obj = Wallet(nsec=NSEC, relays=RELAYS, mints=MINTS, home_relay=HOME_RELAY, logging_level=LOGGING_LEVEL)
188190
click.echo("set!")

safebox/constants.py

-2
This file was deleted.

safebox/prompts.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
SAFEBOX_RELEASE = "v0.01"
2+
WELCOME_MSG = """THIS SOFTWARE IS USED WITHOUT WARRANTY OR LIABILITY TO ITS AUTHOR.
3+
"""
4+
INFO_HELP = f"""This is the help for the safebox info command.
5+
6+
Safebox release is: {SAFEBOX_RELEASE}.
7+
8+
The info function displays general information and confirms that the command line interface is working properly."""
9+
10+
SET_HELP = f"""This is the help for the safebox set command.
11+
12+
The set function sets local configuration options. All configuration information is stored UNENCRYPTED in your home directory of ~/.safebox/config.yml .
13+
"""
14+
15+
NSEC_HELP= """
16+
This option to set to an existing nsec. Be sure you know what you are doing when using this option, and never set it to your personal nsec.
17+
"""
18+
19+
RELAYS_HELP= """
20+
Relays that are used to read posts and profiles.
21+
"""
22+
HOME_RELAY_HELP= """
23+
The home relay is where safebox events are published to and retrieved from. Be sure to use a relay that you trust for availabilty. Relay operators cannot see your data but may decide to block your access. Be ready to replicate your data should your home relay become unreliable or adversarial.
24+
"""
25+
26+
MINTS_HELP ="""
27+
The mints that are used by safebox. The first mint specified in the list is the home mint.
28+
"""

safebox/safedaemon.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import yaml
77
from safebox.wallet import Wallet
8-
from safebox.constants import (
8+
from safebox.prompts import (
99
WELCOME_MSG
1010

1111
)

safebox/wallet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def get_profile(self):
408408
out_string += f"\npubhex: {str(self.pubkey_hex)}"
409409
out_string += f"\nprivhex: {str(self.privkey_hex)}"
410410
out_string += f"\nnsec: {str(self.k.private_key_bech32())}"
411-
out_string += f"\n\nseed phrase: \n{'-'*80}\n{self.wallet_config.seed_phrase}"
411+
out_string += f"\n\nRecovery seed phrase: \n{'-'*80}\n{self.wallet_config.seed_phrase}"
412412
out_string += "\n"+ "-"*80
413413

414414
for key, value in nostr_profile.__dict__.items():

0 commit comments

Comments
 (0)