This commit is contained in:
parent
ed093cb54f
commit
9fcc3d122a
5 changed files with 25 additions and 9 deletions
|
@ -17,14 +17,9 @@ jobs:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build and test
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
load: true
|
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64
|
||||||
push: true
|
push: true
|
||||||
tags: git.cheetah.cat/smartpager/${{ github.event.repository.name }}:latest
|
tags: git.cheetah.cat/smartpager/${{ github.event.repository.name }}:latest
|
|
@ -8,9 +8,12 @@ RUN apk add chromium python3 g++ make py3-pip
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
ENV CHROME_BIN="/usr/bin/chromium-browser"\
|
||||||
|
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
RUN npm install puppeteer
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
|
|
11
compose.yaml
Normal file
11
compose.yaml
Normal 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
|
6
index.js
6
index.js
|
@ -6,7 +6,8 @@ Object.assign(config.deliveryPresets, actualConfig.deliveryPresets)
|
||||||
Object.assign(config.boskrypt, actualConfig.boskrypt)
|
Object.assign(config.boskrypt, actualConfig.boskrypt)
|
||||||
Object.assign(config.general, actualConfig.general)
|
Object.assign(config.general, actualConfig.general)
|
||||||
Object.assign(config.pagers, actualConfig.pagers)
|
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 connection = null
|
||||||
const types = require('./types') // also initializes the registries, if they havent been loaded
|
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
|
const parsedConfig = defaultConfig
|
||||||
Object.assign(parsedConfig.deliveryPresets, actualConfig.deliveryPresets)
|
Object.assign(parsedConfig.deliveryPresets, actualConfig.deliveryPresets)
|
||||||
Object.assign(parsedConfig.boskrypt, actualConfig.boskrypt)
|
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.general, actualConfig.general)
|
||||||
Object.assign(parsedConfig.pagers, actualConfig.pagers)
|
Object.assign(parsedConfig.pagers, actualConfig.pagers)
|
||||||
Object.assign(parsedConfig.connectors, actualConfig.connectors)
|
|
||||||
// parsedConfig.deliveryPresets = parsedConfig.deliveryPresets || {
|
// parsedConfig.deliveryPresets = parsedConfig.deliveryPresets || {
|
||||||
// 'example': {
|
// 'example': {
|
||||||
// "name": "Normal",
|
// "name": "Normal",
|
||||||
|
|
|
@ -39,7 +39,12 @@ class eMessagePuppeteerConnectorBase extends Connector {
|
||||||
}
|
}
|
||||||
|
|
||||||
let sendPromise = () => new Promise(async (res, rej) => {
|
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')
|
this.connectorRegistry.reportState(msg, UUID, 'puppettering')
|
||||||
const page = await browser.newPage()
|
const page = await browser.newPage()
|
||||||
await page.goto('https://ruf.emessage.de/')
|
await page.goto('https://ruf.emessage.de/')
|
||||||
|
|
Loading…
Add table
Reference in a new issue