weee-open / pesto Goto Github PK
View Code? Open in Web Editor NEWDrive SMART data checker, cleaner and system image loader.
License: MIT License
Drive SMART data checker, cleaner and system image loader.
License: MIT License
list_iso /some/path
or similar with the configured pathqueued_cannolo
send the disk and the iso path (enclose it in " (and escape any quote inside the string))Shut down the server when nothing else is queued
Add ability to select local or remote mode to include different use-related scenarios.
It's possible to test the server. Somehow. Automate the tests via GitHub CI. This requires writing some tests before.
Right now other processes block the main thread, or other threads are terminated randomly
Add IP and user entries in settings tab to establish ssh connection to the desired device.
Use paramiko to make ssh sessions and get remote smartctl results
Write some tests to check the Tarallo implementation is working correctly in every possible case, i.e: the disk is already in the DB, the disk is not in the DB but is corrupted, the disk is not in the DB and is in working conditions, etc...
Bonus:
Make a "tests" directory which contains some small virtual disks (they need to be uploaded to GitHub, so <25MB!), e.g. made with VirtualBox, for testing.
There are some buttons, both directly mapped to a command and to a process, but not for all the needed ones, currently.
Always available:
Available only when has_critical_mounts
is False (gray out or something if True, see #38):
Instead of letting the user choose which disks to ignore formatting, which is an approach prone to errors, we can use e.g. lsblk
to detect the disk where the root / partition is mounted, and some other reserved paths (e.g. /media, /mnt, /run), and automatically ignore them.
The only disks we want to format are /dev/sd*, excluding the system disk, which may not always be /dev/sda.
For every other disk containing a swap partition, we should turn the swapoff
before formatting.
queued_badblocks, queued_smartctl, queued_sleep and optionally queued_cannolo. Add a single button or a similar quick way to do that.
Low priority
If tarallo is unreachable, a million exceptions with random messages are thrown from every corner of requests and pytarallo and all disks are skipped. We need more try-excepts.
Traceback (most recent call last):
File "/S/Software/pesto/./pinolo.py", line 863, in gui_update
self.smartTabs.text_boxes[tab].append(line)
AttributeError: 'SmartTabs' object has no attribute 'text_boxes'
And it also dumps core.
Aside from raw smartctl output, pretty print status and uploaded status.
Make it more visible, or color code it, or something. Maybe make a table, or place the 2 bits of information on the same line in some way.
Related to #50 (pretty print that, too)
To erase a SSD use TRIM with:
# blkdiscard -f /dev/sdX
Will be handy if the server could know that is running in a local configuration and, when the connection is closed, it must shutdown itself to avoid that the socket in use remain occupied in case of a client crash.
To make it, the client can run the process with the command:
python pesto_server.py --local
when in local mode, and in remote mode:
python pesto_server.py
But how?
In Windows machines there are no mountpoints and the server raise an exception:
Exception while scanning for disks, skipping
Traceback (most recent call last):
File "C:\Users\Lol\Desktop\WEEE-Open\pesto\basilico.py", line 868, in scan_for_disks
disks[path] = Disk(disk_lsblk, TARALLO)
File "C:\Users\Lol\Desktop\WEEE-Open\pesto\basilico.py", line 31, in __init__
self._mountpoint_map = self._lsblk["mountpoint_map"]
KeyError: 'mountpoint_map'
Exception while scanning for disks, skipping
Traceback (most recent call last):
File "C:\Users\Lol\Desktop\WEEE-Open\pesto\basilico.py", line 868, in scan_for_disks
disks[path] = Disk(disk_lsblk, TARALLO)
File "C:\Users\Lol\Desktop\WEEE-Open\pesto\basilico.py", line 31, in __init__
self._mountpoint_map = self._lsblk["mountpoint_map"]
KeyError: 'mountpoint_map'
On windows machines it will be sufficient to send a mountpoint flag only in C: and asking for every drive if the user is sure to erase the device.
Threads wait on a lock. But they don't wait in order! If 2 threads are queued, when the lock is released, which one will go is random and depends on the scheduler!
And reload on server restart.
Use the "stale" field to mark these entries if they were in any state other than "queued" and ignore them, don't do anything, client needs to show they're stale and the last state, if they were running they probably stopped halfway. Queued entries don't need to be stale and they can be started, if the disk still exists.
Maybe also put HDDs to sleep automatically
Now the client can get all the drives thanks to the server but it cannot know what os is running in the server to choose the function to get drives list. Instead the server can get the os in which it is running on and decide if use get_disks() or get_disks_win().
Since multiple ones for the same disk can be shown, add a date and time.
They are ordered but doing it more than twice gets confusing otherwise.
Should we set erased = no before erasing and similar?
It would be easier to detect if the piallaggio has completed or not or if it has failed or if the final update of tarallo succeeded or not.
Discuss.
Call swapoff, see #15
and reload it when starting
Right click to show drop down menu with:
The log file must be saved somewhere in /var
and configurable via the config file.
Make use of the logging
library.
When received, display it in a huge message box.
It means the disk is failing, see commented-out code
Also write the right commands to install one or the other in the readme
It would be a very nice, if not needed, improvement.
Suggestions:
tqdm
in PythonOnly if it doesn't have a code. A button to do that is needed.
Traceback (most recent call last):
File "/S/Software/pesto/./pinolo.py", line 825, in main
window = Ui(app)
File "/S/Software/pesto/./pinolo.py", line 119, in __init__
self.set_items_functions()
File "/S/Software/pesto/./pinolo.py", line 147, in set_items_functions
self.latest_conf()
File "/S/Software/pesto/./pinolo.py", line 281, in latest_conf
self.port = int(self.settings.value("remotePort"))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Should we do that?
The current method of "do not bother me again" answer is good for testing, but conditions users into immediately ignoring the message box, this is just a disaster waiting to happen when someone erases /dev/sda with no warning...
Make some widgets fill available space instead of hardcoding every size (hardcode just some sizes)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.