diff --git a/.gitignore b/.gitignore index 76857c0..3af2fd9 100644 --- a/.gitignore +++ b/.gitignore @@ -89,4 +89,6 @@ Temporary Items .ftppass -*.sqlite \ No newline at end of file +*.sqlite + +cards/ \ No newline at end of file diff --git a/api/middleware/genCards.js b/api/middleware/genCards.js index 38e7ee6..2fa9aee 100644 --- a/api/middleware/genCards.js +++ b/api/middleware/genCards.js @@ -4,55 +4,100 @@ const path = require('path'); const { chromium } = require('playwright'); const sharp = require('sharp'); -const DIR = process.env.CARDS_PATH || '../cards'; +let globalBrowser; +const queue = []; +let isProcessing = false; -async function genCards({ id, type }) { - if (!process.env.DOMAIN) throw new Error("❌ DOMAIN не заданий у .env"); - if (!process.env.ADMIN_TOKEN) throw new Error("❌ ADMIN_TOKEN не заданий у .env"); - if (!process.env.CARDS_PATH) throw new Error("❌ CARDS_PATH не заданий у .env"); +// Ініціалізація браузера (один раз на весь життєвий цикл додатка) +async function getBrowser() { + if (!globalBrowser) { + globalBrowser = await chromium.launch({ + executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || undefined, + args: [ + '--no-sandbox', + '--disable-setuid-sandbox', + '--disable-gpu', + '--disable-dev-shm-usage' + ] + }); + } + return globalBrowser; +} +// Функція обробки черги +async function processQueue() { + if (isProcessing || queue.length === 0) return; - const name = type == 'homestead' ? `H${id}` : `T${id}` + isProcessing = true; + const { task, resolve, reject } = queue.shift(); - const URL = `https://${process.env.DOMAIN}/api/${type}/${id}`; // Замени на свой URL - const AUTH_TOKEN = process.env.ADMIN_TOKEN; - const DIR = process.env.CARDS_PATH || '../cards'; - const SCREENSHOT_FILE = path.resolve(`${DIR}/cache/${type}/${name}.png`); - const OUTPUT_FILE = path.resolve(`${DIR}/${type}/${name}.webp`); + try { + const result = await runGeneration(task); + resolve(result); + } catch (err) { + reject(err); + } finally { + isProcessing = false; + processQueue(); // беремо наступне завдання + } +} +// Основна логіка генерації +async function runGeneration({ id, type }) { + const { DOMAIN, ADMIN_TOKEN, CARDS_PATH } = process.env; + const name = type === 'homestead' ? `H${id}` : `T${id}`; + const URL = `https://${DOMAIN}/api/${type}/${id}`; + + const baseDir = path.resolve(CARDS_PATH); + const cacheDir = path.join(baseDir, 'cache', type); + const outputDir = path.join(baseDir, type); - // --- Отримуємо дані --- + fs.mkdirSync(cacheDir, { recursive: true }); + fs.mkdirSync(outputDir, { recursive: true }); + + const SCREENSHOT_FILE = path.join(cacheDir, `${name}.png`); + const OUTPUT_FILE = path.join(outputDir, `${name}.webp`); + + // 1. Отримання даних const res = await fetch(URL, { - headers: { 'Authorization': AUTH_TOKEN, 'Accept': 'application/json' } + headers: { 'Authorization': ADMIN_TOKEN, 'Accept': 'application/json' } }); - if (!res.ok) throw new Error(`Помилка запиту: ${res.status}`); + if (!res.ok) throw new Error(`API Error: ${res.status}`); const data = await res.json(); - // --- Генеруємо HTML --- + // 2. Підготовка HTML + const tmpFile = path.join(os.tmpdir(), `map_${type}_${id}_${Date.now()}.html`); const html = `

Картка плану території

`; - - // --- Зберігаємо тимчасовий HTML --- - const tmpFile = path.join(os.tmpdir(), 'map.html'); fs.writeFileSync(tmpFile, html, 'utf-8'); - // --- Зберігаємо --- - // const browser = await chromium.launch(); - const browser = await chromium.launch({ - executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || '/usr/bin/chromium-browser', - args: ['--no-sandbox', '--disable-setuid-sandbox'] + let page; + try { + const browser = await getBrowser(); + page = await browser.newPage({ viewport: { width: 811, height: 531 } }); + + await page.goto(`file://${tmpFile}`, { waitUntil: 'networkidle', timeout: 30000 }); + await page.waitForTimeout(2000); + + const buffer = await page.screenshot(); + + // Зберігаємо файли + await fs.promises.writeFile(SCREENSHOT_FILE, buffer); + await sharp(buffer).webp({ quality: 85 }).toFile(OUTPUT_FILE); + + console.log(`✅ Зображення оновлено: ${name}.webp`); + return true; + } finally { + if (page) await page.close(); + if (fs.existsSync(tmpFile)) fs.unlinkSync(tmpFile); // Обов'язково видаляємо сміття + } +} + +// Експортуємо функцію, яка додає завдання в чергу +function genCards(params) { + return new Promise((resolve, reject) => { + queue.push({ task: params, resolve, reject }); + processQueue(); }); - const page = await browser.newPage({ viewport: { width: 811, height: 531 } }); - await page.goto(`file://${tmpFile}`); - await page.waitForTimeout(2000); // пауза 1 секунда для провантаження карти - await page.screenshot({ path: SCREENSHOT_FILE }); - await browser.close(); - - await sharp(SCREENSHOT_FILE) - .webp() - .toFile(OUTPUT_FILE); - - console.log(`Зображеня збережене: ${name}.png`); - // return fs.existsSync(OUTPUT_FILE); } module.exports = genCards; \ No newline at end of file diff --git a/data/cards/cache/T80.png b/data/cards/cache/T80.png deleted file mode 100644 index 79e6c2c..0000000 Binary files a/data/cards/cache/T80.png and /dev/null differ diff --git a/data/cards/cache/house/T81.png b/data/cards/cache/house/T81.png deleted file mode 100644 index 6522424..0000000 Binary files a/data/cards/cache/house/T81.png and /dev/null differ diff --git a/data/cards/homestead/H1.webp b/data/cards/homestead/H1.webp deleted file mode 100644 index 8583df6..0000000 Binary files a/data/cards/homestead/H1.webp and /dev/null differ diff --git a/data/cards/homestead/H10.webp b/data/cards/homestead/H10.webp deleted file mode 100644 index 8d7c559..0000000 Binary files a/data/cards/homestead/H10.webp and /dev/null differ diff --git a/data/cards/homestead/H11.webp b/data/cards/homestead/H11.webp deleted file mode 100644 index 44c3fab..0000000 Binary files a/data/cards/homestead/H11.webp and /dev/null differ diff --git a/data/cards/homestead/H12.webp b/data/cards/homestead/H12.webp deleted file mode 100644 index 2d2eb90..0000000 Binary files a/data/cards/homestead/H12.webp and /dev/null differ diff --git a/data/cards/homestead/H13.webp b/data/cards/homestead/H13.webp deleted file mode 100644 index 0c64444..0000000 Binary files a/data/cards/homestead/H13.webp and /dev/null differ diff --git a/data/cards/homestead/H14.webp b/data/cards/homestead/H14.webp deleted file mode 100644 index bf19f00..0000000 Binary files a/data/cards/homestead/H14.webp and /dev/null differ diff --git a/data/cards/homestead/H15.webp b/data/cards/homestead/H15.webp deleted file mode 100644 index fc7c537..0000000 Binary files a/data/cards/homestead/H15.webp and /dev/null differ diff --git a/data/cards/homestead/H16.webp b/data/cards/homestead/H16.webp deleted file mode 100644 index a0d9880..0000000 Binary files a/data/cards/homestead/H16.webp and /dev/null differ diff --git a/data/cards/homestead/H17.webp b/data/cards/homestead/H17.webp deleted file mode 100644 index 7f1c241..0000000 Binary files a/data/cards/homestead/H17.webp and /dev/null differ diff --git a/data/cards/homestead/H18.webp b/data/cards/homestead/H18.webp deleted file mode 100644 index a87ec62..0000000 Binary files a/data/cards/homestead/H18.webp and /dev/null differ diff --git a/data/cards/homestead/H19.webp b/data/cards/homestead/H19.webp deleted file mode 100644 index 5933109..0000000 Binary files a/data/cards/homestead/H19.webp and /dev/null differ diff --git a/data/cards/homestead/H2.webp b/data/cards/homestead/H2.webp deleted file mode 100644 index ec43849..0000000 Binary files a/data/cards/homestead/H2.webp and /dev/null differ diff --git a/data/cards/homestead/H20.webp b/data/cards/homestead/H20.webp deleted file mode 100644 index 5a71838..0000000 Binary files a/data/cards/homestead/H20.webp and /dev/null differ diff --git a/data/cards/homestead/H21.webp b/data/cards/homestead/H21.webp deleted file mode 100644 index 23ec082..0000000 Binary files a/data/cards/homestead/H21.webp and /dev/null differ diff --git a/data/cards/homestead/H22.webp b/data/cards/homestead/H22.webp deleted file mode 100644 index 129a9cd..0000000 Binary files a/data/cards/homestead/H22.webp and /dev/null differ diff --git a/data/cards/homestead/H23.webp b/data/cards/homestead/H23.webp deleted file mode 100644 index 35fdc79..0000000 Binary files a/data/cards/homestead/H23.webp and /dev/null differ diff --git a/data/cards/homestead/H24.webp b/data/cards/homestead/H24.webp deleted file mode 100644 index ead9d41..0000000 Binary files a/data/cards/homestead/H24.webp and /dev/null differ diff --git a/data/cards/homestead/H25.webp b/data/cards/homestead/H25.webp deleted file mode 100644 index 8de6110..0000000 Binary files a/data/cards/homestead/H25.webp and /dev/null differ diff --git a/data/cards/homestead/H26.webp b/data/cards/homestead/H26.webp deleted file mode 100644 index 86315a6..0000000 Binary files a/data/cards/homestead/H26.webp and /dev/null differ diff --git a/data/cards/homestead/H27.webp b/data/cards/homestead/H27.webp deleted file mode 100644 index 2848746..0000000 Binary files a/data/cards/homestead/H27.webp and /dev/null differ diff --git a/data/cards/homestead/H28.webp b/data/cards/homestead/H28.webp deleted file mode 100644 index d9feb19..0000000 Binary files a/data/cards/homestead/H28.webp and /dev/null differ diff --git a/data/cards/homestead/H29.webp b/data/cards/homestead/H29.webp deleted file mode 100644 index 1ca6545..0000000 Binary files a/data/cards/homestead/H29.webp and /dev/null differ diff --git a/data/cards/homestead/H3.webp b/data/cards/homestead/H3.webp deleted file mode 100644 index efa0898..0000000 Binary files a/data/cards/homestead/H3.webp and /dev/null differ diff --git a/data/cards/homestead/H30.webp b/data/cards/homestead/H30.webp deleted file mode 100644 index a5cb91e..0000000 Binary files a/data/cards/homestead/H30.webp and /dev/null differ diff --git a/data/cards/homestead/H31.webp b/data/cards/homestead/H31.webp deleted file mode 100644 index ce181d8..0000000 Binary files a/data/cards/homestead/H31.webp and /dev/null differ diff --git a/data/cards/homestead/H32.webp b/data/cards/homestead/H32.webp deleted file mode 100644 index 23cd43c..0000000 Binary files a/data/cards/homestead/H32.webp and /dev/null differ diff --git a/data/cards/homestead/H33.webp b/data/cards/homestead/H33.webp deleted file mode 100644 index cbacded..0000000 Binary files a/data/cards/homestead/H33.webp and /dev/null differ diff --git a/data/cards/homestead/H34.webp b/data/cards/homestead/H34.webp deleted file mode 100644 index a3598a2..0000000 Binary files a/data/cards/homestead/H34.webp and /dev/null differ diff --git a/data/cards/homestead/H35.webp b/data/cards/homestead/H35.webp deleted file mode 100644 index 20dc496..0000000 Binary files a/data/cards/homestead/H35.webp and /dev/null differ diff --git a/data/cards/homestead/H36.webp b/data/cards/homestead/H36.webp deleted file mode 100644 index 44f8423..0000000 Binary files a/data/cards/homestead/H36.webp and /dev/null differ diff --git a/data/cards/homestead/H37.webp b/data/cards/homestead/H37.webp deleted file mode 100644 index 3a8a8ad..0000000 Binary files a/data/cards/homestead/H37.webp and /dev/null differ diff --git a/data/cards/homestead/H38.webp b/data/cards/homestead/H38.webp deleted file mode 100644 index bbf7294..0000000 Binary files a/data/cards/homestead/H38.webp and /dev/null differ diff --git a/data/cards/homestead/H39.webp b/data/cards/homestead/H39.webp deleted file mode 100644 index d843a0d..0000000 Binary files a/data/cards/homestead/H39.webp and /dev/null differ diff --git a/data/cards/homestead/H4.webp b/data/cards/homestead/H4.webp deleted file mode 100644 index a2f77b0..0000000 Binary files a/data/cards/homestead/H4.webp and /dev/null differ diff --git a/data/cards/homestead/H40.webp b/data/cards/homestead/H40.webp deleted file mode 100644 index f3954c7..0000000 Binary files a/data/cards/homestead/H40.webp and /dev/null differ diff --git a/data/cards/homestead/H41.webp b/data/cards/homestead/H41.webp deleted file mode 100644 index 0333982..0000000 Binary files a/data/cards/homestead/H41.webp and /dev/null differ diff --git a/data/cards/homestead/H42.webp b/data/cards/homestead/H42.webp deleted file mode 100644 index 5669a11..0000000 Binary files a/data/cards/homestead/H42.webp and /dev/null differ diff --git a/data/cards/homestead/H43.webp b/data/cards/homestead/H43.webp deleted file mode 100644 index 6eb117a..0000000 Binary files a/data/cards/homestead/H43.webp and /dev/null differ diff --git a/data/cards/homestead/H44.webp b/data/cards/homestead/H44.webp deleted file mode 100644 index f56eab4..0000000 Binary files a/data/cards/homestead/H44.webp and /dev/null differ diff --git a/data/cards/homestead/H45.webp b/data/cards/homestead/H45.webp deleted file mode 100644 index 89bd659..0000000 Binary files a/data/cards/homestead/H45.webp and /dev/null differ diff --git a/data/cards/homestead/H46.webp b/data/cards/homestead/H46.webp deleted file mode 100644 index 760990e..0000000 Binary files a/data/cards/homestead/H46.webp and /dev/null differ diff --git a/data/cards/homestead/H47.webp b/data/cards/homestead/H47.webp deleted file mode 100644 index 1c12d19..0000000 Binary files a/data/cards/homestead/H47.webp and /dev/null differ diff --git a/data/cards/homestead/H48.webp b/data/cards/homestead/H48.webp deleted file mode 100644 index b636727..0000000 Binary files a/data/cards/homestead/H48.webp and /dev/null differ diff --git a/data/cards/homestead/H49.webp b/data/cards/homestead/H49.webp deleted file mode 100644 index ed7286f..0000000 Binary files a/data/cards/homestead/H49.webp and /dev/null differ diff --git a/data/cards/homestead/H5.webp b/data/cards/homestead/H5.webp deleted file mode 100644 index ef58148..0000000 Binary files a/data/cards/homestead/H5.webp and /dev/null differ diff --git a/data/cards/homestead/H50.webp b/data/cards/homestead/H50.webp deleted file mode 100644 index c310778..0000000 Binary files a/data/cards/homestead/H50.webp and /dev/null differ diff --git a/data/cards/homestead/H51.webp b/data/cards/homestead/H51.webp deleted file mode 100644 index c6a26b5..0000000 Binary files a/data/cards/homestead/H51.webp and /dev/null differ diff --git a/data/cards/homestead/H52.webp b/data/cards/homestead/H52.webp deleted file mode 100644 index 7194a1a..0000000 Binary files a/data/cards/homestead/H52.webp and /dev/null differ diff --git a/data/cards/homestead/H53.webp b/data/cards/homestead/H53.webp deleted file mode 100644 index b4bdbce..0000000 Binary files a/data/cards/homestead/H53.webp and /dev/null differ diff --git a/data/cards/homestead/H54.webp b/data/cards/homestead/H54.webp deleted file mode 100644 index cd6ca54..0000000 Binary files a/data/cards/homestead/H54.webp and /dev/null differ diff --git a/data/cards/homestead/H55.webp b/data/cards/homestead/H55.webp deleted file mode 100644 index 51f7f18..0000000 Binary files a/data/cards/homestead/H55.webp and /dev/null differ diff --git a/data/cards/homestead/H56.webp b/data/cards/homestead/H56.webp deleted file mode 100644 index 5643998..0000000 Binary files a/data/cards/homestead/H56.webp and /dev/null differ diff --git a/data/cards/homestead/H57.webp b/data/cards/homestead/H57.webp deleted file mode 100644 index 14f89d9..0000000 Binary files a/data/cards/homestead/H57.webp and /dev/null differ diff --git a/data/cards/homestead/H58.webp b/data/cards/homestead/H58.webp deleted file mode 100644 index cc6df5c..0000000 Binary files a/data/cards/homestead/H58.webp and /dev/null differ diff --git a/data/cards/homestead/H59.webp b/data/cards/homestead/H59.webp deleted file mode 100644 index cceba7e..0000000 Binary files a/data/cards/homestead/H59.webp and /dev/null differ diff --git a/data/cards/homestead/H6.webp b/data/cards/homestead/H6.webp deleted file mode 100644 index 90bcda1..0000000 Binary files a/data/cards/homestead/H6.webp and /dev/null differ diff --git a/data/cards/homestead/H60.webp b/data/cards/homestead/H60.webp deleted file mode 100644 index 4cfcb12..0000000 Binary files a/data/cards/homestead/H60.webp and /dev/null differ diff --git a/data/cards/homestead/H61.webp b/data/cards/homestead/H61.webp deleted file mode 100644 index f721727..0000000 Binary files a/data/cards/homestead/H61.webp and /dev/null differ diff --git a/data/cards/homestead/H62.webp b/data/cards/homestead/H62.webp deleted file mode 100644 index 7125b3b..0000000 Binary files a/data/cards/homestead/H62.webp and /dev/null differ diff --git a/data/cards/homestead/H63.webp b/data/cards/homestead/H63.webp deleted file mode 100644 index cc239d0..0000000 Binary files a/data/cards/homestead/H63.webp and /dev/null differ diff --git a/data/cards/homestead/H64.webp b/data/cards/homestead/H64.webp deleted file mode 100644 index e367fdf..0000000 Binary files a/data/cards/homestead/H64.webp and /dev/null differ diff --git a/data/cards/homestead/H65.webp b/data/cards/homestead/H65.webp deleted file mode 100644 index 920ecfe..0000000 Binary files a/data/cards/homestead/H65.webp and /dev/null differ diff --git a/data/cards/homestead/H66.webp b/data/cards/homestead/H66.webp deleted file mode 100644 index d1b01a7..0000000 Binary files a/data/cards/homestead/H66.webp and /dev/null differ diff --git a/data/cards/homestead/H67.webp b/data/cards/homestead/H67.webp deleted file mode 100644 index 5a2d034..0000000 Binary files a/data/cards/homestead/H67.webp and /dev/null differ diff --git a/data/cards/homestead/H68.webp b/data/cards/homestead/H68.webp deleted file mode 100644 index 4d6307f..0000000 Binary files a/data/cards/homestead/H68.webp and /dev/null differ diff --git a/data/cards/homestead/H69.webp b/data/cards/homestead/H69.webp deleted file mode 100644 index 010bfb1..0000000 Binary files a/data/cards/homestead/H69.webp and /dev/null differ diff --git a/data/cards/homestead/H7.webp b/data/cards/homestead/H7.webp deleted file mode 100644 index 1027492..0000000 Binary files a/data/cards/homestead/H7.webp and /dev/null differ diff --git a/data/cards/homestead/H70.webp b/data/cards/homestead/H70.webp deleted file mode 100644 index bd4290f..0000000 Binary files a/data/cards/homestead/H70.webp and /dev/null differ diff --git a/data/cards/homestead/H71.webp b/data/cards/homestead/H71.webp deleted file mode 100644 index 93e6c1a..0000000 Binary files a/data/cards/homestead/H71.webp and /dev/null differ diff --git a/data/cards/homestead/H72.webp b/data/cards/homestead/H72.webp deleted file mode 100644 index 7b9b079..0000000 Binary files a/data/cards/homestead/H72.webp and /dev/null differ diff --git a/data/cards/homestead/H73.webp b/data/cards/homestead/H73.webp deleted file mode 100644 index c8113c8..0000000 Binary files a/data/cards/homestead/H73.webp and /dev/null differ diff --git a/data/cards/homestead/H74.webp b/data/cards/homestead/H74.webp deleted file mode 100644 index 9c7d215..0000000 Binary files a/data/cards/homestead/H74.webp and /dev/null differ diff --git a/data/cards/homestead/H75.webp b/data/cards/homestead/H75.webp deleted file mode 100644 index bf23def..0000000 Binary files a/data/cards/homestead/H75.webp and /dev/null differ diff --git a/data/cards/homestead/H76.webp b/data/cards/homestead/H76.webp deleted file mode 100644 index db26f75..0000000 Binary files a/data/cards/homestead/H76.webp and /dev/null differ diff --git a/data/cards/homestead/H8.webp b/data/cards/homestead/H8.webp deleted file mode 100644 index 48ff2d3..0000000 Binary files a/data/cards/homestead/H8.webp and /dev/null differ diff --git a/data/cards/homestead/H9.webp b/data/cards/homestead/H9.webp deleted file mode 100644 index dcd0b0e..0000000 Binary files a/data/cards/homestead/H9.webp and /dev/null differ diff --git a/data/cards/house/T1.webp b/data/cards/house/T1.webp deleted file mode 100644 index 0cfb8ac..0000000 Binary files a/data/cards/house/T1.webp and /dev/null differ diff --git a/data/cards/house/T10.webp b/data/cards/house/T10.webp deleted file mode 100644 index 19b3adc..0000000 Binary files a/data/cards/house/T10.webp and /dev/null differ diff --git a/data/cards/house/T11.webp b/data/cards/house/T11.webp deleted file mode 100644 index 0ca5ebd..0000000 Binary files a/data/cards/house/T11.webp and /dev/null differ diff --git a/data/cards/house/T12.webp b/data/cards/house/T12.webp deleted file mode 100644 index 8567b3c..0000000 Binary files a/data/cards/house/T12.webp and /dev/null differ diff --git a/data/cards/house/T13.webp b/data/cards/house/T13.webp deleted file mode 100644 index f16bf9c..0000000 Binary files a/data/cards/house/T13.webp and /dev/null differ diff --git a/data/cards/house/T14.webp b/data/cards/house/T14.webp deleted file mode 100644 index 2d0446f..0000000 Binary files a/data/cards/house/T14.webp and /dev/null differ diff --git a/data/cards/house/T15.webp b/data/cards/house/T15.webp deleted file mode 100644 index 0202bfd..0000000 Binary files a/data/cards/house/T15.webp and /dev/null differ diff --git a/data/cards/house/T16.webp b/data/cards/house/T16.webp deleted file mode 100644 index 5c7888b..0000000 Binary files a/data/cards/house/T16.webp and /dev/null differ diff --git a/data/cards/house/T17.webp b/data/cards/house/T17.webp deleted file mode 100644 index f4ff860..0000000 Binary files a/data/cards/house/T17.webp and /dev/null differ diff --git a/data/cards/house/T18.webp b/data/cards/house/T18.webp deleted file mode 100644 index dfddb65..0000000 Binary files a/data/cards/house/T18.webp and /dev/null differ diff --git a/data/cards/house/T19.webp b/data/cards/house/T19.webp deleted file mode 100644 index c112570..0000000 Binary files a/data/cards/house/T19.webp and /dev/null differ diff --git a/data/cards/house/T2.webp b/data/cards/house/T2.webp deleted file mode 100644 index fed0cec..0000000 Binary files a/data/cards/house/T2.webp and /dev/null differ diff --git a/data/cards/house/T20.webp b/data/cards/house/T20.webp deleted file mode 100644 index b4a57d4..0000000 Binary files a/data/cards/house/T20.webp and /dev/null differ diff --git a/data/cards/house/T21.webp b/data/cards/house/T21.webp deleted file mode 100644 index 46e1b4d..0000000 Binary files a/data/cards/house/T21.webp and /dev/null differ diff --git a/data/cards/house/T22.webp b/data/cards/house/T22.webp deleted file mode 100644 index 8ec88e6..0000000 Binary files a/data/cards/house/T22.webp and /dev/null differ diff --git a/data/cards/house/T23.webp b/data/cards/house/T23.webp deleted file mode 100644 index 43e459a..0000000 Binary files a/data/cards/house/T23.webp and /dev/null differ diff --git a/data/cards/house/T24.webp b/data/cards/house/T24.webp deleted file mode 100644 index be440cb..0000000 Binary files a/data/cards/house/T24.webp and /dev/null differ diff --git a/data/cards/house/T25.webp b/data/cards/house/T25.webp deleted file mode 100644 index 97e578d..0000000 Binary files a/data/cards/house/T25.webp and /dev/null differ diff --git a/data/cards/house/T26.webp b/data/cards/house/T26.webp deleted file mode 100644 index 2830b3e..0000000 Binary files a/data/cards/house/T26.webp and /dev/null differ diff --git a/data/cards/house/T27.webp b/data/cards/house/T27.webp deleted file mode 100644 index b263c9a..0000000 Binary files a/data/cards/house/T27.webp and /dev/null differ diff --git a/data/cards/house/T28.webp b/data/cards/house/T28.webp deleted file mode 100644 index b6f0721..0000000 Binary files a/data/cards/house/T28.webp and /dev/null differ diff --git a/data/cards/house/T29.webp b/data/cards/house/T29.webp deleted file mode 100644 index b64189e..0000000 Binary files a/data/cards/house/T29.webp and /dev/null differ diff --git a/data/cards/house/T3.webp b/data/cards/house/T3.webp deleted file mode 100644 index 0018b68..0000000 Binary files a/data/cards/house/T3.webp and /dev/null differ diff --git a/data/cards/house/T30.webp b/data/cards/house/T30.webp deleted file mode 100644 index 0cc1711..0000000 Binary files a/data/cards/house/T30.webp and /dev/null differ diff --git a/data/cards/house/T31.webp b/data/cards/house/T31.webp deleted file mode 100644 index 2d88f81..0000000 Binary files a/data/cards/house/T31.webp and /dev/null differ diff --git a/data/cards/house/T32.webp b/data/cards/house/T32.webp deleted file mode 100644 index d2fa7cd..0000000 Binary files a/data/cards/house/T32.webp and /dev/null differ diff --git a/data/cards/house/T33.webp b/data/cards/house/T33.webp deleted file mode 100644 index e2b7004..0000000 Binary files a/data/cards/house/T33.webp and /dev/null differ diff --git a/data/cards/house/T34.webp b/data/cards/house/T34.webp deleted file mode 100644 index 16c8df8..0000000 Binary files a/data/cards/house/T34.webp and /dev/null differ diff --git a/data/cards/house/T35.webp b/data/cards/house/T35.webp deleted file mode 100644 index 2396cee..0000000 Binary files a/data/cards/house/T35.webp and /dev/null differ diff --git a/data/cards/house/T36.webp b/data/cards/house/T36.webp deleted file mode 100644 index 3608c64..0000000 Binary files a/data/cards/house/T36.webp and /dev/null differ diff --git a/data/cards/house/T37.webp b/data/cards/house/T37.webp deleted file mode 100644 index 16511c9..0000000 Binary files a/data/cards/house/T37.webp and /dev/null differ diff --git a/data/cards/house/T38.webp b/data/cards/house/T38.webp deleted file mode 100644 index 382b1a4..0000000 Binary files a/data/cards/house/T38.webp and /dev/null differ diff --git a/data/cards/house/T39.webp b/data/cards/house/T39.webp deleted file mode 100644 index 1fd3429..0000000 Binary files a/data/cards/house/T39.webp and /dev/null differ diff --git a/data/cards/house/T4.webp b/data/cards/house/T4.webp deleted file mode 100644 index 546b744..0000000 Binary files a/data/cards/house/T4.webp and /dev/null differ diff --git a/data/cards/house/T40.webp b/data/cards/house/T40.webp deleted file mode 100644 index 762ebd9..0000000 Binary files a/data/cards/house/T40.webp and /dev/null differ diff --git a/data/cards/house/T41.webp b/data/cards/house/T41.webp deleted file mode 100644 index 7495f29..0000000 Binary files a/data/cards/house/T41.webp and /dev/null differ diff --git a/data/cards/house/T42.webp b/data/cards/house/T42.webp deleted file mode 100644 index 9cce2cb..0000000 Binary files a/data/cards/house/T42.webp and /dev/null differ diff --git a/data/cards/house/T43.webp b/data/cards/house/T43.webp deleted file mode 100644 index faad372..0000000 Binary files a/data/cards/house/T43.webp and /dev/null differ diff --git a/data/cards/house/T44.webp b/data/cards/house/T44.webp deleted file mode 100644 index 119c8f9..0000000 Binary files a/data/cards/house/T44.webp and /dev/null differ diff --git a/data/cards/house/T45.webp b/data/cards/house/T45.webp deleted file mode 100644 index 3bad107..0000000 Binary files a/data/cards/house/T45.webp and /dev/null differ diff --git a/data/cards/house/T46.webp b/data/cards/house/T46.webp deleted file mode 100644 index 270aaf8..0000000 Binary files a/data/cards/house/T46.webp and /dev/null differ diff --git a/data/cards/house/T47.webp b/data/cards/house/T47.webp deleted file mode 100644 index a23179d..0000000 Binary files a/data/cards/house/T47.webp and /dev/null differ diff --git a/data/cards/house/T48.webp b/data/cards/house/T48.webp deleted file mode 100644 index 4414475..0000000 Binary files a/data/cards/house/T48.webp and /dev/null differ diff --git a/data/cards/house/T49.webp b/data/cards/house/T49.webp deleted file mode 100644 index 9ecf9fd..0000000 Binary files a/data/cards/house/T49.webp and /dev/null differ diff --git a/data/cards/house/T5.webp b/data/cards/house/T5.webp deleted file mode 100644 index 276a6bc..0000000 Binary files a/data/cards/house/T5.webp and /dev/null differ diff --git a/data/cards/house/T50.webp b/data/cards/house/T50.webp deleted file mode 100644 index 2848be3..0000000 Binary files a/data/cards/house/T50.webp and /dev/null differ diff --git a/data/cards/house/T51.webp b/data/cards/house/T51.webp deleted file mode 100644 index a12f7a2..0000000 Binary files a/data/cards/house/T51.webp and /dev/null differ diff --git a/data/cards/house/T52.webp b/data/cards/house/T52.webp deleted file mode 100644 index dd8e2da..0000000 Binary files a/data/cards/house/T52.webp and /dev/null differ diff --git a/data/cards/house/T53.webp b/data/cards/house/T53.webp deleted file mode 100644 index f29b631..0000000 Binary files a/data/cards/house/T53.webp and /dev/null differ diff --git a/data/cards/house/T54.webp b/data/cards/house/T54.webp deleted file mode 100644 index c5dac73..0000000 Binary files a/data/cards/house/T54.webp and /dev/null differ diff --git a/data/cards/house/T55.webp b/data/cards/house/T55.webp deleted file mode 100644 index 47474df..0000000 Binary files a/data/cards/house/T55.webp and /dev/null differ diff --git a/data/cards/house/T56.webp b/data/cards/house/T56.webp deleted file mode 100644 index 2c57803..0000000 Binary files a/data/cards/house/T56.webp and /dev/null differ diff --git a/data/cards/house/T57.webp b/data/cards/house/T57.webp deleted file mode 100644 index 264ec11..0000000 Binary files a/data/cards/house/T57.webp and /dev/null differ diff --git a/data/cards/house/T58.webp b/data/cards/house/T58.webp deleted file mode 100644 index 60e5aef..0000000 Binary files a/data/cards/house/T58.webp and /dev/null differ diff --git a/data/cards/house/T59.webp b/data/cards/house/T59.webp deleted file mode 100644 index 2dbb9d0..0000000 Binary files a/data/cards/house/T59.webp and /dev/null differ diff --git a/data/cards/house/T6.webp b/data/cards/house/T6.webp deleted file mode 100644 index 30e3c3c..0000000 Binary files a/data/cards/house/T6.webp and /dev/null differ diff --git a/data/cards/house/T60.webp b/data/cards/house/T60.webp deleted file mode 100644 index 9d2319c..0000000 Binary files a/data/cards/house/T60.webp and /dev/null differ diff --git a/data/cards/house/T61.webp b/data/cards/house/T61.webp deleted file mode 100644 index e29a1bd..0000000 Binary files a/data/cards/house/T61.webp and /dev/null differ diff --git a/data/cards/house/T62.webp b/data/cards/house/T62.webp deleted file mode 100644 index 194feef..0000000 Binary files a/data/cards/house/T62.webp and /dev/null differ diff --git a/data/cards/house/T63.webp b/data/cards/house/T63.webp deleted file mode 100644 index 997226e..0000000 Binary files a/data/cards/house/T63.webp and /dev/null differ diff --git a/data/cards/house/T64.webp b/data/cards/house/T64.webp deleted file mode 100644 index fa70e8e..0000000 Binary files a/data/cards/house/T64.webp and /dev/null differ diff --git a/data/cards/house/T65.webp b/data/cards/house/T65.webp deleted file mode 100644 index cbeb6ef..0000000 Binary files a/data/cards/house/T65.webp and /dev/null differ diff --git a/data/cards/house/T66.webp b/data/cards/house/T66.webp deleted file mode 100644 index da81347..0000000 Binary files a/data/cards/house/T66.webp and /dev/null differ diff --git a/data/cards/house/T67.webp b/data/cards/house/T67.webp deleted file mode 100644 index 2ad3ebc..0000000 Binary files a/data/cards/house/T67.webp and /dev/null differ diff --git a/data/cards/house/T68.webp b/data/cards/house/T68.webp deleted file mode 100644 index 79e803a..0000000 Binary files a/data/cards/house/T68.webp and /dev/null differ diff --git a/data/cards/house/T69.webp b/data/cards/house/T69.webp deleted file mode 100644 index 27a54a7..0000000 Binary files a/data/cards/house/T69.webp and /dev/null differ diff --git a/data/cards/house/T7.webp b/data/cards/house/T7.webp deleted file mode 100644 index cf56bb4..0000000 Binary files a/data/cards/house/T7.webp and /dev/null differ diff --git a/data/cards/house/T70.webp b/data/cards/house/T70.webp deleted file mode 100644 index 2fa754d..0000000 Binary files a/data/cards/house/T70.webp and /dev/null differ diff --git a/data/cards/house/T71.webp b/data/cards/house/T71.webp deleted file mode 100644 index 499d4da..0000000 Binary files a/data/cards/house/T71.webp and /dev/null differ diff --git a/data/cards/house/T72.webp b/data/cards/house/T72.webp deleted file mode 100644 index be0d6d7..0000000 Binary files a/data/cards/house/T72.webp and /dev/null differ diff --git a/data/cards/house/T73.webp b/data/cards/house/T73.webp deleted file mode 100644 index b204572..0000000 Binary files a/data/cards/house/T73.webp and /dev/null differ diff --git a/data/cards/house/T74.webp b/data/cards/house/T74.webp deleted file mode 100644 index 23b4cda..0000000 Binary files a/data/cards/house/T74.webp and /dev/null differ diff --git a/data/cards/house/T75.webp b/data/cards/house/T75.webp deleted file mode 100644 index d21a463..0000000 Binary files a/data/cards/house/T75.webp and /dev/null differ diff --git a/data/cards/house/T76.webp b/data/cards/house/T76.webp deleted file mode 100644 index 82ab670..0000000 Binary files a/data/cards/house/T76.webp and /dev/null differ diff --git a/data/cards/house/T77.webp b/data/cards/house/T77.webp deleted file mode 100644 index 9d1381a..0000000 Binary files a/data/cards/house/T77.webp and /dev/null differ diff --git a/data/cards/house/T78.webp b/data/cards/house/T78.webp deleted file mode 100644 index 05a2e13..0000000 Binary files a/data/cards/house/T78.webp and /dev/null differ diff --git a/data/cards/house/T79.webp b/data/cards/house/T79.webp deleted file mode 100644 index 01730fe..0000000 Binary files a/data/cards/house/T79.webp and /dev/null differ diff --git a/data/cards/house/T8.webp b/data/cards/house/T8.webp deleted file mode 100644 index 6446711..0000000 Binary files a/data/cards/house/T8.webp and /dev/null differ diff --git a/data/cards/house/T80.webp b/data/cards/house/T80.webp deleted file mode 100644 index 99b3d2b..0000000 Binary files a/data/cards/house/T80.webp and /dev/null differ diff --git a/data/cards/house/T81.webp b/data/cards/house/T81.webp deleted file mode 100644 index 17b24f3..0000000 Binary files a/data/cards/house/T81.webp and /dev/null differ diff --git a/data/cards/house/T9.webp b/data/cards/house/T9.webp deleted file mode 100644 index 7a7da9e..0000000 Binary files a/data/cards/house/T9.webp and /dev/null differ diff --git a/docker-compose.yml b/docker-compose.yml index 19c9795..57e7d7c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,5 @@ +name: sheep-service + services: web: image: sheep-service/web @@ -71,6 +73,13 @@ services: command: /bin/sh -c "envsubst '\$DOMAIN' < /etc/nginx/templates/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" networks: - network + depends_on: + api: + condition: service_started + web: + condition: service_started + ws: + condition: service_started cron: image: sheep-service/cron diff --git a/web/lib/pages/territory/constructor/script.js b/web/lib/pages/territory/constructor/script.js index a40d87f..e38efa4 100644 --- a/web/lib/pages/territory/constructor/script.js +++ b/web/lib/pages/territory/constructor/script.js @@ -505,6 +505,8 @@ const Territory_constructor = { const zoom = 19; const googleHybrid = L.tileLayer('http://{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}', { + maxZoom: 20, + minZoom: 15, subdomains: ['mt0', 'mt1', 'mt2', 'mt3'] }); const osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');