Delete commit history
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Danny Bessems 2022-01-20 14:49:37 +01:00
commit c7dabda145
9 changed files with 419 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
.lowdefy/**
.env
.drone.yml

35
.drone.yml Normal file
View File

@ -0,0 +1,35 @@
kind: pipeline
type: kubernetes
name: Harbor
steps:
- name: build & publish
image: plugins/docker
context: .
settings:
repo: bv11-cr01.bessems.eu/library/lowdefy
registry: bv11-cr01.bessems.eu
mtu: 1450
tags: latest
username:
from_secret: harbor_username
password:
from_secret: harbor_password
---
kind: pipeline
type: kubernetes
name: Dockerhub
steps:
- name: build & publish
image: plugins/docker
context: .
settings:
repo: djpbessems/lowdefy
mtu: 1450
tags: latest
username:
from_secret: docker_username
password:
from_secret: docker_password

26
Dockerfile Normal file
View File

@ -0,0 +1,26 @@
FROM node:14-buster AS build
# Set working directory and node user
WORKDIR /home/node/lowdefy
RUN chown node:node /home/node/lowdefy
USER node
# Copy app config and change ownership of files to "node" user
COPY --chown=node:node . .
# Build the Lowdefy config using the Lowdefy CLI
RUN npx lowdefy@3.23.2 build
# Use the correct Lowdefy base image
FROM lowdefy/lowdefy:3.23.2
# Copy build output from build stage
COPY --from=build --chown=node:node /home/node/lowdefy/.lowdefy/build ./build
# Copy contents of public directory into image
COPY --chown=node:node ./public ./public
# Run the server on start
CMD ["node", "./dist/server.js"]

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# Docker.Containers.Lowdefy

210
deploy.yaml Normal file
View File

@ -0,0 +1,210 @@
id: deploy
type: PageHeaderMenu
properties:
title: Deploy
layout:
contentJustify: center
areas:
content:
blocks:
- id: content
type: Card
layout:
size: 1000
contentGutter: 10
blocks:
- id: title
type: Title
layout:
span: 24
properties:
content: Deploy
- id: leftcolumn
type: Box
layout:
span: 12
contentGutter: 10
blocks:
- id: macaddress
required: true
type: TextInput
properties:
title: MAC Address
placeholder: 00:00:00:00:00:00
validate:
- status: error
message: Enter a valid MAC address
pass:
_regex: ^(?!(?:00[:-]){5}00)((?:[0-9a-fA-F]{2}[:-]){5}[0-9a-fA-F]{2})$
- id: projectname
type: TextInput
properties:
title: Project name
- id: hostname
required: true
type: TextInput
properties:
title: Hostname
label:
extra: Can only contain alphanumeric characters and hyphens; must be between 1 and 15 characters long
extraStyle:
font-size: smaller
font-style: italic
validate:
- status: error
message: Enter a valid hostname
pass:
_regex: ^([a-zA-Z0-9]{1,15}|[a-zA-Z0-9][a-zA-Z0-9\-]{0,13}[a-zA-Z0-9])$
- id: ipaddress
required: true
type: TextInput
properties:
title: IP address
placeholder: 0.0.0.0
validate:
- status: error
message: Enter a valid IP address
pass:
_regex: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
- id: subnetmask
required: true
type: TextInput
properties:
title: Subnet mask
placeholder: 255.255.255.0
validate:
- status: error
message: Enter a valid subnet mask
pass:
_regex: ^(?:(255|254|252|248|240|224|192|128|0+)(?:\.(?!$)|$)){4}$
- id: gateway
required: true
type: TextInput
properties:
title: Gateway
placeholder: 0.0.0.0
validate:
- status: error
message: Enter a valid IP address
pass:
_regex: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
- id: dnsserver
required: true
type: TextInput
properties:
title: DNS server
placeholder: 1.1.1.1, 1.0.0.1
label:
extra: (comma-separated list of IP addresses)
extraStyle:
font-size: smaller
font-style: italic
validate:
- status: error
message: Enter one or more valid IP addresses, separated by a comma
pass:
_regex: ^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?))(?:,\s*(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)))*$
- id: dnssuffix
required: true
type: TextInput
properties:
title: DNS suffix
placeholder: example.org
validate:
- status: error
message: Enter a valid domain name
pass:
_regex: (?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}$)
- id: rightcolumn
type: Box
layout:
span: 12
contentGutter: 10
blocks:
- id: certificate
required: true
type: TextArea
properties:
autoSize:
maxRows: 4
minRows: 4
block: true
title: Certificate
placeholder: |
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
label:
extra: PEM format
extraStyle:
font-size: smaller
font-style: italic
- id: privatekey
required: true
type: TextArea
properties:
autoSize:
maxRows: 4
minRows: 4
block: true
title: Private key
placeholder: |
-----BEGIN RSA PRIVATE KEY-----
[...]
-----END RSA PRIVATE KEY-----
label:
extra: PEM format
extraStyle:
font-size: smaller
font-style: italic
- id: warning
type: Alert
properties:
message: After pressing 'Start Deployment' the physical device can be booted over LAN
type: warning
- id: reset_button
type: Button
layout:
grow: 1
properties:
title: Reset
icon: ClearOutlined
block: true
type: default
events:
onClick:
- id: reset
type: Reset
- id: start_deployment
type: Button
layout:
grow: 3
properties:
title: Start Deployment
icon: RocketOutlined
block: true
# requests:
# - id: update_brand
# type: MongoDBUpdateOne # MongoDb updateOne request to update the brand.
# connectionId: brands
# properties:
# filter:
# _id:
# _state: _id # Select the document that matches the document's _id that is in state.
# update:
# $set:
# name:
# _state: name # Insert the brand name we set in state.
# description:
# _state: description # Insert the description name we set in state.
# updated_at:
# _date: now # Set the updated_at date as current time.
events:
onClick:
- id: validate
type: Validate
- id: update_brand # Call the update_brand request.
type: Request
params: update_brand

23
lowdefy.yaml Normal file
View File

@ -0,0 +1,23 @@
lowdefy: 3.23.2
name: Lowdefy starter
licence: MIT
pages:
- _ref: stage.yaml
- _ref: deploy.yaml
menus:
- id: default
links:
- id: Stage
type: MenuLink
pageId: stage
properties:
title: Stage
icon: CloudDownloadOutlined
- id: Deploy
type: MenuLink
pageId: deploy
properties:
title: Deploy
icon: RocketOutlined

BIN
public/logo-dark-theme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

120
stage.yaml Normal file
View File

@ -0,0 +1,120 @@
id: stage
type: PageHeaderMenu
properties:
title: Stage
layout:
contentJustify: center
areas:
content:
blocks:
- id: content
type: Card
layout:
size: 1000
contentGutter: 10
blocks:
- id: title
type: Title
layout:
span: 24
properties:
content: Stage
- id: leftcolumn
type: Box
layout:
span: 12
contentGutter: 10
blocks:
- id: foo
required: true
type: TextInput
properties:
block: true
title: Foo
placeholder: Bar
label:
extra: Lorem ipsum; yada yada
extraStyle:
font-size: smaller
font-style: italic
# span: 5
- id: woot
required: true
type: TextInput
properties:
block: true
title: Woot
placeholder: Sweet
label:
extra: Dude!
extraStyle:
font-size: smaller
font-style: italic
# span: 5
- id: rightcolumn
type: Box
layout:
span: 12
contentGutter: 10
blocks:
- id: alpha
required: true
type: TextArea
properties:
autoSize:
maxRows: 3
minRows: 3
block: true
title: Alpha
placeholder: Beta
label:
extra: Gamma
extraStyle:
font-size: smaller
font-style: italic
# span: 5
- id: kappa
required: true
type: TextArea
properties:
autoSize:
maxRows: 3
minRows: 3
block: true
title: Kappa
placeholder: Lambda
label:
extra: Mu
extraStyle:
font-size: smaller
font-style: italic
# span: 5
- id: bottomrow
type: Box
layout:
span: 24
contentGutter: 10
blocks:
- id: reset_button
type: Button
layout:
grow: 1
properties:
title: Reset
icon: ClearOutlined
block: true
type: default
events:
onClick:
- id: reset
type: Reset
- id: start_download
type: Button
layout:
grow: 3
properties:
title: Download
icon: CloudDownloadOutlined
block: true