Git Product home page Git Product logo

gecoscc-ui's Introduction

gecoscc-ui's People

Contributors

ablanco avatar albertobeiz avatar albluqmun avatar alfem avatar ant30 avatar dependabot[bot] avatar emiliosanchez avatar goinnn avatar ipablo avatar jlsalvador avatar joroca avatar juanconde avatar n1mh avatar pcaro avatar rastydnb avatar system25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gecoscc-ui's Issues

Import printers

When we run the update_printer command, now we only import the printers with PostScript drivers. We need import all printers, because we leave out many models, including generics.

"Complete JSON returned by Ohai" is not a clear description

In a workstation you can see some data (stored in Mongodb) and some data retrieved from Chef. Title for this data is "Complete JSON returned by Ohai" which needs a deep knowledge of GECOS internals.

This should be changed to "Data retrieved from workstation" ("Datos extraidos del puesto")

Error when trying to execute an update

Hi, if an administrator user tries to execute an update of the cookbook by uploading a ZIP file in /updates/add/ and there is no previous version of the gecos_ws_mgmt cookbook in Opscode Chef, the execution fails.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 936, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 909, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/local/lib/python2.7/site-packages/paste/translogger.py", line 68, in __call__
    return self.application(environ, replacement_start_response)
  File "/usr/local/lib/python2.7/site-packages/pyramid/router.py", line 272, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/usr/local/lib/python2.7/site-packages/pyramid/router.py", line 247, in invoke_subrequest
    response = handle_request(request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/tweens.py", line 46, in excview_tween
    response = view_callable(exc, request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/config/views.py", line 385, in viewresult_to_response
    result = view(context, request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/router.py", line 163, in handle_request
    response = view_callable(context, request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/config/views.py", line 245, in _secured_view
    return view(context, request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/config/views.py", line 355, in rendered_view
    result = view(context, request)
  File "/usr/local/lib/python2.7/site-packages/gecoscc/views/admins.py", line 273, in updates_add
    params = form.validate(controls)
  File "/usr/local/lib/python2.7/site-packages/gecoscc/forms.py", line 238, in validate
    return super(UpdateForm, self).validate(data)
  File "/usr/local/lib/python2.7/site-packages/deform/field.py", line 636, in validate
    return self.validate_pstruct(pstruct)
  File "/usr/local/lib/python2.7/site-packages/deform/field.py", line 671, in validate_pstruct
    appstruct = self.schema.deserialize(cstruct)
  File "/usr/local/lib/python2.7/site-packages/colander/__init__.py", line 1917, in deserialize
    appstruct = self.typ.deserialize(self, cstruct)
  File "/usr/local/lib/python2.7/site-packages/colander/__init__.py", line 604, in deserialize
    return self._impl(node, cstruct, callback)
  File "/usr/local/lib/python2.7/site-packages/colander/__init__.py", line 563, in _impl
    sub_result = callback(subnode, subval)
  File "/usr/local/lib/python2.7/site-packages/colander/__init__.py", line 602, in callback
    return subnode.deserialize(subcstruct)
  File "/usr/local/lib/python2.7/site-packages/colander/__init__.py", line 1939, in deserialize
    self.validator(self, appstruct)
  File "/usr/local/lib/python2.7/site-packages/colander/__init__.py", line 198, in __call__
    validator(node, value)
  File "/usr/local/lib/python2.7/site-packages/gecoscc/models.py", line 548, in __call__
    cookbook = get_cookbook(api, settings.get('chef.cookbook_name'))
  File "/usr/local/lib/python2.7/site-packages/gecoscc/utils.py", line 822, in get_cookbook
    return api['/cookbooks/%s/_latest/' % cookbook_name]
  File "/usr/local/lib/python2.7/site-packages/chef/api.py", line 221, in __getitem__
    return self.api_request('GET', path)
  File "/usr/local/lib/python2.7/site-packages/chef/api.py", line 217, in api_request
    response = self.request(method, path, headers, data)
  File "/usr/local/lib/python2.7/site-packages/chef/api.py", line 207, in request
    raise ChefServerError.from_error(response.reason, code=response.status_code)
ChefServerNotFoundError: Object Not Found
Wed Aug 28 08:04:17 2019 {'REMOTE_PORT': '44836', 'HTTP_HOST': '192.168.11.14', 'REMOTE_ADDR': '127.0.0.1', (hidden keys: 33)} failed with ChefServerNotFoundError

Best regards!

Deleted objects can be assigned

Following a specific (and odd) procedure, Printers, Software Profiles and Storage objects can be assigned to OUs even when they have been recently deleted.

Test Case:

  • Create a new printer
  • Assign it to a OU using 'available printers' policy. Save it, but do not apply this change
  • Delete the printer (using a different window in your browser)
  • Apply the change now
  • Check the policy: a weird error shows up.

Error when recalculating policies if the node has no inheritance information

When a computer has no inheritance information that the user clicks the recalculate policies button the following error appears:

[2020-08-31 07:42:09,129: ERROR/MainProcess] [5f48f975c19e1638e29e606d] tasks.py ::: report_generic_error - message = No save in chef server. 'inheritance'
[2020-08-31 07:42:09,130: ERROR/MainProcess] [5f48f975c19e1638e29e606d] Traceback (most recent call last):
  File "/opt/gecosccui-2.6.0/lib/python2.7/site-packages/gecoscc/tasks.py", line 2281, in object_refresh_policies
    return func(user, obj, computers=computers)
  File "/opt/gecosccui-2.6.0/lib/python2.7/site-packages/gecoscc/tasks.py", line 2008, in computer_refresh_policies
    self.object_refresh_policies(user, ou, computers=computers)
  File "/opt/gecosccui-2.6.0/lib/python2.7/site-packages/gecoscc/tasks.py", line 1703, in object_refresh_policies
    self.object_action(user, objnew, action='recalculate policies', computers=computers)
  File "/opt/gecosccui-2.6.0/lib/python2.7/site-packages/gecoscc/tasks.py", line 1599, in object_action
    recalculate_policies_for_computers(self.logger, self.db, obj, computers)
  File "/opt/gecosccui-2.6.0/lib/python2.7/site-packages/gecoscc/utils.py", line 1630, in recalculate_policies_for_computers
    recalculate_inherited_field(logger, db, str(obj['_id']))
  File "/opt/gecosccui-2.6.0/lib/python2.7/site-packages/gecoscc/utils.py", line 2285, in recalculate_inherited_field
    for policy in get_inheritance_tree_policies_list(obj['inheritance'], []):
KeyError: 'inheritance'

Users and Workstation do not disassociate from groups

If we have an Organisational Unit that has a user or a workstation inside, and a group located outside this OU associated with this user or workstation, and we delete the OU, the workstation or user is deleted but this is not disassociated from the group

Error in statistics in a new installed system

Hi, when you install a new system and you still have no data (no root OU defined) the statistics page (/admins/statistics/) fails because of the empty OUs data:

2019-08-28 10:08:50,919 DEBUG [gecoscc.views.admins][DummyThread-136] admins.py ::: statistics - sorted_ous = OrderedDict()
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 936, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 909, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/local/lib/python2.7/site-packages/paste/translogger.py", line 68, in __call__
    return self.application(environ, replacement_start_response)
  File "/usr/local/lib/python2.7/site-packages/pyramid/router.py", line 272, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/usr/local/lib/python2.7/site-packages/pyramid/router.py", line 247, in invoke_subrequest
    response = handle_request(request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/tweens.py", line 46, in excview_tween
    response = view_callable(exc, request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/config/views.py", line 385, in viewresult_to_response
    result = view(context, request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/router.py", line 163, in handle_request
    response = view_callable(context, request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/config/views.py", line 245, in _secured_view
    return view(context, request)
  File "/usr/local/lib/python2.7/site-packages/pyramid/config/views.py", line 355, in rendered_view
    result = view(context, request)
  File "/usr/local/lib/python2.7/site-packages/gecoscc/views/admins.py", line 410, in statistics
    ou_id = str(sorted_ous.items()[0][0])
IndexError: list index out of range
Wed Aug 28 10:08:50 2019 {'REMOTE_PORT': '50140', 'HTTP_HOST': '192.168.11.14', 'REMOTE_ADDR': '127.0.0.1', (hidden keys: 28)} failed with IndexError

Best regards!

Users do not dissociate from workstations

When deleting a workstation, the users associated with the workstation are not disassociated from it. This happens too when deleting an Organisational Unit which has a workstation inside, the users located outside this OU which are associated with the workstation are neither disassociated.

Policies do not merge as expected

A computer or user receives policy attributes from OUs, groups and (software) profiles.

Attributes priority is not resolved properly when many origins merge in a computer/user or when these atrributes are (by instinct) additive.

Besides, current behaviour is poorly documented.

Some discussion could be necessary before implementation.

Error accessing global Settings

Clicking the (new) Settings menu answers with "Internal Server Error".

Gecosccui log follows:

2015-06-24 11:20:44 [17665] [ERROR] Error handling request
Traceback (most recent call last):
File "/opt/gecosccui-development/lib/python2.6/site-packages/gunicorn/workers/async.py", line 45, in handle
self.handle_request(listener, req, client, addr)
File "/opt/gecosccui-development/lib/python2.6/site-packages/gunicorn/workers/ggevent.py", line 151, in handle_request
super(GeventWorker, self).handle_request(*args)
File "/opt/gecosccui-development/lib/python2.6/site-packages/gunicorn/workers/async.py", line 93, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/opt/gecosccui-development/lib/python2.6/site-packages/paste/translogger.py", line 68, in call
return self.application(environ, replacement_start_response)
File "/opt/gecosccui-development/lib/python2.6/site-packages/pyramid/router.py", line 272, in call
response = self.invoke_subrequest(request, use_tweens=True)
File "/opt/gecosccui-development/lib/python2.6/site-packages/pyramid/router.py", line 247, in invoke_subrequest
response = handle_request(request)
File "/opt/gecosccui-development/lib/python2.6/site-packages/pyramid/tweens.py", line 46, in excview_tween
response = view_callable(exc, request)
File "/opt/gecosccui-development/lib/python2.6/site-packages/pyramid/config/views.py", line 385, in viewresult_to_response
result = view(context, request)
File "/opt/gecosccui-development/lib/python2.6/site-packages/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/opt/gecosccui-development/lib/python2.6/site-packages/pyramid/router.py", line 163, in handle_request
response = view_callable(context, request)
File "/opt/gecosccui-development/lib/python2.6/site-packages/pyramid/config/views.py", line 245, in _secured_view
return view(context, request)
File "/opt/gecosccui-development/lib/python2.6/site-packages/pyramid/config/views.py", line 355, in rendered_view
result = view(context, request)
File "/opt/gecosccui-development/lib/python2.6/site-packages/gecoscc/views/settings.py", line 64, in settings
result.append(create_setting("firstboot_api.organization_name"))
File "/opt/gecosccui-development/lib/python2.6/site-packages/gecoscc/views/settings.py", line 50, in create_setting
return Setting().serialize(appstruct)
File "/opt/gecosccui-development/lib/python2.6/site-packages/colander/init.py", line 1862, in serialize
cstruct = self.typ.serialize(self, appstruct)
File "/opt/gecosccui-development/lib/python2.6/site-packages/colander/init.py", line 595, in serialize
return self._impl(node, appstruct, callback)
File "/opt/gecosccui-development/lib/python2.6/site-packages/colander/init.py", line 584, in _impl
raise error
Invalid:

Policy view of a workstation

We need to create a view to see which policies apply to a workstation directly or indirectly and which node applied it, it is a way to improve the "Concurrency problem" #37

Visibility errors

This error may occur in several cases:

When we try to associate a user with a group which is out of user's scope, the association is done successfully instead of getting an error (e.g. when associating a group inside an Organisational Unit with a user which is located outside from this OU).

When we try to add a policy to a group or a workstation using related objects (printers, storages or repositories) which are out of group's/workstation's scope. You can successfully add the policy instead of getting an error (e.g. groups and printers in different OUs in the same Domain's level).

Platform parameters should be defined in a web interface

Global variables set in gecoscc.ini need terminal/ssh access to servers in order to change them.

These parameters should be shown in a web interface (restricted to superadmins):

  • firstboot_api.organization_name ("Organization Name", currently shown in GECOS Config Assistant)
  • firstboot_api.comments ("Commentary", will be shown in a GECOS Config Assistant)
  • update_error_interval ("Workstation Out-date Limit", threshold in days to change workstation icon * color from green to yellow)
  • Repositories ("Default Software Repositories Urls", array with a list of sources.list)
  • Printer urls ("Default Printer List Urls", array with a list of prepackaged printers definitions from Openprinting)
  • Software profiles ("Default Software Profiles" list of profile names and arrays of packages)

Bear in mind these parameters should be shared among a cluster of balanced servers in a high availability production environment.

Admin usernames can not include dots

In corporative world usernames with dots (separating first name and last name, for example) are very common.

Control Center admin users can not include a dot, possibly due to a Chef constraint.

However, workstation users in the organizational tree can include dots, as they are translated back and forth to "###" when needed.

Suggestion: A sanitize username function could be useful for both kind of users.

Reorder basic information in workstation card

Basic workstation information shows something like this:

Users id GECOS
Uptime id Chef
Make & Model last connection

Ordering should be:

Make & Model id (only GECOS id, Chef id should be moved to next tab)
IP Address Uptime
Users Last connection

Log & status rest api

GECOS CC is a complex deployment. If we had a couple of methods to check last lines of webui log and server connection status, diagnostics would be much easier.

Bear in mind these api calls will be served (in production environments) by a central load balancer, and answer served by any frontend server.

Suggested urls:
/server/log?lines=100 retrieves latest 100 lines of webui logs
/server/connections retrieves a parseable list of server connection status (chef, celery)
/server/status retrieves a parseable list of monitoring data (disk space, memory, cpu usage)

These urls should be available to authenticated superusers only

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.