WhiteLabel Erlang
Adventures in the undocumented wilds of inet_dns
Who is this guy?
Geoff Cant
<nem@erlang.geek.nz>
Current (xmpp|mailto):
gcant@process-one.net
Previously
geoff@catalyst.ne...
What have I been up to?
 ejabberd
   debugging
   virtual hosting
   debugging large clusters
   porting patches
   debugg...
What have I been up to?
     Whitelabel ejabberd hosting
A rant in four parts
 Web Frameworks (why Mochiweb)
 Other libraries (ejango, esmtp,
 erlydtl)
 DNS (OTP Undocumented)
 Tr...
Web Frameworks
 Erlyweb
 YAWS
 inets
 The Erlang Web
 Nitrogen
Mochiweb.
(No logo, ‘cause they’re too busy coding)
Other pieces
 Templating
 URL Routing
 Form validation
 Email
Templating
erlydtl
Templates
compile to
modules
Well known
template syntax
(Django-ish)
Template
URL Routing
 Must work with RESTful URLs
 Must be reversible - able to generate
 URLs too
 ejango.url_routes
Form Validation
 Generate forms and validate form
 posts
 Couldn’t find anything available
 already
 Declarative DSL for f...
Sending Email
 smtp_fsm
 Erlware smtp
 No attachments?
 This should be much easier.
 esmtp
Mail Sending API
Mime Attachment API
DNS
 Need to verify ownership of domain
 Need to add XMPP SRV records
 inet:gethostbyname
 ...
 To the githubs!
DNS Undocumented
inet_res:getbyname/2
inet_res:nnslookup/5
inet_db - caching
inet_dns - packet
encoding/decoding,
bugs
‘dn...
Here be Dragons.
Sometimes it’s
undocumented
for a reason
The TXT RR is
subtle.
I reimplemented
the same bug.
My DNS decoder
 TXT RRs are
 <<Len:8,
   Data:Len/binary>>*
 Binary pattern matching
 rocks
Whitelabel Tricks
 Check SOA to test if domain exists
 Bypass DNS caching
YSlow Optimisations
 Initially got a D on my YSlow report
 Decided to gzip and minify content,
 move js blocks around
 eja...
Minifying...
Lessons
 Hierarchal modules are a world of
 hurt.
 Metaprogramming in Erlang is still
 too hard.
 Never trust ADSL routers...
Use Github.
A small plea for help
 I have way too many github projects
 Adopt my code?
 Interested in collaborating?
Fin.
Erlang White Label
Erlang White Label
Erlang White Label
Erlang White Label
Erlang White Label
Upcoming SlideShare
Loading in...5
×

Erlang White Label

1,703

Published on

Geoff Cant Whitelabel Erlang covers the trials, tribulations and technologies used in building a whitelabel ejabberd hosting service.

The talk explains the rationale behind the choices of web server, templating system, email module, page optimizers and other web framework components. The talk also covers the documented and undocumented DNS query and caching modules in OTP and introduces 'dns' - a convenient new API for using them. Finally, the talk describes some tips and tricks useful for whitelabel hosting solutions that require customer DNS updates.

Published in: Technology, News & Politics
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,703
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
40
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Erlang White Label"

  1. 1. WhiteLabel Erlang Adventures in the undocumented wilds of inet_dns
  2. 2. Who is this guy? Geoff Cant <nem@erlang.geek.nz> Current (xmpp|mailto): gcant@process-one.net Previously geoff@catalyst.net.nz archaelus on http:// github, irc:freenode/ #erlang
  3. 3. What have I been up to? ejabberd debugging virtual hosting debugging large clusters porting patches debugging patches
  4. 4. What have I been up to? Whitelabel ejabberd hosting
  5. 5. A rant in four parts Web Frameworks (why Mochiweb) Other libraries (ejango, esmtp, erlydtl) DNS (OTP Undocumented) Tricks and Lessons
  6. 6. Web Frameworks Erlyweb YAWS inets The Erlang Web Nitrogen
  7. 7. Mochiweb. (No logo, ‘cause they’re too busy coding)
  8. 8. Other pieces Templating URL Routing Form validation Email
  9. 9. Templating erlydtl Templates compile to modules Well known template syntax (Django-ish) Template
  10. 10. URL Routing Must work with RESTful URLs Must be reversible - able to generate URLs too ejango.url_routes
  11. 11. Form Validation Generate forms and validate form posts Couldn’t find anything available already Declarative DSL for form specification ejango.form, ejango.form_validator
  12. 12. Sending Email smtp_fsm Erlware smtp No attachments? This should be much easier. esmtp
  13. 13. Mail Sending API
  14. 14. Mime Attachment API
  15. 15. DNS Need to verify ownership of domain Need to add XMPP SRV records inet:gethostbyname ... To the githubs!
  16. 16. DNS Undocumented inet_res:getbyname/2 inet_res:nnslookup/5 inet_db - caching inet_dns - packet encoding/decoding, bugs ‘dns’ -- the way forward.
  17. 17. Here be Dragons. Sometimes it’s undocumented for a reason The TXT RR is subtle. I reimplemented the same bug.
  18. 18. My DNS decoder TXT RRs are <<Len:8, Data:Len/binary>>* Binary pattern matching rocks
  19. 19. Whitelabel Tricks Check SOA to test if domain exists Bypass DNS caching
  20. 20. YSlow Optimisations Initially got a D on my YSlow report Decided to gzip and minify content, move js blocks around ejango.static:compress_docroot/1, ejango.static:serve_compressed/3
  21. 21. Minifying...
  22. 22. Lessons Hierarchal modules are a world of hurt. Metaprogramming in Erlang is still too hard. Never trust ADSL routers. ...
  23. 23. Use Github.
  24. 24. A small plea for help I have way too many github projects Adopt my code? Interested in collaborating?
  25. 25. Fin.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×