Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a53ebb9355 | ||
|
|
06e12930c7 | ||
|
|
0f7655773a | ||
|
|
26660461d4 | ||
|
|
b41ee91db5 | ||
|
|
746dd8d37a | ||
|
|
fb4a57027d | ||
|
|
c97660bed0 | ||
|
|
fd8c8812a3 | ||
|
|
0101392858 | ||
|
|
cc3f82d693 | ||
|
|
d21997c918 | ||
|
|
74fec12f5c | ||
|
|
59525f8fa7 | ||
|
|
3c6d3befb2 | ||
|
|
dfa72c80bc | ||
|
|
c6e534b9db | ||
|
|
032ab6a85d | ||
|
|
830c066ebf | ||
|
|
c432388515 | ||
|
|
476deba93a | ||
|
|
ffb4f2386d | ||
|
|
21716163cb | ||
|
|
ca924148a5 | ||
|
|
37aa9b84ae | ||
|
|
c7bd7d4d7d | ||
|
|
d81a50e696 | ||
|
|
dda9943dbe |
@@ -24,8 +24,8 @@ async function main() {
|
||||
await fs.ensureDir(tempDownloadDir);
|
||||
|
||||
//sqlite3
|
||||
const sqliteRemoteUrl = 'https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v72-linux-x64.tar.gz';
|
||||
const sqliteDecompressedFilename = `${tempDownloadDir}/node-v72-linux-x64/node_sqlite3.node`;
|
||||
const sqliteRemoteUrl = 'https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-linux-x64.tar.gz';
|
||||
const sqliteDecompressedFilename = `${tempDownloadDir}/napi-v3-linux-x64/node_sqlite3.node`;
|
||||
|
||||
if (!await fs.pathExists(sqliteDecompressedFilename)) {
|
||||
// Скачиваем node_sqlite3.node для винды, т.к. pkg не включает его в сборку
|
||||
|
||||
@@ -24,8 +24,8 @@ async function main() {
|
||||
await fs.ensureDir(tempDownloadDir);
|
||||
|
||||
//sqlite3
|
||||
const sqliteRemoteUrl = 'https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.1/node-v72-win32-x64.tar.gz';
|
||||
const sqliteDecompressedFilename = `${tempDownloadDir}/node-v72-win32-x64/node_sqlite3.node`;
|
||||
const sqliteRemoteUrl = 'https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-win32-x64.tar.gz';
|
||||
const sqliteDecompressedFilename = `${tempDownloadDir}/napi-v3-win32-x64/node_sqlite3.node`;
|
||||
|
||||
if (!await fs.pathExists(sqliteDecompressedFilename)) {
|
||||
// Скачиваем node_sqlite3.node для винды, т.к. pkg не включает его в сборку
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 1.3 KiB |
@@ -131,6 +131,9 @@ import ContentsPage from './ContentsPage/ContentsPage.vue';
|
||||
import ReaderDialogs from './ReaderDialogs/ReaderDialogs.vue';
|
||||
|
||||
import bookManager from './share/bookManager';
|
||||
import wallpaperStorage from './share/wallpaperStorage';
|
||||
import dynamicCss from '../../share/dynamicCss';
|
||||
|
||||
import rstore from '../../store/modules/reader';
|
||||
import readerApi from '../../api/reader';
|
||||
import miscApi from '../../api/misc';
|
||||
@@ -274,6 +277,7 @@ class Reader extends Vue {
|
||||
this.updateHeaderMinWidth();
|
||||
|
||||
(async() => {
|
||||
await wallpaperStorage.init();
|
||||
await bookManager.init(this.settings);
|
||||
bookManager.addEventListener(this.bookManagerEvent);
|
||||
|
||||
@@ -327,6 +331,7 @@ class Reader extends Vue {
|
||||
this.pdfAsText = settings.pdfAsText;
|
||||
this.pdfQuality = settings.pdfQuality;
|
||||
this.dualPageMode = settings.dualPageMode;
|
||||
this.userWallpapers = settings.userWallpapers;
|
||||
|
||||
this.readerActionByKeyCode = utils.userHotKeysObjectSwap(settings.userHotKeys);
|
||||
this.$root.readerActionByKeyEvent = (event) => {
|
||||
@@ -334,6 +339,30 @@ class Reader extends Vue {
|
||||
}
|
||||
|
||||
this.updateHeaderMinWidth();
|
||||
|
||||
this.loadWallpapers();//no await
|
||||
}
|
||||
|
||||
//wallpaper css
|
||||
async loadWallpapers() {
|
||||
const wallpaperDataLength = await wallpaperStorage.getLength();
|
||||
if (wallpaperDataLength !== this.wallpaperDataLength) {//оптимизация
|
||||
this.wallpaperDataLength = wallpaperDataLength;
|
||||
|
||||
let newCss = '';
|
||||
for (const wp of this.userWallpapers) {
|
||||
const data = await wallpaperStorage.getData(wp.cssClass);
|
||||
|
||||
if (!data) {
|
||||
//здесь будем восстанавливать данные с сервера
|
||||
}
|
||||
|
||||
if (data) {
|
||||
newCss += `.${wp.cssClass} {background: url(${data}) center; background-size: 100% 100%;}`;
|
||||
}
|
||||
}
|
||||
dynamicCss.replace('wallpapers', newCss);
|
||||
}
|
||||
}
|
||||
|
||||
async checkNewVersionAvailable() {
|
||||
|
||||
@@ -79,6 +79,7 @@ import Component from 'vue-class-component';
|
||||
import _ from 'lodash';
|
||||
|
||||
import * as utils from '../../../share/utils';
|
||||
import * as cryptoUtils from '../../../share/cryptoUtils';
|
||||
import Window from '../../share/Window.vue';
|
||||
import NumInput from '../../share/NumInput.vue';
|
||||
import UserHotKeys from './UserHotKeys/UserHotKeys.vue';
|
||||
@@ -279,8 +280,12 @@ class SettingsPage extends Vue {
|
||||
get wallpaperOptions() {
|
||||
let result = [{label: 'Нет', value: ''}];
|
||||
|
||||
for (const wp of this.userWallpapers) {
|
||||
result.push({label: wp.label, value: wp.cssClass});
|
||||
const userWallpapers = _.cloneDeep(this.userWallpapers);
|
||||
userWallpapers.sort((a, b) => a.label.localeCompare(b.label));
|
||||
|
||||
for (const wp of userWallpapers) {
|
||||
if (wallpaperStorage.keyExists(wp.cssClass))
|
||||
result.push({label: wp.label, value: wp.cssClass});
|
||||
}
|
||||
|
||||
for (let i = 1; i <= 17; i++) {
|
||||
@@ -579,19 +584,19 @@ class SettingsPage extends Vue {
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onload = (e) => {
|
||||
const newUserWallpapers = _.cloneDeep(this.userWallpapers);
|
||||
let n = 0;
|
||||
for (const wp of newUserWallpapers) {
|
||||
const newN = parseInt(wp.label.replace(/\D/g, ''), 10);
|
||||
if (newN > n)
|
||||
n = newN;
|
||||
}
|
||||
n++;
|
||||
|
||||
const cssClass = `user-paper${n}`;
|
||||
newUserWallpapers.push({label: `#${n}`, cssClass});
|
||||
(async() => {
|
||||
await wallpaperStorage.setData(cssClass, e.target.result);
|
||||
const data = e.target.result;
|
||||
const key = utils.toHex(cryptoUtils.sha256(data));
|
||||
const label = `#${key.substring(0, 4)}`;
|
||||
const cssClass = `user-paper${key}`;
|
||||
|
||||
const newUserWallpapers = _.cloneDeep(this.userWallpapers);
|
||||
const index = _.findIndex(newUserWallpapers, (item) => (item.cssClass == cssClass));
|
||||
|
||||
if (index < 0)
|
||||
newUserWallpapers.push({label, cssClass});
|
||||
if (!wallpaperStorage.keyExists(cssClass))
|
||||
await wallpaperStorage.setData(cssClass, data);
|
||||
|
||||
this.userWallpapers = newUserWallpapers;
|
||||
this.wallpaper = cssClass;
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
>
|
||||
<template v-slot:selected-item="scope">
|
||||
<div >{{ scope.opt.label }}</div>
|
||||
<div v-show="scope.opt.value" class="q-ml-sm" :class="scope.opt.value" style="width: 50px; height: 30px;"></div>
|
||||
<div v-show="scope.opt.value" class="q-ml-sm" :class="scope.opt.value" style="width: 40px; height: 28px;"></div>
|
||||
</template>
|
||||
|
||||
<template v-slot:option="scope">
|
||||
@@ -66,10 +66,10 @@
|
||||
v-bind="scope.itemProps"
|
||||
v-on="scope.itemEvents"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-section style="min-width: 50px;">
|
||||
<q-item-label v-html="scope.opt.label" />
|
||||
</q-item-section>
|
||||
<q-item-section v-show="scope.opt.value" :class="scope.opt.value" style="min-width: 70px; min-height: 50px"/>
|
||||
<q-item-section v-show="scope.opt.value" :class="scope.opt.value" style="min-width: 70px; min-height: 50px;"/>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
@@ -78,7 +78,7 @@
|
||||
<q-btn class="q-ml-sm" round dense color="blue" icon="la la-plus" @click.stop="loadWallpaperFileClick">
|
||||
<q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">Добавить файл обоев</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn class="q-ml-sm" round dense color="blue" icon="la la-minus" @click.stop="delWallpaper" :disable="wallpaper.indexOf('user-paper') != 0">
|
||||
<q-btn v-show="wallpaper.indexOf('user-paper') === 0" class="q-ml-sm" round dense color="blue" icon="la la-minus" @click.stop="delWallpaper">
|
||||
<q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">Удалить выбранные обои</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
@@ -2,11 +2,11 @@ import {sleep} from '../../../share/utils';
|
||||
|
||||
export default class DrawHelper {
|
||||
fontBySize(size) {
|
||||
return `${size}px ${this.fontName}`;
|
||||
return `${size}px '${this.fontName}'`;
|
||||
}
|
||||
|
||||
fontByStyle(style) {
|
||||
return `${style.italic ? 'italic' : this.fontStyle} ${style.bold ? 'bold' : this.fontWeight} ${this.fontSize}px ${this.fontName}`;
|
||||
return `${style.italic ? 'italic' : this.fontStyle} ${style.bold ? 'bold' : this.fontWeight} ${this.fontSize}px '${this.fontName}'`;
|
||||
}
|
||||
|
||||
measureText(text, style) {// eslint-disable-line no-unused-vars
|
||||
|
||||
@@ -43,10 +43,8 @@ import _ from 'lodash';
|
||||
import './TextPage.css';
|
||||
|
||||
import * as utils from '../../../share/utils';
|
||||
import dynamicCss from '../../../share/dynamicCss';
|
||||
|
||||
import bookManager from '../share/bookManager';
|
||||
import wallpaperStorage from '../share/wallpaperStorage';
|
||||
import DrawHelper from './DrawHelper';
|
||||
import rstore from '../../../store/modules/reader';
|
||||
import {clickMap} from '../share/clickMap';
|
||||
@@ -162,7 +160,7 @@ class TextPage extends Vue {
|
||||
const wideLetter = 'Щ';
|
||||
|
||||
//preloaded fonts
|
||||
this.fontList = [`12px ${this.fontName}`];
|
||||
this.fontList = [`12px '${this.fontName}'`];
|
||||
|
||||
//widths
|
||||
this.realWidth = this.$refs.main.clientWidth;
|
||||
@@ -252,28 +250,6 @@ class TextPage extends Vue {
|
||||
//statusBar
|
||||
this.statusBarClickable = this.drawHelper.statusBarClickable(this.statusBarTop, this.statusBarHeight);
|
||||
|
||||
//wallpaper css, асинхронно
|
||||
(async() => {
|
||||
const wallpaperDataLength = await wallpaperStorage.getLength();
|
||||
if (wallpaperDataLength !== this.wallpaperDataLength) {//оптимизация
|
||||
this.wallpaperDataLength = wallpaperDataLength;
|
||||
|
||||
let newCss = '';
|
||||
for (const wp of this.userWallpapers) {
|
||||
const data = await wallpaperStorage.getData(wp.cssClass);
|
||||
|
||||
if (!data) {
|
||||
//здесь будем восстанавливать данные с сервера
|
||||
}
|
||||
|
||||
if (data) {
|
||||
newCss += `.${wp.cssClass} {background: url(${data}) center; background-size: 100% 100%;}`;
|
||||
}
|
||||
}
|
||||
dynamicCss.replace('wallpapers', newCss);
|
||||
}
|
||||
})();
|
||||
|
||||
//parsed
|
||||
if (this.parsed) {
|
||||
let wideLine = wideLetter;
|
||||
@@ -524,7 +500,7 @@ class TextPage extends Vue {
|
||||
}
|
||||
|
||||
get font() {
|
||||
return `${this.fontStyle} ${this.fontWeight} ${this.fontSize}px ${this.fontName}`;
|
||||
return `${this.fontStyle} ${this.fontWeight} ${this.fontSize}px '${this.fontName}'`;
|
||||
}
|
||||
|
||||
onPage1TransitionEnd() {
|
||||
|
||||
@@ -159,7 +159,24 @@ export default class BookParser {
|
||||
const prevParaIndex = paraIndex;
|
||||
let p = para[paraIndex];
|
||||
paraOffset -= p.length;
|
||||
//добавление пустых (addEmptyParagraphs) параграфов перед текущим непустым
|
||||
|
||||
//уберем пробелы с концов параграфа, минимум 1 пробел должен быть у пустого параграфа
|
||||
let newParaText = p.text.trim();
|
||||
newParaText = (newParaText.length ? newParaText : ' ');
|
||||
const ldiff = p.text.length - newParaText.length;
|
||||
if (ldiff != 0) {
|
||||
p.text = newParaText;
|
||||
p.length -= ldiff;
|
||||
}
|
||||
|
||||
//удаление параграфов, которые содержат только разметку, такого не должно быть
|
||||
if (!p.length) {
|
||||
delete para[paraIndex];
|
||||
paraIndex--;
|
||||
return;
|
||||
}
|
||||
|
||||
//добавление пустых (не)видимых (addEmptyParagraphs) параграфов перед текущим непустым
|
||||
if (p.text.trim() != '') {
|
||||
for (let i = 0; i < 2; i++) {
|
||||
para[paraIndex] = {
|
||||
@@ -179,15 +196,6 @@ export default class BookParser {
|
||||
curSubtitle.paraIndex = paraIndex;
|
||||
}
|
||||
|
||||
//уберем пробелы с концов параграфа, минимум 1 пробел должен быть у пустого параграфа
|
||||
let newParaText = p.text.trim();
|
||||
newParaText = (newParaText.length ? newParaText : ' ');
|
||||
const ldiff = p.text.length - newParaText.length;
|
||||
if (ldiff != 0) {
|
||||
p.text = newParaText;
|
||||
p.length -= ldiff;
|
||||
}
|
||||
|
||||
p.index = paraIndex;
|
||||
p.offset = paraOffset;
|
||||
para[paraIndex] = p;
|
||||
@@ -203,7 +211,7 @@ export default class BookParser {
|
||||
let p = {
|
||||
index: paraIndex,
|
||||
offset: paraOffset,
|
||||
length: len,
|
||||
length: len,//длина текста внутри параграфа без учета длины разметки
|
||||
text: text,
|
||||
addIndex: 0,
|
||||
};
|
||||
|
||||
@@ -6,6 +6,13 @@ const wpStore = localForage.createInstance({
|
||||
});
|
||||
|
||||
class WallpaperStorage {
|
||||
constructor() {
|
||||
this.cachedKeys = [];
|
||||
}
|
||||
|
||||
async init() {
|
||||
this.cachedKeys = await wpStore.keys();
|
||||
}
|
||||
|
||||
async getLength() {
|
||||
return await wpStore.length();
|
||||
@@ -13,6 +20,7 @@ class WallpaperStorage {
|
||||
|
||||
async setData(key, data) {
|
||||
await wpStore.setItem(key, data);
|
||||
this.cachedKeys = await wpStore.keys();
|
||||
}
|
||||
|
||||
async getData(key) {
|
||||
@@ -21,6 +29,11 @@ class WallpaperStorage {
|
||||
|
||||
async removeData(key) {
|
||||
await wpStore.removeItem(key);
|
||||
this.cachedKeys = await wpStore.keys();
|
||||
}
|
||||
|
||||
keyExists(key) {//не асинхронная
|
||||
return this.cachedKeys.includes(key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
export const versionHistory = [
|
||||
{
|
||||
showUntil: '2021-10-23',
|
||||
header: '0.10.3 (2021-10-24)',
|
||||
content:
|
||||
`
|
||||
<ul>
|
||||
<li>исправления багов</li>
|
||||
</ul>
|
||||
`
|
||||
},
|
||||
|
||||
{
|
||||
showUntil: '2021-10-18',
|
||||
header: '0.10.2 (2021-10-19)',
|
||||
content:
|
||||
`
|
||||
<ul>
|
||||
<li>актуализация версий пакетов и стека используемых технологий</li>
|
||||
</ul>
|
||||
`
|
||||
},
|
||||
|
||||
{
|
||||
showUntil: '2021-10-09',
|
||||
header: '0.10.1 (2021-10-10)',
|
||||
content:
|
||||
`
|
||||
<ul>
|
||||
<li>исправления багов</li>
|
||||
</ul>
|
||||
`
|
||||
},
|
||||
|
||||
{
|
||||
showUntil: '2021-02-16',
|
||||
header: '0.10.0 (2021-02-09)',
|
||||
|
||||
@@ -13,6 +13,10 @@ export function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export function toHex(buf) {
|
||||
return Buffer.from(buf).toString('hex');
|
||||
}
|
||||
|
||||
export function stringToHex(str) {
|
||||
return Buffer.from(str).toString('hex');
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
## Разворачивание сервера OmniReader в Ubuntu:
|
||||
## Разворачивание сервера OmniReader в Ubuntu 20.04:
|
||||
|
||||
### git, clone
|
||||
```
|
||||
cd ~
|
||||
sudo apt install ssh git
|
||||
git clone https://github.com/bookpauk/liberama
|
||||
```
|
||||
@@ -9,7 +10,7 @@ git clone https://github.com/bookpauk/liberama
|
||||
### node.js
|
||||
```
|
||||
sudo apt install -y curl
|
||||
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
|
||||
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
|
||||
sudo apt install -y nodejs
|
||||
```
|
||||
|
||||
@@ -25,41 +26,45 @@ sudo mkdir /home/liberama
|
||||
sudo chown www-data.www-data /home/liberama
|
||||
```
|
||||
|
||||
### external converter `calibre`, download from https://download.calibre-ebook.com/
|
||||
### external converter `calibre`
|
||||
#### download from https://download.calibre-ebook.com/
|
||||
```
|
||||
wget "https://download.calibre-ebook.com/5.5.0/calibre-5.5.0-x86_64.txz"
|
||||
wget "https://download.calibre-ebook.com/5.29.0/calibre-5.29.0-x86_64.txz"
|
||||
sudo -u www-data mkdir -p /home/liberama/data/calibre
|
||||
sudo -u www-data tar xvf calibre-5.5.0-x86_64.txz -C /home/liberama/data/calibre
|
||||
sudo -u www-data tar xvf calibre-5.29.0-x86_64.txz -C /home/liberama/data/calibre
|
||||
```
|
||||
|
||||
### external converters
|
||||
```
|
||||
sudo apt install rar
|
||||
sudo apt install libreoffice
|
||||
sudo apt install poppler-utils
|
||||
sudo apt install djvulibre-bin
|
||||
sudo apt install libtiff-tools
|
||||
sudo apt install graphicsmagick-imagemagick-compat
|
||||
sudo apt install rar libreoffice poppler-utils djvulibre-bin libtiff-tools graphicsmagick-imagemagick-compat
|
||||
```
|
||||
|
||||
### nginx, server config
|
||||
Для своего домена необходимо будет подправить docs/omnireader.ru/omnireader.
|
||||
Можно также настроить сервер для HTTP, без SSL.
|
||||
#### Для своего домена необходимо будет подправить docs/omnireader.ru/omnireader и docs/omnireader.ru/omnireader_http
|
||||
Сначала настроим для HTTP:
|
||||
```
|
||||
sudo apt install nginx
|
||||
sudo cp docs/omnireader.ru/omnireader /etc/nginx/sites-available/omnireader
|
||||
sudo ln -s /etc/nginx/sites-available/omnireader /etc/nginx/sites-enabled/omnireader
|
||||
sudo ln -s /etc/nginx/sites-available/omnireader_http /etc/nginx/sites-enabled/omnireader
|
||||
sudo rm /etc/nginx/sites-enabled/default
|
||||
sudo service nginx reload
|
||||
sudo chown -R www-data.www-data /var/www
|
||||
```
|
||||
|
||||
### certbot
|
||||
Следовать инструкции установки certbot https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx
|
||||
### old.omnireader
|
||||
#### Следовать инструкции установки certbot https://certbot.eff.org/lets-encrypt/ubuntufocal-nginx
|
||||
После установки сертификата, можно использовать конфиг для nginx c ssl:
|
||||
```
|
||||
sudo apt install php7.2 php7.2-curl php7.2-mbstring php7.2-fpm
|
||||
sudo service php7.2-fpm restart
|
||||
sudo cp docs/omnireader.ru/omnireader /etc/nginx/sites-available/omnireader
|
||||
sudo service nginx reload
|
||||
|
||||
```
|
||||
|
||||
### old.omnireader
|
||||
#### Старая версия omnireader на базе PHP, можно не устанавливать
|
||||
```
|
||||
sudo apt install php7.4 php7.4-curl php7.4-mbstring php7.4-fpm
|
||||
sudo service php7.4-fpm restart
|
||||
|
||||
sudo mkdir /home/oldreader
|
||||
sudo chown www-data.www-data /home/oldreader
|
||||
@@ -68,7 +73,7 @@ sudo -u www-data cp -r docs/omnireader.ru/old/* /home/oldreader
|
||||
|
||||
## Запуск по крону
|
||||
```
|
||||
* * * * * /root/liberama/docs/omnireader.ru/cron_server.sh
|
||||
* * * * * ~/liberama/docs/omnireader.ru/cron_server.sh >>~/liberama_cron.log 2>&1
|
||||
```
|
||||
|
||||
## Деплой и запуск
|
||||
@@ -78,8 +83,8 @@ cd docs/omnireader.ru
|
||||
./deploy.sh
|
||||
./start_server.sh
|
||||
```
|
||||
|
||||
После первого запуска будет создан конфигурационный файл `/home/liberama/data/config.json`.
|
||||
|
||||
Необходимо переключить приложение в режим `omnireader`, отредактировав опцию `servers`:
|
||||
```
|
||||
"servers": [
|
||||
@@ -91,4 +96,8 @@ cd docs/omnireader.ru
|
||||
}
|
||||
]
|
||||
```
|
||||
и перезапустить сервер
|
||||
Для использования установленных внешних конвертеров можно также поправить:
|
||||
```
|
||||
"useExternalBookConverter": true,
|
||||
```
|
||||
и перезапустить сервер.
|
||||
@@ -66,6 +66,6 @@ server {
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
include /etc/nginx/fastcgi.conf;
|
||||
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
|
||||
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,6 @@ server {
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
include /etc/nginx/fastcgi.conf;
|
||||
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
|
||||
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
|
||||
}
|
||||
}
|
||||
|
||||
9164
package-lock.json
generated
9164
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
63
package.json
63
package.json
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"name": "Liberama",
|
||||
"version": "0.10.0",
|
||||
"version": "0.10.3",
|
||||
"author": "Book Pauk <bookpauk@gmail.com>",
|
||||
"license": "CC0-1.0",
|
||||
"repository": "bookpauk/liberama",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
"node": ">=14.4.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nodemon --inspect --ignore server/public --ignore server/data --ignore client --exec 'node server'",
|
||||
"build:client": "webpack --config build/webpack.prod.config.js",
|
||||
"build:linux": "npm run build:client && node build/linux && pkg -t node12-linux-x64 -o dist/linux/liberama .",
|
||||
"build:win": "npm run build:client && node build/win && pkg -t node12-win-x64 -o dist/win/liberama .",
|
||||
"build:linux": "npm run build:client && node build/linux && pkg -t node14-linux-x64 -o dist/linux/liberama .",
|
||||
"build:win": "npm run build:client && node build/win && pkg -t node14-win-x64 -o dist/win/liberama .",
|
||||
"lint": "eslint --ext=.js,.vue client server",
|
||||
"build:client-dev": "webpack --config build/webpack.dev.config.js",
|
||||
"postinstall": "npm run build:client-dev && node build/linux"
|
||||
@@ -30,7 +30,7 @@
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"clean-webpack-plugin": "^1.0.1",
|
||||
"copy-webpack-plugin": "^5.1.1",
|
||||
"copy-webpack-plugin": "^5.1.2",
|
||||
"css-loader": "^1.0.0",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-plugin-html": "^5.0.5",
|
||||
@@ -39,23 +39,22 @@
|
||||
"file-loader": "^3.0.1",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"mini-css-extract-plugin": "^0.5.0",
|
||||
"optimize-css-assets-webpack-plugin": "^5.0.3",
|
||||
"pkg": "^4.4.4",
|
||||
"terser-webpack-plugin": "^1.4.1",
|
||||
"optimize-css-assets-webpack-plugin": "^5.0.8",
|
||||
"terser-webpack-plugin": "^1.4.5",
|
||||
"url-loader": "^1.1.2",
|
||||
"vue-class-component": "^6.3.2",
|
||||
"vue-loader": "^15.9.0",
|
||||
"vue-style-loader": "^4.1.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack-dev-middleware": "^3.7.2",
|
||||
"webpack-hot-middleware": "^2.25.0",
|
||||
"vue-loader": "^15.9.8",
|
||||
"vue-style-loader": "^4.1.3",
|
||||
"vue-template-compiler": "^2.6.14",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-middleware": "^3.7.3",
|
||||
"webpack-hot-middleware": "^2.25.1",
|
||||
"webpack-merge": "^4.2.2",
|
||||
"workbox-webpack-plugin": "^5.1.3"
|
||||
"workbox-webpack-plugin": "^5.1.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@quasar/extras": "^1.5.2",
|
||||
"@quasar/extras": "^1.11.2",
|
||||
"axios": "^0.18.1",
|
||||
"base-x": "^3.0.8",
|
||||
"chardet": "^0.7.0",
|
||||
@@ -66,27 +65,29 @@
|
||||
"got": "^9.6.0",
|
||||
"he": "^1.2.0",
|
||||
"iconv-lite": "^0.4.24",
|
||||
"localforage": "^1.7.3",
|
||||
"lodash": "^4.17.15",
|
||||
"minimist": "^1.2.0",
|
||||
"multer": "^1.4.2",
|
||||
"localforage": "^1.10.0",
|
||||
"lodash": "^4.17.21",
|
||||
"minimist": "^1.2.5",
|
||||
"multer": "^1.4.3",
|
||||
"pako": "^1.0.11",
|
||||
"path-browserify": "^1.0.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"pidusage": "^2.0.21",
|
||||
"quasar": "^1.14.3",
|
||||
"safe-buffer": "^5.2.0",
|
||||
"pkg": "^4.4.9",
|
||||
"quasar": "^1.16.0",
|
||||
"safe-buffer": "^5.2.1",
|
||||
"sjcl": "^1.0.8",
|
||||
"sql-template-strings": "^2.2.2",
|
||||
"sqlite": "^3.0.3",
|
||||
"tar-fs": "^2.0.0",
|
||||
"unbzip2-stream": "^1.3.3",
|
||||
"vue": "github:bookpauk/vue",
|
||||
"vue-router": "^3.1.6",
|
||||
"sqlite": "^4.0.23",
|
||||
"sqlite3": "^5.0.2",
|
||||
"tar-fs": "^2.1.1",
|
||||
"unbzip2-stream": "^1.4.3",
|
||||
"vue": "^2.6.14",
|
||||
"vue-router": "^3.5.2",
|
||||
"vue-sanitize": "^0.2.1",
|
||||
"vuex": "^3.1.2",
|
||||
"vuex": "^3.6.2",
|
||||
"vuex-persistedstate": "^2.7.1",
|
||||
"webdav": "^2.10.2",
|
||||
"ws": "^7.2.1",
|
||||
"ws": "^7.5.5",
|
||||
"zip-stream": "^2.1.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,11 +210,11 @@ class ConvertSamlib extends ConvertBase {
|
||||
};
|
||||
|
||||
const onComment = (text) => {// eslint-disable-line no-unused-vars
|
||||
if (text == '--------- Собственно произведение -------------') {
|
||||
if (text.trim() == '--------- Собственно произведение -------------') {
|
||||
inText = true;
|
||||
textFound = true;
|
||||
}
|
||||
if (text == '-----------------------------------------------')
|
||||
if (text.trim() == '-----------------------------------------------')
|
||||
inText = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ const SqliteConnectionPool = require('./SqliteConnectionPool');
|
||||
const log = new (require('../core/AppLogger'))().log;//singleton
|
||||
|
||||
const migrations = {
|
||||
'app': require('./migrations/app'),
|
||||
'readerStorage': require('./migrations/readerStorage'),
|
||||
};
|
||||
|
||||
let instance = null;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const sqlite3 = require('sqlite3');
|
||||
const sqlite = require('sqlite');
|
||||
|
||||
const SQL = require('sql-template-strings');
|
||||
|
||||
class SqliteConnectionPool {
|
||||
@@ -17,7 +19,10 @@ class SqliteConnectionPool {
|
||||
this.waitingQueue = [];
|
||||
|
||||
for (let i = 0; i < connCount; i++) {
|
||||
let client = await sqlite.open(dbFileName);
|
||||
let client = await sqlite.open({
|
||||
filename: dbFileName,
|
||||
driver: sqlite3.Database
|
||||
});
|
||||
|
||||
client.configure('busyTimeout', busyTimeout); //ms
|
||||
await client.exec(`PRAGMA cache_size = ${cacheSize}`);
|
||||
|
||||
Reference in New Issue
Block a user