Skip to content

API draft for the rewrite#308

Draft
oskardotglobal wants to merge 18 commits into
winapps-org:rewritefrom
oskardotglobal:feat-rewrite-api
Draft

API draft for the rewrite#308
oskardotglobal wants to merge 18 commits into
winapps-org:rewritefrom
oskardotglobal:feat-rewrite-api

Conversation

@oskardotglobal

@oskardotglobal oskardotglobal commented Oct 29, 2024

Copy link
Copy Markdown
Member

This PR is a draft for how the API of the rewrite could look like.
There are no implementations yet, but once the API is stable the implementations for features can gradually be put in place.

The main difference between the design of legacy WinApps is that the config is the single source of truth for installed apps and will later also contain paths to the icons for the installed apps, meaning we can get rid of the "pre-configured" apps currently found in the apps folder. A sample config would look like this:

[auth]
username = "Docker"
password = ""
ssh_port = 2222
rdp_port = 3390
domain = ""

[container]
enable = true
enable_podman = false
container_name = "WinApps"

[libvirt]
enable = false
vm_name = "RDPWindows"

[manual]
enable = false
host = "127.0.0.1"

[freerdp]
extra_args = [
    "/cert:ignore",
    "+auto-reconnect",
    "+span",
]
executable = "xfreerdp"

[linked_apps.explorer]
name = "Explorer"
win_exec = "explorer.exe"

# [linked_apps.<...>]
# name = ...

Disclaimer: I've used LLMs for planning purposes ("diffing" the rewrite with the legacy version) and to help decide where mocking for e2ee testing makes sense. However, all the code was written by me.

TODOs

  • Libvirt implementation
  • Basic app detection
  • Uninstalling apps
  • Changing the RDP port
  • Loading apps from multiple files / a well-defined folder / ... so we can better ship pre-defined apps
  • podman unshare support
  • MIME type support
  • port improved app detection
  • ms office URL handlers
  • RDP_SCALE
  • autopausing
  • different flags for desktop and app mode
  • improved freerdp discovery

Comment thread winapps/src/backend/docker.rs Fixed
Comment thread winapps/src/backend/docker.rs Fixed
Comment thread winapps/src/remote_client/freerdp.rs Fixed
Comment thread winapps/src/remote_client/freerdp.rs Fixed
Comment thread winapps/src/lib.rs Fixed
Comment thread winapps/src/lib.rs Fixed
@oskardotglobal

Copy link
Copy Markdown
Member Author

I've been working on this and there are still some implementations and features missing, but as far as the API goes I think it's pretty good.

This is currently still missing the entire libvirt implementation as well as the MULTIMON and SCALE config settings and the app detection, which doesn't even have a proper Api yet.

However, the connection check using a TcpStream should already be more stable than the simple check using Netcat, so I think there's a lot of value to be had here once this is more feature-complete.

Comment thread winapps-cli/src/main.rs Outdated
Comment thread winapps-cli/src/main.rs Outdated
Comment thread winapps/src/errors.rs
Comment thread winapps/src/errors.rs
Comment thread winapps/src/config/operations.rs Outdated
@LDprg

LDprg commented Jan 15, 2025

Copy link
Copy Markdown
Member

This seems great (just a quick look, no proper review). I didn't checked the repo in a while (as written before I sadly lack time to work on winapps at the moment). Didn't expect this to be that far.

@oskardotglobal oskardotglobal requested a review from Copilot April 2, 2025 13:39

This comment was marked as resolved.

@oskardotglobal oskardotglobal force-pushed the feat-rewrite-api branch 2 times, most recently from 3fa000f to ccde666 Compare June 28, 2025 20:56
@oskardotglobal

Copy link
Copy Markdown
Member Author

Ok, I've had some more time to work on this.

The libvirt implementation is still missing, but I'm working towards apps now. The most notable change is the addition of a custom docker image, which already includes the OEM files. The install script has also been changed to now set up an SSH server automatically, which I'll be using for discovering the apps.

This means that basically every feature from the winapps script itself is implemented, I just need the installer logic now; so this should be ready for review soon.

Comment thread shell.nix Outdated
@oskardotglobal

Copy link
Copy Markdown
Member Author

Thanks, git

Comment thread .envrc.example Outdated
Comment thread CONTRIBUTING.md Outdated
@oskardotglobal

Copy link
Copy Markdown
Member Author

Right, rebasing to sign off commits broke history, so I had to scrap all of it, forcing me to squash everything into one commit. Sorry about that.

Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
@oskardotglobal oskardotglobal self-assigned this Oct 3, 2025
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
…into feat-rewrite-api

Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>

# Conflicts:
#	.github/workflows/ci.yaml
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
@oskardotglobal oskardotglobal marked this pull request as ready for review October 5, 2025 13:49
@oskardotglobal oskardotglobal requested a review from LDprg October 12, 2025 14:24
@coderabbitai

This comment was marked as resolved.

@oskardotglobal

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>

@LDprg LDprg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work @oskardotglobal!
I made a quick review for now (I think we will need to do this in multiply cycles because of the PR size).

I don't know what I should think of those AI reviews. I dislike the thought of AI companies making money of open source projects without asking the developers/maintainers.

Comment thread .envrc.example
Comment thread .github/workflows/build.yml
Comment thread .gitignore
Comment thread .pre-commit-config.yaml
Comment thread Cargo.lock
Comment thread winapps/src/config/operations.rs Outdated
Comment thread winapps/src/dirs.rs Outdated
Comment thread winapps/src/lib.rs Outdated
Comment thread winapps/src/remote_client/freerdp.rs Outdated
Comment thread winapps/src/config/operations.rs Outdated
@LDprg

LDprg commented Oct 12, 2025

Copy link
Copy Markdown
Member

We should update the packages to latest and switch from edition="2021" to edition="2024".
Also switching to rust workspaces would help alot.

Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
@oskardotglobal

Copy link
Copy Markdown
Member Author

I've addressed some of your comments. Regarding the AI review, I triggered that myself; I wanted to try it. I honestly can't argue against the quality; it was pretty good. There are settings which auto-generate PR summaries and auto-review PRs which I find to be too intrusive, but if triggered manually I think it could be useful. We should have a discussion about an AI policy for our project, though.

@LDprg

LDprg commented Oct 29, 2025

Copy link
Copy Markdown
Member

A first test resulted in following issues:

  • the default config seems to throw an error about manual.host
  • if the winapps throws an error you cannot show the help menu
  • the default docker credentials should be the default ones in the config

Great work on the error management, btw!

@oskardotglobal oskardotglobal marked this pull request as draft December 5, 2025 12:21
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
@oskardotglobal oskardotglobal moved this to In review in Rewrite roadmap Jan 18, 2026
@oskardotglobal oskardotglobal added the rewrite Using the winapps rewrite label Jan 25, 2026
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>
Signed-off-by: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com>

@LDprg LDprg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I did a quick dirty review. Seems all fine to me (however no testing on my side).

Sry for the late review (I am currently very busy).

@oskardotglobal

Copy link
Copy Markdown
Member Author

No problem. I still have some stuff i'd like to implement (unit tests, better freerdp binary discovery) before this is ready for a full review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rewrite Using the winapps rewrite

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants