mirror of
https://github.com/simon987/sist2.git
synced 2025-12-16 00:39:04 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcab40783c | ||
|
|
ea23bf01e3 | ||
|
|
f5d070496f |
@@ -224,6 +224,6 @@ docker run --rm --entrypoint cat my-sist2-image /root/sist2 > sist2-x64-linux
|
|||||||
git clone --recursive https://github.com/sist2app/sist2/
|
git clone --recursive https://github.com/sist2app/sist2/
|
||||||
(cd sist2-vue; npm install; npm run build)
|
(cd sist2-vue; npm install; npm run build)
|
||||||
(cd sist2-admin/frontend; npm install; npm run build)
|
(cd sist2-admin/frontend; npm install; npm run build)
|
||||||
cmake -DSIST_DEBUG=off -DCMAKE_TOOLCHAIN_FILE=<VCPKG_ROOT>/scripts/buildsystems/vcpkg.cmake .
|
cmake -DSIST_DEBUG=off -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=<VCPKG_ROOT>/scripts/buildsystems/vcpkg.cmake .
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -93,7 +93,9 @@ export default {
|
|||||||
threads: "Number of threads",
|
threads: "Number of threads",
|
||||||
batchSize: "Index batch size",
|
batchSize: "Index batch size",
|
||||||
script: "User script",
|
script: "User script",
|
||||||
searchIndex: "Search index file location"
|
searchIndex: "Search index file location",
|
||||||
|
esMappings: "Elasticsearch mappings file override",
|
||||||
|
esSettings: "Elasticsearch settings file override"
|
||||||
},
|
},
|
||||||
scanOptions: {
|
scanOptions: {
|
||||||
title: "Scanning options",
|
title: "Scanning options",
|
||||||
|
|||||||
@@ -44,6 +44,12 @@
|
|||||||
|
|
||||||
<label>{{ $t("backendOptions.batchSize") }}</label>
|
<label>{{ $t("backendOptions.batchSize") }}</label>
|
||||||
<b-form-input v-model="backend.batch_size" type="number" min="1" @change="update()"></b-form-input>
|
<b-form-input v-model="backend.batch_size" type="number" min="1" @change="update()"></b-form-input>
|
||||||
|
|
||||||
|
<label>{{ $t("backendOptions.esMappings") }}</label>
|
||||||
|
<b-form-textarea v-model="backend.es_mappings" rows="4" @change="update()"></b-form-textarea>
|
||||||
|
|
||||||
|
<label>{{ $t("backendOptions.esSettings") }}</label>
|
||||||
|
<b-form-textarea v-model="backend.es_settings" rows="4" @change="update()"></b-form-textarea>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<label>{{ $t("backendOptions.searchIndex") }}</label>
|
<label>{{ $t("backendOptions.searchIndex") }}</label>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from logging import FileHandler, StreamHandler
|
|||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from typing import List
|
from typing import List, Optional
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
@@ -40,6 +40,8 @@ class Sist2SearchBackend(BaseModel):
|
|||||||
|
|
||||||
es_url: str = "http://elasticsearch:9200"
|
es_url: str = "http://elasticsearch:9200"
|
||||||
es_insecure_ssl: bool = False
|
es_insecure_ssl: bool = False
|
||||||
|
es_mappings: Optional[str] = None
|
||||||
|
es_settings: Optional[str] = None
|
||||||
es_index: str = "sist2"
|
es_index: str = "sist2"
|
||||||
threads: int = 1
|
threads: int = 1
|
||||||
batch_size: int = 70
|
batch_size: int = 70
|
||||||
@@ -57,6 +59,8 @@ class IndexOptions(BaseModel):
|
|||||||
path: str = None
|
path: str = None
|
||||||
incremental_index: bool = True
|
incremental_index: bool = True
|
||||||
search_backend: str = None
|
search_backend: str = None
|
||||||
|
es_mappings_file: Optional[str] = None
|
||||||
|
es_settings_file: Optional[str] = None
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
@@ -75,6 +79,12 @@ class IndexOptions(BaseModel):
|
|||||||
|
|
||||||
if search_backend.es_insecure_ssl:
|
if search_backend.es_insecure_ssl:
|
||||||
args.append(f"--es-insecure-ssl")
|
args.append(f"--es-insecure-ssl")
|
||||||
|
|
||||||
|
if self.es_mappings_file:
|
||||||
|
args.append(f"--mappings-file={self.es_mappings_file}")
|
||||||
|
if self.es_settings_file:
|
||||||
|
args.append(f"--settings-file={self.es_settings_file}")
|
||||||
|
|
||||||
if self.incremental_index:
|
if self.incremental_index:
|
||||||
args.append(f"--incremental-index")
|
args.append(f"--incremental-index")
|
||||||
|
|
||||||
@@ -249,6 +259,20 @@ class Sist2:
|
|||||||
|
|
||||||
def index(self, options: IndexOptions, search_backend: Sist2SearchBackend, logs_cb, set_pid_cb):
|
def index(self, options: IndexOptions, search_backend: Sist2SearchBackend, logs_cb, set_pid_cb):
|
||||||
|
|
||||||
|
if search_backend.es_mappings:
|
||||||
|
with NamedTemporaryFile("w", prefix="sist2-admin", suffix=".txt", delete=False) as f:
|
||||||
|
f.write(search_backend.es_mappings)
|
||||||
|
options.es_mappings_file = f.name
|
||||||
|
else:
|
||||||
|
options.es_mappings_file = None
|
||||||
|
|
||||||
|
if search_backend.es_settings:
|
||||||
|
with NamedTemporaryFile("w", prefix="sist2-admin", suffix=".txt", delete=False) as f:
|
||||||
|
f.write(search_backend.es_settings)
|
||||||
|
options.es_settings_file = f.name
|
||||||
|
else:
|
||||||
|
options.es_settings_file = None
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
self.bin_path,
|
self.bin_path,
|
||||||
*options.args(search_backend),
|
*options.args(search_backend),
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ class Sist2Api {
|
|||||||
hit._props.isImage = true;
|
hit._props.isImage = true;
|
||||||
}
|
}
|
||||||
if ("width" in hit._source && !hit._props.isSubDocument && hit._source.videoc !== "tiff"
|
if ("width" in hit._source && !hit._props.isSubDocument && hit._source.videoc !== "tiff"
|
||||||
&& hit._source.videoc !== "raw" && hit._source.videoc !== "ppm") {
|
&& hit._source.videoc !== "raw" && hit._source.videoc !== "ppm"
|
||||||
|
&& hit._source.mime !== "image/jp2") {
|
||||||
hit._props.isPlayableImage = true;
|
hit._props.isPlayableImage = true;
|
||||||
}
|
}
|
||||||
if ("width" in hit._source && "height" in hit._source) {
|
if ("width" in hit._source && "height" in hit._source) {
|
||||||
|
|||||||
@@ -51,11 +51,11 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "git_hash.h"
|
#include "git_hash.h"
|
||||||
|
|
||||||
#define VERSION "3.4.5"
|
#define VERSION "3.4.6"
|
||||||
static const char *const Version = VERSION;
|
static const char *const Version = VERSION;
|
||||||
static const int VersionMajor = 3;
|
static const int VersionMajor = 3;
|
||||||
static const int VersionMinor = 4;
|
static const int VersionMinor = 4;
|
||||||
static const int VersionPatch = 5;
|
static const int VersionPatch = 6;
|
||||||
|
|
||||||
#ifndef SIST_PLATFORM
|
#ifndef SIST_PLATFORM
|
||||||
#define SIST_PLATFORM unknown
|
#define SIST_PLATFORM unknown
|
||||||
|
|||||||
Reference in New Issue
Block a user