Merge branch 'testing' into feature/3702-update-binding
This commit is contained in:
commit
ee754f6c64
|
@ -23,3 +23,6 @@
|
||||||
padding-top: 0px;
|
padding-top: 0px;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
.help {
|
||||||
|
color: #993365;
|
||||||
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
868e59911be73a941938644143d81f21a2fdbe82ea0841493c2d9fc04701e058334af5fecd69c1a1525ebd5c8c17ac3f49d8ecc53bbfc8a018f169be48fe79d6 USODY_2022.5.2-beta.iso
|
|
|
@ -5,7 +5,7 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||||
|
|
||||||
<title>{% block page_title %}{% endblock %} - USOdy</title>
|
<title>{% block page_title %}{% endblock %} - Usody</title>
|
||||||
<meta content="" name="description">
|
<meta content="" name="description">
|
||||||
<meta content="" name="keywords">
|
<meta content="" name="keywords">
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item d-flex align-items-center" href="{{ url_for('workbench.settings') }}">
|
<a class="dropdown-item d-flex align-items-center" href="{{ url_for('workbench.settings') }}">
|
||||||
<i class="bi bi-tools"></i>
|
<i class="bi bi-tools"></i>
|
||||||
<span>Workbench</span>
|
<span>Setup</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -283,7 +283,7 @@
|
||||||
<!-- ======= Footer ======= -->
|
<!-- ======= Footer ======= -->
|
||||||
<footer id="footer" class="footer">
|
<footer id="footer" class="footer">
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
© Copyright <strong><span>USOdy</span></strong>. All Rights Reserved
|
© Copyright <strong><span>Usody</span></strong>. All Rights Reserved
|
||||||
</div>
|
</div>
|
||||||
<div class="credits">
|
<div class="credits">
|
||||||
<!-- All the links in the footer should remain intact. -->
|
<!-- All the links in the footer should remain intact. -->
|
||||||
|
|
|
@ -18,31 +18,32 @@
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="pt-6 pb-2">
|
<div class="pt-6 pb-2">
|
||||||
<h5 class="card-title text-center pb-0 fs-4">Download your settings for Workbench</h5>
|
|
||||||
{% if not demo %}
|
|
||||||
<div class="row pt-3">
|
<div class="row pt-3">
|
||||||
<div class="col-5">
|
|
||||||
<a href="{{ url_for('workbench.settings') }}?opt=register" class="btn btn-primary">Register devices</a>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="small">Download the settings only for register devices.</p>
|
<p>Please download the ISO file and the settings file of the
|
||||||
|
version you want and follow these steps
|
||||||
|
<a href="https://help.usody.com/es/setup/setup-pendrive/" target="_blank" class="help">steps</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if iso %}
|
|
||||||
<div class="row pt-3">
|
|
||||||
<div class="col-5">
|
|
||||||
<a href="/static/iso/{{ iso }}" class="btn btn-primary">{{ iso }}</a>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<p class="small">
|
|
||||||
Download Checksum: <a style="color: #993365;" href="/static/iso/SHA512SUMS">SHA512SUMS</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% else %}
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-xl-8">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if demo %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-6">
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="pt-6 pb-2">
|
||||||
|
<h5 class="card-title text-center pb-0 fs-4">Workbench 2022</h5>
|
||||||
{% if iso %}
|
{% if iso %}
|
||||||
<div class="row pt-3">
|
<div class="row pt-3">
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
|
@ -50,22 +51,97 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="small">
|
<p class="small">
|
||||||
Download Checksum: <a style="color: #993365;" href="/static/iso/demo/SHA512SUMS">SHA512SUMS</a>
|
Download Checksum: <a class="help" href="/static/iso/demo/SHA512SUMS">SHA512SUMS</a> |
|
||||||
|
<a href="https://help.usody.com/es/setup/setup-pendrive/" target="_blank" class="help">Help</a></p>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-xl-8">
|
<div class="col-xl-8">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
{% for d, v in iso.items() %}
|
||||||
|
{% if d != 'demo' %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-6">
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="pt-6 pb-2">
|
||||||
|
<h5 class="card-title text-center pb-0 fs-4">Workbench {{ d }}</h5>
|
||||||
|
{% if d == 'v14' %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-5">
|
||||||
|
<a href="{{ url_for('workbench.settings') }}?opt=erease_basic" class="btn btn-primary" style="width: 200px;">Get settings file!</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<p class="small">
|
||||||
|
Settings for basic data erasure. | <a href="https://help.usody.com/es/setup/setup-pendrive/" target="_blank" class="help">Help</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row pt-2">
|
||||||
|
<div class="col-5">
|
||||||
|
<a href="{{ url_for('workbench.settings') }}?opt=erease_sectors" class="btn btn-primary" style="width: 200px;">Get settings file!</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<p class="small">
|
||||||
|
Settings for advanced data erasure through sectors and hidden areas. Guarantee of data removal. | <a href="https://help.usody.com/es/setup/setup-pendrive/" target="_blank" class="help">Help</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-5">
|
||||||
|
<a href="{{ url_for('workbench.settings') }}?opt=register" class="btn btn-primary" style="width: 200px;">Get settings file!</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<p class="small">
|
||||||
|
Settings for register devices.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if iso %}
|
||||||
|
<br />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-5">
|
||||||
|
<a href="/static/iso/{{ d }}/{{ v }}" class="btn btn-primary" style="width: 200px;">Get ISO file</a>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<p class="small">
|
||||||
|
{{ v }}
|
||||||
|
</p>
|
||||||
|
<p class="small">
|
||||||
|
Download Checksum: <a class="help" href="/static/iso/{{ d }}/SHA512SUMS">SHA512SUMS</a> |
|
||||||
|
<a href="https://help.usody.com/es/setup/setup-pendrive/" target="_blank" class="help">Help</a></p>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-xl-8">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
{% endblock main %}
|
{% endblock main %}
|
||||||
|
|
|
@ -2,3 +2,33 @@
|
||||||
|
|
||||||
DH_TOKEN = {{ token }}
|
DH_TOKEN = {{ token }}
|
||||||
DH_URL = {{ url }}
|
DH_URL = {{ url }}
|
||||||
|
{% if erease_basic %}
|
||||||
|
DH_HOST = {{ host }}
|
||||||
|
DH_DATABASE = {{ schema }}
|
||||||
|
DEVICEHUB_URL = https://${DB_HOST}/${DB_DATABASE}/
|
||||||
|
|
||||||
|
WB_BENCHMARK = True
|
||||||
|
WB_STRESS_TEST = 0
|
||||||
|
WB_SMART_TEST = short
|
||||||
|
|
||||||
|
WB_ERASE = EraseBasic
|
||||||
|
WB_ERASE_STEPS = 1
|
||||||
|
WB_ERASE_LEADING_ZEROS = False
|
||||||
|
|
||||||
|
WB_DEBUG = True
|
||||||
|
{% endif %}
|
||||||
|
{% if erease_sectors %}
|
||||||
|
DH_HOST = {{ host }}
|
||||||
|
DH_DATABASE = {{ schema }}
|
||||||
|
DEVICEHUB_URL = https://${DB_HOST}/${DB_DATABASE}/
|
||||||
|
|
||||||
|
WB_BENCHMARK = True
|
||||||
|
WB_STRESS_TEST = 0
|
||||||
|
WB_SMART_TEST = short
|
||||||
|
|
||||||
|
WB_ERASE = EraseSectors
|
||||||
|
WB_ERASE_STEPS = 1
|
||||||
|
WB_ERASE_LEADING_ZEROS = True
|
||||||
|
|
||||||
|
WB_DEBUG = True
|
||||||
|
{% endif %}
|
||||||
|
|
|
@ -20,7 +20,7 @@ workbench = Blueprint('workbench', __name__, url_prefix='/workbench')
|
||||||
class SettingsView(GenericMixin):
|
class SettingsView(GenericMixin):
|
||||||
decorators = [login_required]
|
decorators = [login_required]
|
||||||
template_name = 'workbench/settings.html'
|
template_name = 'workbench/settings.html'
|
||||||
page_title = "Workbench Settings"
|
page_title = "Workbench"
|
||||||
|
|
||||||
def dispatch_request(self):
|
def dispatch_request(self):
|
||||||
self.get_context()
|
self.get_context()
|
||||||
|
@ -33,7 +33,7 @@ class SettingsView(GenericMixin):
|
||||||
self.get_iso()
|
self.get_iso()
|
||||||
|
|
||||||
self.opt = request.values.get('opt')
|
self.opt = request.values.get('opt')
|
||||||
if self.opt in ['register']:
|
if self.opt in ['register', 'erease_basic', 'erease_sectors']:
|
||||||
return self.download()
|
return self.download()
|
||||||
|
|
||||||
return flask.render_template(self.template_name, **self.context)
|
return flask.render_template(self.template_name, **self.context)
|
||||||
|
@ -44,27 +44,44 @@ class SettingsView(GenericMixin):
|
||||||
if self.context.get('demo'):
|
if self.context.get('demo'):
|
||||||
uri = f'{path}/static/iso/demo/'
|
uri = f'{path}/static/iso/demo/'
|
||||||
|
|
||||||
files = [
|
self.context['iso'] = {}
|
||||||
f for f in os.listdir(uri) if f[-3:].lower() == 'iso'
|
|
||||||
]
|
|
||||||
|
|
||||||
self.context['iso'] = ''
|
if not os.path.exists(uri):
|
||||||
self.context['iso_sha'] = ''
|
return
|
||||||
|
|
||||||
|
versions = os.listdir(f'{path}/static/iso/')
|
||||||
|
versions.sort()
|
||||||
|
|
||||||
|
for d in versions:
|
||||||
|
dir_iso = f'{uri}/{d}'
|
||||||
|
if not os.path.isdir(dir_iso):
|
||||||
|
continue
|
||||||
|
|
||||||
|
files = [f for f in os.listdir(dir_iso) if f[-3:].lower() == 'iso']
|
||||||
|
|
||||||
if files:
|
if files:
|
||||||
self.context['iso'] = files[0]
|
self.context['iso'][f'{d}'] = files[0]
|
||||||
self.context['iso_sha'] = 'aaa'
|
|
||||||
|
|
||||||
def download(self):
|
def download(self):
|
||||||
url = "https://{}/api/inventory/".format(app.config['HOST'])
|
url = "https://{}/api/inventory/".format(app.config['HOST'])
|
||||||
self.wbContext = {
|
self.wbContext = {
|
||||||
'token': self.get_token(),
|
'token': self.get_token(),
|
||||||
'url': url,
|
'url': url,
|
||||||
|
'erease_basic': None,
|
||||||
|
'erease_sectors': None,
|
||||||
}
|
}
|
||||||
options = {"register": self.register}
|
# if is a v14 version
|
||||||
return options[self.opt]()
|
# TODO when not use more v14, we can remove this if
|
||||||
|
if 'erease' in self.opt:
|
||||||
|
url = "https://{}/actions/".format(app.config['HOST'])
|
||||||
|
self.wbContext['url'] = url
|
||||||
|
self.wbContext['host'] = app.config['HOST']
|
||||||
|
self.wbContext['schema'] = app.config['SCHEMA']
|
||||||
|
if self.opt == 'erease_basic':
|
||||||
|
self.wbContext['erease_basic'] = True
|
||||||
|
if self.opt == 'erease_sectors':
|
||||||
|
self.wbContext['erease_sectors'] = True
|
||||||
|
|
||||||
def register(self):
|
|
||||||
data = flask.render_template('workbench/wbSettings.ini', **self.wbContext)
|
data = flask.render_template('workbench/wbSettings.ini', **self.wbContext)
|
||||||
return self.response_download(data)
|
return self.response_download(data)
|
||||||
|
|
||||||
|
@ -94,4 +111,4 @@ class SettingsView(GenericMixin):
|
||||||
return token
|
return token
|
||||||
|
|
||||||
|
|
||||||
workbench.add_url_rule('/settings/', view_func=SettingsView.as_view('settings'))
|
workbench.add_url_rule('/', view_func=SettingsView.as_view('settings'))
|
||||||
|
|
|
@ -100,7 +100,7 @@ def test_api_docs(client: Client):
|
||||||
'/users/login/',
|
'/users/login/',
|
||||||
'/users/logout/',
|
'/users/logout/',
|
||||||
'/versions/',
|
'/versions/',
|
||||||
'/workbench/settings/',
|
'/workbench/',
|
||||||
}
|
}
|
||||||
assert docs['info'] == {'title': 'Devicehub', 'version': '0.2'}
|
assert docs['info'] == {'title': 'Devicehub', 'version': '0.2'}
|
||||||
assert docs['components']['securitySchemes']['bearerAuth'] == {
|
assert docs['components']['securitySchemes']['bearerAuth'] == {
|
||||||
|
|
|
@ -1282,18 +1282,17 @@ def test_action_datawipe(user3: UserClientFlask):
|
||||||
@pytest.mark.mvp
|
@pytest.mark.mvp
|
||||||
@pytest.mark.usefixtures(conftest.app_context.__name__)
|
@pytest.mark.usefixtures(conftest.app_context.__name__)
|
||||||
def test_wb_settings(user3: UserClientFlask):
|
def test_wb_settings(user3: UserClientFlask):
|
||||||
uri = '/workbench/settings/'
|
uri = '/workbench/'
|
||||||
body, status = user3.get(uri)
|
body, status = user3.get(uri)
|
||||||
|
|
||||||
assert status == '200 OK'
|
assert status == '200 OK'
|
||||||
assert "Download your settings for Workbench" in body
|
assert "Please download the ISO file and the settings file of the" in body
|
||||||
assert "Workbench Settings" in body
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.mvp
|
@pytest.mark.mvp
|
||||||
@pytest.mark.usefixtures(conftest.app_context.__name__)
|
@pytest.mark.usefixtures(conftest.app_context.__name__)
|
||||||
def test_wb_settings_register(user3: UserClientFlask):
|
def test_wb_settings_register(user3: UserClientFlask):
|
||||||
uri = '/workbench/settings/?opt=register'
|
uri = '/workbench/?opt=register'
|
||||||
body, status = user3.get(uri)
|
body, status = user3.get(uri)
|
||||||
|
|
||||||
assert status == '200 OK'
|
assert status == '200 OK'
|
||||||
|
|
Reference in New Issue