Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite/simplify the template system #223

Closed
favonia opened this issue Sep 28, 2022 · 0 comments · Fixed by #233
Closed

Rewrite/simplify the template system #223

favonia opened this issue Sep 28, 2022 · 0 comments · Fixed by #233

Comments

@favonia
Copy link
Owner

favonia commented Sep 28, 2022

Problem

The current template system is working but does not seem to be well-engineered.

  1. Currently, the template engine increases the size of the (compressed) image by ~1MB.
  2. TTL currently supports templates (for fun), but that is probably overkill.
  3. For PROXIED, only Boolean expressions are needed. No need to support variables, template inclusion, looping, etc.

Proposal

  1. TTL should not support templates.
  2. PROXIED should support only very restricted templates as a Boolean expression consisting of
    a. Constants supported by strconv.ParseBool
    b. &&, ||, !
    b. is(a, b, c)
    c. sub(a, b, c): subdomains of a.b.c (not including a.b.c itself)

Benefits

  1. Extremely fast
  2. Extremely small (again)
  3. No ugly string quotations for domains!

Examples

  • is(a.org) || is(b.org)
  • sub(org) && !sub(favonia.org)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant