Remove to pkl project
This commit is contained in:
		
							parent
							
								
									83c65c00fe
								
							
						
					
					
						commit
						6340cfd5c7
					
				
					 9 changed files with 5 additions and 98 deletions
				
			
		
							
								
								
									
										5
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -7,16 +7,13 @@ sqlx:
 | 
				
			||||||
build-rpi:
 | 
					build-rpi:
 | 
				
			||||||
	cross build --target arm-unknown-linux-gnueabihf
 | 
						cross build --target arm-unknown-linux-gnueabihf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
emgauwa-%.json: config/%.pkl config/lib/%.pkl
 | 
					emgauwa-%.json: config/%.pkl
 | 
				
			||||||
	pkl eval -f json -o $@ $<
 | 
						pkl eval -f json -o $@ $<
 | 
				
			||||||
 | 
					
 | 
				
			||||||
configs:
 | 
					configs:
 | 
				
			||||||
	$(MAKE) emgauwa-core.json
 | 
						$(MAKE) emgauwa-core.json
 | 
				
			||||||
	$(MAKE) emgauwa-controller.json
 | 
						$(MAKE) emgauwa-controller.json
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pkl-package:
 | 
					 | 
				
			||||||
	pkl project package config --output-path "./out/pkl"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
clean:
 | 
					clean:
 | 
				
			||||||
	rm -f emgauwa-controller.json
 | 
						rm -f emgauwa-controller.json
 | 
				
			||||||
	rm -f emgauwa-controller.sqlite
 | 
						rm -f emgauwa-controller.sqlite
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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"
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,4 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  "schemaVersion": 1,
 | 
					 | 
				
			||||||
  "resolvedDependencies": {}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,21 +1,4 @@
 | 
				
			||||||
amends "./lib/controller.pkl"
 | 
					amends "package://emgauwa.app/pkl/emgauwa@0.1.0#/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"
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
relays {
 | 
					relays {
 | 
				
			||||||
  new {
 | 
					  new {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,18 +1 @@
 | 
				
			||||||
amends "./lib/core.pkl"
 | 
					amends "package://emgauwa.app/pkl/emgauwa@0.1.0#/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"
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -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>
 | 
					 | 
				
			||||||
| 
						 | 
					@ -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>
 | 
					 | 
				
			||||||
| 
						 | 
					@ -39,7 +39,7 @@ async fn run_websocket(
 | 
				
			||||||
	log::debug!("Trying to connect to {}", url);
 | 
						log::debug!("Trying to connect to {}", url);
 | 
				
			||||||
	match connect_async(url).await {
 | 
						match connect_async(url).await {
 | 
				
			||||||
		Ok(connection) => {
 | 
							Ok(connection) => {
 | 
				
			||||||
			log::debug!("Websocket connected");
 | 
								log::info!("Websocket connected");
 | 
				
			||||||
			let (ws_stream, _) = connection;
 | 
								let (ws_stream, _) = connection;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			let (mut write, read) = ws_stream.split();
 | 
								let (mut write, read) = ws_stream.split();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue