Commit Graph

115 Commits

Author SHA1 Message Date
Daniel Markstedt 85edd50047
Partition and format HFS/FAT volumes in the Web UI + SMB install (#946)
- New "format as" option when creating new images; removing the image creation options from easyinstall
- Bring in HFSer as new submodule providing the driver binaries; removing the Lido driver binary from this repo
- Add SpeedTools driver option
- Point to github mirror of hfdisk, since the original git server is down
- While rearranging the easyinstall options, moved the CtrlBoard option up to the main section
- Add an easyinstall script to configure Samba, while consolidating file sharing with Netatalk
2022-11-01 16:43:24 -07:00
Daniel Markstedt 4b109a70b0
Improve Web UI integration tests (#939)
* Remove deprecated critital log level from test

* Move drive_properties back into template data sets

* Move properties data integrity checks to test code

* Streamline the drive formatting logic
2022-10-25 08:51:04 -07:00
Daniel Markstedt 8ec5b53b28
Bump the Web UI requests lib to 2.28.1 (#938) 2022-10-24 12:53:50 -07:00
Daniel Markstedt 1da3caf568
Bump to the latest bjoern/Flask/Jinja2; click/itsdangerous/MarkupSafe are implicit dependencies of the above so removing explicit requirements. (#935) 2022-10-24 11:50:35 -07:00
dependabot[bot] db2c542c97
Bump protobuf from 3.20.1 to 3.20.2 in /python/web (#933)
* Bump protobuf from 3.20.1 to 3.20.2 in /python/web

Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 3.20.1 to 3.20.2.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.20.1...v3.20.2)

---
updated-dependencies:
- dependency-name: protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-23 19:06:23 -07:00
Daniel Markstedt 5172d167e7
Web UI: More file path sanitation, better network bridge warnings, each endpoint return one message (#932)
- Sanitize file paths with Path: for flat file structures, always extract Path().name, and for nested file structures either look for absolute paths, or someone trying to use ".." to traverse the dir strucutre.
- Reduce redundancy in network bridge detection method, and return somewhat more informative messages
- Make all endpoints return exactly one message
- Move some warning messages to logging
- Use tempfile for iso generation temp file handling
2022-10-23 19:05:29 -07:00
Daniel Markstedt e3e833b4d2
Fix one case of Path object conversion that was missed during the refactoring (#929) 2022-10-22 08:01:08 -07:00
Daniel Markstedt efd40ceab2 Descriptive names for file transfer target dirs 2022-10-19 19:31:59 -07:00
Daniel Markstedt aed793001d Change locale fallback to info logging 2022-10-14 19:39:32 -07:00
nucleogenic 6514e24770
Docker container for Pytest (#901)
* Dockerize Pytest

* Fix auto-delete warning in delete file test

* Allow tests to be executed with a non-default home dir

* Use hostname for Docker container only if tests executed in Docker

* Update container entrypoint to pytest

* Re-format tests with black

* Define if the execution environment is a Docker container in env fixture

* Skip unsupported host bridge attachment test in Docker
2022-10-14 19:30:08 -07:00
Daniel Markstedt a8ac6a06cf
Fix a web UI integration test (#912)
Fix an integration test that hadn't been updated after the refactoring
2022-10-14 09:12:57 -07:00
Daniel Markstedt 5a679509a1
More refactoring of Python code to address Sonar issues (#906)
- Use Path objects for file operations
- Use urllib to sanitize URLs
- Some explicit type conversions
- Consistent regex syntax
- Add rudimentary logging when archive extraction caching fails
- Fixed two cases of the property file creation not being notified in the Flash message
- added doctype and html lang attribute to the web server 502 page
2022-10-12 12:59:01 -07:00
n4al d6153e9647
Updating Spanish translation (#902)
* Updating Spanish translation

* Removing unused translations
2022-10-10 08:54:27 -07:00
Daniel Markstedt e8c3deea2f Update translations 2022-10-09 16:18:17 -07:00
Daniel Markstedt 1b10b123d2
Refactor python code to address Sonarcloud issues (#900)
- copy/move/delete file class methods now take Path objects as arguments
- The file download endpoint in the Web UI uses the safer download from dir method
- Simplified logging
- Merged nested if statements
- Removed naked handling of unknown error states
- Added fallback empty list for drive_properties, to avoid errors when json file is missing or broken
- Move drive_properties to env[]
- Constants for common error messages
- Dummy variable for list comprehension
2022-10-09 13:50:20 -07:00
Daniel Markstedt 62e287c96d
Remove redundant help text, table columns and parameters from the Web UI (#898)
- Remove the Size option from the Drives page, since we offer custom sizes with Drive profiles now in the Create Image form
- Fetch size from drive props data structure rather than the web form
- Remove a range of redundant / obvious help text to reduce UI clutter and emphasize the important help text
- Remove the Size column from the CD-ROM drives table since it's always N/A
- Merge the two Logging related sections, and the two Create Image related sections (semantically associated)
2022-10-07 19:55:53 -07:00
Daniel Markstedt d1a703418c
Address Sonarcloud issues for the html code; improve on css styles (#892)
Refactor and clean up code to conform to SonarCloud static analysis, improve readability and semantics.
- Add labels for each form input, and tweak placeholder text accordingly.
- Move CSS styles to the stylesheet; minor tweaks for clarity and consistency
- Use the legacy align=center attribute for centering paragraphs (backwards compatible)
- Remove all instances of using tables for layout
- Add header tags to all remaining tables, with scope parameters.
- Add descriptions to each table
- Move drive reference hyperlinks to the drive name column (addresses "same link text leads to different URL" code smell.)
- Inject lang parameters to each html tag
- Standardize on h2 tags as top header for each template
- Add 'json' to config file UI elements, to communicate actual file name/format
- Clean up indentation
- Dropbox styling: Added a colored outline, added padding to more clearly communicate its function. Hid the (X) SVG that indicates failure, since failure is already communicated by the error text. Also, the SVG always obstructed the file name or error so was quite counter-productive.
2022-10-07 13:13:29 -07:00
Daniel Markstedt 90ace5fd53
Introduce utility method to look up drive props by drive name. (#888)
* Introduce utility method to look up drive props by drive name.

* Make /drive/create endpoint fetch file ending from properties data structure; update tests
2022-10-06 14:04:41 -07:00
Daniel Markstedt 52ebb3a2ae
Improve the logic and data structure for SCSI ID management in Web UI (#893)
- Have the get_scsi_ids() utility method return a dict, while adding occupied_ids. Leverage this to improve the logic for detecting which IDs are available to be reserved in the Web UI. (Which fixes a recent regression bug that's causing no IDs to be detected as available to be reserved.)
- Improve /scsi/attach endpoint logic to capture dynamic parameter fields now prefixed with "param_" (previous it scanned for any arbitrary field, which wasn't very accurate or secure)
- Added Product string to the block_size:512 CD-ROM device, so that it's obvious when it's being used.
- Tweaked test data for attach_device tests
2022-10-06 10:00:57 -07:00
Daniel Markstedt 52259c374f
Improve the logic for checking the network bridge configuration (#894)
* Improve the logic for checking the network bridge configuration
2022-10-05 14:14:48 -07:00
Daniel Markstedt 0e4d42f04c
Use man2html to generate man pages in the Web UI (#887)
* Use man2html to generate man pages in the web UI

* Fix tests
2022-10-04 06:38:15 -07:00
Daniel Markstedt dcb4b33f2e
Add capabilities to get and render manpage output in the Web UI (#881)
- class method to get arbitrary file contents
- new web UI endpoint to fetch the contents of rascsi man pages (rendered txt files)
- Link to manpage in page footer
- Link to new wiki page for image type docs
- Other UI tweaks
2022-10-03 12:46:18 -07:00
Daniel Markstedt fd47411322
Device table refinement in Web UI (#884)
* Refine the attached device table to optimize information displayed

* Error handling when attempting to insert withough image file

* Format the parameters in the jinja template instead

* Call the DaynaPORT device Ethernet Adapter in the Web UI
2022-10-03 11:47:08 -07:00
Daniel Markstedt 2dae021cdd
Merge pull request #883 from akuker/rdmark-generalize-properties
Allow for generating properties files in the Create Image UI
2022-10-02 09:49:49 -07:00
Daniel Markstedt 5e4fa38051
Add missing watchdog requirement (#880) 2022-10-02 15:30:28 +02:00
Daniel Markstedt c07e1a8ede Allow for generating properties files in the Create Image UI 2022-10-01 19:56:19 -07:00
Daniel Markstedt d969fbdcce
Attach empty removable drives in the Web UI (#877)
* Read the drive properties file once and store it in the Flask app config. Spin out the drive properties formatting to a helper method.

* Add empty removable disk drives to the attach peripherals UI

* Refinement of UI labels and help text, moving some context to the wiki
2022-10-01 16:51:30 -07:00
Daniel Markstedt 78bab77f4b
Swedish localization update 2022-09 (#874)
* Swedish localization updates

* Use LUN for compactness
2022-09-30 21:20:19 -05:00
Daniel Markstedt 3c8e7dbef0
Allow the selecting of target dir when uploading or downloading files (#867)
Uses a single endpoint for downloading files
Adds a select field to pick target dir for both download and upload forms
Moves the Macproxy/Netatalk helptext into the helptext blocks, and the related status messages down into the page footer
2022-09-27 17:38:34 -07:00
nucleogenic 70c073e928
Display a warning when Pytest fixtures fail to delete a file 2022-09-27 15:39:58 +01:00
Daniel Markstedt 5da3d6c24b
Introduce info.html template and use it to render detailed info (#863)
new:
- new templates to render structured info contents in
- get_diskinfo() class method that calls disktype and returns the results
- /diskinfo endpoint in the Flask app that renders the results from get_diskinfo()

changed:
- /logs/show and /scsi/info endpoints in the Flask app render in templates
- Now using the "RaSCSI Reloaded Control Page" header to function as the link back to the homepage (instead of the github project) which is in line with how most webapps work
- Removed the center style for "Attached!" to allow the ? button to be placed on the same line
- Remove individual device info, and introduced show all device info in a template
2022-09-26 17:44:41 -07:00
Daniel Markstedt edbaaf645d
Web UI tweaks: Detaching removable devices; SCSI-1 drive profiles (#854)
* Display the Detach action for injected removable media

* Flag three DEC drives as SCSI-1
2022-09-25 17:37:28 -07:00
nucleogenic 75b0994b77
Add missing asserts to API tests 2022-09-26 00:00:20 +01:00
nucleogenic a142af571d
Improve organisation of tests 2022-09-26 00:00:20 +01:00
nucleogenic 6f7e611aa1
Add missing dev dependency flake8 2022-09-26 00:00:19 +01:00
nucleogenic f8e58708aa
Update comments 2022-09-26 00:00:19 +01:00
nucleogenic 663de0631e
Added tests for extracting .sit and .7z archive formats 2022-09-26 00:00:19 +01:00
nucleogenic 65c2286ffe
Fix shell exit issue in web/start.sh 2022-09-26 00:00:19 +01:00
nucleogenic 8062e5f5d7
Updates to allow tests to run against a remote RaSCSI instance 2022-09-26 00:00:19 +01:00
nucleogenic 1a15c4c648
Expose env info to API clients 2022-09-26 00:00:19 +01:00
nucleogenic 0e6147e0bb
Setup pytest, flake8, black + add API tests 2022-09-26 00:00:18 +01:00
nucleogenic dd40d7156a
Fix issue causing stale reservations after loading a config 2022-09-26 00:00:18 +01:00
nucleogenic fb8f306005
Implement response generator for HTML and JSON requests
Supporting updates to web.py and templates
2022-09-26 00:00:18 +01:00
nucleogenic 1e9a7d2283
Move flattening of file type lists to template layer 2022-09-25 23:58:07 +01:00
nucleogenic 4ef2e20b4f
Update get_supported_locales to return a JSON serializable result 2022-09-25 23:58:07 +01:00
nucleogenic edf65a8768
Update RaCtlCmds methods to return JSON serializable results 2022-09-25 23:58:07 +01:00
Daniel Markstedt 12b61ada84
Consistently use SI-compliant notation for file sizes (B/KiB/MiB/GiB/TiB) where appropriate. (#855) 2022-09-25 16:37:36 -05:00
dependabot[bot] e513af694b
Bump protobuf from 3.19.3 to 3.19.5 in /python/common (#856)
* Bump protobuf from 3.19.3 to 3.19.5 in /python/common

Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 3.19.3 to 3.19.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.19.3...v3.19.5)
2022-09-25 10:51:05 -07:00
dependabot[bot] 37ee5cd47f
Bump protobuf from 3.19.3 to 3.19.5 in /python/ctrlboard (#858)
* Bump protobuf from 3.19.3 to 3.19.5 in /python/ctrlboard

Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 3.19.3 to 3.19.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.19.3...v3.19.5)
2022-09-25 10:49:53 -07:00
dependabot[bot] d642b49bf6
Bump protobuf from 3.19.1 to 3.19.5 in /python/oled (#857)
* Bump protobuf from 3.19.1 to 3.19.5 in /python/oled

Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 3.19.1 to 3.19.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.19.1...v3.19.5)
2022-09-25 10:47:33 -07:00