Remove to pkl project

This commit is contained in:
Tobias Reisinger 2024-04-30 01:50:43 +02:00
parent 83c65c00fe
commit 6340cfd5c7
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
9 changed files with 5 additions and 98 deletions

View file

@ -7,16 +7,13 @@ sqlx:
build-rpi:
cross build --target arm-unknown-linux-gnueabihf
emgauwa-%.json: config/%.pkl config/lib/%.pkl
emgauwa-%.json: config/%.pkl
pkl eval -f json -o $@ $<
configs:
$(MAKE) emgauwa-core.json
$(MAKE) emgauwa-controller.json
pkl-package:
pkl project package config --output-path "./out/pkl"
clean:
rm -f emgauwa-controller.json
rm -f emgauwa-controller.sqlite

View file

@ -1,8 +0,0 @@
amends "pkl:Project"
package {
name = "emgauwa"
baseUri = "package://emgauwa.app/pkl/\(name)"
version = "0.1.0"
packageZipUrl = "https://emgauwa.app/pkl/\(name)@\(version).zip"
}

View file

@ -1,4 +0,0 @@
{
"schemaVersion": 1,
"resolvedDependencies": {}
}

View file

@ -1,21 +1,4 @@
amends "./lib/controller.pkl"
server {
host = "127.0.0.1"
port = 4419
}
database = "sqlite://emgauwa-controller.sqlite"
permissions {
user = "" // read("env:USER")
group = "" // read("env:USER")
}
logging {
level = "INFO"
file = "stdout"
}
amends "package://emgauwa.app/pkl/emgauwa@0.1.0#/controller.pkl"
relays {
new {
@ -70,4 +53,4 @@ relays {
pin = 21
inverted = false
}
}
}

View file

@ -1,18 +1 @@
amends "./lib/core.pkl"
server {
host = "127.0.0.1"
port = 4419
}
database = "sqlite://emgauwa-core.sqlite"
permissions {
user = "" // read("env:USER")
group = "" // read("env:USER")
}
logging {
level = "INFO"
file = "stdout"
}
amends "package://emgauwa.app/pkl/emgauwa@0.1.0#/core.pkl"

View file

@ -1,15 +0,0 @@
class ServerConfig {
host: String
port: UInt16
}
/// Set to a user and a group to drop privileges to after binding to the port
class PermissionsConfig {
user: String
group: String
}
class LoggingConfig {
level: "TRACE"|"DEBUG"|"INFO"|"WARN"|"ERROR"|"FATAL"
file: String
}

View file

@ -1,17 +0,0 @@
import "./common.pkl"
server: common.ServerConfig
database: String
permissions: common.PermissionsConfig
logging: common.LoggingConfig
class RelayConfig {
driver: "null"|"gpio"|"piface"
pin: Number
inverted: Boolean
pulse: Number(this >= 0)|Null = null
}
relays: Listing<RelayConfig>

View file

@ -1,12 +0,0 @@
import "./common.pkl"
server: common.ServerConfig
database: String
permissions: common.PermissionsConfig
logging: common.LoggingConfig
/// Leave empty to allow all origins (will always respond with Origin and not "*")
origins: Listing<String>

View file

@ -39,7 +39,7 @@ async fn run_websocket(
log::debug!("Trying to connect to {}", url);
match connect_async(url).await {
Ok(connection) => {
log::debug!("Websocket connected");
log::info!("Websocket connected");
let (ws_stream, _) = connection;
let (mut write, read) = ws_stream.split();