Kaynağa Gözat

build appimage

Sebastian Stenzel 4 yıl önce
ebeveyn
işleme
6a8f975955

+ 78 - 0
.github/workflows/build.yml

@@ -129,6 +129,84 @@ jobs:
           path: runtime
           if-no-files-found: error
 
+
+
+#
+# Linux AppImage
+# 
+
+  linux-appimage:
+    name: Build AppDir
+    runs-on: ubuntu-latest
+    needs: [buildkit, jlink]
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set version
+        id: setversion
+        run: |
+          if [[ $GITHUB_REF == refs/tags/* ]]; then
+            echo "BUILD_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
+          else
+            echo "BUILD_VERSION=SNAPSHOT" >> $GITHUB_ENV
+          fi
+      - name: Download buildkit-linux
+        uses: actions/download-artifact@v2
+        with:
+          name: buildkit-linux
+          path: Cryptomator.AppDir
+      - name: Download buildkit-linux
+        uses: actions/download-artifact@v2
+        with:
+          name: buildkit-linux
+          path: Cryptomator.AppDir/runtime
+      - name: Extract libjffi.so # workaround for https://github.com/cryptomator/cryptomator-linux/issues/27
+        run: |
+          JFFI_NATIVE_JAR=`ls libs/ | grep -e 'jffi-[1-9]\.[0-9]\{1,2\}.[0-9]\{1,2\}-native.jar'`
+          ${JAVA_HOME}/bin/jar -xf libs/${JFFI_NATIVE_JAR} /jni/x86_64-Linux/
+          mv jni/x86_64-Linux/* libs/libjffi.so
+        working-directory: Cryptomator.AppDir
+      - name: Patch Cryptomator.AppDir
+        run: |
+          cp -r dist/appimage/resources/appimage/AppDir/* Cryptomator.AppDir/
+          export REVISION_NO=`git rev-list --count HEAD`
+          envsubst '${REVISION_NO}' < dist/appimage/resources/appimage/AppDir/bin/cryptomator.sh > Cryptomator.AppDir/bin/cryptomator.sh
+          ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/org.cryptomator.Cryptomator.svg
+          ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/Cryptomator.svg
+          ln -s usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg Cryptomator.AppDir/.DirIcon
+          ln -s usr/share/applications/org.cryptomator.Cryptomator.desktop Cryptomator.AppDir/Cryptomator.desktop
+          ln -s bin/cryptomator.sh Cryptomator.AppDir/AppRun
+      - name: Download AppImageKit
+        run: |
+          curl -L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o appimagetool.AppImage
+          chmod +x appimagetool.AppImage
+          ./appimagetool.AppImage --appimage-extract
+      - name: Prepare GPG-Agent for signing with key 615D449FE6E6A235
+        run: |
+          echo "${GPG_PRIVATE_KEY}" | gpg --batch --quiet --import
+          echo "${GPG_PASSPHRASE}" | gpg --batch --quiet --passphrase-fd 0 --pinentry-mode loopback -u 615D449FE6E6A235 --dry-run --sign appdir.tar.gz
+        env:
+          GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
+          GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
+      - name: Build AppImage
+        run: >
+          ./squashfs-root/AppRun Cryptomator.AppDir cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage
+          -u 'gh-releases-zsync|cryptomator|cryptomator|latest|cryptomator-*-x86_64.AppImage.zsync'
+          --sign --sign-key=615D449FE6E6A235 --sign-args="--batch --pinentry-mode loopback"
+      - name: Create Detached GPG Signature
+        run: |
+          gpg --batch --quiet --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage
+          gpg --batch --quiet --pinentry-mode loopback -u 615D449FE6E6A235 --detach-sign -a cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage.zsync
+      - name: Upload AppImage
+        uses: actions/upload-artifact@v2
+        with:
+          name: appimage
+          path: |
+            cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage
+            cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage.asc
+            cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage.zsync
+            cryptomator-${{ env.BUILD_VERSION }}-x86_64.AppImage.zsync.asc
+          if-no-files-found: error
+
   # release:
   #   name: Draft a Release on GitHub Releases
   #   runs-on: ubuntu-latest

+ 37 - 0
dist/appimage/resources/appimage/AppDir/bin/cryptomator.sh

@@ -0,0 +1,37 @@
+#!/bin/sh
+cd $(dirname $0)
+
+# determine GTK version
+GTK2_PRESENT=1 # initially false
+GTK3_PRESENT=0 # initially true
+if command -v dpkg &> /dev/null; then # do stuff for debian based things
+	GTK2_PRESENT=`dpkg -l libgtk* | grep -e '\^ii' | grep -e 'libgtk2-*' &> /dev/null; echo $?`
+	GTK3_PRESENT=`dpkg -l libgtk* | grep -e '\^ii' | grep -e 'libgtk-3-*' &> /dev/null; echo $?`
+elif command -v rpm &> /dev/null; then # do stuff for rpm based things (including yum/dnf)
+	GTK2_PRESENT=`rpm -qa | grep -e '\^gtk2-[0-9][0-9]*' &> /dev/null; echo $?`
+	GTK3_PRESENT=`rpm -qa | grep -e '\^gtk3-[0-9][0-9]*' &> /dev/null; echo $?`
+elif command -v pacman &> /dev/null; then # don't forget arch
+	GTK2_PRESENT=`pacman -Qi gtk2 &> /dev/null; echo $?`
+	GTK3_PRESENT=`pacman -Qi gtk3 &> /dev/null; echo $?`
+fi
+
+if [ "$GTK2_PRESENT" -eq 0 ] && [ "$GTK3_PRESENT" -ne 0 ]; then
+	GTK_FLAG="-Djdk.gtk.version=2"
+fi
+
+# workaround for https://github.com/cryptomator/cryptomator-linux/issues/27
+export LD_PRELOAD=libs/libjffi.so
+
+# start Cryptomator
+./runtime/bin/java \
+	-p "mods" \
+	-cp "libs/*" \
+	-Dcryptomator.logDir="~/.local/share/Cryptomator/logs" \
+	-Dcryptomator.mountPointsDir="~/.local/share/Cryptomator/mnt" \
+	-Dcryptomator.settingsPath="~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json" \
+	-Dcryptomator.ipcPortPath="~/.config/Cryptomator/ipcPort.bin:~/.Cryptomator/ipcPort.bin" \
+	-Dcryptomator.buildNumber="appimage-${REVISION_NO}" \
+	$GTK_FLAG \
+	-Xss2m \
+	-Xmx512m \
+	-m org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator

+ 10 - 0
dist/appimage/resources/appimage/AppDir/usr/share/applications/org.cryptomator.Cryptomator.desktop

@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Cryptomator
+Comment=Cloud Storage Encryption Utility
+Exec=cryptomator %F
+Icon=org.cryptomator.Cryptomator
+Terminal=false
+Type=Application
+Categories=Utility;Security;FileTools;
+StartupWMClass=org.cryptomator.launcher.Cryptomator
+MimeType=application/vnd.cryptomator.encrypted;application/x-vnd.cryptomator.vault-metadata;

BIN
dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/256x256/apps/org.cryptomator.Cryptomator.png


BIN
dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/512x512/apps/org.cryptomator.Cryptomator.png


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
dist/appimage/resources/appimage/AppDir/usr/share/icons/hicolor/scalable/apps/org.cryptomator.Cryptomator.svg


+ 69 - 0
dist/appimage/resources/appimage/AppDir/usr/share/metainfo/org.cryptomator.Cryptomator.appdata.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2018 Armin Schrenk <armin.schrenk@zoho.eu> -->
+<component type="desktop-application">
+  <id>org.cryptomator.Cryptomator</id>
+  <metadata_license>FSFAP</metadata_license>
+  <project_license>GPL-3.0-or-later</project_license>
+  <name>Cryptomator</name>
+  <summary>Multi-platform client-side encryption tool optimized for cloud storages</summary>
+  <description>
+    <p>
+      Cryptomator offers multi-platform transparent client-side encryption of your files in the cloud.
+    </p>
+    <p>
+      Features:
+      <ul>
+        <li>Works with Dropbox, Google Drive, OneDrive, ownCloud, Nextcloud and any other cloud storage service which synchronizes with a local directory</li>
+        <li>Open Source means: No backdoors, control is better than trust</li>
+        <li>Client-side: No accounts, no data shared with any online service</li>
+        <li>Totally transparent: Just work on the virtual drive as if it were a USB flash drive</li>
+        <li>AES encryption with 256-bit key length</li>
+        <li>File names get encrypted</li>
+        <li>Folder structure gets obfuscated</li>
+        <li>Use as many vaults in your Dropbox as you want, each having individual passwords</li>
+        <li>One thousand commits for the security of your data!! :tada:</li>
+      </ul>
+    </p>
+    <p>
+      Privacy:
+      <ul>
+        <li>256-bit keys (unlimited strength policy bundled with native binaries)</li>
+        <li>Scrypt key derivation</li>
+        <li>Cryptographically secure random numbers for salts, IVs and the masterkey of course</li>
+        <li>Sensitive data is wiped from the heap asap</li>
+        <li>Lightweight: Complexity kills security</li>
+      </ul>
+    </p>
+    <p>
+      Consistency:
+      <ul>
+        <li>HMAC over file contents to recognize changed ciphertext before decryption</li>
+        <li>I/O operations are transactional and atomic, if the filesystems support it</li>
+        <li>Each file contains all information needed for decryption (except for the key of course), no common metadata means no Single Point of Failure</li>
+      </ul>
+    </p>
+  </description>
+  <categories>
+      <category>Office</category>
+      <category>Security</category>
+      <category>FileTools</category>
+      <category>Java</category>
+  </categories>
+  <url type="homepage">http://cryptomator.org</url>
+  <url type="bugtracker">https://github.com/cryptomator/cryptomator/issues</url>
+  <url type="faq">https://community.cryptomator.org/c/kb/faq</url>
+  <url type="help">https://community.cryptomator.org/</url>
+  <url type="donation">https://cryptomator.org/</url>
+  <content_rating type="oars-1.0">
+    <content_attribute id="violence-cartoon">none</content_attribute>
+    <content_attribute id="drugs-alcohol">none</content_attribute>
+    <content_attribute id="sex-nudity">none</content_attribute>
+    <content_attribute id="language-profanity">none</content_attribute>
+    <content_attribute id="social-info">mild</content_attribute> <!-- update checker conencts to https://api.cryptomator.org/updates/latestVersion.json -->
+  </content_rating>
+  <project_group>Cryptomator</project_group>
+  <provides>
+    <binary>cryptomator</binary>
+  </provides>
+  <launchable type="desktop-id">org.cryptomator.Cryptomator.desktop</launchable>
+</component>