diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 29ca10f6d9591141572e7e66dd607db82be307cd..9b3d55261e72753c1f581d495c433b6f85b6f147 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -7,15 +7,15 @@ source-code: https://github.com/sleuthkit/autopsy/ website: https://www.autopsy.com/ license: Apache-2.0 grade: stable # must be 'stable' to release into candidate/stable channels -confinement: devmode # or classic # use 'strict' once you have the right plugs and slots +confinement: strict # or classic # use 'strict' once you have the right plugs and slots architectures: [amd64] compression: lzo icon: snap/gui/autopsy.png -# plugs: -# system-files-autopsy: -# interface: system-files -# read: [/dev] +plugs: + system-files-autopsy: + interface: system-files + read: [/dev] # does not appear necessary as writing to home directory gets written to $SNAP_USER_DATA: https://snapcraft.io/docs/environment-variables # layout: @@ -32,6 +32,7 @@ apps: jdkhome: $SNAP/usr/lib/jvm/java-17-openjdk-amd64 # provide means for java gstreamer to find gstreamer libs jreflags: $jreflags '-Djava.io.tmpdir=$HOME/tmp' '-Djna.library.path=$SNAP/usr/lib/x86_64-linux-gnu:$SNAP/usr/local/lib' + LD_LIBRARY_PATH: $SNAP/usr/local/lib:$LD_LIBRARY_PATH #LD_LIBRARY_PATH: ${SNAP}/usr/local/lib:${SNAP}/usr/lib/x86_64-linux-gnu/gstreamer-1.0:${SNAP}/usr/lib/x86_64-linux-gnu:${SNAP}/lib/x86_64-linux-gnu:${SNAP}/usr/lib/x86_64-linux-gnu/glib-2.0:${LD_LIBRARY_PATH} # make sure path is set up to ensure things like photorec are found PATH: $SNAP/usr/bin:$SNAP/usr/local/bin:$PATH @@ -40,9 +41,9 @@ apps: GST_PLUGIN_SCANNER: $SNAP/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner SOLR_LOGS_DIR: $HOME/.autopsy/dev/solr/logs SOLR_PID_DIR: $HOME/.autopsy/dev/solr/logs - command-chain: - - autopsy/bin/tmpsetup.sh - command: autopsy/bin/autopsy + # command-chain: + # - autopsy/bin/tmpsetup.sh + command: autopsy/bin/autopsywrapper.sh # More info here: https://snapcraft.io/docs/gnome-extension extensions: [ gnome ] common-id: org.sleuthkit.autopsy @@ -76,7 +77,7 @@ apps: - raw-usb - removable-media - sd-control - # - system-files-autopsy + - system-files-autopsy - system-observe - system-trace - udisks2 @@ -192,9 +193,14 @@ parts: # snaps run applications with different permissions. This ensures applications can run. chmod 755 "$AUTOPSY_LOCATION/bin/autopsy" - echo '#!/bin/bash' > $AUTOPSY_LOCATION/bin/tmpsetup.sh - echo 'mkdir -p $HOME/tmp' >> $AUTOPSY_LOCATION/bin/tmpsetup.sh - chmod 755 $AUTOPSY_LOCATION/bin/tmpsetup.sh + cat <<EOF > $AUTOPSY_LOCATION/bin/autopsywrapper.sh + #!/bin/bash + mkdir -p \$HOME/tmp + echo Starting Autopsy... + \$SNAP/autopsy/bin/autopsy 2>&1 | tee \$HOME/logging.txt + EOF + + chmod 755 $AUTOPSY_LOCATION/bin/autopsywrapper.sh # include this line to print all set variables # sed -i '129 i set -o posix ; echo $(set) >&2 ; ls -l "${jdkhome}/bin/java"' "$AUTOPSY_LOCATION/platform/lib/nbexec"