Add container setup scripts for various services
All checks were successful
GBCI / build (push) Successful in 16m16s

- Implemented ALM container setup with Forgejo installation and systemd service configuration.
- Created Bot container setup with necessary dependencies and Node.js application installation.
- Developed Desktop container setup with XRDP and Brave browser installation.
- Established Directory container setup with Zitadel installation and service configuration.
- Added Doc Editor container setup for Collabora Online integration.
- Implemented Drive container setup with MinIO installation and service configuration.
- Created Email container setup with Stalwart Mail installation and service configuration.
- Developed Meeting container setup with LiveKit and TURN server configuration.
- Added Proxy container setup with Caddy installation and service configuration.
- Implemented System container setup for general bots with service configuration.
- Created Table Editor container setup with NocoDB installation and service configuration.
- Developed Tables container setup with PostgreSQL installation and configuration.
- Added Webmail container setup with Roundcube installation and service configuration.
- Included prompt guidelines for container setup scripts.
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-07-14 16:40:21 -03:00
parent d4697a6a93
commit 7131911313
2 changed files with 151 additions and 134 deletions

View file

@ -24,6 +24,8 @@ async fn main() -> std::io::Result<()> {
let json = FIND "users", "name=John"
let x=2
let text = GET "example.com"
let nome = "table"
let d = FIND nome, "car=2"
"#;
match script_service.compile(script) {

View file

@ -20,17 +20,20 @@ impl ScriptService {
engine.set_allow_looping(true);
// Register custom syntax for FOR EACH loop
engine.register_custom_syntax(
engine
.register_custom_syntax(
&["FOR", "EACH", "$ident$", "in", "$expr$", "$block$"],
false, // Not a statement
|context, inputs| {
// Simple implementation - just return unit for now
Ok(Dynamic::UNIT)
},
).unwrap();
)
.unwrap();
// FIND command: FIND "table", "filter"
engine.register_custom_syntax(
engine
.register_custom_syntax(
&["FIND", "$expr$", ",", "$expr$"],
false, // Expression, not statement
|context, inputs| {
@ -46,12 +49,15 @@ impl ScriptService {
"filter": filter_str,
"results": []
});
println!("SET executed: {}", result.to_string());
Ok(Dynamic::from(result.to_string()))
},
).unwrap();
)
.unwrap();
// SET command: SET "table", "key", "value"
engine.register_custom_syntax(
engine
.register_custom_syntax(
&["SET", "$expr$", ",", "$expr$", ",", "$expr$"],
true, // Statement
|context, inputs| {
@ -73,10 +79,12 @@ impl ScriptService {
println!("SET executed: {}", result.to_string());
Ok(Dynamic::UNIT)
},
).unwrap();
)
.unwrap();
// GET command: GET "url"
engine.register_custom_syntax(
engine
.register_custom_syntax(
&["GET", "$expr$"],
false, // Expression, not statement
|context, inputs| {
@ -85,11 +93,16 @@ impl ScriptService {
Ok(format!("Content from {}", url_str).into())
},
).unwrap();
)
.unwrap();
// CREATE SITE command: CREATE SITE "name", "company", "website", "template", "prompt"
engine.register_custom_syntax(
&["CREATE", "SITE", "$expr$", ",", "$expr$", ",", "$expr$", ",", "$expr$", ",", "$expr$"],
engine
.register_custom_syntax(
&[
"CREATE", "SITE", "$expr$", ",", "$expr$", ",", "$expr$", ",", "$expr$", ",",
"$expr$",
],
true, // Statement
|context, inputs| {
if inputs.len() < 5 {
@ -113,10 +126,12 @@ impl ScriptService {
println!("CREATE SITE executed: {}", result.to_string());
Ok(Dynamic::UNIT)
},
).unwrap();
)
.unwrap();
// CREATE DRAFT command: CREATE DRAFT "to", "subject", "body"
engine.register_custom_syntax(
engine
.register_custom_syntax(
&["CREATE", "DRAFT", "$expr$", ",", "$expr$", ",", "$expr$"],
true, // Statement
|context, inputs| {
@ -137,10 +152,12 @@ impl ScriptService {
println!("CREATE DRAFT executed: {}", result.to_string());
Ok(Dynamic::UNIT)
},
).unwrap();
)
.unwrap();
// PRINT command
engine.register_custom_syntax(
engine
.register_custom_syntax(
&["PRINT", "$expr$"],
true, // Statement
|context, inputs| {
@ -148,12 +165,11 @@ impl ScriptService {
println!("{}", value);
Ok(Dynamic::UNIT)
},
).unwrap();
)
.unwrap();
// Register web service functions
engine.register_fn("web_get", |url: &str| {
format!("Response from {}", url)
});
engine.register_fn("web_get", |url: &str| format!("Response from {}", url));
ScriptService {
engine,
@ -203,14 +219,13 @@ impl ScriptService {
result
}
pub fn compile(&self, script: &str) -> Result<rhai::AST, Box<EvalAltResult>> {
pub fn compile(&self, script: &str) -> Result<rhai::AST, Box<EvalAltResult>> {
let processed_script = self.preprocess_basic_script(script);
match self.engine.compile(&processed_script) {
Ok(ast) => Ok(ast),
Err(parse_error) => Err(Box::new(EvalAltResult::from(parse_error))),
}
}
}
pub fn run(&self, ast: &rhai::AST) -> Result<Dynamic, Box<EvalAltResult>> {
self.engine.eval_ast(ast)