Open sahiilll opened 4 years ago
This is regarding the terminal_port. Following are the references to the attribute:
cd /home/vital/vital2.0/source/virtual_lab/vital_site/
grep -r "terminal_port" ./
IN TEMPLATES static html files
/templates/vital/terminal.html : There are no working references to this file. I believe this is an old file which should be removed. Please Verify and confirm.
/templates/vital/virtual_machines.html: The reference to "terminal_port" is under the if loop condition where it checks if the display server is SPICE or not. We have not been using SPICE server for long. Removing this reference from code would mean backtracking to SPICE server calls to make sure it does not get to this loop to avoid errors. Kindly confirm and proceed.
/templates/vital/console-spice.html: this should be removed as well if not in use.
/templates/vital/console-vnc.html:
OLD METHOD ( NON tokenized vnc window ) This one is even trickier. The console-vnc.html is being called by "console" view function. The console view function is supposed to fetch the terminal_port from database and pass it to the console-vnc.html. And then vnc-console.html opens up a new window with
CURRENT METHOD: ( Tokenized vnc window)
Following link is then created in virtual_machines.html to refer to student vnc console.
<a href="https://{{ server_name }}/vmconsole/vnc_auto.html?token={{ vm.token }}" onclick="return windowpop(this.href, 'Terminal-{{ vm.id }}', 825, 680, {{ vm.id }})">
(windowpop is a javascript function defined in course_vms.html)
Kindly investigate and find out what to keep and what to remove on the basis of differences between old method and new tokenized method.
IN VIEWS:
IN Management control commands
@KolyamboSunny Kindly investigate further on the issue keeping the new code and removing the old code for vnc window console. And consequently, remove the terminal_port attribute from the database safely when you are done removing all references from the code without any errors. I would be happy to help you for any questions regarding flow of source code
@treddington Professor, let me know if you find something wrong in explanation or if you want to add something to it.
TBD: no_vnc_pid removal information
TBD: audit removal information
I think this makes sense.
Following are my findings while working on the database revamping issue:
Terminal_port is a attribute to the User_vm_config. terminal port was supposed to be use when student vm gets corrupted or gets into the error and Vital admin needs to open the student vm from console directly to check and debug errors Now, this being not the case, there is no use for such attribute and should be carefully removed from the source code to avoid further mess.
no_vnc_pid: To my understanding no_vnc_pid is used to kill stray opened machines when students forget to close the session. This functionality is not being used and should be removed from source code.
audit: Yuvraj here has well documented the logging guide on the link https://github.com/vital2/vital-development/wiki/Vital-Log-&-Debugger-Guide. Although, the one thing that was missed out from the guide is audit logging. There are many references to this audit function and the output is stored in the database table "vital_audit"
Points can be further added to remove any of such trash from the code