First ideas

This commit is contained in:
user 2019-08-14 19:42:13 +02:00
commit fad87c6b1e
5 changed files with 53 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
**/*.sw*

5
README.md Normal file
View File

@ -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.

3
examples/.mytilde.1.json Normal file
View File

@ -0,0 +1,3 @@
{
"domains": ["mydomain.example.com"]
}

15
examples/.mytilde.2.json Normal file
View File

@ -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"
}
}
}
]
}

29
mytilde.rs Normal file
View File

@ -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>,
}