-
Notifications
You must be signed in to change notification settings - Fork 36
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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.
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inumu_version.json
for major versions. The end result is that this scales better, as a single change toruntime_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 withsteam-container-runtime
. This change also deprecatesBUILD_ID.txt
in$HOME/.local/share/umu
, and the launcher will no longer download it.