Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
e55548b105 | |||
cea3f7e33c |
.gitea/workflows
DoxyfileGNUmakefileapps
core
default.nixdeps
c-ares_config
codemirror
codemirror_src
sqlite
metadata/en-US/changelogs
src
@ -10,6 +10,6 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- run: sudo apt update && sudo apt install -y doxygen graphviz mingw-w64
|
||||
- run: sudo apt update && sudo apt install -y doxygen mingw-w64
|
||||
- run: make all -j`nproc` docs
|
||||
- run: docker build .
|
||||
|
32
GNUmakefile
32
GNUmakefile
@ -4,10 +4,11 @@ MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
VERSION_CODE := 26
|
||||
VERSION_NUMBER := 0.0.22
|
||||
VERSION_NAME := Get born soon.
|
||||
VERSION_NUMBER := 0.0.22-wip
|
||||
VERSION_NAME := Look for the helpers.
|
||||
|
||||
SQLITE_URL := https://www.sqlite.org/2024/sqlite-amalgamation-3460100.zip
|
||||
SQLITE_URL := https://www.sqlite.org/2024/sqlite-amalgamation-3460000.zip
|
||||
LIBUV_URL := https://dist.libuv.org/dist/v1.48.0/libuv-v1.48.0.tar.gz
|
||||
BUNDLETOOL_URL := https://github.com/google/bundletool/releases/download/1.17.0/bundletool-all-1.17.0.jar
|
||||
|
||||
PROJECT = tildefriends
|
||||
@ -54,16 +55,16 @@ CFLAGS += \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-unknown-warning-option \
|
||||
-MMD \
|
||||
-MP \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-fno-exceptions \
|
||||
-g
|
||||
-g \
|
||||
-flto
|
||||
LDFLAGS += \
|
||||
-Wno-attributes \
|
||||
-flto=auto
|
||||
-flto=auto \
|
||||
-Wno-attributes
|
||||
|
||||
ANDROID_MIN_SDK_VERSION := 24
|
||||
ANDROID_TARGET_SDK_VERSION := 34
|
||||
@ -159,7 +160,6 @@ NONANDROID_RELEASE_TARGETS := $(filter-out $(ANDROID_ARM64_TARGETS),$(RELEASE_TA
|
||||
NONANDROID_TARGETS := $(filter-out $(ANDROID_TARGETS),$(ALL_TARGETS))
|
||||
NONMACOS_TARGETS := $(filter-out $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS),$(ALL_TARGETS))
|
||||
DEADSTRIP_TARGETS := $(filter-out $(ANDROID_TARGETS),$(NONMACOS_TARGETS))
|
||||
$(NONMACOS_TARGETS): LDFLAGS += -static-libgcc
|
||||
|
||||
$(NONANDROID_TARGETS): CFLAGS += -fno-omit-frame-pointer
|
||||
$(filter-out $(WINDOWS_TARGETS),$(ALL_TARGETS)): LDFLAGS += -rdynamic
|
||||
@ -169,13 +169,10 @@ $(ANDROID_TARGETS): CFLAGS += \
|
||||
-fdebug-compilation-dir . \
|
||||
-fomit-frame-pointer \
|
||||
-fno-asynchronous-unwind-tables \
|
||||
-funwind-tables \
|
||||
-Wno-unknown-warning-option
|
||||
-funwind-tables
|
||||
$(ANDROID_TARGETS): LDFLAGS += --sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC
|
||||
$(DEBUG_TARGETS): CFLAGS += -DDEBUG -Og
|
||||
$(RELEASE_TARGETS): CFLAGS += \
|
||||
-DNDEBUG \
|
||||
-flto
|
||||
$(RELEASE_TARGETS): CFLAGS += -DNDEBUG
|
||||
$(NONANDROID_RELEASE_TARGETS): CFLAGS += -O3
|
||||
$(ANDROID_RELEASE_TARGETS): CFLAGS += -Oz
|
||||
$(WINDOWS_TARGETS): CC = x86_64-w64-mingw32-gcc-win32
|
||||
@ -501,8 +498,6 @@ $(UV_OBJS): CFLAGS += \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-unused-result \
|
||||
-Wno-unused-variable
|
||||
$(UV_OBJS): CFLAGS += -fno-lto
|
||||
$(filter out/win%,$(UV_OBJS)): CFLAGS += -Wno-cast-function-type
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
$(UV_OBJS): CFLAGS += \
|
||||
-D_GNU_SOURCE
|
||||
@ -578,7 +573,6 @@ ifneq ($(UNAME_S),OpenBSD)
|
||||
$(filter-out $(BUILD_DIR)/win%,$(SODIUM_OBJS)): CFLAGS += \
|
||||
-DHAVE_ALLOCA_H
|
||||
endif
|
||||
$(SODIUM_OBJS): CFLAGS := $(filter-out -flto,$(CFLAGS))
|
||||
|
||||
SQLITE_SOURCES := deps/sqlite/sqlite3.c
|
||||
SQLITE_OBJS := $(call get_objs,SQLITE_SOURCES)
|
||||
@ -1036,6 +1030,10 @@ apklog:
|
||||
.PHONY: apklog
|
||||
|
||||
fetchdeps:
|
||||
@echo "[fetch] libuv"
|
||||
@test -f out/deps/libuv.tar.gz && test "$$(cat out/deps/libuv.txt 2>/dev/null)" = $(LIBUV_URL) || (mkdir -p out/deps/ && curl -q $(LIBUV_URL) -o out/deps/libuv.tar.gz)
|
||||
@test -d deps/libuv/ && test "$$(cat out/deps/libuv.txt 2>/dev/null)" = $(LIBUV_URL) || (rm -rf deps/libuv/ && mkdir -p deps/libuv/ && tar -C deps/libuv/ -m --strip=1 -xf out/deps/libuv.tar.gz)
|
||||
@echo -n $(LIBUV_URL) > out/deps/libuv.txt
|
||||
@echo "[fetch] sqlite"
|
||||
@test -f out/deps/sqlite.zip && test "$$(cat out/deps/sqlite.txt 2>/dev/null)" = $(SQLITE_URL) || (mkdir -p out/deps/ && curl -q $(SQLITE_URL) -o out/deps/sqlite.zip)
|
||||
@test -d deps/sqlite/ && test "$$(cat out/deps/sqlite.txt 2>/dev/null)" = $(SQLITE_URL) || (mkdir -p deps/sqlite/ && unzip -qDjo -d deps/sqlite/ out/deps/sqlite.zip)
|
||||
@ -1125,4 +1123,4 @@ docs:
|
||||
.PHONY: docs
|
||||
|
||||
fdroid: out/apk/TildeFriends-release.fdroid.unsigned.apk
|
||||
.PHONY: fdroid
|
||||
.PHONE: fdroid
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🎛",
|
||||
"previous": "&R49FywYF8CXPhoSEydLbSCgvCddeyTiBwGuDU/gqY+M=.sha256"
|
||||
"previous": "&vrpS/vE7n588iYv1p8HafDxHB+YDHTrtUbJiu9nGA9I=.sha256"
|
||||
}
|
||||
|
@ -27,27 +27,23 @@ function global_settings_set(key, value) {
|
||||
});
|
||||
}
|
||||
|
||||
function title_case(name) {
|
||||
return name.split('_').map(x => x.charAt(0).toUpperCase() + x.substring(1)).join(' ');
|
||||
}
|
||||
|
||||
window.addEventListener('load', function () {
|
||||
const permission_template = (permission) => html` <code>${permission}</code>`;
|
||||
function input_template(key, description) {
|
||||
if (description.type === 'boolean') {
|
||||
return html`
|
||||
<li class="w3-row">
|
||||
<label class="w3-quarter" for=${'gs_' + key} style="font-weight: bold">${title_case(key)}</label>
|
||||
<label class="w3-quarter" for=${'gs_' + key} style="font-weight: bold">${key}</label>
|
||||
<div class="w3-quarter w3-padding">${description.description}</div>
|
||||
<div class="w3-quarter w3-padding w3-center"><input class="w3-check" type="checkbox" ?checked=${description.value} id=${'gs_' + key}></input></div>
|
||||
<button class="w3-quarter w3-button w3-theme-action" @click=${(e) => global_settings_set(key, e.srcElement.previousElementSibling.firstChild.checked)}>Set</button>
|
||||
<input class="w3-quarter w3-check" type="checkbox" ?checked=${description.value} id=${'gs_' + key}></input>
|
||||
<button class="w3-quarter w3-button w3-theme-action" @click=${(e) => global_settings_set(key, e.srcElement.previousElementSibling.checked)}>Set</button>
|
||||
</li>
|
||||
`;
|
||||
} else if (description.type === 'textarea') {
|
||||
return html`
|
||||
<li class="w3-row">
|
||||
<label class="w3-quarter" for=${'gs_' + key} style="font-weight: bold"
|
||||
>${title_case(key)}</label
|
||||
>${key}</label
|
||||
>
|
||||
<div class="w3-rest w3-padding">${description.description}</div>
|
||||
<textarea
|
||||
@ -72,7 +68,7 @@ ${description.value}</textarea
|
||||
} else {
|
||||
return html`
|
||||
<li class="w3-row">
|
||||
<label class="w3-quarter" for=${'gs_' + key} style="font-weight: bold">${title_case(key)}</label>
|
||||
<label class="w3-quarter" for=${'gs_' + key} style="font-weight: bold">${key}</label>
|
||||
<div class="w3-quarter w3-padding">${description.description}</div>
|
||||
<input class="w3-input w3-quarter" type="text" value="${description.value}" id=${'gs_' + key}></input>
|
||||
<button class="w3-button w3-quarter w3-theme-action" @click=${(e) => global_settings_set(key, e.srcElement.previousElementSibling.value)}>Set</button>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🐌",
|
||||
"previous": "&xsmsLytB3VvoHphiFHZGGEvrCfTEVGXrGwobGTIYFPQ=.sha256"
|
||||
"previous": "&2xK//SIpjFb0+uT5I7MSAGJ3d1FKuI/rlzhcCQd3NME=.sha256"
|
||||
}
|
||||
|
@ -188,10 +188,6 @@ class TfProfileElement extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
copy_id() {
|
||||
navigator.clipboard.writeText(this.id);
|
||||
}
|
||||
|
||||
render() {
|
||||
if (
|
||||
this.id == this.whoami &&
|
||||
@ -291,14 +287,6 @@ class TfProfileElement extends LitElement {
|
||||
let description = this.editing?.description ?? profile.description;
|
||||
return html`<div style="border: 2px solid black; background-color: rgba(255, 255, 255, 0.2); padding: 16px">
|
||||
<tf-user id=${this.id} .users=${this.users}></tf-user> (${tfutils.human_readable_size(this.size)})
|
||||
<div class="w3-row">
|
||||
<div class="w3-col s1 w3-container w3-right">
|
||||
<button class="w3-button w3-theme-d1 w3-ripple" @click=${this.copy_id}>Copy</button>
|
||||
</div>
|
||||
<div class="w3-rest w3-container">
|
||||
<input type="text" class="w3-theme-d1" style="width: 100%; vertical-align: middle" readonly value=${this.id}></input>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row; gap: 1em">
|
||||
${edit_profile}
|
||||
<div style="flex: 1 0 50%">
|
||||
|
@ -17,12 +17,6 @@ class TfTabConnectionsElement extends LitElement {
|
||||
|
||||
static styles = styles;
|
||||
|
||||
static k_broadcast_emojis = {
|
||||
discovery: '🏓',
|
||||
room: '🚪',
|
||||
peer_exchange: '🕸',
|
||||
};
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
let self = this;
|
||||
@ -98,7 +92,6 @@ class TfTabConnectionsElement extends LitElement {
|
||||
Connect
|
||||
</button>
|
||||
<div class="w3-bar-item">
|
||||
${TfTabConnectionsElement.k_broadcast_emojis[connection.origin]}
|
||||
<tf-user id=${connection.pubkey} .users=${this.users}></tf-user>
|
||||
${this.render_connection_summary(connection)}
|
||||
</div>
|
||||
|
23
core/core.js
23
core/core.js
@ -23,18 +23,13 @@ const k_global_settings = {
|
||||
room: {
|
||||
type: 'boolean',
|
||||
default_value: true,
|
||||
description: 'Enable peers to tunnel through this instance as a room.',
|
||||
description: 'Whether this instance should behave as a room.',
|
||||
},
|
||||
room_name: {
|
||||
type: 'string',
|
||||
default_value: 'tilde friends tunnel',
|
||||
description: 'Name of the room.',
|
||||
},
|
||||
replicator: {
|
||||
type: 'boolean',
|
||||
default_value: true,
|
||||
description: 'Enable message and blob replication.',
|
||||
},
|
||||
code_of_conduct: {
|
||||
type: 'textarea',
|
||||
default_value: undefined,
|
||||
@ -71,19 +66,9 @@ const k_global_settings = {
|
||||
},
|
||||
seeds_host: {
|
||||
type: 'string',
|
||||
default_value: 'seeds.tildefriends.net',
|
||||
default_value: '',
|
||||
description: 'Hostname for seed connections.',
|
||||
},
|
||||
peer_exchange: {
|
||||
type: 'boolean',
|
||||
default_value: false,
|
||||
description: 'Enable discovery of, sharing of, and connecting to internet peer strangers, including announcing this instance.',
|
||||
},
|
||||
account_registration: {
|
||||
type: 'boolean',
|
||||
default_value: true,
|
||||
description: 'Allow registration of new accounts.',
|
||||
},
|
||||
};
|
||||
|
||||
let gGlobalSettings = {
|
||||
@ -520,9 +505,8 @@ async function getProcessBlob(blobId, key, options) {
|
||||
imports.core.globalSettingsGet = function (key) {
|
||||
return gGlobalSettings[key];
|
||||
};
|
||||
imports.core.globalSettingsSet = async function (key, value) {
|
||||
imports.core.globalSettingsSet = function (key, value) {
|
||||
print('Setting', key, value);
|
||||
await loadSettings();
|
||||
gGlobalSettings[key] = value;
|
||||
setGlobalSettings(gGlobalSettings);
|
||||
print('Done.');
|
||||
@ -1352,6 +1336,7 @@ function storePermission(user, packageOwner, packageName, permission, allow) {
|
||||
|
||||
export {
|
||||
gGlobalSettings as globalSettings,
|
||||
setGlobalSettings,
|
||||
invoke,
|
||||
getSessionProcessBlob,
|
||||
};
|
||||
|
@ -21,14 +21,14 @@
|
||||
}:
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "tildefriends";
|
||||
version = "0.0.22";
|
||||
version = "0.0.21";
|
||||
|
||||
src = pkgs.fetchFromGitea {
|
||||
domain = "dev.tildefriends.net";
|
||||
owner = "cory";
|
||||
repo = "tildefriends";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-0x4LJXtMUxBsWEOoWAaQlStTfvqUf4Qs/5vJZ2EvBpY=";
|
||||
hash = "sha256-cBj9Hz0qT0Tqm7ivM8HPG9TNwC9iv0lTcE8XCNba8F4=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
|
13
deps/c-ares_config/ares_build.h
vendored
13
deps/c-ares_config/ares_build.h
vendored
@ -39,9 +39,6 @@
|
||||
#define GETSERVBYPORT_R_ARGS 6
|
||||
#define HAVE_GETSERVBYNAME_R 1
|
||||
#define HAVE_GETSERVBYPORT_R 1
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__OpenBSD__) && !defined(__HAIKU__)
|
||||
#define HAVE_PIPE2 1
|
||||
#endif
|
||||
|
||||
@ -50,11 +47,13 @@
|
||||
#define GETSERVBYPORT_R_ARGS 4
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__OpenBSD__) && !defined(__HAIKU__)
|
||||
#if !defined(__APPLE__) && !defined(_WIN32) && !defined(__OpenBSD__)
|
||||
#define HAVE_MALLOC_H 1
|
||||
#if !defined(__HAIKU__)
|
||||
#define HAVE_SYS_RANDOM_H 1
|
||||
#define HAVE_EPOLL 1
|
||||
#define HAVE_SYS_EPOLL_H 1
|
||||
#define HAVE_SYS_RANDOM_H 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__WIN32)
|
||||
@ -139,10 +138,8 @@
|
||||
#define HAVE_IFADDRS_H 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_WRITEV 1
|
||||
#if defined(__ANDROID__) || defined(__APPLE__) || defined(__OpenBSD__)
|
||||
#if !defined(__HAIKU__)
|
||||
#define HAVE_ARC4RANDOM_BUF 1
|
||||
#else
|
||||
#undef HAVE_ARC4RANDOM_BUF
|
||||
#endif
|
||||
#define HAVE_GETIFADDRS 1
|
||||
#define HAVE_STAT 1
|
||||
|
2
deps/codemirror/cm6.js
vendored
2
deps/codemirror/cm6.js
vendored
File diff suppressed because one or more lines are too long
262
deps/codemirror_src/package-lock.json
generated
vendored
262
deps/codemirror_src/package-lock.json
generated
vendored
@ -22,7 +22,6 @@
|
||||
"version": "6.18.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.0.tgz",
|
||||
"integrity": "sha512-5DbOvBbY4qW5l57cjDsmmpDh3/TeK1vXfTHa+BUMrRzdWdcxKZ4U4V7vQaTtOpApNU4kLS4FQ6cINtLg245LXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.0.0",
|
||||
"@codemirror/state": "^6.0.0",
|
||||
@ -40,7 +39,6 @@
|
||||
"version": "6.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.6.0.tgz",
|
||||
"integrity": "sha512-qnY+b7j1UNcTS31Eenuc/5YJB6gQOzkUoNmJQc0rznwqSRpeaWWpjkWy2C/MPTcePpsKJEM26hXrOXl1+nceXg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.0.0",
|
||||
"@codemirror/state": "^6.4.0",
|
||||
@ -52,7 +50,6 @@
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.2.1.tgz",
|
||||
"integrity": "sha512-/UNWDNV5Viwi/1lpr/dIXJNWiwDxpw13I4pTUAsNxZdg6E0mI2kTQb0P2iHczg1Tu+H4EBgJR+hYhKiHKko7qg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "^6.0.0",
|
||||
"@codemirror/language": "^6.0.0",
|
||||
@ -65,7 +62,6 @@
|
||||
"version": "6.4.9",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-6.4.9.tgz",
|
||||
"integrity": "sha512-aQv37pIMSlueybId/2PVSP6NPnmurFDVmZwzc7jszd2KAF8qd4VBbvNYPXWQq90WIARjsdVkPbw29pszmHws3Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "^6.0.0",
|
||||
"@codemirror/lang-css": "^6.0.0",
|
||||
@ -82,7 +78,6 @@
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.2.tgz",
|
||||
"integrity": "sha512-VGQfY+FCc285AhWuwjYxQyUQcYurWlxdKYT4bqwr3Twnd5wP5WSeu52t4tvvuWmljT4EmgEgZCqSieokhtY8hg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "^6.0.0",
|
||||
"@codemirror/language": "^6.6.0",
|
||||
@ -97,7 +92,6 @@
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/lang-json/-/lang-json-6.0.1.tgz",
|
||||
"integrity": "sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.0.0",
|
||||
"@lezer/json": "^1.0.0"
|
||||
@ -107,7 +101,6 @@
|
||||
"version": "6.10.2",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.2.tgz",
|
||||
"integrity": "sha512-kgbTYTo0Au6dCSc/TFy7fK3fpJmgHDv1sG1KNQKJXVi+xBTEeBPY/M30YXiU6mMXeH+YIDLsbrT4ZwNRdtF+SA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
"@codemirror/view": "^6.23.0",
|
||||
@ -121,7 +114,6 @@
|
||||
"version": "6.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.1.tgz",
|
||||
"integrity": "sha512-IZ0Y7S4/bpaunwggW2jYqwLuHj0QtESf5xcROewY6+lDNwZ/NzvR4t+vpYgg9m7V8UXLPYqG+lu3DF470E5Oxg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
"@codemirror/view": "^6.0.0",
|
||||
@ -132,7 +124,6 @@
|
||||
"version": "6.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.6.tgz",
|
||||
"integrity": "sha512-rpMgcsh7o0GuCDUXKPvww+muLA1pDJaFrpq/CCHtpQJYz8xopu4D1hPcKRoDD0YlF8gZaqTNIRa4VRBWyhyy7Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.0.0",
|
||||
"@codemirror/view": "^6.0.0",
|
||||
@ -142,14 +133,12 @@
|
||||
"node_modules/@codemirror/state": {
|
||||
"version": "6.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.4.1.tgz",
|
||||
"integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A=="
|
||||
},
|
||||
"node_modules/@codemirror/theme-one-dark": {
|
||||
"version": "6.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz",
|
||||
"integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "^6.0.0",
|
||||
"@codemirror/state": "^6.0.0",
|
||||
@ -158,10 +147,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@codemirror/view": {
|
||||
"version": "6.33.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.33.0.tgz",
|
||||
"integrity": "sha512-AroaR3BvnjRW8fiZBalAaK+ZzB5usGgI014YKElYZvQdNH5ZIidHlO+cyf/2rWzyBFRkvG6VhiXeAEbC53P2YQ==",
|
||||
"license": "MIT",
|
||||
"version": "6.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.30.0.tgz",
|
||||
"integrity": "sha512-96Nmn8OeLh6aONQprIeYk8hGVnEuYpWuxKSkdsODOx9hWPxyuyZGvmvxV/JmLsp+CubMO1PsLaN5TNNgrl0UrQ==",
|
||||
"dependencies": {
|
||||
"@codemirror/state": "^6.4.0",
|
||||
"style-mod": "^4.1.0",
|
||||
@ -173,7 +161,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
|
||||
"integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/set-array": "^1.2.1",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.10",
|
||||
@ -188,7 +175,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
|
||||
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
@ -198,7 +184,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
|
||||
"integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
@ -208,7 +193,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz",
|
||||
"integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/gen-mapping": "^0.3.5",
|
||||
"@jridgewell/trace-mapping": "^0.3.25"
|
||||
@ -218,15 +202,13 @@
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
|
||||
"integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@jridgewell/trace-mapping": {
|
||||
"version": "0.3.25",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
|
||||
"integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/resolve-uri": "^3.1.0",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
@ -235,14 +217,12 @@
|
||||
"node_modules/@lezer/common": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.1.tgz",
|
||||
"integrity": "sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ=="
|
||||
},
|
||||
"node_modules/@lezer/css": {
|
||||
"version": "1.1.8",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.1.8.tgz",
|
||||
"integrity": "sha512-7JhxupKuMBaWQKjQoLtzhGj83DdnZY9MckEOG5+/iLKNK2ZJqKc6hf6uc0HjwCX7Qlok44jBNqZhHKDhEhZYLA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^1.2.0",
|
||||
"@lezer/highlight": "^1.0.0",
|
||||
@ -250,10 +230,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@lezer/highlight": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz",
|
||||
"integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==",
|
||||
"license": "MIT",
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.0.tgz",
|
||||
"integrity": "sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^1.0.0"
|
||||
}
|
||||
@ -262,7 +241,6 @@
|
||||
"version": "1.3.10",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.10.tgz",
|
||||
"integrity": "sha512-dqpT8nISx/p9Do3AchvYGV3qYc4/rKr3IBZxlHmpIKam56P47RSHkSF5f13Vu9hebS1jM0HmtJIwLbWz1VIY6w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^1.2.0",
|
||||
"@lezer/highlight": "^1.0.0",
|
||||
@ -273,7 +251,6 @@
|
||||
"version": "1.4.17",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.17.tgz",
|
||||
"integrity": "sha512-bYW4ctpyGK+JMumDApeUzuIezX01H76R1foD6LcRX224FWfyYit/HYxiPGDjXXe/wQWASjCvVGoukTH68+0HIA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^1.2.0",
|
||||
"@lezer/highlight": "^1.1.3",
|
||||
@ -284,7 +261,6 @@
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/json/-/json-1.0.2.tgz",
|
||||
"integrity": "sha512-xHT2P4S5eeCYECyKNPhr4cbEL9tc8w83SPwRC373o9uEdrvGKTZoJVAGxpOsZckMlEh9W23Pc72ew918RWQOBQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^1.2.0",
|
||||
"@lezer/highlight": "^1.0.0",
|
||||
@ -295,7 +271,6 @@
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz",
|
||||
"integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@lezer/common": "^1.0.0"
|
||||
}
|
||||
@ -304,7 +279,6 @@
|
||||
"version": "15.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz",
|
||||
"integrity": "sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^5.0.1",
|
||||
"@types/resolve": "1.20.2",
|
||||
@ -330,7 +304,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz",
|
||||
"integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"serialize-javascript": "^6.0.1",
|
||||
"smob": "^1.0.0",
|
||||
@ -352,7 +325,6 @@
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz",
|
||||
"integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/estree": "^1.0.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
@ -371,208 +343,192 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.0.tgz",
|
||||
"integrity": "sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.20.0.tgz",
|
||||
"integrity": "sha512-TSpWzflCc4VGAUJZlPpgAJE1+V60MePDQnBd7PPkpuEmOy8i87aL6tinFGKBFKuEDikYpig72QzdT3QPYIi+oA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm64": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.0.tgz",
|
||||
"integrity": "sha512-a1sR2zSK1B4eYkiZu17ZUZhmUQcKjk2/j9Me2IDjk1GHW7LB5Z35LEzj9iJch6gtUfsnvZs1ZNyDW2oZSThrkA==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.20.0.tgz",
|
||||
"integrity": "sha512-u00Ro/nok7oGzVuh/FMYfNoGqxU5CPWz1mxV85S2w9LxHR8OoMQBuSk+3BKVIDYgkpeOET5yXkx90OYFc+ytpQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-arm64": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.0.tgz",
|
||||
"integrity": "sha512-zOnKWLgDld/svhKO5PD9ozmL6roy5OQ5T4ThvdYZLpiOhEGY+dp2NwUmxK0Ld91LrbjrvtNAE0ERBwjqhZTRAA==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.20.0.tgz",
|
||||
"integrity": "sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-x64": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.0.tgz",
|
||||
"integrity": "sha512-7doS8br0xAkg48SKE2QNtMSFPFUlRdw9+votl27MvT46vo44ATBmdZdGysOevNELmZlfd+NEa0UYOA8f01WSrg==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.20.0.tgz",
|
||||
"integrity": "sha512-xbrMDdlev53vNXexEa6l0LffojxhqDTBeL+VUxuuIXys4x6xyvbKq5XqTXBCEUA8ty8iEJblHvFaWRJTk/icAQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.0.tgz",
|
||||
"integrity": "sha512-pWJsfQjNWNGsoCq53KjMtwdJDmh/6NubwQcz52aEwLEuvx08bzcy6tOUuawAOncPnxz/3siRtd8hiQ32G1y8VA==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.20.0.tgz",
|
||||
"integrity": "sha512-jMYvxZwGmoHFBTbr12Xc6wOdc2xA5tF5F2q6t7Rcfab68TT0n+r7dgawD4qhPEvasDsVpQi+MgDzj2faOLsZjA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.0.tgz",
|
||||
"integrity": "sha512-efRIANsz3UHZrnZXuEvxS9LoCOWMGD1rweciD6uJQIx2myN3a8Im1FafZBzh7zk1RJ6oKcR16dU3UPldaKd83w==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.20.0.tgz",
|
||||
"integrity": "sha512-1asSTl4HKuIHIB1GcdFHNNZhxAYEdqML/MW4QmPS4G0ivbEcBr1JKlFLKsIRqjSwOBkdItn3/ZDlyvZ/N6KPlw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-gnu": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.0.tgz",
|
||||
"integrity": "sha512-ZrPhydkTVhyeGTW94WJ8pnl1uroqVHM3j3hjdquwAcWnmivjAwOYjTEAuEDeJvGX7xv3Z9GAvrBkEzCgHq9U1w==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.20.0.tgz",
|
||||
"integrity": "sha512-COBb8Bkx56KldOYJfMf6wKeYJrtJ9vEgBRAOkfw6Ens0tnmzPqvlpjZiLgkhg6cA3DGzCmLmmd319pmHvKWWlQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-musl": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.0.tgz",
|
||||
"integrity": "sha512-cfaupqd+UEFeURmqNP2eEvXqgbSox/LHOyN9/d2pSdV8xTrjdg3NgOFJCtc1vQ/jEke1qD0IejbBfxleBPHnPw==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.20.0.tgz",
|
||||
"integrity": "sha512-+it+mBSyMslVQa8wSPvBx53fYuZK/oLTu5RJoXogjk6x7Q7sz1GNRsXWjn6SwyJm8E/oMjNVwPhmNdIjwP135Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.0.tgz",
|
||||
"integrity": "sha512-ZKPan1/RvAhrUylwBXC9t7B2hXdpb/ufeu22pG2psV7RN8roOfGurEghw1ySmX/CmDDHNTDDjY3lo9hRlgtaHg==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.20.0.tgz",
|
||||
"integrity": "sha512-yAMvqhPfGKsAxHN8I4+jE0CpLWD8cv4z7CK7BMmhjDuz606Q2tFKkWRY8bHR9JQXYcoLfopo5TTqzxgPUjUMfw==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.0.tgz",
|
||||
"integrity": "sha512-H1eRaCwd5E8eS8leiS+o/NqMdljkcb1d6r2h4fKSsCXQilLKArq6WS7XBLDu80Yz+nMqHVFDquwcVrQmGr28rg==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.20.0.tgz",
|
||||
"integrity": "sha512-qmuxFpfmi/2SUkAw95TtNq/w/I7Gpjurx609OOOV7U4vhvUhBcftcmXwl3rqAek+ADBwSjIC4IVNLiszoj3dPA==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-s390x-gnu": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.0.tgz",
|
||||
"integrity": "sha512-zJ4hA+3b5tu8u7L58CCSI0A9N1vkfwPhWd/puGXwtZlsB5bTkwDNW/+JCU84+3QYmKpLi+XvHdmrlwUwDA6kqw==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.20.0.tgz",
|
||||
"integrity": "sha512-I0BtGXddHSHjV1mqTNkgUZLnS3WtsqebAXv11D5BZE/gfw5KoyXSAXVqyJximQXNvNzUo4GKlCK/dIwXlz+jlg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.0.tgz",
|
||||
"integrity": "sha512-e2hrvElFIh6kW/UNBQK/kzqMNY5mO+67YtEh9OA65RM5IJXYTWiXjX6fjIiPaqOkBthYF1EqgiZ6OXKcQsM0hg==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.20.0.tgz",
|
||||
"integrity": "sha512-y+eoL2I3iphUg9tN9GB6ku1FA8kOfmF4oUEWhztDJ4KXJy1agk/9+pejOuZkNFhRwHAOxMsBPLbXPd6mJiCwew==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-musl": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.0.tgz",
|
||||
"integrity": "sha512-1vvmgDdUSebVGXWX2lIcgRebqfQSff0hMEkLJyakQ9JQUbLDkEaMsPTLOmyccyC6IJ/l3FZuJbmrBw/u0A0uCQ==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.20.0.tgz",
|
||||
"integrity": "sha512-hM3nhW40kBNYUkZb/r9k2FKK+/MnKglX7UYd4ZUy5DJs8/sMsIbqWK2piZtVGE3kcXVNj3B2IrUYROJMMCikNg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-arm64-msvc": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.0.tgz",
|
||||
"integrity": "sha512-s5oFkZ/hFcrlAyBTONFY1TWndfyre1wOMwU+6KCpm/iatybvrRgmZVM+vCFwxmC5ZhdlgfE0N4XorsDpi7/4XQ==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.20.0.tgz",
|
||||
"integrity": "sha512-psegMvP+Ik/Bg7QRJbv8w8PAytPA7Uo8fpFjXyCRHWm6Nt42L+JtoqH8eDQ5hRP7/XW2UiIriy1Z46jf0Oa1kA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-ia32-msvc": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.0.tgz",
|
||||
"integrity": "sha512-G9+TEqRnAA6nbpqyUqgTiopmnfgnMkR3kMukFBDsiyy23LZvUCpiUwjTRx6ezYCjJODXrh52rBR9oXvm+Fp5wg==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.20.0.tgz",
|
||||
"integrity": "sha512-GabekH3w4lgAJpVxkk7hUzUf2hICSQO0a/BLFA11/RMxQT92MabKAqyubzDZmMOC/hcJNlc+rrypzNzYl4Dx7A==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-x64-msvc": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.0.tgz",
|
||||
"integrity": "sha512-2jsCDZwtQvRhejHLfZ1JY6w6kEuEtfF9nzYsZxzSlNVKDX+DpsDJ+Rbjkm74nvg2rdx0gwBS+IMdvwJuq3S9pQ==",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.20.0.tgz",
|
||||
"integrity": "sha512-aJ1EJSuTdGnM6qbVC4B5DSmozPTqIag9fSzXRNNo+humQLG89XpPgdt16Ia56ORD7s+H8Pmyx44uczDQ0yDzpg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
@ -581,21 +537,18 @@
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
|
||||
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw=="
|
||||
},
|
||||
"node_modules/@types/resolve": {
|
||||
"version": "1.20.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
|
||||
"integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q=="
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.12.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
|
||||
"integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@ -607,14 +560,12 @@
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/builtin-modules": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
|
||||
"integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
@ -626,7 +577,6 @@
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz",
|
||||
"integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "^6.0.0",
|
||||
"@codemirror/commands": "^6.0.0",
|
||||
@ -641,20 +591,17 @@
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/crelt": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz",
|
||||
"integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="
|
||||
},
|
||||
"node_modules/deepmerge": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
||||
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
@ -662,15 +609,13 @@
|
||||
"node_modules/estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
@ -683,7 +628,6 @@
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
@ -692,7 +636,6 @@
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
@ -704,7 +647,6 @@
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz",
|
||||
"integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"builtin-modules": "^3.3.0"
|
||||
},
|
||||
@ -716,10 +658,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/is-core-module": {
|
||||
"version": "2.15.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz",
|
||||
"integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==",
|
||||
"license": "MIT",
|
||||
"version": "2.15.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz",
|
||||
"integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==",
|
||||
"dependencies": {
|
||||
"hasown": "^2.0.2"
|
||||
},
|
||||
@ -733,20 +674,17 @@
|
||||
"node_modules/is-module": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
|
||||
"integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g=="
|
||||
},
|
||||
"node_modules/path-parse": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8.6"
|
||||
},
|
||||
@ -759,7 +697,6 @@
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.1.0"
|
||||
}
|
||||
@ -768,7 +705,6 @@
|
||||
"version": "1.22.8",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz",
|
||||
"integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-core-module": "^2.13.0",
|
||||
"path-parse": "^1.0.7",
|
||||
@ -782,10 +718,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "4.21.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.0.tgz",
|
||||
"integrity": "sha512-vo+S/lfA2lMS7rZ2Qoubi6I5hwZwzXeUIctILZLbHI+laNtvhhOIon2S1JksA5UEDQ7l3vberd0fxK44lTYjbQ==",
|
||||
"license": "MIT",
|
||||
"version": "4.20.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.20.0.tgz",
|
||||
"integrity": "sha512-6rbWBChcnSGzIlXeIdNIZTopKYad8ZG8ajhl78lGRLsI2rX8IkaotQhVas2Ma+GPxJav19wrSzvRvuiv0YKzWw==",
|
||||
"dependencies": {
|
||||
"@types/estree": "1.0.5"
|
||||
},
|
||||
@ -797,22 +732,22 @@
|
||||
"npm": ">=8.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-android-arm-eabi": "4.21.0",
|
||||
"@rollup/rollup-android-arm64": "4.21.0",
|
||||
"@rollup/rollup-darwin-arm64": "4.21.0",
|
||||
"@rollup/rollup-darwin-x64": "4.21.0",
|
||||
"@rollup/rollup-linux-arm-gnueabihf": "4.21.0",
|
||||
"@rollup/rollup-linux-arm-musleabihf": "4.21.0",
|
||||
"@rollup/rollup-linux-arm64-gnu": "4.21.0",
|
||||
"@rollup/rollup-linux-arm64-musl": "4.21.0",
|
||||
"@rollup/rollup-linux-powerpc64le-gnu": "4.21.0",
|
||||
"@rollup/rollup-linux-riscv64-gnu": "4.21.0",
|
||||
"@rollup/rollup-linux-s390x-gnu": "4.21.0",
|
||||
"@rollup/rollup-linux-x64-gnu": "4.21.0",
|
||||
"@rollup/rollup-linux-x64-musl": "4.21.0",
|
||||
"@rollup/rollup-win32-arm64-msvc": "4.21.0",
|
||||
"@rollup/rollup-win32-ia32-msvc": "4.21.0",
|
||||
"@rollup/rollup-win32-x64-msvc": "4.21.0",
|
||||
"@rollup/rollup-android-arm-eabi": "4.20.0",
|
||||
"@rollup/rollup-android-arm64": "4.20.0",
|
||||
"@rollup/rollup-darwin-arm64": "4.20.0",
|
||||
"@rollup/rollup-darwin-x64": "4.20.0",
|
||||
"@rollup/rollup-linux-arm-gnueabihf": "4.20.0",
|
||||
"@rollup/rollup-linux-arm-musleabihf": "4.20.0",
|
||||
"@rollup/rollup-linux-arm64-gnu": "4.20.0",
|
||||
"@rollup/rollup-linux-arm64-musl": "4.20.0",
|
||||
"@rollup/rollup-linux-powerpc64le-gnu": "4.20.0",
|
||||
"@rollup/rollup-linux-riscv64-gnu": "4.20.0",
|
||||
"@rollup/rollup-linux-s390x-gnu": "4.20.0",
|
||||
"@rollup/rollup-linux-x64-gnu": "4.20.0",
|
||||
"@rollup/rollup-linux-x64-musl": "4.20.0",
|
||||
"@rollup/rollup-win32-arm64-msvc": "4.20.0",
|
||||
"@rollup/rollup-win32-ia32-msvc": "4.20.0",
|
||||
"@rollup/rollup-win32-x64-msvc": "4.20.0",
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
@ -834,15 +769,13 @@
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
]
|
||||
},
|
||||
"node_modules/serialize-javascript": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",
|
||||
"integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"randombytes": "^2.1.0"
|
||||
}
|
||||
@ -851,15 +784,13 @@
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz",
|
||||
"integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
@ -869,7 +800,6 @@
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
|
||||
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"source-map": "^0.6.0"
|
||||
@ -878,14 +808,12 @@
|
||||
"node_modules/style-mod": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz",
|
||||
"integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw=="
|
||||
},
|
||||
"node_modules/supports-preserve-symlinks-flag": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
|
||||
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
@ -894,11 +822,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/terser": {
|
||||
"version": "5.31.6",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz",
|
||||
"integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==",
|
||||
"version": "5.31.3",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz",
|
||||
"integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"@jridgewell/source-map": "^0.3.3",
|
||||
"acorn": "^8.8.2",
|
||||
@ -915,8 +842,7 @@
|
||||
"node_modules/w3c-keyname": {
|
||||
"version": "2.2.8",
|
||||
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
|
||||
"integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",
|
||||
"license": "MIT"
|
||||
"integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
40
deps/sqlite/shell.c
vendored
40
deps/sqlite/shell.c
vendored
@ -604,6 +604,11 @@ zSkipValidUtf8(const char *z, int nAccept, long ccm);
|
||||
# define CIO_WIN_WC_XLATE 0 /* Not exposing translation routines at all */
|
||||
#endif
|
||||
|
||||
#if CIO_WIN_WC_XLATE
|
||||
/* Character used to represent a known-incomplete UTF-8 char group (<28>) */
|
||||
static WCHAR cBadGroup = 0xfffd;
|
||||
#endif
|
||||
|
||||
#if CIO_WIN_WC_XLATE
|
||||
static HANDLE handleOfFile(FILE *pf){
|
||||
int fileDesc = _fileno(pf);
|
||||
@ -12542,7 +12547,7 @@ static int expertFilter(
|
||||
pCsr->pData = 0;
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = idxPrintfPrepareStmt(pExpert->db, &pCsr->pData, &pVtab->base.zErrMsg,
|
||||
"SELECT * FROM main.%Q WHERE sqlite_expert_sample()", pVtab->pTab->zName
|
||||
"SELECT * FROM main.%Q WHERE sample()", pVtab->pTab->zName
|
||||
);
|
||||
}
|
||||
|
||||
@ -13416,7 +13421,7 @@ struct IdxRemCtx {
|
||||
};
|
||||
|
||||
/*
|
||||
** Implementation of scalar function sqlite_expert_rem().
|
||||
** Implementation of scalar function rem().
|
||||
*/
|
||||
static void idxRemFunc(
|
||||
sqlite3_context *pCtx,
|
||||
@ -13429,7 +13434,7 @@ static void idxRemFunc(
|
||||
assert( argc==2 );
|
||||
|
||||
iSlot = sqlite3_value_int(argv[0]);
|
||||
assert( iSlot<p->nSlot );
|
||||
assert( iSlot<=p->nSlot );
|
||||
pSlot = &p->aSlot[iSlot];
|
||||
|
||||
switch( pSlot->eType ){
|
||||
@ -13540,8 +13545,7 @@ static int idxPopulateOneStat1(
|
||||
const char *zName = (const char*)sqlite3_column_text(pIndexXInfo, 0);
|
||||
const char *zColl = (const char*)sqlite3_column_text(pIndexXInfo, 1);
|
||||
zCols = idxAppendText(&rc, zCols,
|
||||
"%sx.%Q IS sqlite_expert_rem(%d, x.%Q) COLLATE %s",
|
||||
zComma, zName, nCol, zName, zColl
|
||||
"%sx.%Q IS rem(%d, x.%Q) COLLATE %s", zComma, zName, nCol, zName, zColl
|
||||
);
|
||||
zOrder = idxAppendText(&rc, zOrder, "%s%d", zComma, ++nCol);
|
||||
}
|
||||
@ -13674,13 +13678,13 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3 *dbrem = (p->iSample==100 ? p->db : p->dbv);
|
||||
rc = sqlite3_create_function(dbrem, "sqlite_expert_rem",
|
||||
2, SQLITE_UTF8, (void*)pCtx, idxRemFunc, 0, 0
|
||||
rc = sqlite3_create_function(
|
||||
dbrem, "rem", 2, SQLITE_UTF8, (void*)pCtx, idxRemFunc, 0, 0
|
||||
);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3_create_function(p->db, "sqlite_expert_sample",
|
||||
0, SQLITE_UTF8, (void*)&samplectx, idxSampleFunc, 0, 0
|
||||
rc = sqlite3_create_function(
|
||||
p->db, "sample", 0, SQLITE_UTF8, (void*)&samplectx, idxSampleFunc, 0, 0
|
||||
);
|
||||
}
|
||||
|
||||
@ -13732,9 +13736,6 @@ static int idxPopulateStat1(sqlite3expert *p, char **pzErr){
|
||||
rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0);
|
||||
}
|
||||
|
||||
sqlite3_create_function(p->db, "sqlite_expert_rem", 2, SQLITE_UTF8, 0,0,0,0);
|
||||
sqlite3_create_function(p->db, "sqlite_expert_sample", 0,SQLITE_UTF8,0,0,0,0);
|
||||
|
||||
sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp."UNIQUE_TABLE_NAME,0,0,0);
|
||||
return rc;
|
||||
}
|
||||
@ -16835,8 +16836,8 @@ static int recoverError(
|
||||
va_start(ap, zFmt);
|
||||
if( zFmt ){
|
||||
z = sqlite3_vmprintf(zFmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
va_end(ap);
|
||||
sqlite3_free(p->zErrMsg);
|
||||
p->zErrMsg = z;
|
||||
p->errCode = errCode;
|
||||
@ -27084,6 +27085,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
import_cleanup(&sCtx);
|
||||
shell_out_of_memory();
|
||||
}
|
||||
nByte = strlen(zSql);
|
||||
rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
|
||||
sqlite3_free(zSql);
|
||||
zSql = 0;
|
||||
@ -27102,21 +27104,16 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
sqlite3_finalize(pStmt);
|
||||
pStmt = 0;
|
||||
if( nCol==0 ) return 0; /* no columns, no error */
|
||||
|
||||
nByte = 64 /* space for "INSERT INTO", "VALUES(", ")\0" */
|
||||
+ (zSchema ? strlen(zSchema)*2 + 2: 0) /* Quoted schema name */
|
||||
+ strlen(zTable)*2 + 2 /* Quoted table name */
|
||||
+ nCol*2; /* Space for ",?" for each column */
|
||||
zSql = sqlite3_malloc64( nByte );
|
||||
zSql = sqlite3_malloc64( nByte*2 + 20 + nCol*2 );
|
||||
if( zSql==0 ){
|
||||
import_cleanup(&sCtx);
|
||||
shell_out_of_memory();
|
||||
}
|
||||
if( zSchema ){
|
||||
sqlite3_snprintf(nByte, zSql, "INSERT INTO \"%w\".\"%w\" VALUES(?",
|
||||
sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\".\"%w\" VALUES(?",
|
||||
zSchema, zTable);
|
||||
}else{
|
||||
sqlite3_snprintf(nByte, zSql, "INSERT INTO \"%w\" VALUES(?", zTable);
|
||||
sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable);
|
||||
}
|
||||
j = strlen30(zSql);
|
||||
for(i=1; i<nCol; i++){
|
||||
@ -27125,7 +27122,6 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}
|
||||
zSql[j++] = ')';
|
||||
zSql[j] = 0;
|
||||
assert( j<nByte );
|
||||
if( eVerbose>=2 ){
|
||||
oputf("Insert using: %s\n", zSql);
|
||||
}
|
||||
|
154
deps/sqlite/sqlite3.c
vendored
154
deps/sqlite/sqlite3.c
vendored
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
** This file is an amalgamation of many separate C source files from SQLite
|
||||
** version 3.46.1. By combining all the individual C code files into this
|
||||
** version 3.46.0. By combining all the individual C code files into this
|
||||
** single large file, the entire code can be compiled as a single translation
|
||||
** unit. This allows many compilers to do optimizations that would not be
|
||||
** possible if the files were compiled separately. Performance improvements
|
||||
@ -18,7 +18,7 @@
|
||||
** separate file. This file contains only code for the core SQLite library.
|
||||
**
|
||||
** The content in this amalgamation comes from Fossil check-in
|
||||
** c9c2ab54ba1f5f46360f1b4f35d849cd3f08.
|
||||
** 96c92aba00c8375bc32fafcdf12429c58bd8.
|
||||
*/
|
||||
#define SQLITE_CORE 1
|
||||
#define SQLITE_AMALGAMATION 1
|
||||
@ -459,9 +459,9 @@ extern "C" {
|
||||
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
||||
** [sqlite_version()] and [sqlite_source_id()].
|
||||
*/
|
||||
#define SQLITE_VERSION "3.46.1"
|
||||
#define SQLITE_VERSION_NUMBER 3046001
|
||||
#define SQLITE_SOURCE_ID "2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33"
|
||||
#define SQLITE_VERSION "3.46.0"
|
||||
#define SQLITE_VERSION_NUMBER 3046000
|
||||
#define SQLITE_SOURCE_ID "2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e"
|
||||
|
||||
/*
|
||||
** CAPI3REF: Run-Time Library Version Numbers
|
||||
@ -19361,7 +19361,7 @@ struct SrcList {
|
||||
#define WHERE_AGG_DISTINCT 0x0400 /* Query is "SELECT agg(DISTINCT ...)" */
|
||||
#define WHERE_ORDERBY_LIMIT 0x0800 /* ORDERBY+LIMIT on the inner loop */
|
||||
#define WHERE_RIGHT_JOIN 0x1000 /* Processing a RIGHT JOIN */
|
||||
#define WHERE_KEEP_ALL_JOINS 0x2000 /* Do not do the omit-noop-join opt */
|
||||
/* 0x2000 not currently used */
|
||||
#define WHERE_USE_LIMIT 0x4000 /* Use the LIMIT in cost estimates */
|
||||
/* 0x8000 not currently used */
|
||||
|
||||
@ -90173,8 +90173,7 @@ SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe *v, int iVar, u8 aff
|
||||
assert( iVar>0 );
|
||||
if( v ){
|
||||
Mem *pMem = &v->aVar[iVar-1];
|
||||
assert( (v->db->flags & SQLITE_EnableQPSG)==0
|
||||
|| (v->db->mDbFlags & DBFLAG_InternalFunc)!=0 );
|
||||
assert( (v->db->flags & SQLITE_EnableQPSG)==0 );
|
||||
if( 0==(pMem->flags & MEM_Null) ){
|
||||
sqlite3_value *pRet = sqlite3ValueNew(v->db);
|
||||
if( pRet ){
|
||||
@ -90194,8 +90193,7 @@ SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe *v, int iVar, u8 aff
|
||||
*/
|
||||
SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){
|
||||
assert( iVar>0 );
|
||||
assert( (v->db->flags & SQLITE_EnableQPSG)==0
|
||||
|| (v->db->mDbFlags & DBFLAG_InternalFunc)!=0 );
|
||||
assert( (v->db->flags & SQLITE_EnableQPSG)==0 );
|
||||
if( iVar>=32 ){
|
||||
v->expmask |= 0x80000000;
|
||||
}else{
|
||||
@ -106952,7 +106950,7 @@ static void extendFJMatch(
|
||||
static SQLITE_NOINLINE int isValidSchemaTableName(
|
||||
const char *zTab, /* Name as it appears in the SQL */
|
||||
Table *pTab, /* The schema table we are trying to match */
|
||||
const char *zDb /* non-NULL if a database qualifier is present */
|
||||
Schema *pSchema /* non-NULL if a database qualifier is present */
|
||||
){
|
||||
const char *zLegacy;
|
||||
assert( pTab!=0 );
|
||||
@ -106963,7 +106961,7 @@ static SQLITE_NOINLINE int isValidSchemaTableName(
|
||||
if( sqlite3StrICmp(zTab+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 ){
|
||||
return 1;
|
||||
}
|
||||
if( zDb==0 ) return 0;
|
||||
if( pSchema==0 ) return 0;
|
||||
if( sqlite3StrICmp(zTab+7, &LEGACY_SCHEMA_TABLE[7])==0 ) return 1;
|
||||
if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1;
|
||||
}else{
|
||||
@ -107146,7 +107144,7 @@ static int lookupName(
|
||||
}
|
||||
}else if( sqlite3StrICmp(zTab, pTab->zName)!=0 ){
|
||||
if( pTab->tnum!=1 ) continue;
|
||||
if( !isValidSchemaTableName(zTab, pTab, zDb) ) continue;
|
||||
if( !isValidSchemaTableName(zTab, pTab, pSchema) ) continue;
|
||||
}
|
||||
assert( ExprUseYTab(pExpr) );
|
||||
if( IN_RENAME_OBJECT && pItem->zAlias ){
|
||||
@ -108878,9 +108876,6 @@ SQLITE_PRIVATE int sqlite3ResolveExprNames(
|
||||
** Resolve all names for all expression in an expression list. This is
|
||||
** just like sqlite3ResolveExprNames() except that it works for an expression
|
||||
** list rather than a single expression.
|
||||
**
|
||||
** The return value is SQLITE_OK (0) for success or SQLITE_ERROR (1) for a
|
||||
** failure.
|
||||
*/
|
||||
SQLITE_PRIVATE int sqlite3ResolveExprListNames(
|
||||
NameContext *pNC, /* Namespace to resolve expressions in. */
|
||||
@ -108889,7 +108884,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames(
|
||||
int i;
|
||||
int savedHasAgg = 0;
|
||||
Walker w;
|
||||
if( pList==0 ) return SQLITE_OK;
|
||||
if( pList==0 ) return WRC_Continue;
|
||||
w.pParse = pNC->pParse;
|
||||
w.xExprCallback = resolveExprStep;
|
||||
w.xSelectCallback = resolveSelectStep;
|
||||
@ -108903,7 +108898,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames(
|
||||
#if SQLITE_MAX_EXPR_DEPTH>0
|
||||
w.pParse->nHeight += pExpr->nHeight;
|
||||
if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){
|
||||
return SQLITE_ERROR;
|
||||
return WRC_Abort;
|
||||
}
|
||||
#endif
|
||||
sqlite3WalkExprNN(&w, pExpr);
|
||||
@ -108920,10 +108915,10 @@ SQLITE_PRIVATE int sqlite3ResolveExprListNames(
|
||||
(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg);
|
||||
pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg);
|
||||
}
|
||||
if( w.pParse->nErr>0 ) return SQLITE_ERROR;
|
||||
if( w.pParse->nErr>0 ) return WRC_Abort;
|
||||
}
|
||||
pNC->ncFlags |= savedHasAgg;
|
||||
return SQLITE_OK;
|
||||
return WRC_Continue;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -117462,7 +117457,7 @@ static int renameResolveTrigger(Parse *pParse){
|
||||
/* ALWAYS() because if the table of the trigger does not exist, the
|
||||
** error would have been hit before this point */
|
||||
if( ALWAYS(pParse->pTriggerTab) ){
|
||||
rc = sqlite3ViewGetColumnNames(pParse, pParse->pTriggerTab)!=0;
|
||||
rc = sqlite3ViewGetColumnNames(pParse, pParse->pTriggerTab);
|
||||
}
|
||||
|
||||
/* Resolve symbols in WHEN clause */
|
||||
@ -124431,9 +124426,8 @@ create_view_fail:
|
||||
#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE)
|
||||
/*
|
||||
** The Table structure pTable is really a VIEW. Fill in the names of
|
||||
** the columns of the view in the pTable structure. Return non-zero if
|
||||
** there are errors. If an error is seen an error message is left
|
||||
** in pParse->zErrMsg.
|
||||
** the columns of the view in the pTable structure. Return the number
|
||||
** of errors. If an error is seen leave an error message in pParse->zErrMsg.
|
||||
*/
|
||||
static SQLITE_NOINLINE int viewGetColumnNames(Parse *pParse, Table *pTable){
|
||||
Table *pSelTab; /* A fake table from which we get the result set */
|
||||
@ -124556,7 +124550,7 @@ static SQLITE_NOINLINE int viewGetColumnNames(Parse *pParse, Table *pTable){
|
||||
sqlite3DeleteColumnNames(db, pTable);
|
||||
}
|
||||
#endif /* SQLITE_OMIT_VIEW */
|
||||
return nErr + pParse->nErr;
|
||||
return nErr;
|
||||
}
|
||||
SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
|
||||
assert( pTable!=0 );
|
||||
@ -130854,8 +130848,6 @@ static void groupConcatValue(sqlite3_context *context){
|
||||
sqlite3_result_error_toobig(context);
|
||||
}else if( pAccum->accError==SQLITE_NOMEM ){
|
||||
sqlite3_result_error_nomem(context);
|
||||
}else if( pGCC->nAccum>0 && pAccum->nChar==0 ){
|
||||
sqlite3_result_text(context, "", 1, SQLITE_STATIC);
|
||||
}else{
|
||||
const char *zText = sqlite3_str_value(pAccum);
|
||||
sqlite3_result_text(context, zText, pAccum->nChar, SQLITE_TRANSIENT);
|
||||
@ -133610,7 +133602,6 @@ SQLITE_PRIVATE Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList
|
||||
pRet->pSrc->nSrc = 1;
|
||||
pRet->pPrior = pLeft->pPrior;
|
||||
pRet->op = pLeft->op;
|
||||
if( pRet->pPrior ) pRet->selFlags |= SF_Values;
|
||||
pLeft->pPrior = 0;
|
||||
pLeft->op = TK_SELECT;
|
||||
assert( pLeft->pNext==0 );
|
||||
@ -166076,9 +166067,7 @@ static int whereLoopAddBtree(
|
||||
" according to whereIsCoveringIndex()\n", pProbe->zName));
|
||||
}
|
||||
}
|
||||
}else if( m==0
|
||||
&& (HasRowid(pTab) || pWInfo->pSelect!=0 || sqlite3FaultSim(700))
|
||||
){
|
||||
}else if( m==0 ){
|
||||
WHERETRACE(0x200,
|
||||
("-> %s a covering index according to bitmasks\n",
|
||||
pProbe->zName, m==0 ? "is" : "is not"));
|
||||
@ -167967,10 +167956,6 @@ static void showAllWhereLoops(WhereInfo *pWInfo, WhereClause *pWC){
|
||||
** the right-most table of a subquery that was flattened into the
|
||||
** main query and that subquery was the right-hand operand of an
|
||||
** inner join that held an ON or USING clause.
|
||||
** 6) The ORDER BY clause has 63 or fewer terms
|
||||
** 7) The omit-noop-join optimization is enabled.
|
||||
**
|
||||
** Items (1), (6), and (7) are checked by the caller.
|
||||
**
|
||||
** For example, given:
|
||||
**
|
||||
@ -168384,7 +168369,6 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
|
||||
if( pOrderBy && pOrderBy->nExpr>=BMS ){
|
||||
pOrderBy = 0;
|
||||
wctrlFlags &= ~WHERE_WANT_DISTINCT;
|
||||
wctrlFlags |= WHERE_KEEP_ALL_JOINS; /* Disable omit-noop-join opt */
|
||||
}
|
||||
|
||||
/* The number of tables in the FROM clause is limited by the number of
|
||||
@ -168685,10 +168669,10 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
|
||||
** in-line sqlite3WhereCodeOneLoopStart() for performance reasons.
|
||||
*/
|
||||
notReady = ~(Bitmask)0;
|
||||
if( pWInfo->nLevel>=2 /* Must be a join, or this opt8n is pointless */
|
||||
&& pResultSet!=0 /* Condition (1) */
|
||||
&& 0==(wctrlFlags & (WHERE_AGG_DISTINCT|WHERE_KEEP_ALL_JOINS)) /* (1),(6) */
|
||||
&& OptimizationEnabled(db, SQLITE_OmitNoopJoin) /* (7) */
|
||||
if( pWInfo->nLevel>=2
|
||||
&& pResultSet!=0 /* these two combine to guarantee */
|
||||
&& 0==(wctrlFlags & WHERE_AGG_DISTINCT) /* condition (1) above */
|
||||
&& OptimizationEnabled(db, SQLITE_OmitNoopJoin)
|
||||
){
|
||||
notReady = whereOmitNoopJoin(pWInfo, notReady);
|
||||
nTabList = pWInfo->nLevel;
|
||||
@ -169008,6 +168992,26 @@ whereBeginError:
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
/*
|
||||
** Return true if cursor iCur is opened by instruction k of the
|
||||
** bytecode. Used inside of assert() only.
|
||||
*/
|
||||
static int cursorIsOpen(Vdbe *v, int iCur, int k){
|
||||
while( k>=0 ){
|
||||
VdbeOp *pOp = sqlite3VdbeGetOp(v,k--);
|
||||
if( pOp->p1!=iCur ) continue;
|
||||
if( pOp->opcode==OP_Close ) return 0;
|
||||
if( pOp->opcode==OP_OpenRead ) return 1;
|
||||
if( pOp->opcode==OP_OpenWrite ) return 1;
|
||||
if( pOp->opcode==OP_OpenDup ) return 1;
|
||||
if( pOp->opcode==OP_OpenAutoindex ) return 1;
|
||||
if( pOp->opcode==OP_OpenEphemeral ) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* SQLITE_DEBUG */
|
||||
|
||||
/*
|
||||
** Generate the end of the WHERE loop. See comments on
|
||||
** sqlite3WhereBegin() for additional information.
|
||||
@ -169307,10 +169311,16 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
** reference. Verify that this is harmless - that the
|
||||
** table being referenced really is open.
|
||||
*/
|
||||
if( pLoop->wsFlags & WHERE_IDX_ONLY ){
|
||||
sqlite3ErrorMsg(pParse, "internal query planner error");
|
||||
pParse->rc = SQLITE_INTERNAL;
|
||||
}
|
||||
#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC
|
||||
assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0
|
||||
|| cursorIsOpen(v,pOp->p1,k)
|
||||
|| pOp->opcode==OP_Offset
|
||||
);
|
||||
#else
|
||||
assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0
|
||||
|| cursorIsOpen(v,pOp->p1,k)
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}else if( pOp->opcode==OP_Rowid ){
|
||||
pOp->p1 = pLevel->iIdxCur;
|
||||
@ -172581,9 +172591,9 @@ static void updateDeleteLimitError(
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( (p->selFlags & (SF_MultiValue|SF_Values))==0
|
||||
&& (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0
|
||||
&& cnt>mxSelect
|
||||
if( (p->selFlags & SF_MultiValue)==0 &&
|
||||
(mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 &&
|
||||
cnt>mxSelect
|
||||
){
|
||||
sqlite3ErrorMsg(pParse, "too many terms in compound SELECT");
|
||||
}
|
||||
@ -236994,11 +237004,7 @@ static int sqlite3Fts5ExprNew(
|
||||
}
|
||||
|
||||
sqlite3_free(sParse.apPhrase);
|
||||
if( 0==*pzErr ){
|
||||
*pzErr = sParse.zErr;
|
||||
}else{
|
||||
sqlite3_free(sParse.zErr);
|
||||
}
|
||||
*pzErr = sParse.zErr;
|
||||
return sParse.rc;
|
||||
}
|
||||
|
||||
@ -239126,7 +239132,6 @@ static Fts5ExprNode *sqlite3Fts5ParseImplicitAnd(
|
||||
assert( pRight->eType==FTS5_STRING
|
||||
|| pRight->eType==FTS5_TERM
|
||||
|| pRight->eType==FTS5_EOF
|
||||
|| (pRight->eType==FTS5_AND && pParse->bPhraseToAnd)
|
||||
);
|
||||
|
||||
if( pLeft->eType==FTS5_AND ){
|
||||
@ -251294,7 +251299,6 @@ static int fts5UpdateMethod(
|
||||
rc = SQLITE_ERROR;
|
||||
}else{
|
||||
rc = fts5SpecialDelete(pTab, apVal);
|
||||
bUpdateOrDelete = 1;
|
||||
}
|
||||
}else{
|
||||
rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]);
|
||||
@ -252469,16 +252473,14 @@ static int sqlite3Fts5GetTokenizer(
|
||||
if( pMod==0 ){
|
||||
assert( nArg>0 );
|
||||
rc = SQLITE_ERROR;
|
||||
if( pzErr ) *pzErr = sqlite3_mprintf("no such tokenizer: %s", azArg[0]);
|
||||
*pzErr = sqlite3_mprintf("no such tokenizer: %s", azArg[0]);
|
||||
}else{
|
||||
rc = pMod->x.xCreate(
|
||||
pMod->pUserData, (azArg?&azArg[1]:0), (nArg?nArg-1:0), &pConfig->pTok
|
||||
);
|
||||
pConfig->pTokApi = &pMod->x;
|
||||
if( rc!=SQLITE_OK ){
|
||||
if( pzErr && rc!=SQLITE_NOMEM ){
|
||||
*pzErr = sqlite3_mprintf("error in tokenizer constructor");
|
||||
}
|
||||
if( pzErr ) *pzErr = sqlite3_mprintf("error in tokenizer constructor");
|
||||
}else{
|
||||
pConfig->ePattern = sqlite3Fts5TokenizerPattern(
|
||||
pMod->x.xCreate, pConfig->pTok
|
||||
@ -252537,7 +252539,7 @@ static void fts5SourceIdFunc(
|
||||
){
|
||||
assert( nArg==0 );
|
||||
UNUSED_PARAM2(nArg, apUnused);
|
||||
sqlite3_result_text(pCtx, "fts5: 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33", -1, SQLITE_TRANSIENT);
|
||||
sqlite3_result_text(pCtx, "fts5: 2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e", -1, SQLITE_TRANSIENT);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -252572,23 +252574,17 @@ static int fts5IntegrityMethod(
|
||||
|
||||
assert( pzErr!=0 && *pzErr==0 );
|
||||
UNUSED_PARAM(isQuick);
|
||||
assert( pTab->p.pConfig->pzErrmsg==0 );
|
||||
pTab->p.pConfig->pzErrmsg = pzErr;
|
||||
rc = sqlite3Fts5StorageIntegrity(pTab->pStorage, 0);
|
||||
if( *pzErr==0 && rc!=SQLITE_OK ){
|
||||
if( (rc&0xff)==SQLITE_CORRUPT ){
|
||||
*pzErr = sqlite3_mprintf("malformed inverted index for FTS5 table %s.%s",
|
||||
zSchema, zTabname);
|
||||
rc = (*pzErr) ? SQLITE_OK : SQLITE_NOMEM;
|
||||
}else{
|
||||
*pzErr = sqlite3_mprintf("unable to validate the inverted index for"
|
||||
" FTS5 table %s.%s: %s",
|
||||
zSchema, zTabname, sqlite3_errstr(rc));
|
||||
}
|
||||
if( (rc&0xff)==SQLITE_CORRUPT ){
|
||||
*pzErr = sqlite3_mprintf("malformed inverted index for FTS5 table %s.%s",
|
||||
zSchema, zTabname);
|
||||
rc = (*pzErr) ? SQLITE_OK : SQLITE_NOMEM;
|
||||
}else if( rc!=SQLITE_OK ){
|
||||
*pzErr = sqlite3_mprintf("unable to validate the inverted index for"
|
||||
" FTS5 table %s.%s: %s",
|
||||
zSchema, zTabname, sqlite3_errstr(rc));
|
||||
}
|
||||
|
||||
sqlite3Fts5IndexCloseReader(pTab->p.pIndex);
|
||||
pTab->p.pConfig->pzErrmsg = 0;
|
||||
|
||||
return rc;
|
||||
}
|
||||
@ -254022,7 +254018,7 @@ static int fts5AsciiCreate(
|
||||
int i;
|
||||
memset(p, 0, sizeof(AsciiTokenizer));
|
||||
memcpy(p->aTokenChar, aAsciiTokenChar, sizeof(aAsciiTokenChar));
|
||||
for(i=0; rc==SQLITE_OK && i<nArg-1; i+=2){
|
||||
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
||||
const char *zArg = azArg[i+1];
|
||||
if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){
|
||||
fts5AsciiAddExceptions(p, zArg, 1);
|
||||
@ -254033,7 +254029,6 @@ static int fts5AsciiCreate(
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
}
|
||||
if( rc==SQLITE_OK && i<nArg ) rc = SQLITE_ERROR;
|
||||
if( rc!=SQLITE_OK ){
|
||||
fts5AsciiDelete((Fts5Tokenizer*)p);
|
||||
p = 0;
|
||||
@ -254325,16 +254320,17 @@ static int fts5UnicodeCreate(
|
||||
}
|
||||
|
||||
/* Search for a "categories" argument */
|
||||
for(i=0; rc==SQLITE_OK && i<nArg-1; i+=2){
|
||||
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
||||
if( 0==sqlite3_stricmp(azArg[i], "categories") ){
|
||||
zCat = azArg[i+1];
|
||||
}
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = unicodeSetCategories(p, zCat);
|
||||
}
|
||||
|
||||
for(i=0; rc==SQLITE_OK && i<nArg-1; i+=2){
|
||||
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
||||
const char *zArg = azArg[i+1];
|
||||
if( 0==sqlite3_stricmp(azArg[i], "remove_diacritics") ){
|
||||
if( (zArg[0]!='0' && zArg[0]!='1' && zArg[0]!='2') || zArg[1] ){
|
||||
@ -254359,7 +254355,6 @@ static int fts5UnicodeCreate(
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
}
|
||||
if( i<nArg && rc==SQLITE_OK ) rc = SQLITE_ERROR;
|
||||
|
||||
}else{
|
||||
rc = SQLITE_NOMEM;
|
||||
@ -255242,7 +255237,7 @@ static int fts5TriCreate(
|
||||
int i;
|
||||
pNew->bFold = 1;
|
||||
pNew->iFoldParam = 0;
|
||||
for(i=0; rc==SQLITE_OK && i<nArg-1; i+=2){
|
||||
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
||||
const char *zArg = azArg[i+1];
|
||||
if( 0==sqlite3_stricmp(azArg[i], "case_sensitive") ){
|
||||
if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1] ){
|
||||
@ -255260,7 +255255,6 @@ static int fts5TriCreate(
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
}
|
||||
if( i<nArg && rc==SQLITE_OK ) rc = SQLITE_ERROR;
|
||||
|
||||
if( pNew->iFoldParam!=0 && pNew->bFold==0 ){
|
||||
rc = SQLITE_ERROR;
|
||||
|
6
deps/sqlite/sqlite3.h
vendored
6
deps/sqlite/sqlite3.h
vendored
@ -146,9 +146,9 @@ extern "C" {
|
||||
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
||||
** [sqlite_version()] and [sqlite_source_id()].
|
||||
*/
|
||||
#define SQLITE_VERSION "3.46.1"
|
||||
#define SQLITE_VERSION_NUMBER 3046001
|
||||
#define SQLITE_SOURCE_ID "2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33"
|
||||
#define SQLITE_VERSION "3.46.0"
|
||||
#define SQLITE_VERSION_NUMBER 3046000
|
||||
#define SQLITE_SOURCE_ID "2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e"
|
||||
|
||||
/*
|
||||
** CAPI3REF: Run-Time Library Version Numbers
|
||||
|
@ -1,12 +0,0 @@
|
||||
* Took an initial whack at encouraging internet-based discovery of open peers.
|
||||
* Added settings to control whether replication, room, peer exchange, and account registration are allowed.
|
||||
* Implemented prompt() on Android.
|
||||
* Fixed some incorrect cross-thread use of the main JS context.
|
||||
* Fixed yet another incorrect use of the DB from the main thread, from an RPC that isn't ever hit. Hmm.
|
||||
* Minor admin layout fixes.
|
||||
* Added c-ares for TXT record lookups.
|
||||
* Latest libsodium-stable.
|
||||
* Latest libbacktrace.
|
||||
* Latest CodeMirror.
|
||||
* Updated to Lit 3.2.0.
|
||||
* Updated sqlite to 3.46.1.
|
@ -2,8 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.unprompted.tildefriends"
|
||||
android:versionCode="26"
|
||||
android:versionName="0.0.22">
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
android:versionName="0.0.22-wip">
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<application
|
||||
android:label="Tilde Friends"
|
||||
|
@ -7,7 +7,6 @@ import android.content.ComponentName;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
@ -16,7 +15,6 @@ import android.os.Parcel;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.RemoteException;
|
||||
import android.os.StrictMode;
|
||||
import android.text.InputType;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
@ -34,7 +32,6 @@ import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import java.io.BufferedReader;
|
||||
@ -69,7 +66,7 @@ public class TildeFriendsActivity extends Activity {
|
||||
Log.w("tildefriends", "system.loadLibrary() completed.");
|
||||
}
|
||||
|
||||
public static native int tf_server_main(String files_dir, String apk_path, String out_port_file_path, ConnectivityManager connectivity_manager);
|
||||
public static native int tf_server_main(String files_dir, String apk_path, String out_port_file_path);
|
||||
public static native int tf_sandbox_main(int pipe_fd);
|
||||
|
||||
@Override
|
||||
@ -151,11 +148,7 @@ public class TildeFriendsActivity extends Activity {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.w("tildefriends", "Calling tf_server_main.");
|
||||
int result = tf_server_main(
|
||||
getFilesDir().toString(),
|
||||
getPackageResourcePath().toString(),
|
||||
port_file_path,
|
||||
(ConnectivityManager)getApplicationContext().getSystemService(CONNECTIVITY_SERVICE));
|
||||
int result = tf_server_main(getFilesDir().toString(), getPackageResourcePath().toString(), port_file_path);
|
||||
Log.w("tildefriends", "tf_server_main returned " + result + ".");
|
||||
}
|
||||
});
|
||||
@ -198,6 +191,30 @@ public class TildeFriendsActivity extends Activity {
|
||||
});
|
||||
|
||||
web_view.setWebChromeClient(new WebChromeClient() {
|
||||
@Override
|
||||
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
|
||||
new AlertDialog.Builder(view.getContext())
|
||||
.setTitle("Tilde Friends")
|
||||
.setMessage(message)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener()
|
||||
{
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
result.confirm();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener()
|
||||
{
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
result.cancel();
|
||||
}
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
|
||||
new AlertDialog.Builder(view.getContext())
|
||||
@ -215,59 +232,6 @@ public class TildeFriendsActivity extends Activity {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
|
||||
new AlertDialog.Builder(view.getContext())
|
||||
.setTitle("Tilde Friends")
|
||||
.setMessage(message)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener()
|
||||
{
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
result.confirm();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener()
|
||||
{
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
result.cancel();
|
||||
}
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
|
||||
EditText input = new EditText(view.getContext());
|
||||
input.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
input.setText(defaultValue);
|
||||
|
||||
new AlertDialog.Builder(view.getContext())
|
||||
.setTitle("Tilde Friends")
|
||||
.setMessage(message)
|
||||
.setView(input)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener()
|
||||
{
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
result.confirm(input.getText().toString());
|
||||
}
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener()
|
||||
{
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
result.cancel();
|
||||
}
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
** https://stackoverflow.com/questions/5907369/file-upload-in-webview
|
||||
** https://stackoverflow.com/questions/8586691/how-to-open-file-save-dialog-in-android
|
||||
|
@ -1071,7 +1071,7 @@ void* tf_http_get_user_data(tf_http_t* http)
|
||||
|
||||
const char* tf_http_get_cookie(const char* cookie_header, const char* name)
|
||||
{
|
||||
if (!cookie_header || !name)
|
||||
if (!cookie_header)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ const int64_t k_refresh_interval = 1ULL * 7 * 24 * 60 * 60 * 1000;
|
||||
|
||||
static JSValue _authenticate_jwt(tf_ssb_t* ssb, JSContext* context, const char* jwt);
|
||||
static JSValue _httpd_websocket_upgrade(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
|
||||
static const char* _make_session_jwt(JSContext* context, tf_ssb_t* ssb, const char* name);
|
||||
static const char* _make_session_jwt(tf_ssb_t* ssb, const char* name);
|
||||
static const char* _make_set_session_cookie_header(tf_http_request_t* request, const char* session_cookie);
|
||||
|
||||
static JSClassID _httpd_class_id;
|
||||
@ -334,7 +334,7 @@ static JSValue _httpd_websocket_upgrade(JSContext* context, JSValueConst this_va
|
||||
tf_free((void*)session);
|
||||
JSValue name = !JS_IsUndefined(jwt) ? JS_GetPropertyStr(context, jwt, "name") : JS_UNDEFINED;
|
||||
const char* name_string = !JS_IsUndefined(name) ? JS_ToCString(context, name) : NULL;
|
||||
const char* session_token = _make_session_jwt(tf_ssb_get_context(ssb), ssb, name_string);
|
||||
const char* session_token = _make_session_jwt(ssb, name_string);
|
||||
const char* cookie = _make_set_session_cookie_header(request, session_token);
|
||||
tf_free((void*)session_token);
|
||||
JS_FreeCString(context, name_string);
|
||||
@ -1305,7 +1305,7 @@ static bool _is_name_valid(const char* name)
|
||||
return true;
|
||||
}
|
||||
|
||||
static const char* _make_session_jwt(JSContext* context, tf_ssb_t* ssb, const char* name)
|
||||
static const char* _make_session_jwt(tf_ssb_t* ssb, const char* name)
|
||||
{
|
||||
if (!name || !*name)
|
||||
{
|
||||
@ -1319,6 +1319,7 @@ static const char* _make_session_jwt(JSContext* context, tf_ssb_t* ssb, const ch
|
||||
char header_base64[256];
|
||||
sodium_bin2base64(header_base64, sizeof(header_base64), (uint8_t*)header_json, strlen(header_json), sodium_base64_VARIANT_URLSAFE_NO_PADDING);
|
||||
|
||||
JSContext* context = tf_ssb_get_context(ssb);
|
||||
JSValue payload = JS_NewObject(context);
|
||||
JS_SetPropertyStr(context, payload, "name", JS_NewString(context, name));
|
||||
JS_SetPropertyStr(context, payload, "exp", JS_NewInt64(context, now.tv_sec * 1000 + now.tv_nsec / 1000000LL + k_refresh_interval));
|
||||
@ -1483,39 +1484,27 @@ static void _httpd_endpoint_login_work(tf_ssb_t* ssb, void* user_data)
|
||||
|
||||
if (form_register && strcmp(form_register, "1") == 0)
|
||||
{
|
||||
bool registered = false;
|
||||
if (!have_account && _is_name_valid(account_name) && password && confirm && strcmp(password, confirm) == 0)
|
||||
if (!have_account && _is_name_valid(account_name) && password && confirm && strcmp(password, confirm) == 0 &&
|
||||
tf_ssb_db_register_account(ssb, account_name, password))
|
||||
{
|
||||
sqlite3* db = tf_ssb_acquire_db_writer(ssb);
|
||||
registered = tf_ssb_db_register_account(tf_ssb_get_loop(ssb), db, context, account_name, password);
|
||||
tf_ssb_release_db_writer(ssb, db);
|
||||
if (registered)
|
||||
{
|
||||
tf_free((void*)send_session);
|
||||
send_session = _make_session_jwt(context, ssb, account_name);
|
||||
may_become_first_admin = true;
|
||||
}
|
||||
tf_free((void*)send_session);
|
||||
send_session = _make_session_jwt(ssb, account_name);
|
||||
may_become_first_admin = true;
|
||||
}
|
||||
if (!registered)
|
||||
else
|
||||
{
|
||||
login_error = "Error registering account.";
|
||||
}
|
||||
}
|
||||
else if (change && strcmp(change, "1") == 0)
|
||||
{
|
||||
bool set = false;
|
||||
if (have_account && _is_name_valid(account_name) && new_password && confirm && strcmp(new_password, confirm) == 0 && _verify_password(password, account_passwd))
|
||||
if (have_account && _is_name_valid(account_name) && new_password && confirm && strcmp(new_password, confirm) == 0 && _verify_password(password, account_passwd) &&
|
||||
tf_ssb_db_set_account_password(ssb, account_name, new_password))
|
||||
{
|
||||
sqlite3* db = tf_ssb_acquire_db_writer(ssb);
|
||||
set = tf_ssb_db_set_account_password(tf_ssb_get_loop(ssb), db, context, account_name, new_password);
|
||||
tf_ssb_release_db_writer(ssb, db);
|
||||
if (set)
|
||||
{
|
||||
tf_free((void*)send_session);
|
||||
send_session = _make_session_jwt(context, ssb, account_name);
|
||||
}
|
||||
tf_free((void*)send_session);
|
||||
send_session = _make_session_jwt(ssb, account_name);
|
||||
}
|
||||
if (!set)
|
||||
else
|
||||
{
|
||||
login_error = "Error changing password.";
|
||||
}
|
||||
@ -1525,7 +1514,7 @@ static void _httpd_endpoint_login_work(tf_ssb_t* ssb, void* user_data)
|
||||
if (have_account && *account_passwd && _verify_password(password, account_passwd))
|
||||
{
|
||||
tf_free((void*)send_session);
|
||||
send_session = _make_session_jwt(context, ssb, account_name);
|
||||
send_session = _make_session_jwt(ssb, account_name);
|
||||
may_become_first_admin = true;
|
||||
}
|
||||
else
|
||||
@ -1537,7 +1526,7 @@ static void _httpd_endpoint_login_work(tf_ssb_t* ssb, void* user_data)
|
||||
else
|
||||
{
|
||||
tf_free((void*)send_session);
|
||||
send_session = _make_session_jwt(context, ssb, "guest");
|
||||
send_session = _make_session_jwt(ssb, "guest");
|
||||
}
|
||||
tf_free(post_form_data);
|
||||
}
|
||||
|
13
src/main.c
13
src/main.c
@ -9,7 +9,6 @@
|
||||
#include "tests.h"
|
||||
#include "util.js.h"
|
||||
|
||||
#include "ares.h"
|
||||
#include "backtrace.h"
|
||||
#include "sqlite3.h"
|
||||
#include "unzip.h"
|
||||
@ -751,7 +750,7 @@ static void _tf_service_stop()
|
||||
(*s_jni_env)->CallStaticVoidMethod(s_jni_env, c, stop_sandbox);
|
||||
}
|
||||
|
||||
static jint _tf_server_main(JNIEnv* env, jobject this_object, jstring files_dir, jstring apk_path, jstring out_port_file_path, jobject connectivity_manager)
|
||||
static jint _tf_server_main(JNIEnv* env, jobject this_object, jstring files_dir, jstring apk_path, jstring out_port_file_path)
|
||||
{
|
||||
s_jni_env = env;
|
||||
|
||||
@ -759,9 +758,6 @@ static jint _tf_server_main(JNIEnv* env, jobject this_object, jstring files_dir,
|
||||
_startup(0, (char*[]) { NULL });
|
||||
tf_printf("That was startup.\n");
|
||||
|
||||
ares_library_init_android(connectivity_manager);
|
||||
ares_library_init(0);
|
||||
|
||||
const char* files = (*env)->GetStringUTFChars(env, files_dir, NULL);
|
||||
const char* apk = (*env)->GetStringUTFChars(env, apk_path, NULL);
|
||||
const char* out_port_file = (*env)->GetStringUTFChars(env, out_port_file_path, NULL);
|
||||
@ -798,7 +794,6 @@ static jint _tf_server_main(JNIEnv* env, jobject this_object, jstring files_dir,
|
||||
(*env)->ReleaseStringUTFChars(env, apk_path, apk);
|
||||
(*env)->ReleaseStringUTFChars(env, out_port_file_path, out_port_file);
|
||||
|
||||
ares_library_cleanup();
|
||||
tf_mem_shutdown();
|
||||
tf_printf("tf_server_main finished with %d.", result);
|
||||
|
||||
@ -851,7 +846,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
|
||||
tf_printf("Registering method.\n");
|
||||
static const JNINativeMethod methods[] = {
|
||||
{ "tf_server_main", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/net/ConnectivityManager;)I", _tf_server_main },
|
||||
{ "tf_server_main", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I", _tf_server_main },
|
||||
{ "tf_sandbox_main", "(I)I", _tf_sandbox_main },
|
||||
};
|
||||
int result = (*env)->RegisterNatives(env, c, methods, (int)_countof(methods));
|
||||
@ -860,8 +855,6 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
return result;
|
||||
}
|
||||
|
||||
ares_library_init_jvm(vm);
|
||||
|
||||
tf_printf("Done.\n");
|
||||
return JNI_VERSION_1_6;
|
||||
}
|
||||
@ -896,7 +889,6 @@ void tf_run_thread_start(const char* zip_path)
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
_startup(argc, argv);
|
||||
ares_library_init(0);
|
||||
|
||||
int result = 0;
|
||||
if (argc >= 2)
|
||||
@ -917,7 +909,6 @@ int main(int argc, char* argv[])
|
||||
result = _tf_command_run(argv[0], argc, argv);
|
||||
}
|
||||
done:
|
||||
ares_library_cleanup();
|
||||
tf_mem_shutdown();
|
||||
return result;
|
||||
}
|
||||
|
103
src/ssb.c
103
src/ssb.c
@ -77,9 +77,6 @@ enum
|
||||
k_tf_ssb_rpc_message_body_length_max = 1 * 1024 * 1024,
|
||||
k_debug_close_message_count = 256,
|
||||
k_debug_close_connection_count = 32,
|
||||
k_seed_expire_seconds = 10 * 60,
|
||||
k_seed_check_interval_seconds = 5 * 60,
|
||||
k_udp_discovery_expires_seconds = 10,
|
||||
};
|
||||
|
||||
typedef struct _tf_ssb_broadcast_t tf_ssb_broadcast_t;
|
||||
@ -119,9 +116,7 @@ typedef struct _tf_ssb_broadcast_t
|
||||
tf_ssb_broadcast_t* next;
|
||||
time_t ctime;
|
||||
time_t mtime;
|
||||
time_t expires_at;
|
||||
char host[256];
|
||||
tf_ssb_broadcast_origin_t origin;
|
||||
struct sockaddr_in addr;
|
||||
tf_ssb_connection_t* tunnel_connection;
|
||||
uint8_t pub[crypto_sign_PUBLICKEYBYTES];
|
||||
@ -265,11 +260,8 @@ typedef struct _tf_ssb_t
|
||||
|
||||
uv_thread_t thread_self;
|
||||
bool is_room;
|
||||
bool is_replicator;
|
||||
bool is_peer_exchange;
|
||||
char* room_name;
|
||||
char seeds_host[256];
|
||||
time_t last_seed_check;
|
||||
|
||||
tf_ssb_timer_t** timers;
|
||||
int timers_count;
|
||||
@ -365,7 +357,7 @@ static JSClassID _connection_class_id;
|
||||
static int s_connection_index;
|
||||
static int s_tunnel_index;
|
||||
|
||||
static void _tf_ssb_add_broadcast(tf_ssb_t* ssb, const tf_ssb_broadcast_t* broadcast, int expires_seconds);
|
||||
static void _tf_ssb_add_broadcast(tf_ssb_t* ssb, const tf_ssb_broadcast_t* broadcast);
|
||||
static void _tf_ssb_connection_client_send_hello(tf_ssb_connection_t* connection);
|
||||
static void _tf_ssb_connection_close(tf_ssb_connection_t* connection, const char* reason);
|
||||
static void _tf_ssb_connection_destroy(tf_ssb_connection_t* connection, const char* reason);
|
||||
@ -2198,7 +2190,6 @@ tf_ssb_t* tf_ssb_create(uv_loop_t* loop, JSContext* context, const char* db_path
|
||||
{
|
||||
tf_ssb_t* ssb = tf_malloc(sizeof(tf_ssb_t));
|
||||
memset(ssb, 0, sizeof(*ssb));
|
||||
ssb->is_replicator = true;
|
||||
|
||||
const char* actual_key = network_key ? network_key : k_ssb_network_string;
|
||||
if (sodium_hex2bin(ssb->network_key, sizeof(ssb->network_key), actual_key, strlen(actual_key), ": ", NULL, NULL))
|
||||
@ -2402,14 +2393,6 @@ tf_trace_t* tf_ssb_get_trace(tf_ssb_t* ssb)
|
||||
|
||||
JSContext* tf_ssb_get_context(tf_ssb_t* ssb)
|
||||
{
|
||||
if (ssb->thread_self && uv_thread_self() != ssb->thread_self)
|
||||
{
|
||||
const char* bt = tf_util_backtrace_string();
|
||||
tf_printf("Acquiring JS context from non-main thread:\n%s\n", bt);
|
||||
tf_free((void*)bt);
|
||||
abort();
|
||||
}
|
||||
|
||||
return ssb->context;
|
||||
}
|
||||
|
||||
@ -2960,10 +2943,10 @@ static void _tf_ssb_update_seeds_after_work(tf_ssb_t* ssb, int status, void* use
|
||||
seeds_t* seeds = user_data;
|
||||
for (int i = 0; i < seeds->seeds_count; i++)
|
||||
{
|
||||
tf_ssb_broadcast_t broadcast = { .origin = k_tf_ssb_broadcast_origin_peer_exchange };
|
||||
tf_ssb_broadcast_t broadcast = { 0 };
|
||||
if (_tf_ssb_parse_broadcast(seeds->seeds[i], &broadcast))
|
||||
{
|
||||
_tf_ssb_add_broadcast(ssb, &broadcast, k_seed_expire_seconds);
|
||||
_tf_ssb_add_broadcast(ssb, &broadcast);
|
||||
}
|
||||
tf_free(seeds->seeds[i]);
|
||||
}
|
||||
@ -2988,12 +2971,11 @@ static void _tf_ssb_broadcast_timer(uv_timer_t* timer)
|
||||
uv_free_interface_addresses(info, count);
|
||||
}
|
||||
|
||||
time_t now = time(NULL);
|
||||
if (ssb->is_peer_exchange && *ssb->seeds_host && now - ssb->last_seed_check > k_seed_check_interval_seconds)
|
||||
seeds_t* seeds = tf_malloc(sizeof(seeds_t));
|
||||
*seeds = (seeds_t) { 0 };
|
||||
|
||||
if (*ssb->seeds_host)
|
||||
{
|
||||
seeds_t* seeds = tf_malloc(sizeof(seeds_t));
|
||||
*seeds = (seeds_t) { 0 };
|
||||
ssb->last_seed_check = now;
|
||||
tf_ssb_run_work(ssb, _tf_ssb_update_seeds_work, _tf_ssb_update_seeds_after_work, seeds);
|
||||
}
|
||||
}
|
||||
@ -3039,21 +3021,6 @@ int tf_ssb_server_open(tf_ssb_t* ssb, int port)
|
||||
return status == 0 ? assigned_port : 0;
|
||||
}
|
||||
|
||||
int tf_ssb_server_get_port(tf_ssb_t* ssb)
|
||||
{
|
||||
int port = 0;
|
||||
if (ssb && ssb->server.data)
|
||||
{
|
||||
struct sockaddr_storage name = { 0 };
|
||||
int size = (int)sizeof(name);
|
||||
if (uv_tcp_getsockname(&ssb->server, (struct sockaddr*)&name, &size) == 0)
|
||||
{
|
||||
port = ntohs(((struct sockaddr_in*)&name)->sin_port);
|
||||
}
|
||||
}
|
||||
return port;
|
||||
}
|
||||
|
||||
void tf_ssb_server_close(tf_ssb_t* ssb)
|
||||
{
|
||||
if (ssb->server.data && !uv_is_closing((uv_handle_t*)&ssb->server))
|
||||
@ -3123,7 +3090,7 @@ static void _tf_ssb_notify_broadcasts_changed(tf_ssb_t* ssb)
|
||||
}
|
||||
}
|
||||
|
||||
static void _tf_ssb_add_broadcast(tf_ssb_t* ssb, const tf_ssb_broadcast_t* broadcast, int expires_seconds)
|
||||
static void _tf_ssb_add_broadcast(tf_ssb_t* ssb, const tf_ssb_broadcast_t* broadcast)
|
||||
{
|
||||
if (memcmp(broadcast->pub, ssb->pub, sizeof(ssb->pub)) == 0)
|
||||
{
|
||||
@ -3137,7 +3104,6 @@ static void _tf_ssb_add_broadcast(tf_ssb_t* ssb, const tf_ssb_broadcast_t* broad
|
||||
if (node->tunnel_connection == broadcast->tunnel_connection && memcmp(node->pub, broadcast->pub, sizeof(node->pub)) == 0)
|
||||
{
|
||||
node->mtime = time(NULL);
|
||||
node->expires_at = node->mtime + expires_seconds;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -3150,7 +3116,6 @@ static void _tf_ssb_add_broadcast(tf_ssb_t* ssb, const tf_ssb_broadcast_t* broad
|
||||
node->addr.sin_addr.s_addr == broadcast->addr.sin_addr.s_addr && memcmp(node->pub, broadcast->pub, sizeof(node->pub)) == 0)
|
||||
{
|
||||
node->mtime = time(NULL);
|
||||
node->expires_at = node->mtime + expires_seconds;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -3167,22 +3132,12 @@ static void _tf_ssb_add_broadcast(tf_ssb_t* ssb, const tf_ssb_broadcast_t* broad
|
||||
node->next = ssb->broadcasts;
|
||||
node->ctime = time(NULL);
|
||||
node->mtime = node->ctime;
|
||||
node->expires_at = node->mtime + expires_seconds;
|
||||
ssb->broadcasts = node;
|
||||
ssb->broadcasts_count++;
|
||||
|
||||
_tf_ssb_notify_broadcasts_changed(ssb);
|
||||
}
|
||||
|
||||
void tf_ssb_add_broadcast(tf_ssb_t* ssb, const char* connection, tf_ssb_broadcast_origin_t origin, int64_t expires_seconds)
|
||||
{
|
||||
tf_ssb_broadcast_t broadcast = { .origin = origin };
|
||||
if (_tf_ssb_parse_broadcast(connection, &broadcast))
|
||||
{
|
||||
_tf_ssb_add_broadcast(ssb, &broadcast, expires_seconds);
|
||||
}
|
||||
}
|
||||
|
||||
static void _tf_ssb_on_broadcast_listener_recv(uv_udp_t* handle, ssize_t nread, const uv_buf_t* buf, const struct sockaddr* addr, unsigned flags)
|
||||
{
|
||||
if (nread <= 0)
|
||||
@ -3199,19 +3154,18 @@ static void _tf_ssb_on_broadcast_listener_recv(uv_udp_t* handle, ssize_t nread,
|
||||
char* entry = strtok_r(buf->base, k_delim, &state);
|
||||
while (entry)
|
||||
{
|
||||
tf_ssb_broadcast_t broadcast = { .origin = k_tf_ssb_broadcast_origin_discovery };
|
||||
tf_ssb_broadcast_t broadcast = { 0 };
|
||||
if (_tf_ssb_parse_broadcast(entry, &broadcast))
|
||||
{
|
||||
_tf_ssb_add_broadcast(ssb, &broadcast, k_udp_discovery_expires_seconds);
|
||||
_tf_ssb_add_broadcast(ssb, &broadcast);
|
||||
}
|
||||
entry = strtok_r(NULL, k_delim, &state);
|
||||
}
|
||||
tf_free(buf->base);
|
||||
}
|
||||
|
||||
void tf_ssb_visit_broadcasts(tf_ssb_t* ssb,
|
||||
void (*callback)(const char* host, const struct sockaddr_in* addr, tf_ssb_broadcast_origin_t origin, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data),
|
||||
void* user_data)
|
||||
void tf_ssb_visit_broadcasts(
|
||||
tf_ssb_t* ssb, void (*callback)(const char* host, const struct sockaddr_in* addr, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data), void* user_data)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
tf_ssb_broadcast_t* next = NULL;
|
||||
@ -3221,7 +3175,7 @@ void tf_ssb_visit_broadcasts(tf_ssb_t* ssb,
|
||||
if (node->mtime - now < 60)
|
||||
{
|
||||
tf_trace_begin(ssb->trace, "broadcast");
|
||||
callback(node->host, &node->addr, node->origin, node->tunnel_connection, node->pub, user_data);
|
||||
callback(node->host, &node->addr, node->tunnel_connection, node->pub, user_data);
|
||||
tf_trace_end(ssb->trace);
|
||||
}
|
||||
}
|
||||
@ -3234,7 +3188,7 @@ static void _tf_ssb_broadcast_cleanup_timer(uv_timer_t* timer)
|
||||
time_t now = time(NULL);
|
||||
for (tf_ssb_broadcast_t** it = &ssb->broadcasts; *it;)
|
||||
{
|
||||
if (!(*it)->tunnel_connection && now > (*it)->expires_at)
|
||||
if (!(*it)->tunnel_connection && (*it)->mtime < now - 10)
|
||||
{
|
||||
tf_ssb_broadcast_t* node = *it;
|
||||
*it = node->next;
|
||||
@ -3647,11 +3601,10 @@ void tf_ssb_notify_blob_want_added(tf_ssb_t* ssb, const char* id)
|
||||
void tf_ssb_connection_add_room_attendant(tf_ssb_connection_t* connection, const char* id)
|
||||
{
|
||||
tf_ssb_broadcast_t broadcast = {
|
||||
.origin = k_tf_ssb_broadcast_origin_room,
|
||||
.tunnel_connection = connection,
|
||||
};
|
||||
tf_ssb_id_str_to_bin(broadcast.pub, id);
|
||||
_tf_ssb_add_broadcast(connection->ssb, &broadcast, 0);
|
||||
_tf_ssb_add_broadcast(connection->ssb, &broadcast);
|
||||
}
|
||||
|
||||
void tf_ssb_connection_remove_room_attendant(tf_ssb_connection_t* connection, const char* id)
|
||||
@ -4032,26 +3985,6 @@ const char* tf_ssb_get_room_name(tf_ssb_t* ssb)
|
||||
return ssb->room_name;
|
||||
}
|
||||
|
||||
bool tf_ssb_is_replicator(tf_ssb_t* ssb)
|
||||
{
|
||||
return ssb->is_replicator;
|
||||
}
|
||||
|
||||
void tf_ssb_set_is_replicator(tf_ssb_t* ssb, bool is_replicator)
|
||||
{
|
||||
ssb->is_replicator = is_replicator;
|
||||
}
|
||||
|
||||
bool tf_ssb_is_peer_exchange(tf_ssb_t* ssb)
|
||||
{
|
||||
return ssb->is_peer_exchange;
|
||||
}
|
||||
|
||||
void tf_ssb_set_is_peer_exchange(tf_ssb_t* ssb, bool is_peer_exchange)
|
||||
{
|
||||
ssb->is_peer_exchange = is_peer_exchange;
|
||||
}
|
||||
|
||||
void tf_ssb_set_room_name(tf_ssb_t* ssb, const char* room_name)
|
||||
{
|
||||
tf_free(ssb->room_name);
|
||||
@ -4061,8 +3994,6 @@ void tf_ssb_set_room_name(tf_ssb_t* ssb, const char* room_name)
|
||||
typedef struct _update_settings_t
|
||||
{
|
||||
bool is_room;
|
||||
bool is_replicator;
|
||||
bool is_peer_exchange;
|
||||
char seeds_host[256];
|
||||
char room_name[1024];
|
||||
} update_settings_t;
|
||||
@ -4120,8 +4051,6 @@ static void _tf_ssb_update_settings_work(tf_ssb_t* ssb, void* user_data)
|
||||
{
|
||||
update_settings_t* update = user_data;
|
||||
update->is_room = _get_global_setting_bool(ssb, "room", true);
|
||||
update->is_replicator = _get_global_setting_bool(ssb, "replicator", true);
|
||||
update->is_peer_exchange = _get_global_setting_bool(ssb, "peer_exchange", true);
|
||||
_get_global_setting_string(ssb, "room_name", update->room_name, sizeof(update->room_name));
|
||||
_get_global_setting_string(ssb, "seeds_host", update->seeds_host, sizeof(update->seeds_host));
|
||||
}
|
||||
@ -4131,8 +4060,6 @@ static void _tf_ssb_update_settings_after_work(tf_ssb_t* ssb, int result, void*
|
||||
update_settings_t* update = user_data;
|
||||
tf_ssb_set_is_room(ssb, update->is_room);
|
||||
tf_ssb_set_room_name(ssb, update->room_name);
|
||||
tf_ssb_set_is_peer_exchange(ssb, update->is_peer_exchange);
|
||||
tf_ssb_set_is_replicator(ssb, update->is_replicator);
|
||||
snprintf(ssb->seeds_host, sizeof(ssb->seeds_host), "%s", update->seeds_host);
|
||||
_tf_ssb_start_update_settings(ssb);
|
||||
tf_free(update);
|
||||
|
84
src/ssb.db.c
84
src/ssb.db.c
@ -1644,13 +1644,14 @@ bool tf_ssb_db_get_account_password_hash(tf_ssb_t* ssb, const char* name, char*
|
||||
return result;
|
||||
}
|
||||
|
||||
bool tf_ssb_db_set_account_password(uv_loop_t* loop, sqlite3* db, JSContext* context, const char* name, const char* password)
|
||||
bool tf_ssb_db_set_account_password(tf_ssb_t* ssb, const char* name, const char* password)
|
||||
{
|
||||
JSContext* context = tf_ssb_get_context(ssb);
|
||||
bool result = false;
|
||||
static const int k_salt_length = 12;
|
||||
|
||||
char buffer[16];
|
||||
size_t bytes = uv_random(loop, &(uv_random_t) { 0 }, buffer, sizeof(buffer), 0, NULL) == 0 ? sizeof(buffer) : 0;
|
||||
size_t bytes = uv_random(tf_ssb_get_loop(ssb), &(uv_random_t) { 0 }, buffer, sizeof(buffer), 0, NULL) == 0 ? sizeof(buffer) : 0;
|
||||
char output[7 + 22 + 1];
|
||||
char* salt = crypt_gensalt_rn("$2b$", k_salt_length, buffer, bytes, output, sizeof(output));
|
||||
char hash_output[7 + 22 + 31 + 1];
|
||||
@ -1662,6 +1663,7 @@ bool tf_ssb_db_set_account_password(uv_loop_t* loop, sqlite3* db, JSContext* con
|
||||
size_t user_length = 0;
|
||||
const char* user_string = JS_ToCStringLen(context, &user_length, user_json);
|
||||
|
||||
sqlite3* db = tf_ssb_acquire_db_writer(ssb);
|
||||
sqlite3_stmt* statement = NULL;
|
||||
if (sqlite3_prepare(db, "INSERT OR REPLACE INTO properties (id, key, value) VALUES ('auth', 'user:' || ?, ?)", -1, &statement, NULL) == SQLITE_OK)
|
||||
{
|
||||
@ -1671,6 +1673,7 @@ bool tf_ssb_db_set_account_password(uv_loop_t* loop, sqlite3* db, JSContext* con
|
||||
}
|
||||
sqlite3_finalize(statement);
|
||||
}
|
||||
tf_ssb_release_db_writer(ssb, db);
|
||||
|
||||
JS_FreeCString(context, user_string);
|
||||
JS_FreeValue(context, user_json);
|
||||
@ -1678,70 +1681,47 @@ bool tf_ssb_db_set_account_password(uv_loop_t* loop, sqlite3* db, JSContext* con
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool _tf_ssb_db_get_global_setting_bool(sqlite3* db, const char* name, bool default_value)
|
||||
bool tf_ssb_db_register_account(tf_ssb_t* ssb, const char* name, const char* password)
|
||||
{
|
||||
bool result = default_value;
|
||||
sqlite3_stmt* statement;
|
||||
if (sqlite3_prepare(db, "SELECT json_extract(value, '$.' || ?) FROM properties WHERE id = 'core' AND key = 'settings'", -1, &statement, NULL) == SQLITE_OK)
|
||||
bool result = false;
|
||||
JSContext* context = tf_ssb_get_context(ssb);
|
||||
JSValue users_array = JS_UNDEFINED;
|
||||
|
||||
sqlite3* db = tf_ssb_acquire_db_writer(ssb);
|
||||
sqlite3_stmt* statement = NULL;
|
||||
if (sqlite3_prepare(db, "SELECT value FROM properties WHERE id = 'auth' AND key = 'users'", -1, &statement, NULL) == SQLITE_OK)
|
||||
{
|
||||
if (sqlite3_bind_text(statement, 1, name, -1, NULL) == SQLITE_OK)
|
||||
if (sqlite3_step(statement) == SQLITE_ROW)
|
||||
{
|
||||
if (sqlite3_step(statement) == SQLITE_ROW && sqlite3_column_type(statement, 0) != SQLITE_NULL)
|
||||
{
|
||||
result = sqlite3_column_int(statement, 0) != 0;
|
||||
}
|
||||
users_array = JS_ParseJSON(context, (const char*)sqlite3_column_text(statement, 0), sqlite3_column_bytes(statement, 0), NULL);
|
||||
}
|
||||
sqlite3_finalize(statement);
|
||||
}
|
||||
else
|
||||
if (JS_IsUndefined(users_array))
|
||||
{
|
||||
tf_printf("prepare failed: %s\n", sqlite3_errmsg(db));
|
||||
users_array = JS_NewArray(context);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
int length = tf_util_get_length(context, users_array);
|
||||
JS_SetPropertyUint32(context, users_array, length, JS_NewString(context, name));
|
||||
|
||||
bool tf_ssb_db_register_account(uv_loop_t* loop, sqlite3* db, JSContext* context, const char* name, const char* password)
|
||||
{
|
||||
bool result = false;
|
||||
JSValue users_array = JS_UNDEFINED;
|
||||
|
||||
bool registration_allowed = _tf_ssb_db_get_global_setting_bool(db, "account_registration", true);
|
||||
if (registration_allowed)
|
||||
JSValue json = JS_JSONStringify(context, users_array, JS_NULL, JS_NULL);
|
||||
JS_FreeValue(context, users_array);
|
||||
size_t value_length = 0;
|
||||
const char* value = JS_ToCStringLen(context, &value_length, json);
|
||||
if (sqlite3_prepare(db, "INSERT OR REPLACE INTO properties (id, key, value) VALUES ('auth', 'users', ?)", -1, &statement, NULL) == SQLITE_OK)
|
||||
{
|
||||
sqlite3_stmt* statement = NULL;
|
||||
if (sqlite3_prepare(db, "SELECT value FROM properties WHERE id = 'auth' AND key = 'users'", -1, &statement, NULL) == SQLITE_OK)
|
||||
if (sqlite3_bind_text(statement, 1, value, value_length, NULL) == SQLITE_OK)
|
||||
{
|
||||
if (sqlite3_step(statement) == SQLITE_ROW)
|
||||
{
|
||||
users_array = JS_ParseJSON(context, (const char*)sqlite3_column_text(statement, 0), sqlite3_column_bytes(statement, 0), NULL);
|
||||
}
|
||||
sqlite3_finalize(statement);
|
||||
tf_printf("added user to properties\n");
|
||||
result = sqlite3_step(statement) == SQLITE_DONE;
|
||||
}
|
||||
if (JS_IsUndefined(users_array))
|
||||
{
|
||||
users_array = JS_NewArray(context);
|
||||
}
|
||||
int length = tf_util_get_length(context, users_array);
|
||||
JS_SetPropertyUint32(context, users_array, length, JS_NewString(context, name));
|
||||
|
||||
JSValue json = JS_JSONStringify(context, users_array, JS_NULL, JS_NULL);
|
||||
JS_FreeValue(context, users_array);
|
||||
size_t value_length = 0;
|
||||
const char* value = JS_ToCStringLen(context, &value_length, json);
|
||||
if (sqlite3_prepare(db, "INSERT OR REPLACE INTO properties (id, key, value) VALUES ('auth', 'users', ?)", -1, &statement, NULL) == SQLITE_OK)
|
||||
{
|
||||
if (sqlite3_bind_text(statement, 1, value, value_length, NULL) == SQLITE_OK)
|
||||
{
|
||||
tf_printf("added user to properties\n");
|
||||
result = sqlite3_step(statement) == SQLITE_DONE;
|
||||
}
|
||||
sqlite3_finalize(statement);
|
||||
}
|
||||
JS_FreeCString(context, value);
|
||||
JS_FreeValue(context, json);
|
||||
sqlite3_finalize(statement);
|
||||
}
|
||||
JS_FreeCString(context, value);
|
||||
JS_FreeValue(context, json);
|
||||
tf_ssb_release_db_writer(ssb, db);
|
||||
|
||||
result = result && tf_ssb_db_set_account_password(loop, db, context, name, password);
|
||||
result = result && tf_ssb_db_set_account_password(ssb, name, password);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
12
src/ssb.db.h
12
src/ssb.db.h
@ -360,25 +360,21 @@ bool tf_ssb_db_get_account_password_hash(tf_ssb_t* ssb, const char* name, char*
|
||||
|
||||
/**
|
||||
** Insert or update a user's hashed password in the database.
|
||||
** @param loop The event loop.
|
||||
** @param db A DB writer.
|
||||
** @param context A JS context.
|
||||
** @param ssb The SSB instance.
|
||||
** @param name The username.
|
||||
** @param password The raw password.
|
||||
** @return true if the hash of the password was successfully stored.
|
||||
*/
|
||||
bool tf_ssb_db_set_account_password(uv_loop_t* loop, sqlite3* db, JSContext* context, const char* name, const char* password);
|
||||
bool tf_ssb_db_set_account_password(tf_ssb_t* ssb, const char* name, const char* password);
|
||||
|
||||
/**
|
||||
** Add a user account to the database.
|
||||
** @param loop The event loop.
|
||||
** @param db A DB writer.
|
||||
** @param context A JS context.
|
||||
** @param ssb The SSB instance.
|
||||
** @param name The username to add.
|
||||
** @param password The user's raw password.
|
||||
** @return true If the user was added successfully.
|
||||
*/
|
||||
bool tf_ssb_db_register_account(uv_loop_t* loop, sqlite3* db, JSContext* context, const char* name, const char* password);
|
||||
bool tf_ssb_db_register_account(tf_ssb_t* ssb, const char* name, const char* password);
|
||||
|
||||
/**
|
||||
** Get an entry from the properties table.
|
||||
|
61
src/ssb.h
61
src/ssb.h
@ -28,8 +28,6 @@ enum
|
||||
k_ssb_rpc_flag_new_request = 0x10,
|
||||
|
||||
k_ssb_blob_bytes_max = 5 * 1024 * 1024,
|
||||
|
||||
k_ssb_peer_exchange_expires_seconds = 60 * 60,
|
||||
};
|
||||
|
||||
/**
|
||||
@ -43,16 +41,6 @@ typedef enum _tf_ssb_change_t
|
||||
k_tf_ssb_change_update,
|
||||
} tf_ssb_change_t;
|
||||
|
||||
/**
|
||||
** The origin of a broadcast entry.
|
||||
*/
|
||||
typedef enum _tf_ssb_broadcast_origin_t
|
||||
{
|
||||
k_tf_ssb_broadcast_origin_discovery,
|
||||
k_tf_ssb_broadcast_origin_room,
|
||||
k_tf_ssb_broadcast_origin_peer_exchange,
|
||||
} tf_ssb_broadcast_origin_t;
|
||||
|
||||
/**
|
||||
** Flags describing the structure of a message.
|
||||
*/
|
||||
@ -311,18 +299,8 @@ bool tf_ssb_whoami(tf_ssb_t* ssb, char* out_id, size_t out_id_size);
|
||||
** @param callback The callback.
|
||||
** @param user_data User data for the callback.
|
||||
*/
|
||||
void tf_ssb_visit_broadcasts(tf_ssb_t* ssb,
|
||||
void (*callback)(const char* host, const struct sockaddr_in* addr, tf_ssb_broadcast_origin_t origin, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data),
|
||||
void* user_data);
|
||||
|
||||
/**
|
||||
** Add a broadcast entry.
|
||||
** @param ssb The SSB instance.
|
||||
** @param connection The connection string to add.
|
||||
** @param origin The origin of the broadcast entry.
|
||||
** @param expires_seconds How long the broadcast entry should last.
|
||||
*/
|
||||
void tf_ssb_add_broadcast(tf_ssb_t* ssb, const char* connection, tf_ssb_broadcast_origin_t origin, int64_t expires_seconds);
|
||||
void tf_ssb_visit_broadcasts(
|
||||
tf_ssb_t* ssb, void (*callback)(const char* host, const struct sockaddr_in* addr, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data), void* user_data);
|
||||
|
||||
/**
|
||||
** Get the identities of all active connections.
|
||||
@ -364,13 +342,6 @@ void tf_ssb_connect_str(tf_ssb_t* ssb, const char* address);
|
||||
*/
|
||||
int tf_ssb_server_open(tf_ssb_t* ssb, int port);
|
||||
|
||||
/**
|
||||
** Determine the port that a server is listening on.
|
||||
** @param ssb The SSB instance.
|
||||
** @return The port number, or 0 if not bound.
|
||||
*/
|
||||
int tf_ssb_server_get_port(tf_ssb_t* ssb);
|
||||
|
||||
/**
|
||||
** Stop listening for SHS connections.
|
||||
** @param ssb The SSB instance.
|
||||
@ -993,34 +964,6 @@ bool tf_ssb_is_room(tf_ssb_t* ssb);
|
||||
*/
|
||||
void tf_ssb_set_is_room(tf_ssb_t* ssb, bool is_room);
|
||||
|
||||
/**
|
||||
** Get whether the running server supports replication of messages and blobs.
|
||||
** @param ssb The SSB instance.
|
||||
** @return True if the server is a replicator.
|
||||
*/
|
||||
bool tf_ssb_is_replicator(tf_ssb_t* ssb);
|
||||
|
||||
/**
|
||||
** Set whether the running server supports replication of messages and blobs.
|
||||
** @param ssb The SSB instance.
|
||||
** @param is_replicator Whether to support replication.
|
||||
*/
|
||||
void tf_ssb_set_is_replicator(tf_ssb_t* ssb, bool is_replicator);
|
||||
|
||||
/**
|
||||
** Get whether the running server participates in peer exchange.
|
||||
** @param ssb The SSB instance.
|
||||
** @return True if the server participates in peer exchange.
|
||||
*/
|
||||
bool tf_ssb_is_peer_exchange(tf_ssb_t* ssb);
|
||||
|
||||
/**
|
||||
** Set whether the running server participates in peer exchange.
|
||||
** @param ssb The SSB instance.
|
||||
** @param is_peer_exchange Whether to participate in peer exchange.
|
||||
*/
|
||||
void tf_ssb_set_is_peer_exchange(tf_ssb_t* ssb, bool is_peer_exchange);
|
||||
|
||||
/**
|
||||
** Get the name of the room hosted by the running server.
|
||||
** @param ssb The SSB instance.
|
||||
|
@ -231,11 +231,7 @@ static void _tf_ssb_import_app_json(tf_ssb_t* ssb, uv_loop_t* loop, JSContext* c
|
||||
|
||||
void tf_ssb_import(tf_ssb_t* ssb, const char* user, const char* path)
|
||||
{
|
||||
if (!path)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (strlen(path) > strlen(".json") && strcasecmp(path + strlen(path) - strlen(".json"), ".json") == 0)
|
||||
if (strlen(path) > strlen(".json") && strcasecmp(path + strlen(path) - strlen(".json"), ".json") == 0)
|
||||
{
|
||||
_tf_ssb_import_app_json(ssb, tf_ssb_get_loop(ssb), tf_ssb_get_context(ssb), user, path);
|
||||
}
|
||||
|
15
src/ssb.js.c
15
src/ssb.js.c
@ -1450,25 +1450,12 @@ typedef struct _broadcasts_t
|
||||
int length;
|
||||
} broadcasts_t;
|
||||
|
||||
static void _tf_ssb_broadcasts_visit(
|
||||
const char* host, const struct sockaddr_in* addr, tf_ssb_broadcast_origin_t origin, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data)
|
||||
static void _tf_ssb_broadcasts_visit(const char* host, const struct sockaddr_in* addr, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data)
|
||||
{
|
||||
broadcasts_t* broadcasts = user_data;
|
||||
JSValue entry = JS_NewObject(broadcasts->context);
|
||||
char pubkey[k_id_base64_len];
|
||||
tf_ssb_id_bin_to_str(pubkey, sizeof(pubkey), pub);
|
||||
switch (origin)
|
||||
{
|
||||
case k_tf_ssb_broadcast_origin_discovery:
|
||||
JS_SetPropertyStr(broadcasts->context, entry, "origin", JS_NewString(broadcasts->context, "discovery"));
|
||||
break;
|
||||
case k_tf_ssb_broadcast_origin_room:
|
||||
JS_SetPropertyStr(broadcasts->context, entry, "origin", JS_NewString(broadcasts->context, "room"));
|
||||
break;
|
||||
case k_tf_ssb_broadcast_origin_peer_exchange:
|
||||
JS_SetPropertyStr(broadcasts->context, entry, "origin", JS_NewString(broadcasts->context, "peer_exchange"));
|
||||
break;
|
||||
}
|
||||
if (tunnel)
|
||||
{
|
||||
JS_SetPropertyStr(broadcasts->context, entry, "tunnel", JS_DupValue(broadcasts->context, tf_ssb_connection_get_object(tunnel)));
|
||||
|
238
src/ssb.rpc.c
238
src/ssb.rpc.c
@ -19,7 +19,6 @@
|
||||
#endif
|
||||
|
||||
static void _tf_ssb_connection_send_history_stream(tf_ssb_connection_t* connection, int32_t request_number, const char* author, int64_t sequence, bool keys, bool live);
|
||||
static void _tf_ssb_rpc_send_peers_exchange(tf_ssb_connection_t* connection);
|
||||
static void _tf_ssb_rpc_start_delete_blobs(tf_ssb_t* ssb, int delay_ms);
|
||||
|
||||
static int64_t _get_global_setting_int64(tf_ssb_t* ssb, const char* name, int64_t default_value)
|
||||
@ -108,12 +107,6 @@ static void _tf_ssb_rpc_blobs_get(tf_ssb_connection_t* connection, uint8_t flags
|
||||
{
|
||||
return;
|
||||
}
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
if (!tf_ssb_is_replicator(ssb))
|
||||
{
|
||||
tf_ssb_connection_rpc_send_error_method_not_allowed(connection, flags, -request_number, "blobs.get");
|
||||
return;
|
||||
}
|
||||
|
||||
tf_ssb_connection_add_request(connection, -request_number, "blobs.get", _tf_ssb_rpc_blobs_get_callback, NULL, NULL, NULL);
|
||||
JSContext* context = tf_ssb_connection_get_context(connection);
|
||||
@ -148,51 +141,18 @@ static void _tf_ssb_rpc_blobs_get(tf_ssb_connection_t* connection, uint8_t flags
|
||||
JS_FreeValue(context, ids);
|
||||
}
|
||||
|
||||
typedef struct _blobs_has_work_t
|
||||
{
|
||||
int64_t request_number;
|
||||
char id[k_id_base64_len];
|
||||
bool found;
|
||||
} blobs_has_work_t;
|
||||
|
||||
static void _tf_ssb_rpc_blobs_has_work(tf_ssb_connection_t* connection, void* user_data)
|
||||
{
|
||||
blobs_has_work_t* work = user_data;
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
work->found = tf_ssb_db_blob_has(ssb, work->id);
|
||||
}
|
||||
|
||||
static void _tf_ssb_rpc_blobs_has_after_work(tf_ssb_connection_t* connection, int status, void* user_data)
|
||||
{
|
||||
blobs_has_work_t* work = user_data;
|
||||
tf_ssb_connection_rpc_send(connection, k_ssb_rpc_flag_json | k_ssb_rpc_flag_end_error | k_ssb_rpc_flag_stream, -work->request_number, NULL,
|
||||
(const uint8_t*)(work->found ? "true" : "false"), strlen(work->found ? "true" : "false"), NULL, NULL, NULL);
|
||||
tf_free(work);
|
||||
}
|
||||
|
||||
static void _tf_ssb_rpc_blobs_has(tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, JSValue args, const uint8_t* message, size_t size, void* user_data)
|
||||
{
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
if (!tf_ssb_is_replicator(ssb))
|
||||
{
|
||||
tf_ssb_connection_rpc_send_error_method_not_allowed(connection, flags, -request_number, "blobs.has");
|
||||
return;
|
||||
}
|
||||
JSContext* context = tf_ssb_connection_get_context(connection);
|
||||
JSValue ids = JS_GetPropertyStr(context, args, "args");
|
||||
JSValue id = JS_GetPropertyUint32(context, ids, 0);
|
||||
const char* id_str = JS_ToCString(context, id);
|
||||
|
||||
blobs_has_work_t* work = tf_malloc(sizeof(blobs_has_work_t));
|
||||
*work = (blobs_has_work_t) {
|
||||
.request_number = request_number,
|
||||
};
|
||||
snprintf(work->id, sizeof(work->id), "%s", id_str);
|
||||
tf_ssb_connection_run_work(connection, _tf_ssb_rpc_blobs_has_work, _tf_ssb_rpc_blobs_has_after_work, work);
|
||||
|
||||
bool has = tf_ssb_db_blob_has(ssb, id_str);
|
||||
JS_FreeCString(context, id_str);
|
||||
JS_FreeValue(context, id);
|
||||
JS_FreeValue(context, ids);
|
||||
tf_ssb_connection_rpc_send(connection, k_ssb_rpc_flag_json, -request_number, NULL, (const uint8_t*)(has ? "true" : "false"), strlen(has ? "true" : "false"), NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static void _tf_ssb_rpc_blob_wants_added_callback(tf_ssb_t* ssb, const char* id, void* user_data)
|
||||
@ -282,13 +242,8 @@ static void _tf_ssb_rpc_request_more_blobs(tf_ssb_connection_t* connection)
|
||||
static void _tf_ssb_rpc_blobs_createWants(
|
||||
tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, JSValue args, const uint8_t* message, size_t size, void* user_data)
|
||||
{
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
if (!tf_ssb_is_replicator(ssb))
|
||||
{
|
||||
tf_ssb_connection_rpc_send_error_method_not_allowed(connection, flags, -request_number, "blobs.createWants");
|
||||
return;
|
||||
}
|
||||
tf_ssb_blob_wants_t* blob_wants = tf_ssb_connection_get_blob_wants_state(connection);
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
tf_ssb_add_blob_want_added_callback(ssb, _tf_ssb_rpc_blob_wants_added_callback, NULL, connection);
|
||||
blob_wants->request_number = request_number;
|
||||
_tf_ssb_rpc_request_more_blobs(connection);
|
||||
@ -605,7 +560,6 @@ static void _tf_ssb_rpc_connection_blobs_createWants_callback(
|
||||
if (!JS_IsUndefined(name))
|
||||
{
|
||||
/* { name: "Error" } */
|
||||
tf_ssb_connection_remove_request(connection, -request_number);
|
||||
JS_FreeValue(context, name);
|
||||
return;
|
||||
}
|
||||
@ -901,11 +855,6 @@ static void _tf_ssb_rpc_createHistoryStream(
|
||||
tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, JSValue args, const uint8_t* message, size_t size, void* user_data)
|
||||
{
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
if (!tf_ssb_is_replicator(ssb))
|
||||
{
|
||||
tf_ssb_connection_rpc_send_error_method_not_allowed(connection, flags, -request_number, "createHistoryStream");
|
||||
return;
|
||||
}
|
||||
JSContext* context = tf_ssb_get_context(ssb);
|
||||
JSValue arg_array = JS_GetPropertyStr(context, args, "args");
|
||||
JSValue arg = JS_GetPropertyUint32(context, arg_array, 0);
|
||||
@ -1137,7 +1086,6 @@ static void _tf_ssb_rpc_ebt_replicate(tf_ssb_connection_t* connection, uint8_t f
|
||||
if (_is_error(context, args))
|
||||
{
|
||||
/* TODO: Send createHistoryStream. */
|
||||
tf_ssb_connection_remove_request(connection, -request_number);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1209,12 +1157,6 @@ static void _tf_ssb_rpc_ebt_replicate_server(
|
||||
{
|
||||
return;
|
||||
}
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
if (!tf_ssb_is_replicator(ssb))
|
||||
{
|
||||
tf_ssb_connection_rpc_send_error_method_not_allowed(connection, flags, -request_number, "ebt.replicate");
|
||||
return;
|
||||
}
|
||||
_tf_ssb_rpc_ebt_replicate(connection, flags, request_number, args, message, size, user_data);
|
||||
tf_ssb_connection_add_request(connection, -request_number, "ebt.replicate", _tf_ssb_rpc_ebt_replicate, NULL, NULL, NULL);
|
||||
}
|
||||
@ -1224,24 +1166,21 @@ static void _tf_ssb_rpc_connections_changed_callback(tf_ssb_t* ssb, tf_ssb_chang
|
||||
JSContext* context = tf_ssb_get_context(ssb);
|
||||
if (change == k_tf_ssb_change_connect)
|
||||
{
|
||||
if (tf_ssb_is_replicator(ssb))
|
||||
{
|
||||
JSValue message = JS_NewObject(context);
|
||||
JSValue name = JS_NewArray(context);
|
||||
JS_SetPropertyUint32(context, name, 0, JS_NewString(context, "blobs"));
|
||||
JS_SetPropertyUint32(context, name, 1, JS_NewString(context, "createWants"));
|
||||
JS_SetPropertyStr(context, message, "name", name);
|
||||
JS_SetPropertyStr(context, message, "type", JS_NewString(context, "source"));
|
||||
JS_SetPropertyStr(context, message, "args", JS_NewArray(context));
|
||||
tf_ssb_connection_rpc_send_json(connection, k_ssb_rpc_flag_stream | k_ssb_rpc_flag_new_request, tf_ssb_connection_next_request_number(connection), "blobs.createWants",
|
||||
message, _tf_ssb_rpc_connection_blobs_createWants_callback, NULL, NULL);
|
||||
JS_FreeValue(context, message);
|
||||
}
|
||||
JSValue message = JS_NewObject(context);
|
||||
JSValue name = JS_NewArray(context);
|
||||
JS_SetPropertyUint32(context, name, 0, JS_NewString(context, "blobs"));
|
||||
JS_SetPropertyUint32(context, name, 1, JS_NewString(context, "createWants"));
|
||||
JS_SetPropertyStr(context, message, "name", name);
|
||||
JS_SetPropertyStr(context, message, "type", JS_NewString(context, "source"));
|
||||
JS_SetPropertyStr(context, message, "args", JS_NewArray(context));
|
||||
tf_ssb_connection_rpc_send_json(connection, k_ssb_rpc_flag_stream | k_ssb_rpc_flag_new_request, tf_ssb_connection_next_request_number(connection), "blobs.createWants",
|
||||
message, _tf_ssb_rpc_connection_blobs_createWants_callback, NULL, NULL);
|
||||
JS_FreeValue(context, message);
|
||||
|
||||
if (tf_ssb_connection_is_client(connection))
|
||||
{
|
||||
JSValue message = JS_NewObject(context);
|
||||
JSValue name = JS_NewArray(context);
|
||||
message = JS_NewObject(context);
|
||||
name = JS_NewArray(context);
|
||||
JS_SetPropertyUint32(context, name, 0, JS_NewString(context, "tunnel"));
|
||||
JS_SetPropertyUint32(context, name, 1, JS_NewString(context, "isRoom"));
|
||||
JS_SetPropertyStr(context, message, "name", name);
|
||||
@ -1250,15 +1189,7 @@ static void _tf_ssb_rpc_connections_changed_callback(tf_ssb_t* ssb, tf_ssb_chang
|
||||
_tf_ssb_rpc_connection_tunnel_isRoom_callback, NULL, NULL);
|
||||
JS_FreeValue(context, message);
|
||||
|
||||
if (tf_ssb_is_peer_exchange(ssb))
|
||||
{
|
||||
_tf_ssb_rpc_send_peers_exchange(connection);
|
||||
}
|
||||
|
||||
if (tf_ssb_is_replicator(ssb))
|
||||
{
|
||||
_tf_ssb_rpc_send_ebt_replicate(connection);
|
||||
}
|
||||
_tf_ssb_rpc_send_ebt_replicate(connection);
|
||||
}
|
||||
}
|
||||
else if (change == k_tf_ssb_change_remove)
|
||||
@ -1372,142 +1303,6 @@ void tf_ssb_rpc_start_periodic(tf_ssb_t* ssb)
|
||||
_tf_ssb_rpc_start_delete_blobs(ssb, 30 * 1000);
|
||||
}
|
||||
|
||||
typedef struct _peers_exchange_t
|
||||
{
|
||||
tf_ssb_t* ssb;
|
||||
JSValue peers;
|
||||
} peers_exchange_t;
|
||||
|
||||
static void _tf_ssb_get_peers_exhange_callback(
|
||||
const char* host, const struct sockaddr_in* addr, tf_ssb_broadcast_origin_t origin, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data)
|
||||
{
|
||||
peers_exchange_t* data = user_data;
|
||||
if (origin == k_tf_ssb_broadcast_origin_peer_exchange)
|
||||
{
|
||||
char fullid[256] = { 0 };
|
||||
tf_base64_encode(pub, k_id_bin_len, fullid, sizeof(fullid));
|
||||
char* dot = strchr(fullid, '.');
|
||||
if (dot)
|
||||
{
|
||||
*dot = '\0';
|
||||
}
|
||||
|
||||
char connection[1024] = { 0 };
|
||||
snprintf(connection, sizeof(connection), "net:%s:%d~shs:%s", host, ntohs(addr->sin_port), fullid);
|
||||
|
||||
JSContext* context = tf_ssb_get_context(data->ssb);
|
||||
JS_SetPropertyStr(context, data->peers, connection, JS_NewInt32(context, 0));
|
||||
}
|
||||
}
|
||||
|
||||
static JSValue _tf_ssb_get_peers_exchange(tf_ssb_t* ssb)
|
||||
{
|
||||
JSContext* context = tf_ssb_get_context(ssb);
|
||||
JSValue peers = JS_NewObject(context);
|
||||
tf_ssb_visit_broadcasts(ssb, _tf_ssb_get_peers_exhange_callback, &(peers_exchange_t) { .ssb = ssb, .peers = peers });
|
||||
return peers;
|
||||
}
|
||||
|
||||
static void _tf_ssb_rpc_peers_exchange_internal(
|
||||
tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, JSValue args, const uint8_t* message, size_t size, void* user_data)
|
||||
{
|
||||
JSContext* context = tf_ssb_connection_get_context(connection);
|
||||
if (_is_error(context, args))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* The peer that participated in the exchange is now a peer exchange entry, too. */
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
if (*tf_ssb_connection_get_host(connection))
|
||||
{
|
||||
char fullid[k_id_base64_len] = { 0 };
|
||||
tf_ssb_connection_get_id(connection, fullid, sizeof(fullid));
|
||||
char* dot = strchr(fullid, '.');
|
||||
if (dot)
|
||||
{
|
||||
*dot = '\0';
|
||||
}
|
||||
|
||||
int port = tf_ssb_connection_get_port(connection);
|
||||
JSValue port_value = JS_GetPropertyStr(context, args, "port");
|
||||
JS_ToInt32(context, &port, port_value);
|
||||
JS_FreeValue(context, port_value);
|
||||
|
||||
char connection_string[1024] = { 0 };
|
||||
snprintf(connection_string, sizeof(connection_string), "net:%s:%d~shs:%s", tf_ssb_connection_get_host(connection), port, fullid + 1);
|
||||
tf_ssb_add_broadcast(ssb, connection_string, k_tf_ssb_broadcast_origin_peer_exchange, k_ssb_peer_exchange_expires_seconds);
|
||||
}
|
||||
|
||||
JSValue in_peers = JS_GetPropertyStr(context, args, "peers");
|
||||
|
||||
JSPropertyEnum* ptab = NULL;
|
||||
uint32_t plen = 0;
|
||||
if (JS_GetOwnPropertyNames(context, &ptab, &plen, in_peers, JS_GPN_STRING_MASK) == 0)
|
||||
{
|
||||
for (uint32_t i = 0; i < plen; ++i)
|
||||
{
|
||||
JSValue key = JS_AtomToString(context, ptab[i].atom);
|
||||
JSPropertyDescriptor desc;
|
||||
JSValue key_value = JS_NULL;
|
||||
if (JS_GetOwnProperty(context, &desc, args, ptab[i].atom) == 1)
|
||||
{
|
||||
key_value = desc.value;
|
||||
JS_FreeValue(context, desc.setter);
|
||||
JS_FreeValue(context, desc.getter);
|
||||
}
|
||||
const char* connection = JS_ToCString(context, key);
|
||||
int64_t timestamp = 0;
|
||||
JS_ToInt64(context, ×tamp, key_value);
|
||||
/* ADD BROADCAST connection: timestamp */
|
||||
JS_FreeCString(context, connection);
|
||||
JS_FreeValue(context, key);
|
||||
JS_FreeValue(context, key_value);
|
||||
}
|
||||
for (uint32_t i = 0; i < plen; ++i)
|
||||
{
|
||||
JS_FreeAtom(context, ptab[i].atom);
|
||||
}
|
||||
js_free(context, ptab);
|
||||
}
|
||||
JS_FreeValue(context, in_peers);
|
||||
}
|
||||
|
||||
static void _tf_ssb_rpc_send_peers_exchange(tf_ssb_connection_t* connection)
|
||||
{
|
||||
int32_t request_number = tf_ssb_connection_next_request_number(connection);
|
||||
JSContext* context = tf_ssb_connection_get_context(connection);
|
||||
JSValue message = JS_NewObject(context);
|
||||
JSValue name = JS_NewArray(context);
|
||||
JS_SetPropertyUint32(context, name, 0, JS_NewString(context, "peers"));
|
||||
JS_SetPropertyUint32(context, name, 1, JS_NewString(context, "exchange"));
|
||||
JS_SetPropertyStr(context, message, "name", name);
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
JS_SetPropertyStr(context, message, "port", JS_NewInt32(context, tf_ssb_server_get_port(ssb)));
|
||||
JS_SetPropertyStr(context, message, "peers", _tf_ssb_get_peers_exchange(ssb));
|
||||
tf_ssb_connection_rpc_send_json(connection, k_ssb_rpc_flag_new_request, request_number, "peers.exchange", message, _tf_ssb_rpc_peers_exchange_internal, NULL, NULL);
|
||||
JS_FreeValue(context, message);
|
||||
}
|
||||
|
||||
static void _tf_ssb_rpc_peers_exchange(tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, JSValue args, const uint8_t* message, size_t size, void* user_data)
|
||||
{
|
||||
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
|
||||
if (!tf_ssb_is_peer_exchange(ssb))
|
||||
{
|
||||
tf_ssb_connection_rpc_send_error_method_not_allowed(connection, flags, -request_number, "peers.exchange");
|
||||
return;
|
||||
}
|
||||
|
||||
_tf_ssb_rpc_peers_exchange_internal(connection, flags, request_number, args, message, size, user_data);
|
||||
|
||||
JSContext* context = tf_ssb_connection_get_context(connection);
|
||||
JSValue out_message = JS_NewObject(context);
|
||||
JS_SetPropertyStr(context, out_message, "port", JS_NewInt32(context, tf_ssb_server_get_port(ssb)));
|
||||
JS_SetPropertyStr(context, out_message, "peers", _tf_ssb_get_peers_exchange(ssb));
|
||||
tf_ssb_connection_rpc_send_json(connection, flags, -request_number, NULL, out_message, NULL, NULL, NULL);
|
||||
JS_FreeValue(context, out_message);
|
||||
}
|
||||
|
||||
void tf_ssb_rpc_register(tf_ssb_t* ssb)
|
||||
{
|
||||
tf_ssb_add_connections_changed_callback(ssb, _tf_ssb_rpc_connections_changed_callback, NULL, NULL);
|
||||
@ -1521,5 +1316,4 @@ void tf_ssb_rpc_register(tf_ssb_t* ssb)
|
||||
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "room", "attendants", NULL }, _tf_ssb_rpc_room_attendants, NULL, NULL); /* SOURCE */
|
||||
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "createHistoryStream", NULL }, _tf_ssb_rpc_createHistoryStream, NULL, NULL); /* SOURCE */
|
||||
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "ebt", "replicate", NULL }, _tf_ssb_rpc_ebt_replicate_server, NULL, NULL); /* DUPLEX */
|
||||
tf_ssb_add_rpc_callback(ssb, (const char*[]) { "peers", "exchange", NULL }, _tf_ssb_rpc_peers_exchange, NULL, NULL); /* ASYNC */
|
||||
}
|
||||
|
115
src/ssb.tests.c
115
src/ssb.tests.c
@ -250,51 +250,22 @@ void tf_ssb_test_ssb(const tf_test_options_t* options)
|
||||
tf_printf("Waiting for connection.\n");
|
||||
while (test.connection_count0 != 1 || test.connection_count1 != 1)
|
||||
{
|
||||
tf_ssb_set_main_thread(ssb0, true);
|
||||
tf_ssb_set_main_thread(ssb1, true);
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
tf_ssb_set_main_thread(ssb0, false);
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
}
|
||||
tf_ssb_server_close(ssb0);
|
||||
|
||||
tf_printf("Waiting for messages.\n");
|
||||
while (_ssb_test_count_messages(ssb1) < 3)
|
||||
{
|
||||
tf_ssb_set_main_thread(ssb0, true);
|
||||
tf_ssb_set_main_thread(ssb1, true);
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
tf_ssb_set_main_thread(ssb0, false);
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
}
|
||||
|
||||
tf_printf("Waiting for blob.\n");
|
||||
while (!tf_ssb_db_blob_get(ssb1, blob_id, NULL, NULL))
|
||||
{
|
||||
tf_ssb_set_main_thread(ssb0, true);
|
||||
tf_ssb_set_main_thread(ssb1, true);
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
tf_ssb_set_main_thread(ssb0, false);
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
}
|
||||
|
||||
JSContext* context = tf_ssb_get_context(ssb1);
|
||||
JSValue message = JS_NewObject(context);
|
||||
JSValue name = JS_NewArray(context);
|
||||
JS_SetPropertyUint32(context, name, 0, JS_NewString(context, "blobs"));
|
||||
JS_SetPropertyUint32(context, name, 1, JS_NewString(context, "has"));
|
||||
JS_SetPropertyStr(context, message, "name", name);
|
||||
JSValue args = JS_NewArray(context);
|
||||
JS_SetPropertyUint32(context, args, 0, JS_NewString(context, blob_id));
|
||||
JS_SetPropertyStr(context, message, "args", args);
|
||||
JS_SetPropertyStr(context, message, "type", JS_NewString(context, "async"));
|
||||
|
||||
tf_ssb_connection_t* connections[4] = { 0 };
|
||||
tf_ssb_get_connections(ssb1, connections, 4);
|
||||
int64_t request_number = tf_ssb_connection_next_request_number(connections[0]);
|
||||
tf_ssb_connection_rpc_send_json(connections[0], k_ssb_rpc_flag_stream | k_ssb_rpc_flag_new_request, request_number, "blobs.has", message, NULL, NULL, NULL);
|
||||
JS_FreeValue(context, message);
|
||||
|
||||
uint8_t* b1;
|
||||
size_t s1 = 0;
|
||||
b = tf_ssb_db_blob_get(ssb1, blob_id, &b1, &s1);
|
||||
@ -322,22 +293,14 @@ void tf_ssb_test_ssb(const tf_test_options_t* options)
|
||||
|
||||
while (count0 == 0)
|
||||
{
|
||||
tf_ssb_set_main_thread(ssb0, true);
|
||||
tf_ssb_set_main_thread(ssb1, true);
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
tf_ssb_set_main_thread(ssb0, false);
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
}
|
||||
tf_ssb_remove_message_added_callback(ssb0, _message_added, &count0);
|
||||
|
||||
tf_printf("Waiting for message from other.\n");
|
||||
while (count1 == 0)
|
||||
{
|
||||
tf_ssb_set_main_thread(ssb0, true);
|
||||
tf_ssb_set_main_thread(ssb1, true);
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
tf_ssb_set_main_thread(ssb0, false);
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
}
|
||||
tf_ssb_remove_message_added_callback(ssb1, _message_added, &count1);
|
||||
tf_printf("done\n");
|
||||
@ -348,11 +311,7 @@ void tf_ssb_test_ssb(const tf_test_options_t* options)
|
||||
uv_close((uv_handle_t*)&idle1, NULL);
|
||||
|
||||
tf_printf("final run\n");
|
||||
tf_ssb_set_main_thread(ssb0, true);
|
||||
tf_ssb_set_main_thread(ssb1, true);
|
||||
uv_run(&loop, UV_RUN_DEFAULT);
|
||||
tf_ssb_set_main_thread(ssb0, false);
|
||||
tf_ssb_set_main_thread(ssb1, false);
|
||||
tf_printf("done\n");
|
||||
|
||||
tf_printf("destroy 0\n");
|
||||
@ -364,7 +323,7 @@ void tf_ssb_test_ssb(const tf_test_options_t* options)
|
||||
uv_loop_close(&loop);
|
||||
}
|
||||
|
||||
static void _broadcasts_visit(const char* host, const struct sockaddr_in* addr, tf_ssb_broadcast_origin_t origin, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data)
|
||||
static void _broadcasts_visit(const char* host, const struct sockaddr_in* addr, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data)
|
||||
{
|
||||
int* count = user_data;
|
||||
(*count)++;
|
||||
@ -788,8 +747,7 @@ static void _break_in_a_bit(tf_ssb_t* ssb, tf_ssb_connection_t* connection, cons
|
||||
uv_timer_start(&data->timer, _close_callback, 3000, 0);
|
||||
}
|
||||
|
||||
static void _ssb_test_room_broadcasts_visit(
|
||||
const char* host, const struct sockaddr_in* addr, tf_ssb_broadcast_origin_t origin, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data)
|
||||
static void _ssb_test_room_broadcasts_visit(const char* host, const struct sockaddr_in* addr, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data)
|
||||
{
|
||||
tf_ssb_t* ssb = user_data;
|
||||
char id[k_id_base64_len] = { 0 };
|
||||
@ -911,73 +869,4 @@ void tf_ssb_test_encrypt(const tf_test_options_t* options)
|
||||
printf("returned %d\n", WEXITSTATUS(result));
|
||||
assert(WEXITSTATUS(result) == 0);
|
||||
}
|
||||
|
||||
static void _count_broadcasts_callback(
|
||||
const char* host, const struct sockaddr_in* addr, tf_ssb_broadcast_origin_t origin, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data)
|
||||
{
|
||||
int* count = user_data;
|
||||
(*count)++;
|
||||
}
|
||||
|
||||
static int _count_broadcasts(tf_ssb_t* ssb)
|
||||
{
|
||||
int count = 0;
|
||||
tf_ssb_visit_broadcasts(ssb, _count_broadcasts_callback, &count);
|
||||
return count;
|
||||
}
|
||||
|
||||
void tf_ssb_test_peer_exchange(const tf_test_options_t* options)
|
||||
{
|
||||
uv_loop_t loop = { 0 };
|
||||
uv_loop_init(&loop);
|
||||
|
||||
unlink("out/test_db0.sqlite");
|
||||
tf_ssb_t* ssb0 = tf_ssb_create(&loop, NULL, "file:out/test_db0.sqlite", NULL);
|
||||
tf_ssb_set_is_room(ssb0, false);
|
||||
tf_ssb_set_is_replicator(ssb0, false);
|
||||
tf_ssb_set_is_peer_exchange(ssb0, true);
|
||||
tf_ssb_register(tf_ssb_get_context(ssb0), ssb0);
|
||||
tf_ssb_server_open(ssb0, 12347);
|
||||
|
||||
unlink("out/test_db1.sqlite");
|
||||
tf_ssb_t* ssb1 = tf_ssb_create(&loop, NULL, "file:out/test_db1.sqlite", NULL);
|
||||
tf_ssb_set_is_room(ssb1, false);
|
||||
tf_ssb_set_is_replicator(ssb1, false);
|
||||
tf_ssb_set_is_peer_exchange(ssb1, true);
|
||||
tf_ssb_register(tf_ssb_get_context(ssb1), ssb1);
|
||||
tf_ssb_server_open(ssb1, 12348);
|
||||
|
||||
unlink("out/test_db2.sqlite");
|
||||
tf_ssb_t* ssb2 = tf_ssb_create(&loop, NULL, "file:out/test_db2.sqlite", NULL);
|
||||
tf_ssb_set_is_room(ssb2, false);
|
||||
tf_ssb_set_is_replicator(ssb2, false);
|
||||
tf_ssb_set_is_peer_exchange(ssb2, true);
|
||||
tf_ssb_register(tf_ssb_get_context(ssb2), ssb2);
|
||||
tf_ssb_server_open(ssb2, 12349);
|
||||
|
||||
char id0[k_id_base64_len] = { 0 };
|
||||
tf_ssb_whoami(ssb0, id0, sizeof(id0));
|
||||
uint8_t id0bin[k_id_bin_len];
|
||||
tf_ssb_id_str_to_bin(id0bin, id0);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin);
|
||||
tf_ssb_connect(ssb2, "127.0.0.1", 12347, id0bin);
|
||||
|
||||
while (_count_broadcasts(ssb0) != 2 || _count_broadcasts(ssb1) != 1 || _count_broadcasts(ssb2) != 1)
|
||||
{
|
||||
uv_run(&loop, UV_RUN_ONCE);
|
||||
}
|
||||
|
||||
tf_ssb_send_close(ssb0);
|
||||
tf_ssb_send_close(ssb1);
|
||||
tf_ssb_send_close(ssb2);
|
||||
|
||||
tf_ssb_destroy(ssb0);
|
||||
tf_ssb_destroy(ssb1);
|
||||
tf_ssb_destroy(ssb2);
|
||||
|
||||
uv_run(&loop, UV_RUN_DEFAULT);
|
||||
|
||||
uv_loop_close(&loop);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -53,10 +53,4 @@ void tf_ssb_test_go_ssb_room(const tf_test_options_t* options);
|
||||
*/
|
||||
void tf_ssb_test_encrypt(const tf_test_options_t* options);
|
||||
|
||||
/**
|
||||
** Test peer exchange.
|
||||
** @param options The test options.
|
||||
*/
|
||||
void tf_ssb_test_peer_exchange(const tf_test_options_t* options);
|
||||
|
||||
/** @} */
|
||||
|
38
src/task.c
38
src/task.c
@ -140,7 +140,8 @@ typedef struct _tf_task_t
|
||||
float idle_percent;
|
||||
float thread_percent;
|
||||
|
||||
uv_async_t run_jobs_async;
|
||||
uv_idle_t idle;
|
||||
uv_prepare_t prepare;
|
||||
uv_signal_t sig_term;
|
||||
uv_signal_t sig_int;
|
||||
|
||||
@ -207,6 +208,7 @@ static void _tf_task_sendPromiseExportMessage(tf_task_t* from, tf_taskstub_t* to
|
||||
static JSValue _tf_task_executeSource(tf_task_t* task, const char* source, const char* name);
|
||||
static tf_taskstub_t* _tf_task_get_stub(tf_task_t* task, taskid_t id);
|
||||
static void _tf_task_release_export(tf_taskstub_t* stub, exportid_t exportId);
|
||||
static void _tf_task_run_jobs_prepare(uv_prepare_t* prepare);
|
||||
static void _timeout_unlink(tf_task_t* task, timeout_t* timeout);
|
||||
static void _timeout_closed(uv_handle_t* handle);
|
||||
|
||||
@ -1519,20 +1521,25 @@ static bool _tf_task_run_jobs(tf_task_t* task)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void _tf_task_run_jobs_async(uv_async_t* async)
|
||||
static void _tf_task_run_jobs_idle(uv_idle_t* idle)
|
||||
{
|
||||
tf_task_t* task = async->data;
|
||||
if (_tf_task_run_jobs(task))
|
||||
tf_task_t* task = idle->data;
|
||||
if (!_tf_task_run_jobs(task))
|
||||
{
|
||||
uv_async_send(async);
|
||||
/* No more jobs. Don't try again as actively. */
|
||||
uv_idle_stop(&task->idle);
|
||||
uv_prepare_start(&task->prepare, _tf_task_run_jobs_prepare);
|
||||
}
|
||||
}
|
||||
|
||||
void tf_task_check_jobs(tf_task_t* task)
|
||||
static void _tf_task_run_jobs_prepare(uv_prepare_t* prepare)
|
||||
{
|
||||
if (JS_IsJobPending(task->_runtime))
|
||||
tf_task_t* task = prepare->data;
|
||||
if (_tf_task_run_jobs(task))
|
||||
{
|
||||
uv_async_send(&task->run_jobs_async);
|
||||
/* More jobs. We can run again immediately. */
|
||||
uv_idle_start(&task->idle, _tf_task_run_jobs_idle);
|
||||
uv_prepare_stop(&task->prepare);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1629,9 +1636,13 @@ tf_task_t* tf_task_create()
|
||||
uv_timer_init(&task->_loop, &task->gc_timer);
|
||||
uv_timer_start(&task->gc_timer, _tf_task_gc_timer, 1000, 1000);
|
||||
uv_unref((uv_handle_t*)&task->gc_timer);
|
||||
task->run_jobs_async.data = task;
|
||||
uv_async_init(&task->_loop, &task->run_jobs_async, _tf_task_run_jobs_async);
|
||||
uv_unref((uv_handle_t*)&task->run_jobs_async);
|
||||
task->idle.data = task;
|
||||
uv_idle_init(&task->_loop, &task->idle);
|
||||
uv_unref((uv_handle_t*)&task->idle);
|
||||
task->prepare.data = task;
|
||||
uv_prepare_init(&task->_loop, &task->prepare);
|
||||
uv_unref((uv_handle_t*)&task->prepare);
|
||||
uv_idle_start(&task->idle, _tf_task_run_jobs_idle);
|
||||
task->sig_term.data = task;
|
||||
uv_signal_init(&task->_loop, &task->sig_term);
|
||||
uv_signal_start(&task->sig_term, _tf_task_signal_shutdown, SIGTERM);
|
||||
@ -1899,13 +1910,14 @@ void tf_task_destroy(tf_task_t* task)
|
||||
{
|
||||
uv_close((uv_handle_t*)&task->gc_timer, _tf_task_on_handle_close);
|
||||
}
|
||||
uv_close((uv_handle_t*)&task->run_jobs_async, _tf_task_on_handle_close);
|
||||
uv_close((uv_handle_t*)&task->idle, _tf_task_on_handle_close);
|
||||
uv_close((uv_handle_t*)&task->prepare, _tf_task_on_handle_close);
|
||||
uv_signal_stop(&task->sig_term);
|
||||
uv_close((uv_handle_t*)&task->sig_term, _tf_task_on_handle_close);
|
||||
uv_signal_stop(&task->sig_int);
|
||||
uv_close((uv_handle_t*)&task->sig_int, _tf_task_on_handle_close);
|
||||
|
||||
while (task->trace_timer.data || task->gc_timer.data || task->run_jobs_async.data || task->sig_term.data || task->sig_int.data)
|
||||
while (task->trace_timer.data || task->gc_timer.data || task->idle.data || task->prepare.data || task->sig_term.data || task->sig_int.data)
|
||||
{
|
||||
uv_run(&task->_loop, UV_RUN_ONCE);
|
||||
}
|
||||
|
@ -364,11 +364,4 @@ tf_android_start_service_t* tf_task_get_android_start_service();
|
||||
*/
|
||||
tf_android_stop_service_t* tf_task_get_android_stop_service();
|
||||
|
||||
/**
|
||||
** Check for JS jobs that need to be run. Generally to be called post-JS_Call
|
||||
** in tf_util_report_error.
|
||||
** @param task The task.
|
||||
*/
|
||||
void tf_task_check_jobs(tf_task_t* task);
|
||||
|
||||
/** @} */
|
||||
|
@ -915,7 +915,6 @@ void tf_tests(const tf_test_options_t* options)
|
||||
_tf_test_run(options, "auto", _test_auto, false);
|
||||
_tf_test_run(options, "go-ssb-room", tf_ssb_test_go_ssb_room, true);
|
||||
_tf_test_run(options, "encrypt", tf_ssb_test_encrypt, false);
|
||||
_tf_test_run(options, "peer_exchange", tf_ssb_test_peer_exchange, false);
|
||||
tf_printf("Tests completed.\n");
|
||||
#endif
|
||||
}
|
||||
|
@ -211,7 +211,6 @@ static JSValue _util_print(JSContext* context, JSValueConst this_val, int argc,
|
||||
bool tf_util_report_error(JSContext* context, JSValue value)
|
||||
{
|
||||
bool is_error = false;
|
||||
tf_task_t* task = tf_task_get(context);
|
||||
if (JS_IsError(context, value))
|
||||
{
|
||||
const char* string = JS_ToCString(context, value);
|
||||
@ -227,11 +226,13 @@ bool tf_util_report_error(JSContext* context, JSValue value)
|
||||
}
|
||||
JS_FreeValue(context, stack);
|
||||
|
||||
tf_task_t* task = tf_task_get(context);
|
||||
tf_task_send_error_to_parent(task, value);
|
||||
is_error = true;
|
||||
}
|
||||
else if (JS_IsException(value))
|
||||
{
|
||||
tf_task_t* task = tf_task_get(context);
|
||||
if (!tf_task_send_error_to_parent(task, value))
|
||||
{
|
||||
JSValue exception = JS_GetException(context);
|
||||
@ -240,7 +241,6 @@ bool tf_util_report_error(JSContext* context, JSValue value)
|
||||
}
|
||||
is_error = true;
|
||||
}
|
||||
tf_task_check_jobs(task);
|
||||
return is_error;
|
||||
}
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define VERSION_NUMBER "0.0.22"
|
||||
#define VERSION_NAME "Get born soon."
|
||||
#define VERSION_NUMBER "0.0.22-wip"
|
||||
#define VERSION_NAME "Look for the helpers."
|
||||
|
Reference in New Issue
Block a user