Build Tools Update
This commit is contained in:
parent
6c9fdce488
commit
5aa5b4b51d
6 changed files with 187 additions and 1 deletions
BIN
build_tools/default_config_xml_export
Executable file
BIN
build_tools/default_config_xml_export
Executable file
Binary file not shown.
BIN
build_tools/default_host_xml_export
Executable file
BIN
build_tools/default_host_xml_export
Executable file
Binary file not shown.
142
build_tools/src/default_config_xml_export.pb
Normal file
142
build_tools/src/default_config_xml_export.pb
Normal file
|
@ -0,0 +1,142 @@
|
||||||
|
OpenConsole("Write Default HTTP Config XML Server")
|
||||||
|
PrintN("Create default_http_config.xml...")
|
||||||
|
|
||||||
|
Structure server_http
|
||||||
|
enabled.i
|
||||||
|
port.i
|
||||||
|
binding.s
|
||||||
|
max_clients.i
|
||||||
|
reuse.b
|
||||||
|
thread_id.i
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
Structure server_https
|
||||||
|
enabled.i
|
||||||
|
port.i
|
||||||
|
binding.s
|
||||||
|
max_clients.i
|
||||||
|
reuse.b
|
||||||
|
CA.s
|
||||||
|
Certs.s
|
||||||
|
key.s
|
||||||
|
key_pass.s
|
||||||
|
thread_id.i
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
Structure server_cache
|
||||||
|
time.i
|
||||||
|
maxsize.i
|
||||||
|
current.i
|
||||||
|
enable.i
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
Structure memory
|
||||||
|
MaxFileSize.i
|
||||||
|
DefaultBlockSize.i
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
Structure log_config
|
||||||
|
DebuglogUUID.s
|
||||||
|
Debugdisable.i
|
||||||
|
Accesslog.s
|
||||||
|
AccesslogUUID.s
|
||||||
|
Errorlog.s
|
||||||
|
ErrorlogUUID.s
|
||||||
|
Cachelog.s
|
||||||
|
CachelogUUID.s
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
Enumeration http_header_fieldtype
|
||||||
|
#http_header_field_Static ;Fieldcontent could be directly used
|
||||||
|
#http_header_field_Dynamic_auto ;Must be handled by the Fieldcontent_proc
|
||||||
|
EndEnumeration
|
||||||
|
|
||||||
|
Enumeration http_headerfield_param
|
||||||
|
#http_headerfield_param_string
|
||||||
|
#http_headerfield_param_map
|
||||||
|
#http_headerfield_param_integer
|
||||||
|
EndEnumeration
|
||||||
|
|
||||||
|
Structure http_headerfield_params
|
||||||
|
Type.i ;Types of Field #Content or #Map
|
||||||
|
Content_string.s ;String Field
|
||||||
|
Map Content_Maps.s() ;Map Field
|
||||||
|
Content_integer.i ;Integer Field
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
Structure http_headerfield
|
||||||
|
Fieldname.s ; Name bevore : for ex. "keep-alive:"
|
||||||
|
Fieldcontent.s ; Content after : for ex. "Keep-Alive"
|
||||||
|
Fieldcontent_type.i ; #http_header_field_Static or #http_header_field_Dynamic_auto
|
||||||
|
Fieldcontent_proc.i ; A Procedure Prototype to call
|
||||||
|
Map Field_proc_parameters.http_headerfield_params() ;Parameters to give to call
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
XIncludeFile "../../inc/lweb_http_status_header_private.pbi"
|
||||||
|
|
||||||
|
|
||||||
|
Structure host
|
||||||
|
description.s
|
||||||
|
http.server_http
|
||||||
|
https.server_https
|
||||||
|
cache.server_cache
|
||||||
|
log.log_config
|
||||||
|
mem.memory
|
||||||
|
defaultfile.s
|
||||||
|
basedir.s
|
||||||
|
Map status.http_status_codes() ;Individual Error Messages and Headers
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
Structure config_loader
|
||||||
|
name.s
|
||||||
|
type.s
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
Structure server
|
||||||
|
Map hosts.host()
|
||||||
|
Map status.http_status_codes() ;Default Error Messages and Headers
|
||||||
|
Map config_file.config_loader() ;Map Key is Type and string is file
|
||||||
|
log.log_config
|
||||||
|
mem.memory
|
||||||
|
global_max_cli_threads.i ;The maximum Thread Count = 0 unlimited
|
||||||
|
global_max_cli_memory.i ;The maximum Used Memory per Client Thread = 0 unlimited
|
||||||
|
version.s
|
||||||
|
identifikation.s
|
||||||
|
type.i
|
||||||
|
EndStructure
|
||||||
|
|
||||||
|
;}
|
||||||
|
;*
|
||||||
|
|
||||||
|
;*
|
||||||
|
;* Identifikation des Servers.
|
||||||
|
;*
|
||||||
|
|
||||||
|
Global configuration.server
|
||||||
|
configuration\version = "V0.9"
|
||||||
|
configuration\identifikation = "LiHaSo Webserver " + configuration\version
|
||||||
|
configuration\config_file("status_xml")\name = "cfg/default_http_status_codes.xml"
|
||||||
|
configuration\config_file("status_xml")\type = "file"
|
||||||
|
configuration\config_file("hosts_dir")\name = "cfg/server/"
|
||||||
|
configuration\config_file("hosts_dir")\type = "dir"
|
||||||
|
|
||||||
|
;*
|
||||||
|
;* Diese Parameter müssen entsprechend angepasst sein.
|
||||||
|
;* Später ausgelagert in ein nicht synchronisiertes lweb-cfg.pbi
|
||||||
|
;* Folgende Parameter müssen im Hauptprogramm definiert sein.
|
||||||
|
|
||||||
|
configuration\type = 0
|
||||||
|
configuration\global_max_cli_memory = 0 ; Unlimited
|
||||||
|
configuration\global_max_cli_threads = 0 ; Unlimited
|
||||||
|
|
||||||
|
|
||||||
|
If CreateXML(0)
|
||||||
|
InsertXMLStructure(RootXMLNode(0), @configuration, server)
|
||||||
|
FormatXML(0, #PB_XML_ReFormat)
|
||||||
|
ToSave.s = ComposeXML(0)
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
CreateFile(0, "../cfg/default_http_config.xml")
|
||||||
|
WriteString(0, ToSave)
|
||||||
|
PrintN("Default config xml created: default_http_config.xml")
|
||||||
|
End
|
44
build_tools/src/default_host_xml_export.pb
Normal file
44
build_tools/src/default_host_xml_export.pb
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
OpenConsole("Write Default Host Config XML Server")
|
||||||
|
PrintN("Create default_host.xml...")
|
||||||
|
|
||||||
|
IncludeFile "../../inc/lweb_header_privat.pbi"
|
||||||
|
|
||||||
|
Global host.host
|
||||||
|
host\description = "Default Server"
|
||||||
|
host\defaultfile = "index.html"
|
||||||
|
host\basedir = "/srv/lweb-srv/"
|
||||||
|
host\http\max_clients = 10 ; Max sametime HTTP connections.
|
||||||
|
host\http\port = 8080
|
||||||
|
host\http\binding = "127.0.0.1"
|
||||||
|
|
||||||
|
host\https\max_clients = 100
|
||||||
|
host\https\port = 8443
|
||||||
|
host\https\binding = "127.0.0.1"
|
||||||
|
host\https\enabled = 0
|
||||||
|
host\https\CA = "fullchain.pem"
|
||||||
|
host\https\Certs = "cert.pem"
|
||||||
|
host\https\key = "privkey.pem"
|
||||||
|
host\https\key_pass = ""
|
||||||
|
host\cache\enable = 0 ; Enable / Disable Cached Server
|
||||||
|
host\cache\time = 120 ; TTL of cached files
|
||||||
|
host\cache\maxsize = 1 ; Max Cache
|
||||||
|
host\cache\current = 0 ;
|
||||||
|
|
||||||
|
host\log\AccesslogFile = "/var/log/lhttpd/default_access.log"
|
||||||
|
host\log\CachelogFile = "/var/log/lhttpd/default_cache.log"
|
||||||
|
host\log\ErrorlogFile = "/var/log/lhttpd/default_error.log"
|
||||||
|
host\log\DebuglogFile = "/var/log/lhttpd/default_debug.log"
|
||||||
|
host\mem\MaxFileSize = 524288 ; Default 512 KiB
|
||||||
|
host\mem\DefaultBlockSize = 65536 ; Default Blocksize 64 KiB
|
||||||
|
|
||||||
|
If CreateXML(0)
|
||||||
|
InsertXMLStructure(RootXMLNode(0), @host, host)
|
||||||
|
ExtractXMLStructure(0, @host, host, #PB_XML_NoCase)
|
||||||
|
FormatXML(0, #PB_XML_ReFormat)
|
||||||
|
ToSave.s = ComposeXML(0)
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
CreateFile(0, "../cfg/hosts/default_host.xml")
|
||||||
|
WriteString(0, ToSave)
|
||||||
|
PrintN("Default config xml created: default_host.xml")
|
||||||
|
End
|
|
@ -118,7 +118,7 @@ configuration\status("503")\content = #True
|
||||||
ToSave.s = ComposeXML(0)
|
ToSave.s = ComposeXML(0)
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
CreateFile(0, "default_http_status_codes.xml")
|
CreateFile(0, "../cfg/default_http_status_codes.xml")
|
||||||
WriteString(0, ToSave)
|
WriteString(0, ToSave)
|
||||||
PrintN("Default status codes xml created: default_http_status_codes.xml")
|
PrintN("Default status codes xml created: default_http_status_codes.xml")
|
||||||
End
|
End
|
||||||
|
|
BIN
build_tools/status_xml_export
Executable file
BIN
build_tools/status_xml_export
Executable file
Binary file not shown.
Loading…
Reference in a new issue