shrinked build action + fix config load
Some checks failed
build / build (push) Failing after 1m42s

This commit is contained in:
cheetah 2025-04-05 04:44:02 +02:00
parent ed093cb54f
commit 9fcc3d122a
5 changed files with 25 additions and 9 deletions

View file

@ -17,14 +17,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and test
uses: docker/build-push-action@v6
with:
load: true
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
push: true
tags: git.cheetah.cat/smartpager/${{ github.event.repository.name }}:latest

View file

@ -8,9 +8,12 @@ RUN apk add chromium python3 g++ make py3-pip
WORKDIR /usr/src/app
ENV CHROME_BIN="/usr/bin/chromium-browser"\
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
COPY . .
RUN npm install puppeteer
RUN npm install
USER node

11
compose.yaml Normal file
View file

@ -0,0 +1,11 @@
services:
server:
build:
context: .
environment:
NODE_ENV: production
volumes:
- ./config.json:/usr/src/app/config.json
ports:
- 3000:3000
- 3001:3001

View file

@ -6,7 +6,8 @@ Object.assign(config.deliveryPresets, actualConfig.deliveryPresets)
Object.assign(config.boskrypt, actualConfig.boskrypt)
Object.assign(config.general, actualConfig.general)
Object.assign(config.pagers, actualConfig.pagers)
Object.assign(config.connectors, actualConfig.connectors)
for (let key of Object.keys(defaultConfig.connectors))
Object.assign(config.connectors[key], actualConfig.connectors[key])
const connection = null
const types = require('./types') // also initializes the registries, if they havent been loaded
@ -187,9 +188,10 @@ appConfig.get('/config', async (req, res) => {
const parsedConfig = defaultConfig
Object.assign(parsedConfig.deliveryPresets, actualConfig.deliveryPresets)
Object.assign(parsedConfig.boskrypt, actualConfig.boskrypt)
for (let key of Object.keys(parsedConfig.connectors))
Object.assign(parsedConfig.connectors[key], actualConfig.connectors[key])
Object.assign(parsedConfig.general, actualConfig.general)
Object.assign(parsedConfig.pagers, actualConfig.pagers)
Object.assign(parsedConfig.connectors, actualConfig.connectors)
// parsedConfig.deliveryPresets = parsedConfig.deliveryPresets || {
// 'example': {
// "name": "Normal",

View file

@ -39,7 +39,12 @@ class eMessagePuppeteerConnectorBase extends Connector {
}
let sendPromise = () => new Promise(async (res, rej) => {
const browser = await puppeteer.launch({ headless: true })
const browser = await puppeteer.launch({
headless: true,
executablePath: '/usr/bin/chromium',
executablePath: '/usr/bin/chromium-browser',
args: ['--no-sandbox', '--disable-dev-shm-usage'],
})
this.connectorRegistry.reportState(msg, UUID, 'puppettering')
const page = await browser.newPage()
await page.goto('https://ruf.emessage.de/')