From 4f81106fa14a73c3dde94ad0dada0f89b0e4792d Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 01:59:53 +0100 Subject: [PATCH 01/32] Add sandboxing in `-ia` or 'install-appimage' using the `--sandbox` flag --- modules/install.am | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/install.am b/modules/install.am index 5e07680a8..831b0e1dc 100644 --- a/modules/install.am +++ b/modules/install.am @@ -370,6 +370,9 @@ case "$1" in echo " USAGE: $AMCLI $1 --debug [ARGUMENT]" echo " USAGE: $AMCLI $1 --force-latest [ARGUMENT]" echo " USAGE: $AMCLI $1 --icons [ARGUMENT]" + if [ "$1" = "-ia" ] || [ "$1" = "install-appimage" ]; then + echo " USAGE: $AMCLI $1 --sandbox [ARGUMENT]" + fi [ "$AMCLI" = "am" ] && echo " USAGE: $AMCLI $1 --user [ARGUMENT]" exit 1 ;; @@ -423,6 +426,11 @@ case "$1" in else echo "💀 ERROR: \"$arg\" does NOT exist in the \"AM\" database, $(printf "please check the list, run the \"%b$AMCLIPATH_ORIGIN -l\033[0m\" command.\n\n" "${Gold}")" | fold -sw 72 | sed 's/^/ /g' fi + if [ "$1" = "-ia" ] || [ "$1" = "install-appimage" ]; then + if echo "$@" | grep -q -- "--sandbox"; then + "$AMCLIPATH_ORIGIN" --sandbox "$arg" + fi + fi echo "____________________________________________________________________________" done echo "============================================================================" From e2b3a61504d3d5c59dc5d908669edd8600f454b6 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 02:12:45 +0100 Subject: [PATCH 02/32] Save the list of installed apps if Aisap is not installed --- modules/install.am | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/install.am b/modules/install.am index 831b0e1dc..6a355663a 100644 --- a/modules/install.am +++ b/modules/install.am @@ -428,7 +428,13 @@ case "$1" in fi if [ "$1" = "-ia" ] || [ "$1" = "install-appimage" ]; then if echo "$@" | grep -q -- "--sandbox"; then - "$AMCLIPATH_ORIGIN" --sandbox "$arg" + if ! command -v aisap >/dev/null 2>&1; then + mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null + "$AMCLIPATH_ORIGIN" --sandbox "$arg" + mv "$CACHEDIR"/installed.backup.am "$AMCACHEDIR"/installed 2>/dev/null + else + "$AMCLIPATH_ORIGIN" --sandbox "$arg" + fi fi fi echo "____________________________________________________________________________" From 9c7ae46834f2a48f68c88f4097991fcc9d769a00 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 02:16:27 +0100 Subject: [PATCH 03/32] Allow AM users with appman-config file to choose local installation... ...of Aisap --- modules/sandboxes.am | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/sandboxes.am b/modules/sandboxes.am index 622304478..4efdfd776 100644 --- a/modules/sandboxes.am +++ b/modules/sandboxes.am @@ -70,7 +70,16 @@ _check_aisap() { echo " OPERATION ABORTED!" return 1 fi - "$AMCLIPATH" -i aisap >/dev/null 2>&1 + if [ "$CLI" = am ] && [ -f "$APPMANCONFIG"/appman-config ]; then + read -r -p " ◆ DO YOU WISH TO INSTALL AISAP LOCALLY? (Y/n) " yn + if echo "$yn" | grep -i '^n' >/dev/null 2>&1; then + "$AMCLIPATH" -i aisap >/dev/null 2>&1 + else + "$AMCLIPATH" -i --user aisap >/dev/null 2>&1 + fi + else + "$AMCLIPATH" -i aisap >/dev/null 2>&1 + fi command -v aisap 1>/dev/null || return 1 echo " aisap installed successfully!" fi From 14e443f9acf3b7b1a49d96e652799e3ab015e75d Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 02:34:37 +0100 Subject: [PATCH 04/32] Option --sandbox, detect if the argument is in BINDIR... ...and unset SUDOCMD --- modules/sandboxes.am | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/sandboxes.am b/modules/sandboxes.am index 4efdfd776..316ba93f6 100644 --- a/modules/sandboxes.am +++ b/modules/sandboxes.am @@ -4,6 +4,8 @@ # THIS MODULE INCLUDES ALL ACTIONS INTENDED TO ISOLATE DOTFILES OR CONTAINERIZE INSTALLED APPIMAGES ################################################################################################### +SUDOCMD_ORIGIN="$SUDOCMD" + # Get xdg variables for _configure_dirs_access for DIR in DESKTOP DOCUMENTS DOWNLOAD GAMES MUSIC PICTURES VIDEOS; do eval XDG_DIR="$(xdg-user-dir $DIR 2>/dev/null)" @@ -82,11 +84,14 @@ _check_aisap() { fi command -v aisap 1>/dev/null || return 1 echo " aisap installed successfully!" - fi + fi if grep "aisap-am" "$TARGET" >/dev/null 2>&1; then echo " $1 is already sandboxed!" return 1 fi + if [ -n "$BINDIR" ] && test -f "$BINDIR"/"$1"; then + SUDOCMD="" + fi } _generate_sandbox_script() { @@ -248,6 +253,7 @@ _install_sandbox_script() { printf '\033[0m%s\033[33m\n' " to revert the changes, in this case that is:" printf '\033[33m%s\033[0m' " $1 --disable-sandbox" printf '%s\033[33m%s\n\033[0m\n' " or " "$AMCLI --disable-sandbox $1" + SUDOCMD="$SUDOCMD_ORIGIN" } # Main logic From b26e31af911fae0b420b38b7cc08d2ca49d07df7 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 03:49:24 +0100 Subject: [PATCH 05/32] Extend sandboxing also to `-i`/`install` in case of local scripts --- modules/install.am | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/install.am b/modules/install.am index 6a355663a..70d9d8f1a 100644 --- a/modules/install.am +++ b/modules/install.am @@ -370,9 +370,7 @@ case "$1" in echo " USAGE: $AMCLI $1 --debug [ARGUMENT]" echo " USAGE: $AMCLI $1 --force-latest [ARGUMENT]" echo " USAGE: $AMCLI $1 --icons [ARGUMENT]" - if [ "$1" = "-ia" ] || [ "$1" = "install-appimage" ]; then - echo " USAGE: $AMCLI $1 --sandbox [ARGUMENT]" - fi + echo " USAGE: $AMCLI $1 --sandbox [ARGUMENT]" [ "$AMCLI" = "am" ] && echo " USAGE: $AMCLI $1 --user [ARGUMENT]" exit 1 ;; @@ -426,15 +424,14 @@ case "$1" in else echo "💀 ERROR: \"$arg\" does NOT exist in the \"AM\" database, $(printf "please check the list, run the \"%b$AMCLIPATH_ORIGIN -l\033[0m\" command.\n\n" "${Gold}")" | fold -sw 72 | sed 's/^/ /g' fi - if [ "$1" = "-ia" ] || [ "$1" = "install-appimage" ]; then - if echo "$@" | grep -q -- "--sandbox"; then - if ! command -v aisap >/dev/null 2>&1; then - mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null - "$AMCLIPATH_ORIGIN" --sandbox "$arg" - mv "$CACHEDIR"/installed.backup.am "$AMCACHEDIR"/installed 2>/dev/null - else - "$AMCLIPATH_ORIGIN" --sandbox "$arg" - fi + if echo "$@" | grep -q -- "--sandbox"; then + if ! command -v aisap >/dev/null 2>&1; then + mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null + "$AMCLIPATH_ORIGIN" --sandbox "$arg" + mv "$CACHEDIR"/installed.backup.am "$AMCACHEDIR"/installed 2>/dev/null + else + echo "" + "$AMCLIPATH_ORIGIN" --sandbox "$arg" fi fi echo "____________________________________________________________________________" From bc2e74eb3bab517830f813d071554bf87e602051 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:34:21 +0100 Subject: [PATCH 06/32] Add option `-ias` --- APP-MANAGER | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index a327478c2..b705f9122 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -383,7 +383,7 @@ available_options="about add apikey backup clean config disable downgrade downlo install install-appimage launcher list lock neodb newrepo nolibfuse off on overwrite purge query remove sandbox \ select sync template test unlock update --all --appimages --apps --byname --config --convert --debug \ --devmode-disable --devmode-enable --disable-notifications --enable-notifications --force-latest --home --icons \ - --launcher --less --pkg --rollback --disable-sandbox --sandbox --system --toolpack --user" + -ias --launcher --less --pkg --rollback --disable-sandbox --sandbox --system --toolpack --user" function _completion_lists() { # Remove existing lists and download new ones @@ -1072,7 +1072,7 @@ case "$1" in ;; 'download'|'-d'|\ 'extra'|'-e'|\ - 'install'|'-i'|\ + 'install'|'-i'|'-ias'|\ 'install-appimage'|'-ia') MODULE="install.am" _online_check From 75ca1ae47e4dab9b2e4ea173d5788d6a57faf4ec Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:35:19 +0100 Subject: [PATCH 07/32] Add option `-ias` --- modules/install.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/install.am b/modules/install.am index 70d9d8f1a..0fd95d8ca 100644 --- a/modules/install.am +++ b/modules/install.am @@ -360,7 +360,7 @@ case "$1" in fi ;; - 'install'|'-i'|\ + 'install'|'-i'|'-ias'|\ 'install-appimage'|'-ia') [ "$AMCLI" = "am" ] && echo "$@" | grep -q -- "--user" && _appman @@ -424,7 +424,7 @@ case "$1" in else echo "💀 ERROR: \"$arg\" does NOT exist in the \"AM\" database, $(printf "please check the list, run the \"%b$AMCLIPATH_ORIGIN -l\033[0m\" command.\n\n" "${Gold}")" | fold -sw 72 | sed 's/^/ /g' fi - if echo "$@" | grep -q -- "--sandbox"; then + if echo "$@" | grep -q -- "--sandbox" || [ "$1" = "-ias" ]; then if ! command -v aisap >/dev/null 2>&1; then mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null "$AMCLIPATH_ORIGIN" --sandbox "$arg" From 0fc969ccbeead957c6313197138fc2257ee663a4 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:04:59 +0100 Subject: [PATCH 08/32] Update "help" message --- APP-MANAGER | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/APP-MANAGER b/APP-MANAGER index b705f9122..215ea992a 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1224,18 +1224,21 @@ case "$1" in ${LightBlue}$AMCLI -i {PROGRAM} ${LightBlue}$AMCLI -i --debug {PROGRAM} ${LightBlue}$AMCLI -i --force-latest {PROGRAM} - ${LightBlue}$AMCLI -i --icons {PROGRAM}\033[0m + ${LightBlue}$AMCLI -i --icons {PROGRAM} + ${LightBlue}$AMCLI -i --sandbox {PROGRAM}\033[0m - Description: Install one or more programs or libraries from the list. With the \"--debug\" option you can see log messages to debug the script. For more details on \"--force-latest\", see the dedicated option, below. Use the \"--icons\" flag to allow the program to use icon themes. It can also be extended with additional flags (see \"--toolpack\"). + Description: Install one or more programs or libraries from the list. With the \"--debug\" option you can see log messages to debug the script. For more details on \"--force-latest\", see the dedicated option, below. Use the \"--icons\" flag to allow the program to use icon themes. It can also be extended with additional flags (see \"--toolpack\"). The \"--sandbox\" flag allows you to set sandboxes for AppImage packages. - ${Gold}install-appimage, -ia\033[0m + ${Gold}install-appimage, -ia, -ias\033[0m ${LightBlue}$AMCLI -ia {PROGRAM} ${LightBlue}$AMCLI -ia --debug {PROGRAM} ${LightBlue}$AMCLI -ia --force-latest {PROGRAM} - ${LightBlue}$AMCLI -ia --icons {PROGRAM}\033[0m + ${LightBlue}$AMCLI -ia --icons {PROGRAM} + ${LightBlue}$AMCLI -ia --sandbox {PROGRAM} + ${LightBlue}$AMCLI -ias {PROGRAM}\033[0m - Description: Same as \"install\" (see above) but for AppImages only. + Description: Same as \"install\" (see above) but for AppImages only. Option \"-ias\" (aka Install AppImage & Sandox) is equivalent to \"-ia --sandbox\", to set sandboxes for AppImage packages. ${Gold}lock\033[0m @@ -1302,6 +1305,8 @@ case "$1" in Description: Run an AppImage in a sandbox using Aisap. + NOTE, \"--sandbox\" can be used as a flag in \"-i\" and \"-ia\" or can be replaced using the option \"-ias\" (aka Install AppImage & Sandox). + ${Gold}sync, -s\033[0m ${LightBlue}$AMCLI -s\033[0m From b87e9b2ea06aec8e4d5ec688b59d197ee24296df Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:24:04 +0100 Subject: [PATCH 09/32] Fix "-ias", with multiple arguments it fails since "$1" is replaced --- modules/install.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/install.am b/modules/install.am index 0fd95d8ca..eb8d0a6ef 100644 --- a/modules/install.am +++ b/modules/install.am @@ -390,6 +390,7 @@ case "$1" in METAPACKAGES="kdegames kdeutils node platform-tools" if [ "$1" = "-ia" ] || [ "$1" = "install-appimage" ]; then _install_appimage; fi + if [ "$1" = "-ias" ]; then FLAGS=$(echo "$@ --sandbox" | tr ' ' '\n' | grep -- "--" | tr '\n ' ' '); fi for arg in $entries; do echo "" @@ -424,7 +425,7 @@ case "$1" in else echo "💀 ERROR: \"$arg\" does NOT exist in the \"AM\" database, $(printf "please check the list, run the \"%b$AMCLIPATH_ORIGIN -l\033[0m\" command.\n\n" "${Gold}")" | fold -sw 72 | sed 's/^/ /g' fi - if echo "$@" | grep -q -- "--sandbox" || [ "$1" = "-ias" ]; then + if echo "$FLAGS" | grep -q -- "--sandbox"; then if ! command -v aisap >/dev/null 2>&1; then mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null "$AMCLIPATH_ORIGIN" --sandbox "$arg" From 39aa6b3e9a0589e55050963d36b6b62cab4455c3 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:32:58 +0100 Subject: [PATCH 10/32] Update README.md --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b871fce63..8ce7f21f4 100644 --- a/README.md +++ b/README.md @@ -404,24 +404,27 @@ Allow installed apps to use system icon themes. You can specify the name of the am -i --debug {PROGRAM} am -i --force-latest {PROGRAM} am -i --icons {PROGRAM} + am -i --sandbox {PROGRAM} **Description**: -Install one or more programs or libraries from the list. With the "`--debug`" option you can see log messages to debug the script. For more details on "`--force-latest`", see the dedicated option, below. Use the "`--icons`" flag to allow the program to use icon themes. It can also be extended with additional flags (see "`--toolpack`"). +Install one or more programs or libraries from the list. With the "`--debug`" option you can see log messages to debug the script. For more details on "`--force-latest`", see the dedicated option, below. Use the "`--icons`" flag to allow the program to use icon themes. It can also be extended with additional flags (see "`--toolpack`"). The "`--sandbox`" flag allows you to set sandboxes for AppImage packages. NOTE: Since this is an "install" option, you can add the "`--user`" flag to install apps locally. See "`--user`" at the bottom to learn more. ------------------------------------------------------------------------ -### `install-appimage`, `-ia` +### `install-appimage`, `-ia`, `-ias` am -ia {PROGRAM} am -ia --debug {PROGRAM} am -ia --force-latest {PROGRAM} am -ia --icons {PROGRAM} + am -ia --sandbox {PROGRAM} + am -ias {PROGRAM} **Description**: -Same as "install" (see above) but for AppImages only. +Same as "install" (see above) but for AppImages only. Option "`-ias`" (aka Install AppImage & Sandox) is equivalent to "`-ia --sandbox`", to set sandboxes for AppImage packages. ------------------------------------------------------------------------ ### `lock` @@ -513,6 +516,8 @@ Removes one or more apps without asking. Run an AppImage in a sandbox using Aisap. +NOTE, "`--sandbox`" can be used as a flag in "`-i`" and "`-ia`" or can be replaced using the option "`-ias`" (aka Install AppImage & Sandox). + ------------------------------------------------------------------------ ### `sync`, `-s` @@ -705,6 +710,7 @@ Below you can access the documentation pages related to the use of "AM", complet ------------------------------------------------------------------------ - [Install applications](docs/guides-and-tutorials/install.md) - [Install only AppImages](docs/guides-and-tutorials/install-appimage.md) + - [Install and sandbox AppImages in one go](docs/guides-and-tutorials/install-appimage.md#install-and-sandbox-appimages-in-one-go) - [Install AppImages not listed in this database but available in other github repos](docs/guides-and-tutorials/extra.md) - [List the installed applications](docs/guides-and-tutorials/files.md) - [List and query all the applications available on the database](docs/guides-and-tutorials/list-and-query.md) From be2e9651f8e5a3270e6771ac7dc0d1939fc3b80f Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:40:38 +0100 Subject: [PATCH 11/32] Update install-appimage.md --- docs/guides-and-tutorials/install-appimage.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/guides-and-tutorials/install-appimage.md b/docs/guides-and-tutorials/install-appimage.md index e585450f0..9da4eaeb9 100644 --- a/docs/guides-and-tutorials/install-appimage.md +++ b/docs/guides-and-tutorials/install-appimage.md @@ -8,8 +8,9 @@ All flags for the `-i`/`install` option can be used here as well. ``` am -ia --debug {PROGRAM} am -ia --force-latest {PROGRAM} -am -ia --user --debug {PROGRAM} -am -ia --user --force-latest {PROGRAM} +am -ia --debug {PROGRAM} +am -ia --force-latest {PROGRAM} +am -ia --sandbox {PROGRAM} ``` Same for AppMan. ``` @@ -23,6 +24,12 @@ https://github.com/user-attachments/assets/b938430c-ec0b-4b90-850f-1332063d5e53 In the video above, before proceeding I use the command `am -q` and `am -q --appimages` to show the difference between `brave` and `brave-appimage` in the lists. +------------------------------------------------------------------------ +## Install and sandbox AppImages in one go +There is also a declination of `-ia`, namely `-ias` (Install AppImage & Sandox) which is equivalent to `-ia --sandbox` to start the sandbox configuration process via Aisap/Bubblewrap (see "[Sandboxing](./sandbox.md)") at the end of each installation + +https://github.com/user-attachments/assets/3498f29b-3f6b-48b1-b4ff-2b1d083af57c + ------------------------------------------------------------------------ | [Back to "Guides and tutorials"](../../README.md#guides-and-tutorials) | [Back to "Main Index"](../../README.md#main-index) | ["Portable Linux Apps"](https://portable-linux-apps.github.io/) | [ "AppMan" ](https://github.com/ivan-hc/AppMan) | From b24150c58001b9935d9696a13bd7e7dcdcbeed1e Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:52:27 +0100 Subject: [PATCH 12/32] Update install.md --- docs/guides-and-tutorials/install.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/guides-and-tutorials/install.md b/docs/guides-and-tutorials/install.md index 061a85300..b53695ee8 100644 --- a/docs/guides-and-tutorials/install.md +++ b/docs/guides-and-tutorials/install.md @@ -32,7 +32,6 @@ or appman -i --debug {PROGRAM} ``` - ### Install the "latest" stable release instead of the latest "unstable" By default, many installation scripts for apps hosted on github will point to the more recent generic release instead of "latest", which is normally used to indicate that the build is "stable". This is because upstream developers do not always guarantee a certain packaging format in "latest", sometimes they may only publish packages for Windows or macOS, so pointing to "latest" would not guarantee that any package for Linux will be installed. @@ -48,6 +47,27 @@ appman -i --force-latest {PROGRAM} https://github.com/user-attachments/assets/ee29adfd-90e1-46f7-aed9-b9c410f68776 +### Install and Sandbox AppImages +Since version 9.3 it is possible to use the "`--sandbox`" flag to sandbox only AppImages during the update process +``` +am -i --sandbox {PROGRAM} +am -i --user --sandbox {PROGRAM} +``` +or +``` +appman -i --sandbox {PROGRAM} +``` + +![Istantanea_2024-12-02_03-50-43-2](https://github.com/user-attachments/assets/da90b4ea-f199-469c-b2a3-e410577f3847) + +...note that sandboxing only works for AppImages using Aisap/Bubblewrap (see "[Sandboxing](./sandbox.md)"), for other programs it will not work. + +However, **it is recommended to use the `-i --sandbox` combination only if you have local and custom scripts to install.** + +If you rely on the AppImages listed in the "AM" database, use the `-ia --sandbox` combination or even better `-ias` (Install AppImage & Sandox). + +See more at "[Install only AppImages](./install-appimage.md)". + ------------------------------------------------------------------------ | [Back to "Guides and tutorials"](../../README.md#guides-and-tutorials) | [Back to "Main Index"](../../README.md#main-index) | ["Portable Linux Apps"](https://portable-linux-apps.github.io/) | [ "AppMan" ](https://github.com/ivan-hc/AppMan) | From 6c5e45a72cd903d1d92ceafb1de5571eda2c73ce Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:53:08 +0100 Subject: [PATCH 13/32] Update install.md --- docs/guides-and-tutorials/install.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/guides-and-tutorials/install.md b/docs/guides-and-tutorials/install.md index b53695ee8..4d18527dd 100644 --- a/docs/guides-and-tutorials/install.md +++ b/docs/guides-and-tutorials/install.md @@ -3,6 +3,7 @@ The option `-i` or `install` is the one responsible of the installation of apps https://github.com/user-attachments/assets/62bc7444-8b1f-4db2-b23b-db7219eec15d +---------------------------------------------------- ### Install, normal behaviour This is the normal syntax. ``` @@ -18,6 +19,7 @@ appman -i {PROGRAM} ``` Since version 9, "AM" also covers locally installed apps. It is therefore not necessary to add a root password, once the `--user` flag is added. And this can also be used in conjunction with the other flags below. +---------------------------------------------------- ### Install, debug an installation script The "install.am" module contains some patches to disable long messages. You can see them with the `--debug` flag. @@ -32,6 +34,7 @@ or appman -i --debug {PROGRAM} ``` +---------------------------------------------------- ### Install the "latest" stable release instead of the latest "unstable" By default, many installation scripts for apps hosted on github will point to the more recent generic release instead of "latest", which is normally used to indicate that the build is "stable". This is because upstream developers do not always guarantee a certain packaging format in "latest", sometimes they may only publish packages for Windows or macOS, so pointing to "latest" would not guarantee that any package for Linux will be installed. @@ -47,6 +50,7 @@ appman -i --force-latest {PROGRAM} https://github.com/user-attachments/assets/ee29adfd-90e1-46f7-aed9-b9c410f68776 +---------------------------------------------------- ### Install and Sandbox AppImages Since version 9.3 it is possible to use the "`--sandbox`" flag to sandbox only AppImages during the update process ``` From 359431c385a95c0411692b6606dbe25f3c1120fc Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:54:17 +0100 Subject: [PATCH 14/32] Update install.md --- docs/guides-and-tutorials/install.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides-and-tutorials/install.md b/docs/guides-and-tutorials/install.md index 4d18527dd..764a76584 100644 --- a/docs/guides-and-tutorials/install.md +++ b/docs/guides-and-tutorials/install.md @@ -52,7 +52,7 @@ https://github.com/user-attachments/assets/ee29adfd-90e1-46f7-aed9-b9c410f68776 ---------------------------------------------------- ### Install and Sandbox AppImages -Since version 9.3 it is possible to use the "`--sandbox`" flag to sandbox only AppImages during the update process +Since version 9.3 it is possible to use the "`--sandbox`" flag to sandbox only AppImages during the installation process ``` am -i --sandbox {PROGRAM} am -i --user --sandbox {PROGRAM} @@ -66,7 +66,7 @@ appman -i --sandbox {PROGRAM} ...note that sandboxing only works for AppImages using Aisap/Bubblewrap (see "[Sandboxing](./sandbox.md)"), for other programs it will not work. -However, **it is recommended to use the `-i --sandbox` combination only if you have local and custom scripts to install.** +NOTE, **it is recommended to use the `-i --sandbox` combination only if you have local and custom scripts to install.** If you rely on the AppImages listed in the "AM" database, use the `-ia --sandbox` combination or even better `-ias` (Install AppImage & Sandox). From 26440c40e4f6bf333f04ce61feefb39c6d9a9178 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:55:35 +0100 Subject: [PATCH 15/32] Update install.md --- docs/guides-and-tutorials/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides-and-tutorials/install.md b/docs/guides-and-tutorials/install.md index 764a76584..97f56bf66 100644 --- a/docs/guides-and-tutorials/install.md +++ b/docs/guides-and-tutorials/install.md @@ -64,7 +64,7 @@ appman -i --sandbox {PROGRAM} ![Istantanea_2024-12-02_03-50-43-2](https://github.com/user-attachments/assets/da90b4ea-f199-469c-b2a3-e410577f3847) -...note that sandboxing only works for AppImages using Aisap/Bubblewrap (see "[Sandboxing](./sandbox.md)"), for other programs it will not work. +...note that sandboxing only works for AppImages (see "[Sandboxing](./sandbox.md)"), for other programs it will not work. NOTE, **it is recommended to use the `-i --sandbox` combination only if you have local and custom scripts to install.** From 27b72e24453dd954ef3977eba4afd912100980d2 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:57:26 +0100 Subject: [PATCH 16/32] Update install-appimage.md --- docs/guides-and-tutorials/install-appimage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides-and-tutorials/install-appimage.md b/docs/guides-and-tutorials/install-appimage.md index 9da4eaeb9..ccc3b90ad 100644 --- a/docs/guides-and-tutorials/install-appimage.md +++ b/docs/guides-and-tutorials/install-appimage.md @@ -9,7 +9,6 @@ All flags for the `-i`/`install` option can be used here as well. am -ia --debug {PROGRAM} am -ia --force-latest {PROGRAM} am -ia --debug {PROGRAM} -am -ia --force-latest {PROGRAM} am -ia --sandbox {PROGRAM} ``` Same for AppMan. @@ -17,6 +16,7 @@ Same for AppMan. appman -ia {PROGRAM} appman -ia --debug {PROGRAM} appman -ia --force-latest {PROGRAM} +appman -ia --sandbox {PROGRAM} ``` In this example, I run the script `brave-appimage` but running `brave`, that instead is the original upstream package. From b6c7429cf80426ae3790e0e501252ccf138f7a09 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:06:49 +0100 Subject: [PATCH 17/32] Update install-appimage.md --- docs/guides-and-tutorials/install-appimage.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/guides-and-tutorials/install-appimage.md b/docs/guides-and-tutorials/install-appimage.md index ccc3b90ad..127e878f6 100644 --- a/docs/guides-and-tutorials/install-appimage.md +++ b/docs/guides-and-tutorials/install-appimage.md @@ -27,9 +27,30 @@ In the video above, before proceeding I use the command `am -q` and `am -q --app ------------------------------------------------------------------------ ## Install and sandbox AppImages in one go There is also a declination of `-ia`, namely `-ias` (Install AppImage & Sandox) which is equivalent to `-ia --sandbox` to start the sandbox configuration process via Aisap/Bubblewrap (see "[Sandboxing](./sandbox.md)") at the end of each installation +``` +am -ias {PROGRAM} +am -ias --user {PROGRAM} +``` +or +``` +appman -ias {PROGRAM} +``` https://github.com/user-attachments/assets/3498f29b-3f6b-48b1-b4ff-2b1d083af57c +NOTE, `-ia --sandbox` and `-ias` are only for the AppImages listed in the "AM" database! + +To Install and Sandbox other AppImages from local scripts, use the `-i --sandbox` combination +``` +am -i --sandbox /path/to/installatio-script +am -i --user --sandbox /path/to/installatio-script +``` +or +``` +appman -i --sandbox /path/to/installatio-script +``` +Sandboxing of other formats or AppImage packages scattered around the system (`--launcher` option) and not installed via "AM"/AppMan is not supported. + ------------------------------------------------------------------------ | [Back to "Guides and tutorials"](../../README.md#guides-and-tutorials) | [Back to "Main Index"](../../README.md#main-index) | ["Portable Linux Apps"](https://portable-linux-apps.github.io/) | [ "AppMan" ](https://github.com/ivan-hc/AppMan) | From 27a126cde3b3ede3a0d2ca1da61c1aa7f6eb2f16 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:11:31 +0100 Subject: [PATCH 18/32] Update sandbox.md --- docs/guides-and-tutorials/sandbox.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/guides-and-tutorials/sandbox.md b/docs/guides-and-tutorials/sandbox.md index 8d73f6338..453c6c687 100644 --- a/docs/guides-and-tutorials/sandbox.md +++ b/docs/guides-and-tutorials/sandbox.md @@ -1,4 +1,6 @@ ## Sandbox an AppImage +This page explains in detail how AppImage sandboxing works individually in "AM". To apply them during installation, go to the related guide "[Install and sandbox AppImages in one go](./install-appimage.md#install-and-sandbox-appimages-in-one-go)" instead. + Since version 6.12, "AM"/"AppMan" uses Bubblewrap for sandboxing AppImage packages, thanks to "[Aisap](https://github.com/mgord9518/aisap)", a highly intuitive and configurable command line solution. The option "`--sandbox`", which since version 5.3 was using Firejail, has taken on a completely different appearance and usability, thanks to the intense work of @Samueru-sama, who managed to extend and enhance "Aisap", making it extremely easy to use in our project, to the point of making us forget that we are using a command line utility. @@ -7,6 +9,7 @@ The option "`--sandbox`", which since version 5.3 was using Firejail, has taken In this sense, "Aisap" may be considered a reference point for the future of AppImages sandboxing! +---------------------------------------------------- #### How to enable a sandbox This method works as follows: ``` @@ -28,12 +31,14 @@ We will first compile the Aisap script in a non-privileged, easy-to-access direc NOTE, the default location for the sandboxed homes is at $HOME/.local/am-sandboxes, but that location can be changed by setting the $SANDBOXDIR environemt variable. +---------------------------------------------------- #### How to disable a sandbox To remove the sandbox just run the command of the AppImage with the flag "--disable-sandbox", like this: ``` $APP --disable-sandbox ``` +---------------------------------------------------- #### Sandboxing example In the video below we will use "Baobab" (GTK3 version), a disk space analyzer, available in the database as "baobab-gtk3". @@ -41,6 +46,7 @@ Among the XDG directories we will authorize "Images" (Pictures) and "Videos" (Vi https://github.com/ivan-hc/AM/assets/88724353/dd193943-7b08-474a-bbbb-4a6906de8b24 +---------------------------------------------------- #### About Aisap sandboxing For more information about "Aisap", visit https://github.com/mgord9518/aisap @@ -55,4 +61,4 @@ EXTRA: The behavior of this option can be tested in a completely standalone way | [Back to "Guides and tutorials"](../../README.md#guides-and-tutorials) | [Back to "Main Index"](../../README.md#main-index) | ["Portable Linux Apps"](https://portable-linux-apps.github.io/) | [ "AppMan" ](https://github.com/ivan-hc/AppMan) | | - | - | - | - | ------------------------------------------------------------------------- \ No newline at end of file +------------------------------------------------------------------------ From ed5224ece20747bd5c3589e59409eede8ceca836 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:11:55 +0100 Subject: [PATCH 19/32] Update APP-MANAGER --- APP-MANAGER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP-MANAGER b/APP-MANAGER index 215ea992a..30be17774 100755 --- a/APP-MANAGER +++ b/APP-MANAGER @@ -1,6 +1,6 @@ #!/usr/bin/env bash -AMVERSION="9.2" +AMVERSION="9.3" # Determine main repository and branch AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main" From 312c994f1fa5cdeef174700d606ad8ea62f8ed78 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:16:47 +0100 Subject: [PATCH 20/32] Update install.am --- modules/install.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/install.am b/modules/install.am index eb8d0a6ef..143381b81 100644 --- a/modules/install.am +++ b/modules/install.am @@ -390,7 +390,7 @@ case "$1" in METAPACKAGES="kdegames kdeutils node platform-tools" if [ "$1" = "-ia" ] || [ "$1" = "install-appimage" ]; then _install_appimage; fi - if [ "$1" = "-ias" ]; then FLAGS=$(echo "$@ --sandbox" | tr ' ' '\n' | grep -- "--" | tr '\n ' ' '); fi + if [ "$1" = "-ias" ]; then FLAGS=$(echo "$@ --sandbox" | tr ' ' '\n' | grep -- "--" | tr '\n ' ' '); _install_appimage; fi for arg in $entries; do echo "" From 443e8de1325017918d29f65f35475fcfe805c160 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:22:29 +0100 Subject: [PATCH 21/32] Update install-appimage.md --- docs/guides-and-tutorials/install-appimage.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/guides-and-tutorials/install-appimage.md b/docs/guides-and-tutorials/install-appimage.md index 127e878f6..86e82e609 100644 --- a/docs/guides-and-tutorials/install-appimage.md +++ b/docs/guides-and-tutorials/install-appimage.md @@ -26,7 +26,7 @@ In the video above, before proceeding I use the command `am -q` and `am -q --app ------------------------------------------------------------------------ ## Install and sandbox AppImages in one go -There is also a declination of `-ia`, namely `-ias` (Install AppImage & Sandox) which is equivalent to `-ia --sandbox` to start the sandbox configuration process via Aisap/Bubblewrap (see "[Sandboxing](./sandbox.md)") at the end of each installation +There is also a declination of `-ia`, namely `-ias` (Install AppImage & Sandox) which is equivalent to `-ia --sandbox` to start the sandbox configuration process via Aisap/Bubblewrap at the end of each installation ``` am -ias {PROGRAM} am -ias --user {PROGRAM} @@ -40,16 +40,18 @@ https://github.com/user-attachments/assets/3498f29b-3f6b-48b1-b4ff-2b1d083af57c NOTE, `-ia --sandbox` and `-ias` are only for the AppImages listed in the "AM" database! -To Install and Sandbox other AppImages from local scripts, use the `-i --sandbox` combination +To Install and Sandbox other AppImages from local scripts and third-party/custom databases, use the `-i --sandbox` combination ``` -am -i --sandbox /path/to/installatio-script -am -i --user --sandbox /path/to/installatio-script +am -i --sandbox {PROGRAM} +am -i --user --sandbox {PROGRAM} ``` or ``` -appman -i --sandbox /path/to/installatio-script +appman -i --sandbox {PROGRAM} ``` -Sandboxing of other formats or AppImage packages scattered around the system (`--launcher` option) and not installed via "AM"/AppMan is not supported. +Sandboxing of other formats is not supported. + +See also how sandboxing works in "AM", at "[Sandboxing](./sandbox.md)". ------------------------------------------------------------------------ From eedc4287b4b96543ee4d6105ce8144f33d8fab91 Mon Sep 17 00:00:00 2001 From: Samuel <36420837+Samueru-sama@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:36:08 -0400 Subject: [PATCH 22/32] use shell built in test --- modules/sandboxes.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sandboxes.am b/modules/sandboxes.am index 316ba93f6..55578ef58 100644 --- a/modules/sandboxes.am +++ b/modules/sandboxes.am @@ -89,7 +89,7 @@ _check_aisap() { echo " $1 is already sandboxed!" return 1 fi - if [ -n "$BINDIR" ] && test -f "$BINDIR"/"$1"; then + if [ -f "$BINDIR"/"$1" ]; then SUDOCMD="" fi } From ec43a544062b136d07409f4c7fcecbc18894bb17 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 3 Dec 2024 00:58:13 +0100 Subject: [PATCH 23/32] Update install-appimage.md --- docs/guides-and-tutorials/install-appimage.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/guides-and-tutorials/install-appimage.md b/docs/guides-and-tutorials/install-appimage.md index 86e82e609..254033fe3 100644 --- a/docs/guides-and-tutorials/install-appimage.md +++ b/docs/guides-and-tutorials/install-appimage.md @@ -8,7 +8,6 @@ All flags for the `-i`/`install` option can be used here as well. ``` am -ia --debug {PROGRAM} am -ia --force-latest {PROGRAM} -am -ia --debug {PROGRAM} am -ia --sandbox {PROGRAM} ``` Same for AppMan. @@ -38,9 +37,9 @@ appman -ias {PROGRAM} https://github.com/user-attachments/assets/3498f29b-3f6b-48b1-b4ff-2b1d083af57c -NOTE, `-ia --sandbox` and `-ias` are only for the AppImages listed in the "AM" database! +NOTE, **`-ia --sandbox` and `-ias` are only for the AppImages listed in the "AM" database!** -To Install and Sandbox other AppImages from local scripts and third-party/custom databases, use the `-i --sandbox` combination +To Install and Sandbox other AppImages from local scripts and third-party/custom databases, **use the `-i --sandbox` combination instead** ``` am -i --sandbox {PROGRAM} am -i --user --sandbox {PROGRAM} From 7316272bf39bde98cdf782ddc2497a4d7032c1fb Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:26:46 +0100 Subject: [PATCH 24/32] List "aisap" among the installed apps --- modules/install.am | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/install.am b/modules/install.am index 143381b81..e8670afe0 100644 --- a/modules/install.am +++ b/modules/install.am @@ -429,6 +429,7 @@ case "$1" in if ! command -v aisap >/dev/null 2>&1; then mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null "$AMCLIPATH_ORIGIN" --sandbox "$arg" + sort "$AMCACHEDIR"/installed >> "$CACHEDIR"/installed.backup.am 2>/dev/null mv "$CACHEDIR"/installed.backup.am "$AMCACHEDIR"/installed 2>/dev/null else echo "" From 78525a9877d08f14e2d60aea66c273862426306a Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:30:51 +0100 Subject: [PATCH 25/32] Update install-appimage.md --- docs/guides-and-tutorials/install-appimage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides-and-tutorials/install-appimage.md b/docs/guides-and-tutorials/install-appimage.md index 254033fe3..a130e57a2 100644 --- a/docs/guides-and-tutorials/install-appimage.md +++ b/docs/guides-and-tutorials/install-appimage.md @@ -35,7 +35,7 @@ or appman -ias {PROGRAM} ``` -https://github.com/user-attachments/assets/3498f29b-3f6b-48b1-b4ff-2b1d083af57c +https://github.com/user-attachments/assets/f761445f-5220-4167-af09-4f07fc5f30c1 NOTE, **`-ia --sandbox` and `-ias` are only for the AppImages listed in the "AM" database!** From 7f4b85075f8c7130a25e5ca464c15d2f45073e16 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:55:47 +0100 Subject: [PATCH 26/32] Prevent "aisap" to be sandboxed --- modules/install.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/install.am b/modules/install.am index e8670afe0..445d8e2eb 100644 --- a/modules/install.am +++ b/modules/install.am @@ -425,7 +425,7 @@ case "$1" in else echo "💀 ERROR: \"$arg\" does NOT exist in the \"AM\" database, $(printf "please check the list, run the \"%b$AMCLIPATH_ORIGIN -l\033[0m\" command.\n\n" "${Gold}")" | fold -sw 72 | sed 's/^/ /g' fi - if echo "$FLAGS" | grep -q -- "--sandbox"; then + if echo "$FLAGS" | grep -q -- "--sandbox" && [ "$arg" != aisap ]; then if ! command -v aisap >/dev/null 2>&1; then mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null "$AMCLIPATH_ORIGIN" --sandbox "$arg" From aeab9caa11f6a6f14ce1594ad65c81cb4b94998f Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Tue, 3 Dec 2024 22:01:52 +0100 Subject: [PATCH 27/32] Install aisap using the correct CLI --- modules/sandboxes.am | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/sandboxes.am b/modules/sandboxes.am index 55578ef58..e2d22f793 100644 --- a/modules/sandboxes.am +++ b/modules/sandboxes.am @@ -4,6 +4,7 @@ # THIS MODULE INCLUDES ALL ACTIONS INTENDED TO ISOLATE DOTFILES OR CONTAINERIZE INSTALLED APPIMAGES ################################################################################################### +AMCLIPATH_ORIGIN="$AMCLIPATH" SUDOCMD_ORIGIN="$SUDOCMD" # Get xdg variables for _configure_dirs_access @@ -75,12 +76,12 @@ _check_aisap() { if [ "$CLI" = am ] && [ -f "$APPMANCONFIG"/appman-config ]; then read -r -p " ◆ DO YOU WISH TO INSTALL AISAP LOCALLY? (Y/n) " yn if echo "$yn" | grep -i '^n' >/dev/null 2>&1; then - "$AMCLIPATH" -i aisap >/dev/null 2>&1 + "$AMCLIPATH_ORIGIN" -i aisap >/dev/null 2>&1 else - "$AMCLIPATH" -i --user aisap >/dev/null 2>&1 + "$AMCLIPATH_ORIGIN" -i --user aisap >/dev/null 2>&1 fi else - "$AMCLIPATH" -i aisap >/dev/null 2>&1 + "$AMCLIPATH_ORIGIN" -i aisap >/dev/null 2>&1 fi command -v aisap 1>/dev/null || return 1 echo " aisap installed successfully!" From 55fe4d25894314c647a336a063282964b5d3a5b7 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Wed, 4 Dec 2024 07:44:54 +0100 Subject: [PATCH 28/32] Fix sandboxing argument issue --- modules/install.am | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/install.am b/modules/install.am index 445d8e2eb..8f0502b60 100644 --- a/modules/install.am +++ b/modules/install.am @@ -425,15 +425,17 @@ case "$1" in else echo "💀 ERROR: \"$arg\" does NOT exist in the \"AM\" database, $(printf "please check the list, run the \"%b$AMCLIPATH_ORIGIN -l\033[0m\" command.\n\n" "${Gold}")" | fold -sw 72 | sed 's/^/ /g' fi + # Sandbox argument + echo "$LASTDIR" > "$AMCACHEDIR"/sandbox.arg if echo "$FLAGS" | grep -q -- "--sandbox" && [ "$arg" != aisap ]; then if ! command -v aisap >/dev/null 2>&1; then mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null - "$AMCLIPATH_ORIGIN" --sandbox "$arg" + "$AMCLIPATH_ORIGIN" --sandbox "$(sort "$AMCACHEDIR"/sandbox.arg)" sort "$AMCACHEDIR"/installed >> "$CACHEDIR"/installed.backup.am 2>/dev/null mv "$CACHEDIR"/installed.backup.am "$AMCACHEDIR"/installed 2>/dev/null else echo "" - "$AMCLIPATH_ORIGIN" --sandbox "$arg" + "$AMCLIPATH_ORIGIN" --sandbox "$(sort "$AMCACHEDIR"/sandbox.arg)" fi fi echo "____________________________________________________________________________" From 3e3f235731a9d5cf6f996c2a851797e8541505bb Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:29:42 +0100 Subject: [PATCH 29/32] Use LASTDIR --- modules/install.am | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/install.am b/modules/install.am index 8f0502b60..acb95e916 100644 --- a/modules/install.am +++ b/modules/install.am @@ -426,16 +426,17 @@ case "$1" in echo "💀 ERROR: \"$arg\" does NOT exist in the \"AM\" database, $(printf "please check the list, run the \"%b$AMCLIPATH_ORIGIN -l\033[0m\" command.\n\n" "${Gold}")" | fold -sw 72 | sed 's/^/ /g' fi # Sandbox argument - echo "$LASTDIR" > "$AMCACHEDIR"/sandbox.arg - if echo "$FLAGS" | grep -q -- "--sandbox" && [ "$arg" != aisap ]; then - if ! command -v aisap >/dev/null 2>&1; then - mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null - "$AMCLIPATH_ORIGIN" --sandbox "$(sort "$AMCACHEDIR"/sandbox.arg)" - sort "$AMCACHEDIR"/installed >> "$CACHEDIR"/installed.backup.am 2>/dev/null - mv "$CACHEDIR"/installed.backup.am "$AMCACHEDIR"/installed 2>/dev/null - else - echo "" - "$AMCLIPATH_ORIGIN" --sandbox "$(sort "$AMCACHEDIR"/sandbox.arg)" + if [ -f "$APPSPATH/$LASTDIR/$LASTDIR" ] && strings -d "$APPSPATH/$LASTDIR/$LASTDIR" | grep -- '--appimage-extract' 1>/dev/null; then + if echo "$FLAGS" | grep -q -- "--sandbox" && [ "$LASTDIR" != aisap ]; then + if ! command -v aisap >/dev/null 2>&1; then + mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null + "$AMCLIPATH_ORIGIN" --sandbox "$LASTDIR" + sort "$AMCACHEDIR"/installed >> "$CACHEDIR"/installed.backup.am 2>/dev/null + mv "$CACHEDIR"/installed.backup.am "$AMCACHEDIR"/installed 2>/dev/null + else + echo "" + "$AMCLIPATH_ORIGIN" --sandbox "$LASTDIR" + fi fi fi echo "____________________________________________________________________________" From 9970a244c90137d548ac9779f28e03d666e6c75a Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:12:11 +0100 Subject: [PATCH 30/32] Update install.am --- modules/install.am | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/install.am b/modules/install.am index acb95e916..2145f2c1f 100644 --- a/modules/install.am +++ b/modules/install.am @@ -101,8 +101,8 @@ _check_if_script_installs_a_metapackage() { if [ -d "$APPSPATH"/"$metapackage"/tmp ]; then $SUDOCMD "$APPSPATH"/"$metapackage"/remove 2> /dev/null elif [ -d "$APPSPATH"/"$metapackage" ]; then - METAPACKAGE_NAME=$(echo "$metapackage" | tr '[:lower:]' '[:upper:]') - echo " ◆ $APPNAME IS PART OF \"$METAPACKAGE_NAME\", ALREADY INSTALLED" + LASTDIR=$(echo "$metapackage" | tr '[:lower:]' '[:upper:]') + echo " ◆ $APPNAME IS PART OF \"$LASTDIR\", ALREADY INSTALLED" return 1 fi fi @@ -390,7 +390,7 @@ case "$1" in METAPACKAGES="kdegames kdeutils node platform-tools" if [ "$1" = "-ia" ] || [ "$1" = "install-appimage" ]; then _install_appimage; fi - if [ "$1" = "-ias" ]; then FLAGS=$(echo "$@ --sandbox" | tr ' ' '\n' | grep -- "--" | tr '\n ' ' '); _install_appimage; fi + if [ "$1" = "-ias" ]; then FLAGS=$(printf "%b\n--sandbox\n" "$FLAGS"); _install_appimage; fi for arg in $entries; do echo "" @@ -426,8 +426,8 @@ case "$1" in echo "💀 ERROR: \"$arg\" does NOT exist in the \"AM\" database, $(printf "please check the list, run the \"%b$AMCLIPATH_ORIGIN -l\033[0m\" command.\n\n" "${Gold}")" | fold -sw 72 | sed 's/^/ /g' fi # Sandbox argument - if [ -f "$APPSPATH/$LASTDIR/$LASTDIR" ] && strings -d "$APPSPATH/$LASTDIR/$LASTDIR" | grep -- '--appimage-extract' 1>/dev/null; then - if echo "$FLAGS" | grep -q -- "--sandbox" && [ "$LASTDIR" != aisap ]; then + if echo "$FLAGS" | grep -q -- "--sandbox" && [ "$LASTDIR" != aisap ]; then + if [ -f "$APPSPATH/$LASTDIR/$LASTDIR" ]; then if ! command -v aisap >/dev/null 2>&1; then mv "$AMCACHEDIR"/installed "$CACHEDIR"/installed.backup.am 2>/dev/null "$AMCLIPATH_ORIGIN" --sandbox "$LASTDIR" @@ -437,6 +437,8 @@ case "$1" in echo "" "$AMCLIPATH_ORIGIN" --sandbox "$LASTDIR" fi + else + printf "\n ERROR: \"%b\" is NOT an AppImage\n" "$LASTDIR" fi fi echo "____________________________________________________________________________" @@ -444,7 +446,7 @@ case "$1" in echo "============================================================================" printf "\n %bEND OF ALL INSTALLATION PROCESSES\n\033[0m" "${LightBlue}" [ -f "$AMCACHEDIR"/installed ] && printf "\n The following new programs have been installed:\n\n" \ - && grep -w -v "◆ am" 0<"$AMCACHEDIR"/installed + && sort "$AMCACHEDIR"/installed | grep -w -v "◆ am" printf "\n============================================================================\n" exit 0 ;; From 504fcea484a0c93a689efb62312bcc853c55c433 Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:28:02 +0100 Subject: [PATCH 31/32] =?UTF-8?q?Show=20aisap=20sandboxing=20message=20if?= =?UTF-8?q?=20"appimage=F0=9F=94=92"=20is=20detected?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/database.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/database.am b/modules/database.am index a63a2996b..cafaccb46 100644 --- a/modules/database.am +++ b/modules/database.am @@ -293,7 +293,9 @@ _files_appimage_type_notes() { _files_total_size() { printf "\n" - command -v aisap >/dev/null 2>&1 && printf '%s\n\n' " AppImages with 🔒 are sandboxed with aisap" + if command -v aisap >/dev/null 2>&1 && grep -qe "appimage🔒" "$AMCACHEDIR"/files*; then + printf '%s\n\n' " AppImages with 🔒 are sandboxed with aisap" + fi TOTAL_SIZE=$(du -shc $(find "$APPSPATH" -maxdepth 2 -type f -name 'remove' -printf "%h\n" 2>/dev/null) | tail -n1 | awk 'END {print $1"iB"}' | sed 's/...$/ &/') echo " TOTAL SIZE: $TOTAL_SIZE of disk space in use" printf "\n" From 352d0b1cbb62903adb60bdf80c14293e4f00a6fa Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:47:28 +0100 Subject: [PATCH 32/32] Update install-appimage.md --- docs/guides-and-tutorials/install-appimage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides-and-tutorials/install-appimage.md b/docs/guides-and-tutorials/install-appimage.md index a130e57a2..c3587c934 100644 --- a/docs/guides-and-tutorials/install-appimage.md +++ b/docs/guides-and-tutorials/install-appimage.md @@ -35,7 +35,7 @@ or appman -ias {PROGRAM} ``` -https://github.com/user-attachments/assets/f761445f-5220-4167-af09-4f07fc5f30c1 +https://github.com/user-attachments/assets/151b5400-415c-48c5-81dd-65a7be1a9b06 NOTE, **`-ia --sandbox` and `-ias` are only for the AppImages listed in the "AM" database!**