erlang white label
DESCRIPTION
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.TRANSCRIPT
![Page 1: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/1.jpg)
WhiteLabel ErlangAdventures in the undocumented wilds of inet_dns
![Page 2: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/2.jpg)
Who is this guy?Geoff Cant <[email protected]>Current (xmpp|mailto):[email protected] [email protected] on http://github, irc:freenode/#erlang
![Page 3: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/3.jpg)
![Page 4: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/4.jpg)
![Page 5: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/5.jpg)
What have I been up to?ejabberd
debuggingvirtual hostingdebugging large clustersporting patchesdebugging patches
![Page 6: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/6.jpg)
What have I been up to?Whitelabel ejabberd hosting
![Page 7: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/7.jpg)
Web Frameworks (why Mochiweb)Other libraries (ejango, esmtp, erlydtl)DNS (OTP Undocumented)Tricks and Lessons
A rant in four parts
![Page 8: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/8.jpg)
ErlywebYAWSinetsThe Erlang WebNitrogen
Web Frameworks
![Page 9: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/9.jpg)
Mochiweb.(No logo, ‘cause they’re too busy coding)
![Page 10: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/10.jpg)
Other piecesTemplatingURL RoutingForm validationEmail
![Page 11: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/11.jpg)
TemplatingerlydtlTemplates compile to modulesWell known template syntax (Django-ish)Template
![Page 12: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/12.jpg)
URL RoutingMust work with RESTful URLsMust be reversible - able to generate URLs tooejango.url_routes
![Page 13: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/13.jpg)
![Page 14: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/14.jpg)
Form ValidationGenerate forms and validate form postsCouldn’t find anything available alreadyDeclarative DSL for form specificationejango.form, ejango.form_validator
![Page 15: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/15.jpg)
![Page 16: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/16.jpg)
Sending Emailsmtp_fsmErlware smtpNo attachments?This should be much easier.esmtp
![Page 17: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/17.jpg)
Mail Sending API
![Page 18: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/18.jpg)
Mime Attachment API
![Page 19: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/19.jpg)
DNSNeed to verify ownership of domainNeed to add XMPP SRV recordsinet:gethostbyname...To the githubs!
![Page 20: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/20.jpg)
![Page 21: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/21.jpg)
DNS Undocumentedinet_res:getbyname/2inet_res:nnslookup/5inet_db - cachinginet_dns - packet encoding/decoding, bugs‘dns’ -- the way forward.
![Page 22: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/22.jpg)
Here be Dragons.Sometimes it’s undocumented for a reasonThe TXT RR is subtle.I reimplemented the same bug.
![Page 23: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/23.jpg)
My DNS decoderTXT RRs are <<Len:8, Data:Len/binary>>* Binary pattern matching rocks
![Page 24: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/24.jpg)
Whitelabel TricksCheck SOA to test if domain existsBypass DNS caching
![Page 25: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/25.jpg)
YSlow OptimisationsInitially got a D on my YSlow reportDecided to gzip and minify content, move js blocks aroundejango.static:compress_docroot/1, ejango.static:serve_compressed/3
![Page 26: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/26.jpg)
Minifying...
![Page 27: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/27.jpg)
LessonsHierarchal modules are a world of hurt.Metaprogramming in Erlang is still too hard.Never trust ADSL routers....
![Page 28: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/28.jpg)
Use Github.
![Page 29: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/29.jpg)
A small plea for helpI have way too many github projectsAdopt my code?Interested in collaborating?
![Page 30: Erlang White Label](https://reader033.vdocuments.us/reader033/viewer/2022052410/54c3aa5d4a7959ca568b458e/html5/thumbnails/30.jpg)
Fin.