added url command
parent
48e956c27c
commit
991c79b350
|
@ -21,6 +21,20 @@ import webbrowser
|
|||
import logger
|
||||
from onionrutils import getclientapiserver
|
||||
import config
|
||||
|
||||
def get_url():
|
||||
try:
|
||||
url = getclientapiserver.get_client_API_server()
|
||||
except FileNotFoundError:
|
||||
url = ""
|
||||
logger.error('Onionr seems to not be running (could not get api host)', terminal=True)
|
||||
else:
|
||||
url = 'http://%s/#%s' % (url, config.get('client.webpassword'))
|
||||
logger.info('Onionr web interface URL: ' + url, terminal=True)
|
||||
return url
|
||||
|
||||
get_url.onionr_help = "Shows the Onionr web interface URL with API key"
|
||||
|
||||
def open_home():
|
||||
try:
|
||||
url = getclientapiserver.get_client_API_server()
|
||||
|
|
|
@ -44,6 +44,7 @@ def get_arguments()->dict:
|
|||
('restart',): restartonionr.restart,
|
||||
('add-address', 'addaddress', 'addadder'): keyadders.add_address,
|
||||
('openhome', 'gui', 'openweb', 'open-home', 'open-web'): openwebinterface.open_home,
|
||||
('get-url', 'url', 'get-web'): openwebinterface.get_url,
|
||||
('add-site', 'addsite', 'addhtml', 'add-html'): filecommands.add_html,
|
||||
('addfile', 'add-file'): filecommands.add_file,
|
||||
('get-file', 'getfile'): filecommands.get_file,
|
||||
|
|
Loading…
Reference in New Issue