Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dffe5fb05a | |||
| 03d7ae05e0 | |||
| 2f55bb3f6d | |||
| c151c2936c | |||
| 7c77c8e850 | |||
| 667ad72583 | |||
| 4b71e80636 | |||
| 07327845b3 | |||
| d043f9c416 | |||
| eadd3bfc48 | |||
| 26bd0722bc | |||
| 443c85c9b5 | |||
| efcc11771e | |||
| 4288eb2c02 | |||
| e009af0575 | |||
| c466d93519 | |||
| d4968b935b | |||
| f45817d4ac | |||
| a6aae9d6f2 | |||
| 838c69f46e | |||
| 0b7ace5dfa | |||
| 8f0f8db201 | |||
| ceda17edc4 | |||
| 12c860de0c | |||
| 12a559dc6d | |||
| 938fa0953b | |||
| 5f678ff088 | |||
| df39489916 | |||
| b2288bc9b2 | |||
| 0923312111 | |||
| 279117ecf2 | |||
| adb017804d | |||
| 0e700b335a | |||
| a7b93deb98 | |||
| 99fb77b867 | |||
| 6f543f8bef | |||
| 473028491c | |||
| a598ba6049 | |||
| a7ced9d477 | |||
| 646da8276a | |||
| af9ad2eb6f | |||
| 9d12943e3a | |||
| b670ef0e32 | |||
| a823e45535 | |||
| 36887eaf40 | |||
| 9809657b84 | |||
| 2b61520524 | |||
| 8b7bced138 | |||
| 24d34c77d5 | |||
| e72e44bb12 | |||
| 08fcd330e1 |
@@ -0,0 +1 @@
|
|||||||
|
81e1a25de641f0292863b1404cba728c1eadd00d
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
name: Build Lotus Chat Desktop
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITEA_URL: https://code.lotusguild.org
|
||||||
|
REPO: LotusGuild/cinny-desktop
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-windows:
|
||||||
|
runs-on: windows
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Checkout submodules (shallow)
|
||||||
|
shell: powershell
|
||||||
|
run: git submodule update --init --depth=1
|
||||||
|
|
||||||
|
- name: Install frontend deps
|
||||||
|
shell: powershell
|
||||||
|
run: cd cinny; npm ci
|
||||||
|
|
||||||
|
- name: Install Tauri deps
|
||||||
|
shell: powershell
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
shell: powershell
|
||||||
|
env:
|
||||||
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ''
|
||||||
|
NODE_OPTIONS: '--max_old_space_size=4096'
|
||||||
|
run: npm run tauri -- build -- --bundles nsis
|
||||||
|
|
||||||
|
- name: Upload to release
|
||||||
|
shell: powershell
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
$VERSION = (Get-Content "src-tauri\tauri.conf.json" | ConvertFrom-Json).version
|
||||||
|
Write-Host "Version: $VERSION"
|
||||||
|
|
||||||
|
$release = Invoke-RestMethod -Uri "$env:GITEA_URL/api/v1/repos/$env:REPO/releases/tags/latest" `
|
||||||
|
-Headers @{ Authorization = "token $env:TOKEN" } -ErrorAction SilentlyContinue
|
||||||
|
if (-not $release) {
|
||||||
|
$release = Invoke-RestMethod -Uri "$env:GITEA_URL/api/v1/repos/$env:REPO/releases" `
|
||||||
|
-Method Post `
|
||||||
|
-Headers @{ Authorization = "token $env:TOKEN"; "Content-Type" = "application/json" } `
|
||||||
|
-Body "{`"tag_name`":`"latest`",`"name`":`"Lotus Chat $VERSION`",`"prerelease`":true,`"body`":`"Built from ${{ github.sha }}`"}"
|
||||||
|
}
|
||||||
|
$releaseId = $release.id
|
||||||
|
|
||||||
|
$nsis = "src-tauri\target\release\bundle\nsis"
|
||||||
|
$files = @(
|
||||||
|
"$nsis\Lotus Chat_${VERSION}_x64-setup.exe",
|
||||||
|
"$nsis\Lotus Chat_${VERSION}_x64-setup.nsis.zip",
|
||||||
|
"$nsis\Lotus Chat_${VERSION}_x64-setup.nsis.zip.sig"
|
||||||
|
)
|
||||||
|
$names = @("LotusChat-x86_64-setup.exe", "LotusChat-x86_64-setup.nsis.zip", "LotusChat-x86_64-setup.nsis.zip.sig")
|
||||||
|
for ($i = 0; $i -lt $files.Length; $i++) {
|
||||||
|
$existing = (Invoke-RestMethod -Uri "$env:GITEA_URL/api/v1/repos/$env:REPO/releases/$releaseId/assets" `
|
||||||
|
-Headers @{ Authorization = "token $env:TOKEN" }) | Where-Object { $_.name -eq $names[$i] }
|
||||||
|
if ($existing) {
|
||||||
|
Invoke-RestMethod -Uri "$env:GITEA_URL/api/v1/repos/$env:REPO/releases/$releaseId/assets/$($existing.id)" `
|
||||||
|
-Method Delete -Headers @{ Authorization = "token $env:TOKEN" }
|
||||||
|
}
|
||||||
|
$bytes = [System.IO.File]::ReadAllBytes($files[$i])
|
||||||
|
Invoke-RestMethod -Uri "$env:GITEA_URL/api/v1/repos/$env:REPO/releases/$releaseId/assets?name=$($names[$i])" `
|
||||||
|
-Method Post `
|
||||||
|
-Headers @{ Authorization = "token $env:TOKEN"; "Content-Type" = "application/octet-stream" } `
|
||||||
|
-Body $bytes
|
||||||
|
}
|
||||||
|
|
||||||
|
build-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: .node-version
|
||||||
|
|
||||||
|
- name: Install system deps
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y \
|
||||||
|
curl wget file \
|
||||||
|
libwebkit2gtk-4.1-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libxdo-dev \
|
||||||
|
libayatana-appindicator3-dev \
|
||||||
|
librsvg2-dev \
|
||||||
|
patchelf \
|
||||||
|
xdg-utils
|
||||||
|
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
workspaces: src-tauri
|
||||||
|
|
||||||
|
- name: Install frontend deps
|
||||||
|
run: cd cinny && npm ci
|
||||||
|
|
||||||
|
- name: Install Tauri deps
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Stage AppRun for AppImage bundler
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.cache/tauri
|
||||||
|
cp tools/AppRun-x86_64 ~/.cache/tauri/AppRun-x86_64
|
||||||
|
chmod +x ~/.cache/tauri/AppRun-x86_64
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ''
|
||||||
|
NODE_OPTIONS: '--max_old_space_size=4096'
|
||||||
|
run: npm run tauri -- build --bundles appimage,deb
|
||||||
|
|
||||||
|
- name: Upload to release
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
VERSION=$(python3 -c "import json; print(json.load(open('src-tauri/tauri.conf.json'))['version'])")
|
||||||
|
echo "Version: $VERSION"
|
||||||
|
|
||||||
|
APPIMAGE_DIR="src-tauri/target/release/bundle/appimage"
|
||||||
|
DEB_DIR="src-tauri/target/release/bundle/deb"
|
||||||
|
|
||||||
|
RELEASE=$(curl -sf "$GITEA_URL/api/v1/repos/$REPO/releases/tags/latest" \
|
||||||
|
-H "Authorization: token $TOKEN" 2>/dev/null || true)
|
||||||
|
RELEASE_ID=$(echo "$RELEASE" | python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
|
||||||
|
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "None" ]; then
|
||||||
|
RELEASE_ID=$(curl -sf -X POST "$GITEA_URL/api/v1/repos/$REPO/releases" \
|
||||||
|
-H "Authorization: token $TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\":\"latest\",\"name\":\"Lotus Chat $VERSION\",\"prerelease\":true,\"body\":\"Built from ${{ github.sha }}\"}" \
|
||||||
|
| python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||||
|
fi
|
||||||
|
|
||||||
|
upload() {
|
||||||
|
local name="$1" path="$2"
|
||||||
|
local existing_id
|
||||||
|
existing_id=$(curl -sf "$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets" \
|
||||||
|
-H "Authorization: token $TOKEN" \
|
||||||
|
| python3 -c "import sys,json; assets=json.load(sys.stdin); print(next((str(a['id']) for a in assets if a['name']=='$name'), ''))" 2>/dev/null || true)
|
||||||
|
if [ -n "$existing_id" ]; then
|
||||||
|
curl -sf -X DELETE "$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets/$existing_id" \
|
||||||
|
-H "Authorization: token $TOKEN" || true
|
||||||
|
fi
|
||||||
|
echo "Uploading $name"
|
||||||
|
curl -sf -X POST \
|
||||||
|
"$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets?name=$name" \
|
||||||
|
-H "Authorization: token $TOKEN" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary @"$path"
|
||||||
|
}
|
||||||
|
|
||||||
|
upload "LotusChat-x86_64.AppImage" "$APPIMAGE_DIR/Lotus Chat_${VERSION}_amd64.AppImage"
|
||||||
|
upload "LotusChat-x86_64.AppImage.tar.gz" "$APPIMAGE_DIR/Lotus Chat_${VERSION}_amd64.AppImage.tar.gz"
|
||||||
|
upload "LotusChat-x86_64.AppImage.tar.gz.sig" "$APPIMAGE_DIR/Lotus Chat_${VERSION}_amd64.AppImage.tar.gz.sig"
|
||||||
|
upload "LotusChat-x86_64.deb" "$DEB_DIR/Lotus Chat_${VERSION}_amd64.deb"
|
||||||
|
|
||||||
|
update-manifest:
|
||||||
|
needs: [build-windows, build-linux]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GITEA_URL: https://code.lotusguild.org
|
||||||
|
REPO: LotusGuild/cinny-desktop
|
||||||
|
steps:
|
||||||
|
- name: Generate and upload release.json
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
BASE="$GITEA_URL/LotusGuild/cinny-desktop/releases/download/latest"
|
||||||
|
|
||||||
|
WIN_SIG=$(curl -sf "$BASE/LotusChat-x86_64-setup.nsis.zip.sig")
|
||||||
|
LIN_SIG=$(curl -sf "$BASE/LotusChat-x86_64.AppImage.tar.gz.sig")
|
||||||
|
|
||||||
|
RELEASE=$(curl -sf "$GITEA_URL/api/v1/repos/$REPO/releases/tags/latest" \
|
||||||
|
-H "Authorization: token $TOKEN")
|
||||||
|
RELEASE_ID=$(echo "$RELEASE" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||||
|
VERSION=$(echo "$RELEASE" | python3 -c "import sys,json; print(json.load(sys.stdin)['name'].split()[-1])")
|
||||||
|
DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||||
|
|
||||||
|
python3 -c "import json,sys; v,d,wu,ws,lu,ls=sys.argv[1:]; print(json.dumps({'version':v,'notes':'Latest Lotus Chat release','pub_date':d,'platforms':{'windows-x86_64':{'url':wu,'signature':ws},'linux-x86_64':{'url':lu,'signature':ls}}},indent=2))" \
|
||||||
|
"$VERSION" "$DATE" \
|
||||||
|
"$BASE/LotusChat-x86_64-setup.nsis.zip" "$WIN_SIG" \
|
||||||
|
"$BASE/LotusChat-x86_64.AppImage.tar.gz" "$LIN_SIG" \
|
||||||
|
> release.json
|
||||||
|
|
||||||
|
cat release.json
|
||||||
|
|
||||||
|
OLD=$(curl -sf "$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets" \
|
||||||
|
-H "Authorization: token $TOKEN" \
|
||||||
|
| python3 -c "import sys,json; print(next((str(a['id']) for a in json.load(sys.stdin) if a['name']=='release.json'), ''))" 2>/dev/null || true)
|
||||||
|
[ -n "$OLD" ] && curl -sf -X DELETE \
|
||||||
|
"$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets/$OLD" \
|
||||||
|
-H "Authorization: token $TOKEN" || true
|
||||||
|
|
||||||
|
curl -sf -X POST \
|
||||||
|
"$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets?name=release.json" \
|
||||||
|
-H "Authorization: token $TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
--data-binary @release.json
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
name: "Upload zip-archive"
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
zip-archive:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Create zip including submodules
|
||||||
|
run: |
|
||||||
|
cd ..
|
||||||
|
zip ${{ github.event.repository.name }}/${{ github.event.repository.name }}-${{ github.ref_name }}.zip ${{ github.event.repository.name }} -r
|
||||||
|
- name: Upload zip to release
|
||||||
|
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
${{ github.event.repository.name }}-${{ github.ref_name }}.zip
|
||||||
+31
-120
@@ -1,82 +1,19 @@
|
|||||||
name: "Publish Tauri App"
|
name: "Publish Tauri App"
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
semantic-release:
|
|
||||||
name: Trigger release
|
|
||||||
outputs:
|
|
||||||
version: ${{ steps.vars.outputs.tag }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
actions: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
||||||
with:
|
|
||||||
node-version-file: ".node-version"
|
|
||||||
package-manager-cache: false
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Run semantic-release
|
|
||||||
run: npm run semantic-release
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get version from tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
TAG=$(git describe --tags --abbrev=0)
|
|
||||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
zip-archive:
|
|
||||||
needs: semantic-release
|
|
||||||
env:
|
|
||||||
TAURI_VERSION: ${{ needs.semantic-release.outputs.version }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
with:
|
|
||||||
ref: ${{ env.TAURI_VERSION }}
|
|
||||||
fetch-depth: 0
|
|
||||||
submodules: true
|
|
||||||
- name: Create zip including submodules
|
|
||||||
run: |
|
|
||||||
cd ..
|
|
||||||
zip ${{ github.event.repository.name }}/${{ github.event.repository.name }}-${{ env.TAURI_VERSION }}.zip ${{ github.event.repository.name }} -r
|
|
||||||
- name: Upload zip to release
|
|
||||||
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
|
|
||||||
with:
|
|
||||||
tag_name: ${{ env.TAURI_VERSION }}
|
|
||||||
files: |
|
|
||||||
${{ github.event.repository.name }}-${{ env.TAURI_VERSION }}.zip
|
|
||||||
|
|
||||||
# Windows-x86_64
|
# Windows-x86_64
|
||||||
windows-x86_64:
|
windows-x86_64:
|
||||||
needs: semantic-release
|
|
||||||
env:
|
|
||||||
TAURI_VERSION: ${{ needs.semantic-release.outputs.version }}
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
with:
|
with:
|
||||||
ref: ${{ env.TAURI_VERSION }}
|
|
||||||
fetch-depth: 0
|
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".node-version"
|
node-version-file: ".node-version"
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
@@ -93,25 +30,26 @@ jobs:
|
|||||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
||||||
- name: Move msi
|
- name: Get app version (windows)
|
||||||
run: |
|
run: |
|
||||||
$version = $env:TAURI_VERSION.TrimStart('v')
|
$json = (Get-Content "src-tauri\tauri.conf.json" -Raw) | ConvertFrom-Json
|
||||||
Move-Item "src-tauri\target\release\bundle\msi\Cinny_${version}_x64_en-US.msi" "src-tauri\target\release\bundle\msi\Cinny_desktop-x86_64.msi"
|
$version = $json.version
|
||||||
|
echo "Version: ${version}"
|
||||||
|
echo "TAURI_VERSION=${version}" >> $Env:GITHUB_ENV
|
||||||
|
echo "${Env:TAURI_VERSION}"
|
||||||
|
shell: pwsh
|
||||||
|
- name: Move msi
|
||||||
|
run: Move-Item "src-tauri\target\release\bundle\msi\Cinny_${{ env.TAURI_VERSION }}_x64_en-US.msi" "src-tauri\target\release\bundle\msi\Cinny_desktop-x86_64.msi"
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
- name: Move msi.zip
|
- name: Move msi.zip
|
||||||
run: |
|
run: Move-Item "src-tauri\target\release\bundle\msi\Cinny_${{ env.TAURI_VERSION }}_x64_en-US.msi.zip" "src-tauri\target\release\bundle\msi\Cinny_desktop-x86_64.msi.zip"
|
||||||
$version = $env:TAURI_VERSION.TrimStart('v')
|
|
||||||
Move-Item "src-tauri\target\release\bundle\msi\Cinny_${version}_x64_en-US.msi.zip" "src-tauri\target\release\bundle\msi\Cinny_desktop-x86_64.msi.zip"
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
- name: Move msi.zip.sig
|
- name: Move msi.zip.sig
|
||||||
run: |
|
run: Move-Item "src-tauri\target\release\bundle\msi\Cinny_${{ env.TAURI_VERSION }}_x64_en-US.msi.zip.sig" "src-tauri\target\release\bundle\msi\Cinny_desktop-x86_64.msi.zip.sig"
|
||||||
$version = $env:TAURI_VERSION.TrimStart('v')
|
|
||||||
Move-Item "src-tauri\target\release\bundle\msi\Cinny_${version}_x64_en-US.msi.zip.sig" "src-tauri\target\release\bundle\msi\Cinny_desktop-x86_64.msi.zip.sig"
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
- name: Upload tagged release
|
- name: Upload tagged release
|
||||||
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
|
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.TAURI_VERSION }}
|
|
||||||
files: |
|
files: |
|
||||||
src-tauri/target/release/bundle/msi/Cinny_desktop-x86_64.msi
|
src-tauri/target/release/bundle/msi/Cinny_desktop-x86_64.msi
|
||||||
src-tauri/target/release/bundle/msi/Cinny_desktop-x86_64.msi.zip
|
src-tauri/target/release/bundle/msi/Cinny_desktop-x86_64.msi.zip
|
||||||
@@ -119,19 +57,14 @@ jobs:
|
|||||||
|
|
||||||
# Linux-x86_64
|
# Linux-x86_64
|
||||||
linux-x86_64:
|
linux-x86_64:
|
||||||
needs: semantic-release
|
|
||||||
env:
|
|
||||||
TAURI_VERSION: ${{ needs.semantic-release.outputs.version }}
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
with:
|
with:
|
||||||
ref: ${{ env.TAURI_VERSION }}
|
|
||||||
fetch-depth: 0
|
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".node-version"
|
node-version-file: ".node-version"
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
@@ -152,30 +85,20 @@ jobs:
|
|||||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
||||||
|
- name: Get app version
|
||||||
|
id: vars
|
||||||
|
run: echo "tag=$(jq .version src-tauri/tauri.conf.json | tr -d '"')" >> $GITHUB_OUTPUT
|
||||||
- name: Move deb
|
- name: Move deb
|
||||||
run: |
|
run: mv "src-tauri/target/release/bundle/deb/Cinny_${{ steps.vars.outputs.tag }}_amd64.deb" "src-tauri/target/release/bundle/deb/Cinny_desktop-x86_64.deb"
|
||||||
VERSION="${{ env.TAURI_VERSION }}"
|
|
||||||
VERSION="${VERSION#v}"
|
|
||||||
mv "src-tauri/target/release/bundle/deb/Cinny_${VERSION}_amd64.deb" "src-tauri/target/release/bundle/deb/Cinny_desktop-x86_64.deb"
|
|
||||||
- name: Move AppImage
|
- name: Move AppImage
|
||||||
run: |
|
run: mv "src-tauri/target/release/bundle/appimage/Cinny_${{ steps.vars.outputs.tag }}_amd64.AppImage" "src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage"
|
||||||
VERSION="${{ env.TAURI_VERSION }}"
|
|
||||||
VERSION="${VERSION#v}"
|
|
||||||
mv "src-tauri/target/release/bundle/appimage/Cinny_${VERSION}_amd64.AppImage" "src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage"
|
|
||||||
- name: Move AppImage.tar.gz
|
- name: Move AppImage.tar.gz
|
||||||
run: |
|
run: mv "src-tauri/target/release/bundle/appimage/Cinny_${{ steps.vars.outputs.tag }}_amd64.AppImage.tar.gz" "src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage.tar.gz"
|
||||||
VERSION="${{ env.TAURI_VERSION }}"
|
|
||||||
VERSION="${VERSION#v}"
|
|
||||||
mv "src-tauri/target/release/bundle/appimage/Cinny_${VERSION}_amd64.AppImage.tar.gz" "src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage.tar.gz"
|
|
||||||
- name: Move AppImage.tar.gz.sig
|
- name: Move AppImage.tar.gz.sig
|
||||||
run: |
|
run: mv "src-tauri/target/release/bundle/appimage/Cinny_${{ steps.vars.outputs.tag }}_amd64.AppImage.tar.gz.sig" "src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage.tar.gz.sig"
|
||||||
VERSION="${{ env.TAURI_VERSION }}"
|
|
||||||
VERSION="${VERSION#v}"
|
|
||||||
mv "src-tauri/target/release/bundle/appimage/Cinny_${VERSION}_amd64.AppImage.tar.gz.sig" "src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage.tar.gz.sig"
|
|
||||||
- name: Upload tagged release
|
- name: Upload tagged release
|
||||||
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
|
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.TAURI_VERSION }}
|
|
||||||
files: |
|
files: |
|
||||||
src-tauri/target/release/bundle/deb/Cinny_desktop-x86_64.deb
|
src-tauri/target/release/bundle/deb/Cinny_desktop-x86_64.deb
|
||||||
src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage
|
src-tauri/target/release/bundle/appimage/Cinny_desktop-x86_64.AppImage
|
||||||
@@ -184,19 +107,14 @@ jobs:
|
|||||||
|
|
||||||
# macos-universal
|
# macos-universal
|
||||||
macos-universal:
|
macos-universal:
|
||||||
needs: semantic-release
|
|
||||||
env:
|
|
||||||
TAURI_VERSION: ${{ needs.semantic-release.outputs.version }}
|
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
with:
|
with:
|
||||||
ref: ${{ env.TAURI_VERSION }}
|
|
||||||
fetch-depth: 0
|
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".node-version"
|
node-version-file: ".node-version"
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
@@ -217,19 +135,18 @@ jobs:
|
|||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
||||||
with:
|
with:
|
||||||
args: "--target universal-apple-darwin"
|
args: "--target universal-apple-darwin"
|
||||||
|
- name: Get app version
|
||||||
|
id: vars
|
||||||
|
run: echo "tag=$(jq .version src-tauri/tauri.conf.json | tr -d '"')" >> $GITHUB_OUTPUT
|
||||||
- name: Move dmg
|
- name: Move dmg
|
||||||
run: |
|
run: mv "src-tauri/target/universal-apple-darwin/release/bundle/dmg/Cinny_${{ steps.vars.outputs.tag }}_universal.dmg" "src-tauri/target/universal-apple-darwin/release/bundle/dmg/Cinny_desktop-universal.dmg"
|
||||||
VERSION="${{ env.TAURI_VERSION }}"
|
|
||||||
VERSION="${VERSION#v}"
|
|
||||||
mv "src-tauri/target/universal-apple-darwin/release/bundle/dmg/Cinny_${VERSION}_universal.dmg" "src-tauri/target/universal-apple-darwin/release/bundle/dmg/Cinny_desktop-universal.dmg"
|
|
||||||
- name: Move app.tar.gz
|
- name: Move app.tar.gz
|
||||||
run: mv "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny.app.tar.gz" "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz"
|
run: mv "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny.app.tar.gz" "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz"
|
||||||
- name: Move app.tar.gz.sig
|
- name: Move app.tar.gz.sig
|
||||||
run: mv "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny.app.tar.gz.sig" "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz.sig"
|
run: mv "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny.app.tar.gz.sig" "src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz.sig"
|
||||||
- name: Upload tagged release
|
- name: Upload tagged release
|
||||||
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
|
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.TAURI_VERSION }}
|
|
||||||
files: |
|
files: |
|
||||||
src-tauri/target/universal-apple-darwin/release/bundle/dmg/Cinny_desktop-universal.dmg
|
src-tauri/target/universal-apple-darwin/release/bundle/dmg/Cinny_desktop-universal.dmg
|
||||||
src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz
|
src-tauri/target/universal-apple-darwin/release/bundle/macos/Cinny_desktop-universal.app.tar.gz
|
||||||
@@ -238,17 +155,11 @@ jobs:
|
|||||||
# Upload release.json
|
# Upload release.json
|
||||||
release-update:
|
release-update:
|
||||||
if: always()
|
if: always()
|
||||||
needs: [windows-x86_64, linux-x86_64, macos-universal, semantic-release]
|
needs: [windows-x86_64, linux-x86_64, macos-universal]
|
||||||
env:
|
|
||||||
TAURI_VERSION: ${{ needs.semantic-release.outputs.version }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
with:
|
|
||||||
ref: ${{ env.TAURI_VERSION }}
|
|
||||||
fetch-depth: 0
|
|
||||||
submodules: true
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Run release.json
|
- name: Run release.json
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".node-version"
|
node-version-file: ".node-version"
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
|
|||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
[submodule "cinny"]
|
[submodule "cinny"]
|
||||||
path = cinny
|
path = cinny
|
||||||
url = https://github.com/cinnyapp/cinny.git
|
url = https://code.lotusguild.org/LotusGuild/cinny.git
|
||||||
|
branch = lotus
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
# These are commented until we enable lint and typecheck
|
|
||||||
# npx tsc -p tsconfig.json --noEmit
|
|
||||||
# npx lint-staged
|
|
||||||
+1
-1
Submodule cinny updated: 6a05ff5840...5469740f4c
+3
-27
@@ -1,35 +1,11 @@
|
|||||||
{
|
{
|
||||||
"defaultHomeserver": 1,
|
"defaultHomeserver": 0,
|
||||||
"homeserverList": [
|
"homeserverList": [
|
||||||
"converser.eu",
|
"matrix.lotusguild.org",
|
||||||
"matrix.org",
|
"matrix.org",
|
||||||
"mozilla.org",
|
"mozilla.org"
|
||||||
"unredacted.org",
|
|
||||||
"xmr.se"
|
|
||||||
],
|
],
|
||||||
"allowCustomHomeservers": true,
|
"allowCustomHomeservers": true,
|
||||||
|
|
||||||
"featuredCommunities": {
|
|
||||||
"openAsDefault": false,
|
|
||||||
"spaces": [
|
|
||||||
"#cinny-space:matrix.org",
|
|
||||||
"#community:matrix.org",
|
|
||||||
"#space:unredacted.org",
|
|
||||||
"#science-space:matrix.org",
|
|
||||||
"#libregaming-games:tchncs.de",
|
|
||||||
"#mathematics-on:matrix.org"
|
|
||||||
],
|
|
||||||
"rooms": [
|
|
||||||
"#cinny:matrix.org",
|
|
||||||
"#freesoftware:matrix.org",
|
|
||||||
"#pcapdroid:matrix.org",
|
|
||||||
"#gentoo:matrix.org",
|
|
||||||
"#PrivSec.dev:arcticfoxes.net",
|
|
||||||
"#disroot:aria-net.org"
|
|
||||||
],
|
|
||||||
"servers": [ "matrix.org", "mozilla.org", "unredacted.org" ]
|
|
||||||
},
|
|
||||||
|
|
||||||
"hashRouter": {
|
"hashRouter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"basename": "/"
|
"basename": "/"
|
||||||
|
|||||||
Generated
+390
-7419
File diff suppressed because it is too large
Load Diff
+4
-53
@@ -1,59 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "cinny",
|
"name": "cinny",
|
||||||
"version": "4.11.2",
|
"version": "4.12.2",
|
||||||
"description": "Yet another matrix client",
|
"description": "Yet another matrix client",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"tauri": "cp config.json cinny/ && tauri",
|
"tauri": "shx cp config.json cinny/ && tauri",
|
||||||
"release": "node scripts/release.mjs",
|
"release": "node scripts/release.mjs",
|
||||||
"lint": "npm run check:eslint && npm run check:prettier",
|
"bump": "node scripts/update-version.mjs"
|
||||||
"check:eslint": "eslint src/*",
|
|
||||||
"check:prettier": "prettier --check .",
|
|
||||||
"fix:prettier": "prettier --write .",
|
|
||||||
"typecheck": "tsc --noEmit",
|
|
||||||
"prepare": "husky install",
|
|
||||||
"commit": "git-cz",
|
|
||||||
"semantic-release": "semantic-release"
|
|
||||||
},
|
|
||||||
"lint-staged": {
|
|
||||||
"*.{ts,tsx,js,jsx}": "eslint",
|
|
||||||
"*": "prettier --ignore-unknown --write"
|
|
||||||
},
|
|
||||||
"config": {
|
|
||||||
"commitizen": {
|
|
||||||
"path": "./node_modules/cz-conventional-changelog"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"release": {
|
|
||||||
"branches": [
|
|
||||||
"main"
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
"@semantic-release/commit-analyzer",
|
|
||||||
"@semantic-release/release-notes-generator",
|
|
||||||
[
|
|
||||||
"@semantic-release/exec",
|
|
||||||
{
|
|
||||||
"prepareCmd": "node scripts/update-version.mjs ${nextRelease.version}"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"@semantic-release/git",
|
|
||||||
{
|
|
||||||
"assets": [
|
|
||||||
"package.json",
|
|
||||||
"package-lock.json",
|
|
||||||
"src-tauri/Cargo.toml",
|
|
||||||
"src-tauri/tauri.conf.json"
|
|
||||||
],
|
|
||||||
"message": "chore(release): ${nextRelease.version} [skip ci]"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@semantic-release/github"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "Ajay Bura",
|
"author": "Ajay Bura",
|
||||||
@@ -73,13 +29,8 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@actions/github": "6.0.0",
|
"@actions/github": "6.0.0",
|
||||||
"@semantic-release/exec": "7.1.0",
|
|
||||||
"@semantic-release/git": "10.0.1",
|
|
||||||
"@tauri-apps/cli": "2.7.1",
|
"@tauri-apps/cli": "2.7.1",
|
||||||
"cz-conventional-changelog": "3.3.0",
|
|
||||||
"husky": "9.1.7",
|
|
||||||
"lint-staged": "16.3.2",
|
|
||||||
"node-fetch": "3.3.2",
|
"node-fetch": "3.3.2",
|
||||||
"semantic-release": "25.0.3"
|
"shx": "0.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,17 +46,19 @@ console.log("Updating cinny web submodule");
|
|||||||
|
|
||||||
execSync("git submodule update --init --recursive", { stdio: "inherit" });
|
execSync("git submodule update --init --recursive", { stdio: "inherit" });
|
||||||
|
|
||||||
execSync("cd cinny && git fetch --tags", { stdio: "inherit" });
|
execSync("git fetch --tags", { cwd: "cinny", stdio: "inherit" });
|
||||||
|
|
||||||
const latestTag = execSync(
|
const latestCommit = execSync("git rev-list --tags --max-count=1", {
|
||||||
"cd cinny && git describe --tags $(git rev-list --tags --max-count=1)"
|
cwd: "cinny",
|
||||||
)
|
}).toString().trim();
|
||||||
.toString()
|
|
||||||
.trim();
|
const latestTag = execSync(`git describe --tags ${latestCommit}`, {
|
||||||
|
cwd: "cinny",
|
||||||
|
}).toString().trim();
|
||||||
|
|
||||||
console.log(`Latest cinny tag: ${latestTag}`);
|
console.log(`Latest cinny tag: ${latestTag}`);
|
||||||
|
|
||||||
execSync(`cd cinny && git checkout ${latestTag}`, { stdio: "inherit" });
|
execSync(`git checkout ${latestTag}`, { cwd: "cinny", stdio: "inherit" });
|
||||||
|
|
||||||
execSync("git add cinny", { stdio: "inherit" });
|
execSync("git add cinny", { stdio: "inherit" });
|
||||||
|
|
||||||
|
|||||||
Generated
+2242
-2038
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "cinny"
|
name = "cinny"
|
||||||
version = "4.11.2"
|
version = "4.12.2"
|
||||||
description = "Yet another matrix client"
|
description = "Yet another matrix client"
|
||||||
authors = ["Ajay Bura"]
|
authors = ["Ajay Bura"]
|
||||||
license = "AGPL-3.0-only"
|
license = "AGPL-3.0-only"
|
||||||
@@ -17,7 +17,7 @@ tauri-build = { version = "2", features = [] }
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
serde_json = "1.0.109"
|
serde_json = "1.0.109"
|
||||||
serde = { version = "1.0.193", features = ["derive"] }
|
serde = { version = "1.0.193", features = ["derive"] }
|
||||||
tauri = { version = "2", features = [ "devtools"] }
|
tauri = { version = "2", features = ["devtools", "wry"] }
|
||||||
tauri-plugin-localhost = "2"
|
tauri-plugin-localhost = "2"
|
||||||
tauri-plugin-window-state = "2"
|
tauri-plugin-window-state = "2"
|
||||||
tauri-plugin-clipboard-manager = "2"
|
tauri-plugin-clipboard-manager = "2"
|
||||||
@@ -28,6 +28,7 @@ tauri-plugin-http = "2"
|
|||||||
tauri-plugin-process = "2"
|
tauri-plugin-process = "2"
|
||||||
tauri-plugin-os = "2"
|
tauri-plugin-os = "2"
|
||||||
tauri-plugin-dialog = "2"
|
tauri-plugin-dialog = "2"
|
||||||
|
tauri-plugin-opener = "2"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# by default Tauri runs in production mode
|
# by default Tauri runs in production mode
|
||||||
@@ -41,6 +42,9 @@ custom-protocol = [ "tauri/custom-protocol" ]
|
|||||||
tauri-plugin-global-shortcut = "2"
|
tauri-plugin-global-shortcut = "2"
|
||||||
tauri-plugin-updater = "2"
|
tauri-plugin-updater = "2"
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "windows")'.dependencies]
|
||||||
|
webview2-com = "0.38"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "app_lib"
|
name = "app_lib"
|
||||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>NSCameraUsageDescription</key>
|
||||||
|
<string>Request camera access for WebRTC calls.</string>
|
||||||
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
|
<string>Request microphone access for WebRTC calls.</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -2,6 +2,11 @@
|
|||||||
"identifier": "migrated",
|
"identifier": "migrated",
|
||||||
"description": "permissions that were migrated from v1",
|
"description": "permissions that were migrated from v1",
|
||||||
"local": true,
|
"local": true,
|
||||||
|
"remote": {
|
||||||
|
"urls": [
|
||||||
|
"http://localhost:44548"
|
||||||
|
]
|
||||||
|
},
|
||||||
"windows": [
|
"windows": [
|
||||||
"main"
|
"main"
|
||||||
],
|
],
|
||||||
@@ -77,6 +82,10 @@
|
|||||||
"clipboard-manager:allow-write-text",
|
"clipboard-manager:allow-write-text",
|
||||||
"core:app:allow-app-show",
|
"core:app:allow-app-show",
|
||||||
"core:app:allow-app-hide",
|
"core:app:allow-app-hide",
|
||||||
"clipboard-manager:default"
|
"clipboard-manager:default",
|
||||||
|
{
|
||||||
|
"identifier": "opener:allow-open-url",
|
||||||
|
"allow": [{ "url": "http://*" }, { "url": "https://*" }]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"windows":["main"],"permissions":["updater:default","global-shortcut:default"],"platforms":["macOS","windows","linux"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","fs:allow-read-file","fs:allow-write-file","fs:allow-read-dir","fs:allow-copy-file","fs:allow-mkdir","fs:allow-remove","fs:allow-remove","fs:allow-rename","fs:allow-exists","core:window:allow-create","core:window:allow-center","core:window:allow-request-user-attention","core:window:allow-set-resizable","core:window:allow-set-maximizable","core:window:allow-set-minimizable","core:window:allow-set-closable","core:window:allow-set-title","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-decorations","core:window:allow-set-always-on-top","core:window:allow-set-content-protected","core:window:allow-set-size","core:window:allow-set-min-size","core:window:allow-set-max-size","core:window:allow-set-position","core:window:allow-set-fullscreen","core:window:allow-set-focus","core:window:allow-set-icon","core:window:allow-set-skip-taskbar","core:window:allow-set-cursor-grab","core:window:allow-set-cursor-visible","core:window:allow-set-cursor-icon","core:window:allow-set-cursor-position","core:window:allow-set-ignore-cursor-events","core:window:allow-start-dragging","core:webview:allow-print","shell:allow-execute","shell:allow-open","dialog:allow-open","dialog:allow-save","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","http:default","notification:default","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-register-all","global-shortcut:allow-unregister","global-shortcut:allow-unregister-all","os:allow-platform","os:allow-version","os:allow-os-type","os:allow-family","os:allow-arch","os:allow-exe-extension","os:allow-locale","os:allow-hostname","process:allow-restart","process:allow-exit","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","clipboard-manager:default"]}}
|
{"desktop-capability":{"identifier":"desktop-capability","description":"","local":true,"windows":["main"],"permissions":["updater:default","global-shortcut:default"],"platforms":["macOS","windows","linux"]},"migrated":{"identifier":"migrated","description":"permissions that were migrated from v1","local":true,"windows":["main"],"permissions":["core:default","fs:allow-read-file","fs:allow-write-file","fs:allow-read-dir","fs:allow-copy-file","fs:allow-mkdir","fs:allow-remove","fs:allow-remove","fs:allow-rename","fs:allow-exists","core:window:allow-create","core:window:allow-center","core:window:allow-request-user-attention","core:window:allow-set-resizable","core:window:allow-set-maximizable","core:window:allow-set-minimizable","core:window:allow-set-closable","core:window:allow-set-title","core:window:allow-maximize","core:window:allow-unmaximize","core:window:allow-minimize","core:window:allow-unminimize","core:window:allow-show","core:window:allow-hide","core:window:allow-close","core:window:allow-set-decorations","core:window:allow-set-always-on-top","core:window:allow-set-content-protected","core:window:allow-set-size","core:window:allow-set-min-size","core:window:allow-set-max-size","core:window:allow-set-position","core:window:allow-set-fullscreen","core:window:allow-set-focus","core:window:allow-set-icon","core:window:allow-set-skip-taskbar","core:window:allow-set-cursor-grab","core:window:allow-set-cursor-visible","core:window:allow-set-cursor-icon","core:window:allow-set-cursor-position","core:window:allow-set-ignore-cursor-events","core:window:allow-start-dragging","core:webview:allow-print","shell:allow-execute","shell:allow-open","dialog:allow-open","dialog:allow-save","dialog:allow-message","dialog:allow-ask","dialog:allow-confirm","http:default","notification:default","global-shortcut:allow-is-registered","global-shortcut:allow-register","global-shortcut:allow-register-all","global-shortcut:allow-unregister","global-shortcut:allow-unregister-all","os:allow-platform","os:allow-version","os:allow-os-type","os:allow-family","os:allow-arch","os:allow-exe-extension","os:allow-locale","os:allow-hostname","process:allow-restart","process:allow-exit","clipboard-manager:allow-read-text","clipboard-manager:allow-write-text","core:app:allow-app-show","core:app:allow-app-hide","clipboard-manager:default",{"identifier":"opener:allow-open-url","allow":[{"url":"http://*"},{"url":"https://*"}]}]}}
|
||||||
@@ -2060,6 +2060,174 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"if": {
|
||||||
|
"properties": {
|
||||||
|
"identifier": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:default",
|
||||||
|
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:allow-default-urls",
|
||||||
|
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Enables the open_path command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:allow-open-path",
|
||||||
|
"markdownDescription": "Enables the open_path command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Enables the open_url command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:allow-open-url",
|
||||||
|
"markdownDescription": "Enables the open_url command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:allow-reveal-item-in-dir",
|
||||||
|
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Denies the open_path command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:deny-open-path",
|
||||||
|
"markdownDescription": "Denies the open_path command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Denies the open_url command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:deny-open-url",
|
||||||
|
"markdownDescription": "Denies the open_url command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:deny-reveal-item-in-dir",
|
||||||
|
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"then": {
|
||||||
|
"properties": {
|
||||||
|
"allow": {
|
||||||
|
"items": {
|
||||||
|
"title": "OpenerScopeEntry",
|
||||||
|
"description": "Opener scope entry.",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"url"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"app": {
|
||||||
|
"description": "An application to open this url with, for example: firefox.",
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Application"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"app": {
|
||||||
|
"description": "An application to open this path with, for example: xdg-open.",
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Application"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"deny": {
|
||||||
|
"items": {
|
||||||
|
"title": "OpenerScopeEntry",
|
||||||
|
"description": "Opener scope entry.",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"url"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"app": {
|
||||||
|
"description": "An application to open this url with, for example: firefox.",
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Application"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"app": {
|
||||||
|
"description": "An application to open this path with, for example: xdg-open.",
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Application"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"identifier": {
|
||||||
|
"description": "Identifier of the permission or permission set.",
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Identifier"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"if": {
|
"if": {
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -6422,6 +6590,54 @@
|
|||||||
"const": "notification:deny-show",
|
"const": "notification:deny-show",
|
||||||
"markdownDescription": "Denies the show command without any pre-configured scope."
|
"markdownDescription": "Denies the show command without any pre-configured scope."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:default",
|
||||||
|
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:allow-default-urls",
|
||||||
|
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Enables the open_path command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:allow-open-path",
|
||||||
|
"markdownDescription": "Enables the open_path command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Enables the open_url command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:allow-open-url",
|
||||||
|
"markdownDescription": "Enables the open_url command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:allow-reveal-item-in-dir",
|
||||||
|
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Denies the open_path command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:deny-open-path",
|
||||||
|
"markdownDescription": "Denies the open_path command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Denies the open_url command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:deny-open-url",
|
||||||
|
"markdownDescription": "Denies the open_url command without any pre-configured scope."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
|
||||||
|
"type": "string",
|
||||||
|
"const": "opener:deny-reveal-item-in-dir",
|
||||||
|
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "This permission set configures which\noperating system information are available\nto gather from the frontend.\n\n#### Granted Permissions\n\nAll information except the host name are available.\n\n\n#### This default permission set includes:\n\n- `allow-arch`\n- `allow-exe-extension`\n- `allow-family`\n- `allow-locale`\n- `allow-os-type`\n- `allow-platform`\n- `allow-version`",
|
"description": "This permission set configures which\noperating system information are available\nto gather from the frontend.\n\n#### Granted Permissions\n\nAll information except the host name are available.\n\n\n#### This default permission set includes:\n\n- `allow-arch`\n- `allow-exe-extension`\n- `allow-family`\n- `allow-locale`\n- `allow-os-type`\n- `allow-platform`\n- `allow-version`",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -6812,6 +7028,23 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"Application": {
|
||||||
|
"description": "Opener scope application.",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"description": "Open in default application.",
|
||||||
|
"type": "null"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "If true, allow open with any application.",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Allow specific application to open with.",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"ShellScopeEntryAllowedArg": {
|
"ShellScopeEntryAllowedArg": {
|
||||||
"description": "A command argument allowed to be executed by the webview API.",
|
"description": "A command argument allowed to be executed by the webview API.",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+48
-11
@@ -3,38 +3,75 @@
|
|||||||
windows_subsystem = "windows"
|
windows_subsystem = "windows"
|
||||||
)]
|
)]
|
||||||
|
|
||||||
// mod menu;
|
use tauri::{webview::{NewWindowResponse, WebviewWindowBuilder}, WebviewUrl};
|
||||||
|
use tauri_plugin_opener::OpenerExt;
|
||||||
use tauri::{webview::WebviewWindowBuilder, WebviewUrl};
|
|
||||||
|
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
let port: u16 = 44548;
|
let port: u16 = 44548;
|
||||||
let context = tauri::generate_context!();
|
let context = tauri::generate_context!();
|
||||||
let builder = tauri::Builder::default();
|
let builder = tauri::Builder::default();
|
||||||
|
|
||||||
// #[cfg(target_os = "macos")]
|
|
||||||
// {
|
|
||||||
// builder = builder.menu(menu::menu());
|
|
||||||
// }
|
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.plugin(tauri_plugin_localhost::Builder::new(port).build())
|
.plugin(tauri_plugin_localhost::Builder::new(port).build())
|
||||||
.plugin(tauri_plugin_window_state::Builder::default().build())
|
.plugin(tauri_plugin_window_state::Builder::default().build())
|
||||||
|
.plugin(tauri_plugin_opener::init())
|
||||||
.setup(move |app| {
|
.setup(move |app| {
|
||||||
// Dev: use devUrl from tauri.conf.json (http://localhost:8080) to support HMR
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
let window_url = WebviewUrl::App(Default::default());
|
let window_url = WebviewUrl::App(Default::default());
|
||||||
|
|
||||||
// Release: tauri-plugin-localhost serves bundled frontend assets on this port
|
|
||||||
#[cfg(not(debug_assertions))]
|
#[cfg(not(debug_assertions))]
|
||||||
let window_url = {
|
let window_url = {
|
||||||
let url = format!("http://localhost:{}", port).parse().unwrap();
|
let url = format!("http://localhost:{}", port).parse().unwrap();
|
||||||
WebviewUrl::External(url)
|
WebviewUrl::External(url)
|
||||||
};
|
};
|
||||||
|
|
||||||
WebviewWindowBuilder::new(app, "main".to_string(), window_url)
|
let app_handle = app.handle().clone();
|
||||||
|
let window = WebviewWindowBuilder::new(app, "main".to_string(), window_url)
|
||||||
.title("Cinny")
|
.title("Cinny")
|
||||||
|
.disable_drag_drop_handler()
|
||||||
|
.on_new_window(move |url, _features| {
|
||||||
|
let _ = app_handle.opener().open_url(url.as_str(), None::<&str>);
|
||||||
|
NewWindowResponse::Deny
|
||||||
|
})
|
||||||
.build()?;
|
.build()?;
|
||||||
|
|
||||||
|
// Grant camera and microphone to WebView2 automatically.
|
||||||
|
// Windows requires an explicit PermissionRequested COM event handler.
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
window.with_webview(|webview| {
|
||||||
|
use webview2_com::{
|
||||||
|
Microsoft::Web::WebView2::Win32::{
|
||||||
|
COREWEBVIEW2_PERMISSION_KIND,
|
||||||
|
COREWEBVIEW2_PERMISSION_KIND_CAMERA,
|
||||||
|
COREWEBVIEW2_PERMISSION_KIND_MICROPHONE,
|
||||||
|
COREWEBVIEW2_PERMISSION_STATE_ALLOW,
|
||||||
|
},
|
||||||
|
PermissionRequestedEventHandler,
|
||||||
|
};
|
||||||
|
|
||||||
|
let controller = webview.controller();
|
||||||
|
if let Ok(core) = unsafe { controller.CoreWebView2() } {
|
||||||
|
let handler = PermissionRequestedEventHandler::create(Box::new(
|
||||||
|
|_sender, args| {
|
||||||
|
if let Some(args) = args {
|
||||||
|
let mut kind = COREWEBVIEW2_PERMISSION_KIND(0);
|
||||||
|
unsafe { args.PermissionKind(&mut kind) }?;
|
||||||
|
if kind == COREWEBVIEW2_PERMISSION_KIND_MICROPHONE
|
||||||
|
|| kind == COREWEBVIEW2_PERMISSION_KIND_CAMERA
|
||||||
|
{
|
||||||
|
unsafe {
|
||||||
|
args.SetState(COREWEBVIEW2_PERMISSION_STATE_ALLOW)
|
||||||
|
}?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
));
|
||||||
|
let mut token = Default::default();
|
||||||
|
let _ = unsafe { core.add_PermissionRequested(&handler, &mut token) };
|
||||||
|
}
|
||||||
|
})?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.run(context)
|
.run(context)
|
||||||
|
|||||||
@@ -45,21 +45,21 @@
|
|||||||
"beforeDevCommand": "cd cinny && npm start",
|
"beforeDevCommand": "cd cinny && npm start",
|
||||||
"devUrl": "http://localhost:8080"
|
"devUrl": "http://localhost:8080"
|
||||||
},
|
},
|
||||||
"productName": "Cinny",
|
"productName": "Lotus Chat",
|
||||||
"mainBinaryName": "cinny",
|
"mainBinaryName": "cinny",
|
||||||
"version": "4.11.2",
|
"version": "4.12.2",
|
||||||
"identifier": "in.cinny.app",
|
"identifier": "org.lotusguild.lotus-chat",
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"updater": {
|
"updater": {
|
||||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE2NDc3NDBGMTAzNTk1NUYKUldSZmxUVVFEM1JIRnRuMjVRTkFOQ21lUFI5KzRMU0s4OWtBS1RNRUVCNE9LcE9GcExNZ2M2NHoK",
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDM1N0Y0RThCQTJEQzY1NTkKUldSWlpkeWlpMDUvTlVjejMzN0E1U0FiaVpLK05QVkRXdWlMMm1NNUprMXAvTGZSbU5maVovNmwK",
|
||||||
"endpoints": [
|
"endpoints": [
|
||||||
"https://github.com/cinnyapp/cinny-desktop/releases/download/tauri/release.json"
|
"https://code.lotusguild.org/LotusGuild/cinny-desktop/releases/download/latest/release.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"security": {
|
"security": {
|
||||||
"csp": "default-src 'self' blob: data: filesystem: ws: wss: http: https: tauri:; script-src 'self' 'unsafe-eval' 'unsafe-inline' blob: data: filesystem: ws: wss: http: https: tauri:; img-src 'self' data: blob: filesystem: http: https:; connect-src 'self' blob: ipc: ws: wss: http: https: http://ipc.localhost"
|
"csp": "default-src 'self' blob: data: filesystem: ws: wss: http: https: tauri:; script-src 'self' 'unsafe-eval' 'unsafe-inline' blob: data: filesystem: ws: wss: http: https: tauri:; style-src 'self' 'unsafe-inline' blob: data: filesystem: http: https:; img-src 'self' data: blob: filesystem: http: https:; media-src 'self' blob: data: mediastream:; connect-src 'self' blob: ipc: ws: wss: http: https: http://ipc.localhost"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user