Init
This commit is contained in:
		
						commit
						5e19a4e603
					
				
					 8 changed files with 93 additions and 0 deletions
				
			
		
							
								
								
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
.out
 | 
			
		||||
							
								
								
									
										8
									
								
								PklProject
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								PklProject
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
amends "pkl:Project"
 | 
			
		||||
 | 
			
		||||
package {
 | 
			
		||||
  name = "emgauwa"
 | 
			
		||||
  baseUri = "package://emgauwa.app/pkl/\(name)"
 | 
			
		||||
  version = "0.1.0"
 | 
			
		||||
  packageZipUrl = "https://emgauwa.app/pkl/\(name)@\(version).zip"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										4
									
								
								PklProject.deps.json
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								PklProject.deps.json
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
{
 | 
			
		||||
  "schemaVersion": 1,
 | 
			
		||||
  "resolvedDependencies": {}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								controller.pkl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								controller.pkl
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
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"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								core.pkl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								core.pkl
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
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"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										15
									
								
								lib/common.pkl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								lib/common.pkl
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										17
									
								
								lib/controller.pkl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								lib/controller.pkl
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
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>
 | 
			
		||||
							
								
								
									
										12
									
								
								lib/core.pkl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								lib/core.pkl
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
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>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue