Skip to content

[master] Feature 727211 SCALUS Modernization - #234

Merged
LeeHoward1 merged 124 commits into
masterfrom
modernization-2.0
Nov 30, 2026
Merged

LeeHoward1 merged 124 commits into
masterfrom
modernization-2.0

Conversation

@LeeHoward1

Copy link
Copy Markdown
Contributor

No description provided.

…tests

Delete the stale 'scalus - Backup.csproj' and its dangling .cs.hide item references, and pin the in-band Safeguard username decode behavior with characterization tests ahead of the core refactor.
Delete the Kestrel-hosted ASP.NET UI, its REST controllers, the bundled Angular 14 app, and the dual-container bridge. The console tool no longer boots a localhost web server or opens the system browser; configuration moves to a dedicated desktop UI. Convert the project from the Web SDK to the console SDK and drop the ASP.NET package dependencies.
Retarget both projects to net10.0, refresh test tooling, and update the RID to win-x64. Switch enum, dictionary, and reflection call sites to the modern generic and TryGetValue forms the newer analyzers expect. Regex and P/Invoke source-generator suggestions are kept as warnings for now.
Replace the local web server and system-browser configuration flow with a
Photino-hosted native window that loads the Angular UI over a custom app://
scheme and calls the core in-process through a JSON bridge. The bridge exposes
config read/write, validation, protocol registration, tokens, parser and
application metadata, platform detection, and import/export file dialogs.

On first launch the app seeds a per-platform default configuration if none
exists. The Angular front-end is built and staged into the host output at
build time and is never checked in.
The basic Windows registrar decided whether SCALUS owned a protocol by testing
whether the registered command merely contained the binary file name. That also
matched a different SCALUS install or any unrelated handler whose command line
happened to mention the name. Compare each token of the registered command
against this binary's canonical absolute path instead.
The Safeguard/SPS in-band username carries a one-time authorization token. It
was written verbatim to the log wherever the URL or the substituted launch
arguments were traced. Add a redaction helper that masks the token value in
both separator styles and apply it at every site that logs the URL or args.
The macOS user-default registrar shelled out to a separate "scalusmac" Swift
tool to call LaunchServices. Call LSCopyDefaultHandlerForURLScheme and
LSSetDefaultHandlerForURLScheme directly through P/Invoke so there is no extra
binary to build, ship or sign, and drop the Swift project and its build step.
The app:// custom-scheme handler was never invoked by WebView2, leaving the window blank. Load index.html directly from the staged wwwroot instead, which renders the Angular app and keeps the in-process bridge working. Also stage scalus.ico and apply it to the window and executable.
The bridge was overwriting window.external.receiveMessage instead of calling it to register a callback, so every response from the host was dropped and the UI never populated. Call receiveMessage with the handler as Photino expects.
…d on first run

Seed the shipped client definitions so the Applications list isn't empty on a fresh install, and present rdp and ssh as unconfigured protocol rows so nothing registers with the OS until the user picks an application. Always ensure rdp and ssh rows exist even for hand-edited configs.
The Applications tab lists client definitions for every platform, but a handler can only launch a client that runs on this machine. Filter the assignment dropdown to applications whose supported platforms include the running OS. Also fix a corrupted separator character in the picker label.
Render the hint text as a flowing sentence instead of laying each fragment out as a flex item, add breathing room above the note, and give the individual-application card a single-square icon on a blue badge to match the full-configuration card.
The native save picker returns immediately with no dialog when it is
given a suggested file name that doesn't exist yet, so export appeared
to do nothing. Point it at the Documents folder instead, and append a
.json extension afterward when the chosen name doesn't have one.
The replace-configuration and discard-changes confirmations used the
native window.confirm() popup, which shows an out-of-place 'This page
says' banner. Route both through a small in-app modal that reuses the
existing dialog styling, with a red action button for the destructive
choice.
The launcher and the configuration UI resolved the config path
differently: on Windows and Linux it fell back to the binary directory,
so edits made in the UI could land next to the executable while the
launcher read from the per-user location. Resolve to the per-user
application data directory everywhere (as macOS already did) so both
read and write the same SCALUS.json, and so the config stays writable
when SCALUS is installed under a read-only path such as Program Files.
Add TemplateContent/TemplateExtension plus LineEnding and Encoding
controls to ParserConfig so launch templates live visibly in the
config instead of relying on an embedded default or an external file.
The write path reconstructs the wire format (CRLF/BOM for .rdp, LF/UTF8
otherwise) from LF-canonical stored text. Legacy UseDefaultTemplate/
UseTemplateFile still deserialize and are migrated to inline content
on load and once on disk at startup.
Replace UseDefaultTemplate/UseTemplateFile in the default and per-OS
SCALUS.json seeds with the resolved template text so a fresh install
ships visible, editable templates instead of pointing at embedded
defaults or files under %AppData%.
Replace the launch-strategy dropdown and UseTemplateFile path with a
'Generate a connection file' toggle plus an inline template content
editor, file extension, and advanced line-ending/encoding controls.
New RDP applications prefill from the built-in default template; the
bridge and seed data now carry TemplateContent/TemplateExtension.
Replace the free-form Options textarea with a single wait-strategy
dropdown (pause, wait for ready, wait for exit, or wait N seconds),
matching how the launcher actually applies those mutually exclusive
options. Drop the PostProcessingExec/Args fields from the editor UI;
they remain in the model and round-trip untouched through load/save
for the rare configs that use them.
Loads an older on-disk config that uses both UseDefaultTemplate and
UseTemplateFile, pulls the external template files in from disk, runs the
migration, and compares the whole result against a known-good fully-inlined
golden config. Covers default-template inlining, CRLF->LF normalization of
external files, .remmina extension derivation, PostProcessing round-trip, and
command-only apps being left alone.
…check

Covers the PostProcessing round-trip claim on real data: editing and saving
an app leaves PostProcessingExec/Args exactly as they were, plain apps stay
clean, saves are idempotent. Also drives the migration through the real
Load(path) so inlining is verified end to end, not just the in-memory helper.
Mechanical first cut of the Core/CLI separation: the shared project becomes a
Scalus.Core class library and a new thin Scalus.Cli project owns Program.cs and
produces the scalus executable. Test and UI project references are unchanged
since the .csproj filename stayed the same. Autofac, Newtonsoft, CommandLineParser
and the verb handlers still live in Core for now; relocating the verbs and
swapping the DI container and serializer come in follow-up commits.
Move all configuration serialization onto System.Text.Json with a
source-generated context (ScalusJson) so the Core library stays
trim- and NativeAOT-friendly. The disk format is unchanged: camelCase,
indented, enums written as names, case-insensitive on read so legacy and
hand-edited files still load. The bridge response envelope keeps its
PascalCase shape for the Angular UI.

Converts the DTO attributes, the load/save paths, the info/verify CLI
dumps, and the Photino bridge off Newtonsoft, and drops the package from
Core and the test project. The characterization tests are retargeted to
the shared serializer, and the launch-args fixtures are rewritten as
valid JSON (System.Text.Json does not accept single-quoted JSON).
Build the container with a plain ServiceCollection/ServiceProvider so the
core has no reflection-based DI left to trip up trimming or NativeAOT. The
old assembly-module scan and the five verb Module.cs files are gone;
services are now registered explicitly, one interface at a time.

The named-application resolution (Named<IApplication> + TypedParameter)
is replaced by CreateVerbApplication, which maps the parsed options type
to its application and builds it with ActivatorUtilities so the parsed
options still flow into the constructor alongside the injected services.
The CLI resolves through GetRequiredService and the Photino bridge now
takes an IServiceProvider, keeping its per-call transient configuration
resolves. Also drops an unused Autofac using in the RDP parser.

Builds clean across Core, CLI and UI, all 43 tests pass, every verb
resolves, and the UI bridge starts cleanly.
LeeHoward1 and others added 21 commits October 6, 2026 11:34
Feature 727211 SCALUS 2.0 Upgrade Angular to 22.2.x; make unregister options visible
…above 65535, which is the limit for the 4th build number in some software.

Update path handling to work cross-platform.
TFS 727211 SCALUS 2.0 - Pipeline bug fixes
…ls if the app doesn't support the current OS; Change button name
Feature 727211 SCALUS Modernization - clear apps on import if not applicable
Feature 727211 SCALUS Modernization - Fix Remmina parsing, port issues, standardize filename
…t the launch information. It only applied to the general log files.
Feature 727211 SCALUS Modernization - Remove confusing text
Feature 727211 SCALUS Modernization - Revert Filename
@LeeHoward1 LeeHoward1 changed the title Feature 727211 SCALUS Modernization [master] Feature 727211 SCALUS Modernization Nov 30, 2026
Comment thread src/Platform/OsServicesBase.cs Resolved
Comment thread src/Platform/OsServicesBase.cs Resolved
Comment thread src/Platform/Unix/LinuxElevator.cs Resolved
Comment thread src/Platform/Windows/WindowsElevator.cs Resolved

@orca-security-us orca-security-us Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed OSS Licenses high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Malicious Packages high 0   medium 0   low 0   info 0 View in Orca
Passed Warning SAST high 4   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca
🛡️ The following SAST misconfigurations have been detected
NAME FILE
high OS Command Injection Vulnerability Detected ...rm/OsServicesBase.cs View in code
high OS Command Injection Vulnerability Detected ...rm/OsServicesBase.cs View in code
high OS Command Injection Vulnerability Detected ...nix/LinuxElevator.cs View in code
high OS Command Injection Vulnerability Detected ...s/WindowsElevator.cs View in code

Note: The scan should have failed if no policies were configured in warn-only mode.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@LeeHoward1
LeeHoward1 merged commit e2234ff into master Nov 30, 2026
18 checks passed
@LeeHoward1
LeeHoward1 deleted the modernization-2.0 branch November 30, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants