« first day (1827 days earlier)      last day (1428 days later) » 

 
1 hour later…
 
8 hours later…
14:18
Hello my Gurus, Its been a while, i have been spreading the gospel of rails far and wide
I come to the wise council with a pressing question
I created a SAAS which works by giving each of my clients a subdomain e.g client1.myapp.com, they can also use client1.com if they have a domain.

The problem comes in when they need to use SSL on their domain, they get warning errors because the SSL they get belongsto *.myapp.com .. I use CNAME DNS records to let them use their own domain. Anyone with an idea on how i can solve this?
A certificate needs to mention the domain it's used for. Can't get around that. And no, *.com doesn't work.
I also think there's a limit on how many domains one certificate can back.
@JohnDvorak You know i actually tried to play around with *.com knowing fully well it wouldn't work hahaha
Yes, so far the only thing that has worked is a multi-domain SSL. But it means redoing all my domains incase i need to modify or add a new one.
Perhaps one cert per client is the easiest option?
SO , thats the thing, i am actually in the process of looking for a way to install multiple certs on my app
I here Nginx can store multiple certs. then after thet i need a script to identify a request and respond with the right cert. I am waaaay out of my depth here
You want to base the cert issued on the URL that's being requested
My dirty mind suggests it might be possible to cobble together an auto-generated htaccess file :/
14:32
Well its the current theory i am working with right now.
Now that sound like an exciting idea ....
*sounds
It's not
Well, there's the fact that i am running my app on Heroku which also worries me. Webrick server doesn't seem to be built for that kind of stuff.
Does Webrick provide hooks in which you could set the certificate to send?
I have found a way to set SSL Parameters in Webrick , i am also trying to think how i can modify it to serve the certificate i want it to serve
Quick pseudocode, on_request do {|req| req.response.cert_filename = req.domain[/\w+\.com$/] + ".crt"}
That code already look good to me, but I'm not a good judge of Webrick code
14:39
@JohnDvorak Let me explore this real quick
@JohnDvorak Thats for serving a single SSL Cert to all requests, i need to modify it
Can you point it to your own function?
If so, you're silver.
I can try
So let me start this over, when a request is done, they expect an SSL certificate in the name of the requesting domain right? right.
SO that means i need to serve my clients domain i.e client1.com with an ssl cert that is for client1.com
correct
So where are these certs usually stored? In the server.. Which means, i need to find a way to put these domain certs on my app and provide them when needed.
So the question here is, how do i put multiple certs on my heroku app. SHould i store the files on my app then find a way for the app to serve a cert according to the requesting domain?
That is approach 1
 
1 hour later…
15:54
@Ndeto Each client that has their own domain name needs a cert specific to that domain. The clients that don't have their own domain name are covered by your wildcard cert for myapp.com.
 
5 hours later…
21:15
@Ndeto - you can't share certificates on heroku as it would require custom bigIP routing or such they don't configured for individual users to control (as you messed everyone up) - it's called a secret or secret key in heroku - you either copy paste it from their webui or you use the heroku command once you install their cmdline utility.
@Ndeto - You can read here about how they view implementing certificates - Manually setting up your cert, then Using more than 1 cert on heroku app
Now, you might potentially, if you have a basic idea of routing & an advanced DNS grasp (its super easy to setup, but also can have effects you didn't plan for & can knock your URL off the internet for 2 weeks) - buy a secondary service to manage your domain's DNS & point them towards your heroku server name URL. I've never tried and heroku might have blocks in place to prevent spammers from using their services
21:54
Ok gang - from yesterday ... brainstorming here ... first, what do you think of doing a root level find to locate all folders with that right name (providing a config file to select which you want or parameter). Then including it's path like that for require?
Second, I need to namespace this ... if I'm doing that across multiple files ... am I doing a require at top & include in the class?
@Mirv It's only necessary to put the top-level "lib" directory in the load path. So, I wouldn't.
Is that in reply to the first or second?
I like my name spaces to match the directory structure. So if my project is called foo, then all of the files in lib/foo start with 'module Foo, and all of the files in lib/foo/bar start with module Foo; module Bar, etc.
@WayneConrad Yes ditto on that - its rails way too ...
    time_greeter            Greeter # Might not need or move to parent folder to hold module
    GreetingSelector        Selector # calls: greeting
    Greeting                Message  # calls: timerange
    TimeInHours             ? Hour # calls: timezoneNames, selector
    TimeRange               ? Range
    TimeToGreeting          Greet # calls TimeInHours, LoadGreeting
    TimeZoneNames

I then house the new files in the namespace module - "TimeHandler" or such
also - i feel silly asking - but is OO setup kind of dying to immutable/functional for webwork for alot of reasons, but because of statehandling & when is it better at tasks?
or just which references talka bout this - i've been googling a bit but since i never took college classes - i don't have the require vocabulary
22:49
Frustrating - based on yesterday i've been more - I still can't decide while require 'Time' works, but my own custom class custom_time.rb in lib named CustomClasswon't let me require 'CustomTime'...but instead I have to require 'custom_time.rb'
23:09
On side note - most of my issues with require were solved yesterday with $: as it turned out the lib directory isn't not automatically included in ruby projects (differing from rails)
So until I make the project into a gem - I have to {$LOAD_PATH | $:} << Dir.pwd for first file called in the lib directory to get any requiring to work at all then have any users call that file specifically.
23:43
Functional makes multi-core easier, I've read.
If your project is a gem, then when running as a gem, the lib directory is automatically added to the load path ($:), and the bin dir is automatically added to PATH.
@WayneConrad yea - that's why I said till I make it a gem :)
i got the rename done & checked in less than an hour for 8 (16 with tests) files (with 4 styles of name & 240 references) - but need to namespace them now

« first day (1827 days earlier)      last day (1428 days later) »