Repository navigation
add type3 spec - #56
Samueru-sama wants to merge 1 commit into
Conversation
|
This requires a more detailed discussion. Just some key points:
|
What are the issues exactly?
You already set I also don't know what you mean by "being inelegant", thanks to variables like
Alright but not adding fallback to |
For example, AppImages with these magic bytes don't run in certain environments. See the many magic-related issues.
"Thanks" to XDG specifications, we have to deal with inelegant solutions like copying around desktop files and icon files. Neither of which is necessary on Windows nor the Mac.
If all apps actually really worked that way, maybe. But currently few do.
Well, just looking at an AppImage in the file manager should never lead to the AppImage being executed. After all, it could be really anything that gets executed. |
No it is not confusing to users. The variable even says it in its name, it is for configuration files. It is also not rarely used, I use it everyday and we had to include the other XDG variables because of requests. 1 2
That's the Desktop entry spec, different thing. The XDG Base dir spec is also not that different from what MacOS does.
Do it in a sandbox then, it is going to be 15 lines of POSIX shell. Nautilus actually sandboxes all thumbnailers for this reason, and more recently GNOME is working on something called glycin which sandboxes its binaries with bwrap to do svg rendering because with svg anything could be executed. |
|
If we ever do a type 3 spec, we should probably store icons and similar metadata out of the compressed filesystem, so that AppImages could use any file format for that and still be compliant, with file managers still being able to access icons etc. |
there is no need to do this since the appimage runtime supports the Just run I will also add I don't have energy to be arguing about this anymore, @probonopd likes to disappear for a while and then come back forgetting everything that has been talked about before. |
|
File managers must be able to extract e.g., the icon and other metadata without executing code from the AppImage for security reasons. |
|
Lets not have a sandbox as a dependency. Scientific tests started at https://github.com/probonopd/AppImageTests/. |
Why not?
We use |
|
Putting in bubblewrap into the runtime that you can't trust by definition doesn't solve the security concerns. A while back, I suggested sandwiching a .zip archive in between the ELF header and the actual payload. This is straightforward to parse (zip implementations just skip data until they find a zip header, also zip is widely available in most programming languages). |
|
Reading @Samueru-sama's statement again, I think you meant that desktops should use a sandboxed process to parse data. Yes, that would be good. Still the overhead of running an executable is suboptimal. And the runtime parameters were never standardized. |
bublewrap would not be in the runtime, that makes no sense.
|
Well Worst case scenario nothing happens, the application is not able to execute at all in the sandbox I shared where Note that this practice isn't odd, glycin works this way already, it runs every image decoder inside a sandbox via bwrap. |
|
Arguably, for a type 3 runtime, these parameters could be specified. What do you think of the .zip approach, though? |
I don't see it as necessary. It is a breaking change without a good compeling reason. For example appimageupdate works regardless of the filesystem/compression-algo, it doesn't need to read the payload. People are also able to execute the appimage regardless of any of this which is the most important part. thumbnailers can just run |
|
It's hardly a breaking change. |
Well it depends, we actually had trouble with the uruntime before because it used to be an UPXed binary prepended to the payload. This confused tools when finding the offset The uruntime is no longer UPXed. gluing a different archive to the payload will likely break tools that would have worked otherwise. |
|
I'd solve this problem and add a reliability feature: just add an ELF header whose value is the offset. The current "Measure ELF header size" is anyway a bit of guesswork and time consuming. Reading the section header is just a few lines of Rust code, for instance. |


I saw TheAssassin made this repo but nothing has been added, so instead of waiting here is my two cents of what a type3 AppImage must be.
Note: This is all already supported by the uruntime minus the
ARG0change which is something I want to get upstreamed first.Rationale behind some of these changes:
The reason is that this allows reusing already running AppImages instead of creating multiple mountpoints which wastes resources. Fixes AppImage/AppImageKit#1100
By making it a hash of the AppImage we avoid any possible conflict with other AppImages and make sure the mounpoint is reused by the same application only.
APPIMAGEWhich points to the location of the AppImage with symlinks followedARG0Which points to the location of the AppImage without following symlinksOWDPath to the working directory when the AppImage was executedThe reason I have changed
ARGV0forARG0is becasueARGV0causes a ton of problems with zsh to the point that I've seen projects code workarounds for this in their code instead of just unsetting the variable manually in theAppRunwhich that on its own is a terrible hack.Even I that I'm aware of this problem have been bitten by it multiple times, the most recent one was this, which was fixed previously...
HOME,XDG_DATA_HOME,XDG_CONFIG_HOMEandXDG_CACHE_HOMEby setting the following envrioment variables:*
REAL_HOMETo the value ofHOMEbefore chaging it*
REAL_XDG_DATA_HOMETo the value ofXDG_DATA_HOMEbefore chaging it*
REAL_XDG_CONFIG_HOMETo the value ofXDG_CONFIG_HOMEbefore changing it*
REAL_XDG_CACHA_HOMETo the value ofXDG_CACHE_HOMEbefore changing itREAL_*enviroment variables are already set, the AppImage MUST NOT change their valueREAL_*variables to the defaults specificed in the XDG Base directory specificationBy keeping the original values of these enviroment variables, the application can restore them before executing child processes. This fixes the issue of other apps using the portable directories of the AppImage.
Since the uruntime does this already, we have this
xdg-openwrapper with all of our sharun AppImages that restores the enviroment variables. For applications like terminal emulators I preload a library that does the same.snap also does something similar already btw
Now onto things I don't think need to be changed.
I don't think it is a good idea to mandate a specific filesystem or compression algo, because maybe in 5 years from now some new format that is much better comes out and we are not able to use it.
Instead it is better to mandate specific flags into the AppImage runtime, that way tools like libappimage can instead falllback to using
--appimage-extractfor example, and this can be done easily in a sandboxThis is also why
--appimage-extractmust extract to anAppDirdirectory instead ofsquashfs-root, since the filesystem may be completely different, the AppImage can instead make asquashfs-rootsymlink to keep compatiblity with existing scripts/tools that expect asquashfs-rootdirectory.I also don't think we need to change the magic bytes, since most of these changes do not break backwards compatibility with existing tools, for example
appimageupdatetoolhas no problem updating an AppImage that follows this type3 spec.