Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor updates to the runtime platform #111

Merged
merged 12 commits into from
Jun 10, 2024

Conversation

R1kaB3rN
Copy link
Member

@R1kaB3rN R1kaB3rN commented Jun 10, 2024

Improves the update procedure of the runtime, by simply globbing the runtime alias such as sniper in $HOME/.local/share/umu and including the runtime alias as part of the hard coded files names and the url of the endpoint containing the Steam Runtime.

Like before, the value of runtime_platform will need to be adjusted in umu_version.json for major versions. The end result is that this scales better, as a single change to runtime_platform should change the url of the endpoint along with the hard coded files names, assuming Valve doesn't make major changes to file names in the future like it had done with steam-container-runtime. This change also deprecates BUILD_ID.txt in $HOME/.local/share/umu, and the launcher will no longer download it.

R1kaB3rN added 10 commits June 10, 2024 12:40
- Prefer changing the value to the runtime's alias. Currently, the launcher fetches from the endpoint https://repo.steampowered.com/steamrt3/images/latest-container-runtime-public-beta where steamrt3 corresponded to the value of runtime_platform in umu_version.json. Instead, we can fetch from https://repo.steampowered.com/steamrt-images-sniper/snapshots/latest-container-runtime-public-beta and set the alias as the value for the runtime_platform. This scales better as it will only require a single change in the configuration file, since all the hard coded file names such as SteamLinuxRuntime_sniper.tar.xz will contain the same alias
- Instead of using the value written in BUILD_ID.txt or even VERSIONS.txt to locate the runtime, we can simply glob top-level directories in $HOME/.local/share/umu that start with the value in runtime_platform in our configuration file. This saves a request as well as an extra file that needs to be written. As far as Steam's runtime directory names for its container runtime framework, this pattern is currently consistent with Soldier (e.g., soldier_platform_0.20240530.90142) which should be safe. In the future, when we build our runtime, the name of the runtime directory will need to start with the value of runtime_platform in umu_version.json
- Change value for runtime_platform in umu_version.json to sniper and update function call to check_runtime
- Only check if the pressure-vessel directory exists
- In the case VERSIONS.txt file is missing, the launcher may fail to update to the latest runtime as the file may or not be associated with the build. To solve this problem, the launcher needs to  make a request to the endpoint corresponding to the runtime's build id instead of the public beta endpoint (e.g., repo.steampowered.com/steamrt-images-sniper/snapshots/0.20240530.90143). To do this, the launcher gets the value from the os-release file in the runtime to create the correct url
- The launcher will use this value to dynamically create values to fetch resources or to locate files. Attempt to mitigate against directory removal attacks for user installations in the home directory by comparing the value retrieved from umu_version.json against a whitelist. However, this still wouldn't protect against really sophisticated attacks as an infinite things can happen once files are in the home directory.
@R1kaB3rN R1kaB3rN marked this pull request as ready for review June 10, 2024 20:24
@R1kaB3rN R1kaB3rN merged commit d01beb3 into Open-Wine-Components:main Jun 10, 2024
4 checks passed
@R1kaB3rN R1kaB3rN deleted the no-build-id branch June 10, 2024 20:30
@R1kaB3rN R1kaB3rN mentioned this pull request Sep 5, 2024
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.

1 participant