Compare commits

...
6 Commits
Author SHA1 Message Date
fyears e06b52d2f5 add comments
Release A New Version / build (16.x) (push) Failing after 45s
2022-04-03 15:31:48 +08:00
fyears 89f2ac035c bump to 0.3.16 2022-04-03 15:30:35 +08:00
fyears bd3e4e91e6 use ci to release 2022-04-03 15:27:51 +08:00
fyears e03522efe4 unified requrl everywhere 2022-04-03 15:05:55 +08:00
fyears 39a33243e8 fix typo 2022-04-03 14:53:39 +08:00
fyears 79d00f28cc update download stats 2022-04-03 13:16:23 +08:00
10 changed files with 110 additions and 37 deletions
+88
View File
@@ -0,0 +1,88 @@
# modified from https://github.com/argenos/nldates-obsidian/blob/master/.github/workflows/release.yml
# which is released under MIT License
# trigger:
# modify manifest.json, package.json, versions.json
# git tag <version number>
# git push origin --tags
name: Release A New Version
on:
push:
tags:
- "*" # Push events to matching any tag format, i.e. 1.0, 20.15.10
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
environment: env-for-buildci
env:
DROPBOX_APP_KEY: ${{secrets.DROPBOX_APP_KEY}}
ONEDRIVE_CLIENT_ID: ${{secrets.ONEDRIVE_CLIENT_ID}}
ONEDRIVE_AUTHORITY: ${{secrets.ONEDRIVE_AUTHORITY}}
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout codes
uses: actions/checkout@v2
with:
lfs: true
submodules: recursive
- name: Checkout LFS
run: git lfs checkout
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- run: npm run build
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: true
- name: Upload main.js
id: upload-main
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./main.js
asset_name: main.js
asset_content_type: text/javascript
- name: Upload manifest.json
id: upload-manifest
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./manifest.json
asset_name: manifest.json
asset_content_type: application/json
- name: Upload styles.css
id: upload-styles
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./styles.css
asset_name: styles.css
asset_content_type: text/css
+1 -3
View File
@@ -4,9 +4,7 @@ This is yet another unofficial sync plugin for Obsidian. If you like it or find
[![BuildCI](https://github.com/fyears/remotely-save/actions/workflows/auto-build.yml/badge.svg)](https://github.com/fyears/remotely-save/actions/workflows/auto-build.yml) [![BuildCI](https://github.com/fyears/remotely-save/actions/workflows/auto-build.yml/badge.svg)](https://github.com/fyears/remotely-save/actions/workflows/auto-build.yml)
[![total downloads auto count](https://remotely-save.github.io/auto-download-stats/totalDownloads.svg)](https://github.com/fyears/remotely-save/releases) [![downloads of latest version](https://img.shields.io/github/downloads-pre/remotely-save/remotely-save/latest/main.js?sort=semver)](https://github.com/fyears/remotely-save/releases)
[![downloads of latest version](https://remotely-save.github.io/auto-download-stats/latestVersionDownloads.svg)](https://github.com/fyears/remotely-save/releases)
## Disclaimer ## Disclaimer
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "remotely-save", "id": "remotely-save",
"name": "Remotely Save", "name": "Remotely Save",
"version": "0.3.15", "version": "0.3.16",
"minAppVersion": "0.13.21", "minAppVersion": "0.13.21",
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.", "description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
"author": "fyears", "author": "fyears",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "remotely-save", "name": "remotely-save",
"version": "0.3.15", "version": "0.3.16",
"description": "This is yet another sync plugin for Obsidian app.", "description": "This is yet another sync plugin for Obsidian app.",
"scripts": { "scripts": {
"dev2": "node esbuild.config.mjs", "dev2": "node esbuild.config.mjs",
+3
View File
@@ -3,6 +3,7 @@
* To avoid circular dependency. * To avoid circular dependency.
*/ */
import { Platform, requireApiVersion } from "obsidian";
import type { LangType, LangTypeAndAuto } from "./i18n"; import type { LangType, LangTypeAndAuto } from "./i18n";
export const DEFAULT_CONTENT_TYPE = "application/octet-stream"; export const DEFAULT_CONTENT_TYPE = "application/octet-stream";
@@ -148,3 +149,5 @@ export interface FileOrFolderMixedState {
export const API_VER_STAT_FOLDER = "0.13.27"; export const API_VER_STAT_FOLDER = "0.13.27";
export const API_VER_REQURL = "0.13.26"; export const API_VER_REQURL = "0.13.26";
export const VALID_REQURL =
requireApiVersion(API_VER_REQURL) && !Platform.isAndroidApp;
+3 -9
View File
@@ -22,19 +22,13 @@ import { buildQueryString } from "@aws-sdk/querystring-builder";
import { HeaderBag, HttpHandlerOptions, Provider } from "@aws-sdk/types"; import { HeaderBag, HttpHandlerOptions, Provider } from "@aws-sdk/types";
import { Buffer } from "buffer"; import { Buffer } from "buffer";
import * as mime from "mime-types"; import * as mime from "mime-types";
import { import { Vault, requestUrl, RequestUrlParam } from "obsidian";
Vault,
requestUrl,
RequestUrlParam,
RequestUrlResponse,
requireApiVersion,
} from "obsidian";
import { Readable } from "stream"; import { Readable } from "stream";
import { import {
API_VER_REQURL,
DEFAULT_CONTENT_TYPE, DEFAULT_CONTENT_TYPE,
RemoteItem, RemoteItem,
S3Config, S3Config,
VALID_REQURL,
} from "./baseTypes"; } from "./baseTypes";
import { decryptArrayBuffer, encryptArrayBuffer } from "./encrypt"; import { decryptArrayBuffer, encryptArrayBuffer } from "./encrypt";
import { import {
@@ -194,7 +188,7 @@ export const getS3Client = (s3Config: S3Config) => {
endpoint = `https://${endpoint}`; endpoint = `https://${endpoint}`;
} }
if (requireApiVersion(API_VER_REQURL) && s3Config.bypassCorsLocally) { if (VALID_REQURL && s3Config.bypassCorsLocally) {
const s3Client = new S3Client({ const s3Client = new S3Client({
region: s3Config.s3Region, region: s3Config.s3Region,
endpoint: endpoint, endpoint: endpoint,
+3 -11
View File
@@ -1,19 +1,11 @@
import { Buffer } from "buffer"; import { Buffer } from "buffer";
import { import { Vault, requestUrl } from "obsidian";
Vault,
request,
requestUrl,
requireApiVersion,
Platform,
Notice,
RequestUrlResponse,
} from "obsidian";
import { Queue } from "@fyears/tsqueue"; import { Queue } from "@fyears/tsqueue";
import chunk from "lodash/chunk"; import chunk from "lodash/chunk";
import flatten from "lodash/flatten"; import flatten from "lodash/flatten";
import { getReasonPhrase } from "http-status-codes"; import { getReasonPhrase } from "http-status-codes";
import { API_VER_REQURL, RemoteItem, WebdavConfig } from "./baseTypes"; import { RemoteItem, VALID_REQURL, WebdavConfig } from "./baseTypes";
import { decryptArrayBuffer, encryptArrayBuffer } from "./encrypt"; import { decryptArrayBuffer, encryptArrayBuffer } from "./encrypt";
import { bufferToArrayBuffer, getPathFolder, mkdirpInVault } from "./misc"; import { bufferToArrayBuffer, getPathFolder, mkdirpInVault } from "./misc";
@@ -28,7 +20,7 @@ import type {
ResponseDataDetailed, ResponseDataDetailed,
} from "webdav/web"; } from "webdav/web";
import { getPatcher } from "webdav/web"; import { getPatcher } from "webdav/web";
if (requireApiVersion(API_VER_REQURL) && !Platform.isAndroidApp) { if (VALID_REQURL) {
getPatcher().patch( getPatcher().patch(
"request", "request",
async ( async (
+8 -10
View File
@@ -11,6 +11,7 @@ import {
API_VER_REQURL, API_VER_REQURL,
SUPPORTED_SERVICES_TYPE, SUPPORTED_SERVICES_TYPE,
SUPPORTED_SERVICES_TYPE_WITH_REMOTE_BASE_DIR, SUPPORTED_SERVICES_TYPE_WITH_REMOTE_BASE_DIR,
VALID_REQURL,
WebdavAuthType, WebdavAuthType,
WebdavDepthType, WebdavDepthType,
} from "./baseTypes"; } from "./baseTypes";
@@ -747,7 +748,7 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
}); });
} }
if (!requireApiVersion(API_VER_REQURL)) { if (!VALID_REQURL) {
s3Div.createEl("p", { s3Div.createEl("p", {
text: t("settings_s3_cors"), text: t("settings_s3_cors"),
}); });
@@ -769,7 +770,7 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
text: t("settings_s3_prod2"), text: t("settings_s3_prod2"),
}); });
if (!requireApiVersion(API_VER_REQURL)) { if (!VALID_REQURL) {
s3LinksUl.createEl("li").createEl("a", { s3LinksUl.createEl("li").createEl("a", {
href: "https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html", href: "https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html",
text: t("settings_s3_prod3"), text: t("settings_s3_prod3"),
@@ -862,7 +863,7 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
}); });
}); });
if (requireApiVersion(API_VER_REQURL)) { if (VALID_REQURL) {
new Setting(s3Div) new Setting(s3Div)
.setName(t("settings_s3_bypasscorslocally")) .setName(t("settings_s3_bypasscorslocally"))
.setDesc( .setDesc(
@@ -1277,9 +1278,6 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
this.plugin.settings.serviceType !== "webdav" this.plugin.settings.serviceType !== "webdav"
); );
const webdavReq =
requireApiVersion(API_VER_REQURL) && !Platform.isAndroidApp;
webdavDiv.createEl("h2", { text: t("settings_webdav") }); webdavDiv.createEl("h2", { text: t("settings_webdav") });
webdavDiv.createEl("p", { webdavDiv.createEl("p", {
@@ -1287,7 +1285,7 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
cls: "webdav-disclaimer", cls: "webdav-disclaimer",
}); });
if (!webdavReq) { if (!VALID_REQURL) {
if (Platform.isAndroidApp) { if (Platform.isAndroidApp) {
webdavDiv.createEl("p", { webdavDiv.createEl("p", {
text: t("settings_webdav_cors_android"), text: t("settings_webdav_cors_android"),
@@ -1372,12 +1370,12 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
.setDesc(t("settings_webdav_auth_desc")) .setDesc(t("settings_webdav_auth_desc"))
.addDropdown(async (dropdown) => { .addDropdown(async (dropdown) => {
dropdown.addOption("basic", "basic"); dropdown.addOption("basic", "basic");
if (webdavReq) { if (VALID_REQURL) {
dropdown.addOption("digest", "digest"); dropdown.addOption("digest", "digest");
} }
// new version config, copied to old version, we need to reset it // new version config, copied to old version, we need to reset it
if (!webdavReq && this.plugin.settings.webdav.authType !== "basic") { if (!VALID_REQURL && this.plugin.settings.webdav.authType !== "basic") {
this.plugin.settings.webdav.authType = "basic"; this.plugin.settings.webdav.authType = "basic";
await this.plugin.saveSettings(); await this.plugin.saveSettings();
} }
@@ -1475,7 +1473,7 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
if (res) { if (res) {
new Notice(t("settings_webdav_connect_succ")); new Notice(t("settings_webdav_connect_succ"));
} else { } else {
if (webdavReq) { if (VALID_REQURL) {
new Notice(t("settings_webdav_connect_fail")); new Notice(t("settings_webdav_connect_fail"));
} else { } else {
new Notice(t("settings_webdav_connect_fail_withcors")); new Notice(t("settings_webdav_connect_fail_withcors"));
+1 -1
View File
@@ -1,4 +1,4 @@
{ {
"0.3.2": "0.12.15", "0.3.2": "0.12.15",
"0.3.15": "0.13.21" "0.3.16": "0.13.21"
} }