First ideas
This commit is contained in:
commit
fad87c6b1e
|
@ -0,0 +1 @@
|
||||||
|
**/*.sw*
|
|
@ -0,0 +1,5 @@
|
||||||
|
# mytilde
|
||||||
|
|
||||||
|
**NOTHING READY HERE**
|
||||||
|
|
||||||
|
This repo contains early reflections around a ~/.mytilde.json config file. The structure of it is described in `mytilde.rs` while two example files are provided in the `examples/` folder.
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"domains": ["mydomain.example.com"]
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"domains": [
|
||||||
|
{
|
||||||
|
"hostname": "mydomain.example.com",
|
||||||
|
"alias": ["mydomain.example.net"],
|
||||||
|
"web": {
|
||||||
|
"template": "reverse",
|
||||||
|
"vars": {
|
||||||
|
"upstream": "127.0.0.1:7777",
|
||||||
|
"root": "/home/user/www/mydomain.example.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
enum Aliases {
|
||||||
|
One(String),
|
||||||
|
More(Vec<String>),
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Domain {
|
||||||
|
Name(string),
|
||||||
|
Config(DomainConfig),
|
||||||
|
}
|
||||||
|
|
||||||
|
struct DomainConfig {
|
||||||
|
hostname: String,
|
||||||
|
alias: Option<Aliases>,
|
||||||
|
web: Option<Web>,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Web {
|
||||||
|
Template(String),
|
||||||
|
Config(WebConfig)
|
||||||
|
}
|
||||||
|
|
||||||
|
struct WebConfig {
|
||||||
|
template: Option<String>,
|
||||||
|
vars: Map<String,Value>,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct MyTilde {
|
||||||
|
domains: Vec<Domain>,
|
||||||
|
}
|
Loading…
Reference in New Issue