diff --git a/README.md b/README.md index 685e88b..9de4e68 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ Click the compass button on the left-hand sidebar to open the vault explorer vie Premium features are available to users who purchase a [Vault Explorer license](https://vaultexplorer.com/docs/premium/). +Please do not share your license key with anyone. Shared license keys will be deactivated. + ## Features | Name | Categories | Documented | @@ -159,11 +161,11 @@ Premium features are available to users who purchase a [Vault Explorer license]( ## Network use -For general usage of the plugin, Vault Explorer does not make any network requests. +Vault Explorer is a privacy friendly plugin. -If you purchase a Vault Explorer license, the plugin will communicate with the Vault Explorer API. These requests will only send the license key you enter and a device ID generated by the plugin. +When you access the grid view, Vault Explorer will make requests to the URL's that you specify to display cover images. You may disable this behavior in the settings. -When you access the grid view and have configured an image URL property in the settings, Vault Explorer will request the specified URLs to display cover images on corresponding grid cards. +Besides cover image fetching, Vault Explorer does not make any network requests. Vault Explorer does not include any client-side telemetry. diff --git a/bun.lockb b/bun.lockb index 5306e1c..939b3df 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/manifest.json b/manifest.json index e865b1d..d0a4b1b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "vault-explorer", "name": "Vault Explorer", - "version": "1.35.1", + "version": "1.36.0", "minAppVersion": "1.4.13", "description": "Explore your vault in visual format", "author": "DecafDev", diff --git a/package.json b/package.json index 70ec932..a539c49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-vault-explorer", - "version": "1.35.1", + "version": "1.36.0", "description": "Explore your vault in visual format", "main": "main.js", "scripts": { @@ -36,6 +36,7 @@ "typescript": "4.7.4" }, "dependencies": { + "crypto": "^1.0.1", "idb": "^8.0.0", "js-logger": "^1.6.1", "lodash": "^4.17.21", diff --git a/src/event/types.ts b/src/event/types.ts index aae0f4b..6c9a48d 100644 --- a/src/event/types.ts +++ b/src/event/types.ts @@ -13,7 +13,7 @@ export enum PluginEvent { FEED_CONTENT_SETTING_CHANGE = "feed-content-setting-change", COVER_IMAGE_SOURCE_SETTING_CHANGE = "cover-image-source-setting-change", PROPERTY_SETTING_CHANGE = "property-setting-change", - DEVICE_REGISTRATION_CHANGE = "device-registration-change", + LICENSE_KEY_VALIDATION_CHANGE = "license-key-validation-change", CLOCK_UPDATES_SETTING_CHANGE = "clock-updates-setting-change", FILTER_TOGGLE_SETTING_CHANGE = "filter-toggle-setting-change", SCROLL_BUTTONS_SETTING_CHANGE = "scroll-buttons-setting-change", diff --git a/src/main.ts b/src/main.ts index c956edd..49b157d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,9 +15,9 @@ import { preformMigrations } from "./migrations"; import Logger from "js-logger"; import { formatMessageForLogger, stringToLogLevel } from "./logger"; import { moveFocus } from "./focus-utils"; -import { loadDeviceId } from "./svelte/shared/services/device-id-utils"; -import License from "./svelte/shared/services/license"; import { PluginEvent } from "./event/types"; +import { isVersionLessThan } from "./utils"; +import License from "./svelte/shared/services/license"; export default class VaultExplorerPlugin extends Plugin { settings: VaultExplorerPluginSettings = DEFAULT_SETTINGS; @@ -27,6 +27,8 @@ export default class VaultExplorerPlugin extends Plugin { await this.loadSettings(); this.setupLogger(); + await License.getInstance().loadStoredKey(); + this.registerView( VAULT_EXPLORER_VIEW, (leaf) => new VaultExplorerView(leaf, this) @@ -54,9 +56,6 @@ export default class VaultExplorerPlugin extends Plugin { this.app.workspace.onLayoutReady(() => { this.layoutReady = true; }); - - await loadDeviceId(); - await License.getInstance().verifyLicense(); } private registerEvents() { @@ -174,6 +173,21 @@ export default class VaultExplorerPlugin extends Plugin { if (loadedVersion !== null) { const newData = preformMigrations(loadedVersion, loadedData); currentData = newData; + if (isVersionLessThan(loadedVersion, "1.36.0")) { + console.log("Cleaning up old data"); + const LOCAL_STORAGE_DEVICE_REGISTERED = + "vault-explorer-device-registration"; + localStorage.removeItem(LOCAL_STORAGE_DEVICE_REGISTERED); + + //Clean up the old device id from the versioning system + const LOCAL_STORAGE_ID = "vault-explorer-id"; + localStorage.removeItem(LOCAL_STORAGE_ID); + + //Clean up the old device id from the versioning system + const LOCAL_STORAGE_LICENSE_KEY = + "vault-explorer-license-key"; + localStorage.removeItem(LOCAL_STORAGE_LICENSE_KEY); + } } } diff --git a/src/svelte/app/components/feed-view.svelte b/src/svelte/app/components/feed-view.svelte index a6bb75b..7c01b14 100644 --- a/src/svelte/app/components/feed-view.svelte +++ b/src/svelte/app/components/feed-view.svelte @@ -5,7 +5,7 @@ import License from "src/svelte/shared/services/license"; import FeedCard from "./feed-card.svelte"; - export let isDeviceRegistered = false; + export let hasValidLicenseKey = false; export let data: FileRenderData[] = []; export let startIndex; export let pageLength; @@ -13,9 +13,9 @@ let filteredItems: FileRenderData[] = []; License.getInstance() - .getIsDeviceRegisteredStore() - .subscribe((isRegistered) => { - isDeviceRegistered = isRegistered; + .getHasValidKeyStore() + .subscribe((hasValidKey) => { + hasValidLicenseKey = hasValidKey; }); $: { @@ -31,13 +31,13 @@
- {#if !isDeviceRegistered} + {#if !hasValidLicenseKey}
{/if} - {#if isDeviceRegistered} + {#if hasValidLicenseKey} {#each filteredItems as fileRenderData (fileRenderData.id)} { - isDeviceRegistered = isRegistered; + .getHasValidKeyStore() + .subscribe((hasValidKey) => { + hasValidLicenseKey = hasValidKey; }); function handleValueChange(e: Event) { @@ -54,7 +54,7 @@ {#if condition !== ContentFilterCondition.IS_EMPTY && condition !== ContentFilterCondition.IS_NOT_EMPTY} - {#if type === FilterRuleType.CONTENT && !isDeviceRegistered} + {#if type === FilterRuleType.CONTENT && !hasValidLicenseKey}
diff --git a/src/svelte/custom-filter-app/components/filter-rule.svelte b/src/svelte/custom-filter-app/components/filter-rule.svelte index 832613f..74b3041 100644 --- a/src/svelte/custom-filter-app/components/filter-rule.svelte +++ b/src/svelte/custom-filter-app/components/filter-rule.svelte @@ -33,14 +33,14 @@ export let condition: FilterCondition; export let isEnabled: boolean; - let isDeviceRegistered = false; + let hasValidLicenseKey = false; const dispatch = createEventDispatcher(); License.getInstance() - .getIsDeviceRegisteredStore() - .subscribe((isRegistered) => { - isDeviceRegistered = isRegistered; + .getHasValidKeyStore() + .subscribe((hasValidKey) => { + hasValidLicenseKey = hasValidKey; }); function handleActionsClick(e: CustomEvent) { @@ -142,7 +142,7 @@