Compare commits

..

3 Commits

Author SHA1 Message Date
Krishan 36887eaf40 chore: Release v4.12.2 (#580)
Release v4.12.2
2026-05-23 23:18:03 +10:00
Krishan 9809657b84 chore: add script for updates (#578) 2026-05-23 21:52:55 +10:00
Krishan 2b61520524 fix: update CSP to allow reordering rooms inside space (#579)
* fix: update CSP to allow reordering rooms inside space

Fixes https://github.com/cinnyapp/cinny/issues/2949

* disable native dnd in windows configuration

* Disable drag and drop for main webview window in lib.rs

* Remove dragDropEnabled setting from tauri.conf.json

* Replace drag_drop_enabled with disable_drag_drop_handler
2026-05-23 21:52:14 +10:00
9 changed files with 90 additions and 53 deletions
+1 -1
Submodule cinny updated: e89b8f7d12...80fd8863c9
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "cinny", "name": "cinny",
"version": "4.12.1", "version": "4.12.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cinny", "name": "cinny",
"version": "4.12.1", "version": "4.12.2",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.7.0", "@tauri-apps/api": "2.7.0",
+3 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "cinny", "name": "cinny",
"version": "4.12.1", "version": "4.12.2",
"description": "Yet another matrix client", "description": "Yet another matrix client",
"main": "index.js", "main": "index.js",
"engines": { "engines": {
@@ -8,7 +8,8 @@
}, },
"scripts": { "scripts": {
"tauri": "cp config.json cinny/ && tauri", "tauri": "cp config.json cinny/ && tauri",
"release": "node scripts/release.mjs" "release": "node scripts/release.mjs",
"bump": "node scripts/update-version.mjs"
}, },
"keywords": [], "keywords": [],
"author": "Ajay Bura", "author": "Ajay Bura",
+1 -1
View File
@@ -71,7 +71,7 @@ async function createTauriRelease() {
await Promise.allSettled(promises); await Promise.allSettled(promises);
const releaseData = { const releaseData = {
version: latestTag.name, name: latestTag.name,
notes: `https://github.com/${repoMetaData.owner}/${repoMetaData.repo}/releases/tag/${latestTag.name}`, notes: `https://github.com/${repoMetaData.owner}/${repoMetaData.repo}/releases/tag/${latestTag.name}`,
pub_date: new Date().toISOString(), pub_date: new Date().toISOString(),
platforms: {}, platforms: {},
+63
View File
@@ -0,0 +1,63 @@
import fs from "fs";
import path from "path";
import { execSync } from "child_process";
const version = process.argv[2];
if (!version) {
console.error("Missing version");
process.exit(1);
}
console.log(`Preparing release ${version}`);
// 1. Update npm versions
execSync(`npm version ${version} --no-git-tag-version`, {
stdio: "inherit"
});
console.log(`Updated package.json and package-lock.json → ${version}`);
// 2. Update Cargo.toml
const cargoToml = "src-tauri/Cargo.toml";
let cargoContent = fs.readFileSync(cargoToml, "utf8");
cargoContent = cargoContent.replace(
/^version\s*=\s*".*"/m,
`version = "${version}"`
);
fs.writeFileSync(cargoToml, cargoContent);
console.log(`Updated ${cargoToml}${version}`);
// 3. Update tauri.conf.json
const tauriConfigPath = "src-tauri/tauri.conf.json";
const tauriConfig = JSON.parse(fs.readFileSync(tauriConfigPath));
tauriConfig.version = version;
fs.writeFileSync(
tauriConfigPath,
JSON.stringify(tauriConfig, null, 2) + "\n"
);
console.log(`Updated ${tauriConfigPath}${version}`);
// 4. Update Cinny web submodule to latest tag
console.log("Updating cinny web submodule");
execSync("git submodule update --init --recursive", { stdio: "inherit" });
execSync("cd cinny && git fetch --tags", { stdio: "inherit" });
const latestTag = execSync(
"cd cinny && git describe --tags $(git rev-list --tags --max-count=1)"
)
.toString()
.trim();
console.log(`Latest cinny tag: ${latestTag}`);
execSync(`cd cinny && git checkout ${latestTag}`, { stdio: "inherit" });
execSync("git add cinny", { stdio: "inherit" });
console.log("Release preparation complete");
+16 -16
View File
@@ -2,7 +2,7 @@
[package] [package]
name = "cinny" name = "cinny"
version = "4.12.1" 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"
@@ -12,23 +12,23 @@ edition = "2021"
rust-version = "1.61" rust-version = "1.61"
[build-dependencies] [build-dependencies]
tauri-build = { version = "2.6.2", features = [] } 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.11.2", features = [ "devtools"] } tauri = { version = "2", features = [ "devtools"] }
tauri-plugin-localhost = "2.3.2" tauri-plugin-localhost = "2"
tauri-plugin-window-state = "2.4.1" tauri-plugin-window-state = "2"
tauri-plugin-clipboard-manager = "2.3.2" tauri-plugin-clipboard-manager = "2"
tauri-plugin-notification = "2.3.3" tauri-plugin-notification = "2"
tauri-plugin-fs = "2.5.1" tauri-plugin-fs = "2"
tauri-plugin-shell = "2.3.5" tauri-plugin-shell = "2"
tauri-plugin-http = "2.5.9" tauri-plugin-http = "2"
tauri-plugin-process = "2.3.1" tauri-plugin-process = "2"
tauri-plugin-os = "2.3.2" tauri-plugin-os = "2"
tauri-plugin-dialog = "2.7.1" tauri-plugin-dialog = "2"
tauri-plugin-opener = "2.5.4" tauri-plugin-opener = "2"
[features] [features]
# by default Tauri runs in production mode # by default Tauri runs in production mode
@@ -39,8 +39,8 @@ default = [ "custom-protocol" ]
custom-protocol = [ "tauri/custom-protocol" ] custom-protocol = [ "tauri/custom-protocol" ]
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-global-shortcut = "2.3.2" tauri-plugin-global-shortcut = "2"
tauri-plugin-updater = { version = "2.10.1", features = ["rustls-tls"] } tauri-plugin-updater = "2"
[lib] [lib]
name = "app_lib" name = "app_lib"
+1 -28
View File
@@ -7,8 +7,6 @@
use tauri::{webview::{NewWindowResponse, WebviewWindowBuilder}, WebviewUrl}; use tauri::{webview::{NewWindowResponse, WebviewWindowBuilder}, WebviewUrl};
use tauri_plugin_opener::OpenerExt; use tauri_plugin_opener::OpenerExt;
use tauri_plugin_updater::UpdaterExt;
use tauri_plugin_dialog::{DialogExt, MessageDialogButtons, MessageDialogKind};
pub fn run() { pub fn run() {
let port: u16 = 44548; let port: u16 = 44548;
@@ -21,36 +19,10 @@ pub fn run() {
// } // }
builder builder
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_dialog::init())
.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()) .plugin(tauri_plugin_opener::init())
.setup(move |app| { .setup(move |app| {
let handle = app.handle().clone();
tauri::async_runtime::spawn(async move {
if let Ok(Some(update)) = handle.updater().unwrap().check().await {
let version = update.version.clone();
let should_update = handle
.dialog()
.message(format!(
"Version {} is available.\n\nWould you like to update now?",
version
))
.title("Update Available")
.kind(MessageDialogKind::Info)
.buttons(MessageDialogButtons::YesNo)
.blocking_show();
if should_update {
if update.download_and_install(|_, _| {}, || {}).await.is_ok() {
handle.restart();
}
}
}
});
// Dev: use devUrl from tauri.conf.json (http://localhost:8080) to support HMR // 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());
@@ -65,6 +37,7 @@ pub fn run() {
let app_handle = app.handle().clone(); let app_handle = app.handle().clone();
WebviewWindowBuilder::new(app, "main".to_string(), window_url) WebviewWindowBuilder::new(app, "main".to_string(), window_url)
.title("Cinny") .title("Cinny")
.disable_drag_drop_handler()
.on_new_window(move |url, _features| { .on_new_window(move |url, _features| {
let _ = app_handle.opener().open_url(url.as_str(), None::<&str>); let _ = app_handle.opener().open_url(url.as_str(), None::<&str>);
NewWindowResponse::Deny NewWindowResponse::Deny
+2 -2
View File
@@ -47,7 +47,7 @@
}, },
"productName": "Cinny", "productName": "Cinny",
"mainBinaryName": "cinny", "mainBinaryName": "cinny",
"version": "4.12.1", "version": "4.12.2",
"identifier": "in.cinny.app", "identifier": "in.cinny.app",
"plugins": { "plugins": {
"updater": { "updater": {
@@ -59,7 +59,7 @@
}, },
"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:; connect-src 'self' blob: ipc: ws: wss: http: https: http://ipc.localhost"
} }
} }
} }