diff --git a/nuxt.config.ts b/nuxt.config.ts index 1587788..0f711f6 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -22,11 +22,11 @@ export default defineNuxtConfig({ provider: 'server', mode: "svg", clientBundle: { - icons: ["solar:global-outline", "gg:extension"], + icons: ["solar:global-outline", "gg:extension", "hugeicons:corporate"], scan: true, includeCustomCollections: true, }, - serverBundle: { collections: ["mdi", "line-md", "solar", "gg"] } + serverBundle: { collections: ["mdi", "line-md", "solar", "gg", "emojione"] } //collections: ["mdi", "line-md"] }, diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index d8d46f4..ea33923 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -25,6 +25,7 @@ "opener:allow-open-url", "opener:default", "os:default", + "os:allow-hostname", "store:default" ] } diff --git a/src-tauri/database/migrations/0002_married_bushwacker.sql b/src-tauri/database/migrations/0002_married_bushwacker.sql new file mode 100644 index 0000000..4fa851e --- /dev/null +++ b/src-tauri/database/migrations/0002_married_bushwacker.sql @@ -0,0 +1,4 @@ +ALTER TABLE `haex_settings` RENAME COLUMN "value_text" TO "value";--> statement-breakpoint +DROP TABLE `testTable`;--> statement-breakpoint +ALTER TABLE `haex_settings` DROP COLUMN `value_json`;--> statement-breakpoint +ALTER TABLE `haex_settings` DROP COLUMN `value_number`; \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/0002_snapshot.json b/src-tauri/database/migrations/meta/0002_snapshot.json new file mode 100644 index 0000000..e8dc4a8 --- /dev/null +++ b/src-tauri/database/migrations/meta/0002_snapshot.json @@ -0,0 +1,180 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "ea3507ca-77bc-4f3c-a605-8426614f5803", + "prevId": "6fb5396b-9f87-4fb5-87a2-22d4eecaa11e", + "tables": { + "haex_extensions": { + "name": "haex_extensions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "author": { + "name": "author", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enabled": { + "name": "enabled", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version": { + "name": "version", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "haex_extensions_permissions": { + "name": "haex_extensions_permissions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "extension_id": { + "name": "extension_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "resource": { + "name": "resource", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "operation": { + "name": "operation", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "haex_extensions_permissions_extension_id_resource_operation_path_unique": { + "name": "haex_extensions_permissions_extension_id_resource_operation_path_unique", + "columns": [ + "extension_id", + "resource", + "operation", + "path" + ], + "isUnique": true + } + }, + "foreignKeys": { + "haex_extensions_permissions_extension_id_haex_extensions_id_fk": { + "name": "haex_extensions_permissions_extension_id_haex_extensions_id_fk", + "tableFrom": "haex_extensions_permissions", + "tableTo": "haex_extensions", + "columnsFrom": [ + "extension_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "haex_settings": { + "name": "haex_settings", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": { + "\"haex_settings\".\"value_text\"": "\"haex_settings\".\"value\"" + } + }, + "internal": { + "indexes": {} + } +} \ No newline at end of file diff --git a/src-tauri/database/migrations/meta/_journal.json b/src-tauri/database/migrations/meta/_journal.json index 734f0be..6e34ff1 100644 --- a/src-tauri/database/migrations/meta/_journal.json +++ b/src-tauri/database/migrations/meta/_journal.json @@ -15,6 +15,13 @@ "when": 1746281577722, "tag": "0001_wealthy_thaddeus_ross", "breakpoints": true + }, + { + "idx": 2, + "version": "6", + "when": 1747583956679, + "tag": "0002_married_bushwacker", + "breakpoints": true } ] } \ No newline at end of file diff --git a/src-tauri/database/schemas/vault.ts b/src-tauri/database/schemas/vault.ts index 55cbc55..5ed2639 100644 --- a/src-tauri/database/schemas/vault.ts +++ b/src-tauri/database/schemas/vault.ts @@ -1,18 +1,15 @@ import { integer, - numeric, sqliteTable, text, - type AnySQLiteColumn, unique, + type AnySQLiteColumn } from "drizzle-orm/sqlite-core"; export const haexSettings = sqliteTable("haex_settings", { id: text().primaryKey(), key: text(), - value_text: text(), - value_json: text({ mode: "json" }), - value_number: numeric(), + value: text(), }); export const haexExtensions = sqliteTable("haex_extensions", { @@ -25,18 +22,13 @@ export const haexExtensions = sqliteTable("haex_extensions", { version: text(), }); -export const testTable = sqliteTable("testTable", { - id: text().primaryKey(), - author: text(), - test: text(), -}); export const haexExtensionsPermissions = sqliteTable( "haex_extensions_permissions", { id: text().primaryKey(), extensionId: text("extension_id").references((): AnySQLiteColumn => haexExtensions.id), - resource: text({ enum: ["fs", "http", "database"] }), + resource: text({ enum: ["fs", "http", "db", "shell"] }), operation: text({ enum: ["read", "write", "create"] }), path: text(), }, diff --git a/src-tauri/database/vault.db b/src-tauri/database/vault.db index e9ea789..7dfe673 100644 Binary files a/src-tauri/database/vault.db and b/src-tauri/database/vault.db differ diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 18680e7..fd66225 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -41,7 +41,6 @@ pub fn run() { }) } } - //extension::core::extension_protocol_handler(&context, &request) }) .plugin(tauri_plugin_http::init()) .manage(DbConnection(Mutex::new(None))) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6356f8d..1307807 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -19,7 +19,7 @@ ], "security": { "csp": { - "default-src": ["'self'", "haex-extension: data: blob: asset:"], + "default-src": "'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost; default-src 'self' asset: http://asset.localhost", "script-src": ["'self'", "haex-extension:"], "style-src": ["'self'", "haex-extension:"], "connect-src": ["'self'", "haex-extension:"], @@ -29,7 +29,7 @@ }, "assetProtocol": { "enable": true, - "scope": ["$RESOURCE/extensions/**"] + "scope": ["$RESOURCE/**", "$APPDATA/**"] } } }, diff --git a/src/app.vue b/src/app.vue index fd21238..2bbc3ba 100644 --- a/src/app.vue +++ b/src/app.vue @@ -1,6 +1,6 @@