hey folks, how would I use the hosted kratos (on d...
# talk-kratos
b
hey folks, how would I use the hosted kratos (on dev plan) with a custom UI on a different server? sounds impossible to me as they have to be at least hosted on the same subdomain?
i
not sure to understand your issue
as of your kratos api is reachable your UI can be wherever you want
b
I’m using the self-service flows, so I guess the cookies aren’t set on the domain my service is running but rather on the subdomain of the API
I guess it’s more a question about the dev tier/pricing model 😄
i
maybe I wrong but here it mostly a cookie domain @magnificent-energy-493 right ?
I mean you cannot configure your kratos with separate top level domain but your kratos address can be in different domain
b
I guess that’s my problem if I understood you correctly. with the hosted kratos you need to pay $18 bucks for a custom domain per month. I don’t want to pay $18 bucks to develop my app with a custom UI with the hosted kratos. If there’s no other way I’ll probably put a self-hosted kratos up on a VPS or something, which is much less than $18 per month. but it seems like such an obvious gap that I thought I asked
i
oh ok
got it
b
appreciate you jumping in though 🙏 thank you!
m
@bored-agency-21522 just out of interest, what does the self-hosting save you per year?
m
Hey Christian, for a custom domain you need a paid plan. Otherwise you should be able to develop your custom UI on the dev plan as well, local dev at least should work https://www.ory.sh/docs/getting-started/local-development Maybe you can use the new ory/elements as well, that would save you the time to write your own UI and you can still customize: https://www.ory.sh/docs/getting-started/custom-ui-ory-elements
b
Thank you! It’s already implemented 😉 I just want to build the POC more closer to production
m
Testing self-hosted is of course also possible and you could take that config and import it, so almost no change if you move between setups. But not sure if setting up a selfhosted instance that is ready for prod is cheaper than 18$, reading the docs for it already is a couple hours investment.
Probably depends how familiar you are with that 🙂
b
I have a docker-compose setup locally which I could just put somewhere. Using i.e. scaleway dev costs me 5 bucks per month
I don’t know what I’m gonna do yet but it felt like an oversight, that’s why I asked
m
(I’m not an Ory person, btw. Just curious)
b
I know 😉 no worries
For prod $18 is easily justifiable, but not for my staging environment imho
m
I don’t know what I’d do in that position either
I guess I’d just worry that if staging isn’t similar enough to prod that could be a problem
For $150/year saving
b
yeah that as well. but it’s a small side project that I pay from my own money, so I would like to save as much money as possible, using free tiers as long as I don’t have paying customers 🤷 after that I don’t care about small expenses like $18
m
Ah yeah that makes sense
You could use an AWS micro and be free forever 😄
b
hm yeah, I need to look into that. we moved away from AWS so I never looked back. a few years ago they had one year maximum, did that change?
thank you for the suggestion!
m
I think you can stay free forever for some tiers
b
Nice! I’m also using fly.io for the rest, that’s cutie comfy and also free
m
EC2 micro is free forever according to aws.amazon.com/ec2/pricing
b
Nice! Thanks a bunch!
Not sure it can run kratos + db but I will try
m
😄
Maybe if it supports sqlite
b
I could also use Postgres via fly.io, not sure which db I’m currently using
i
default is sqlite
b
Would’ve been easier to develop and try poc via ory directly and then just pay them when I get paying users. Would’ve gladly done that 🤷🏼‍♂️
i
sure
b
Maybe that’s some input to be considered for pricing/dev strategy in the future @magnificent-energy-493 ?
m
Hey @bored-agency-21522 that is definitely very valuable input , thanks 🙏 Let me try to really nail this down: You can get a free staging instance if you have a paid instance and we will soon introduce a switch between prod/staging (so you dont need this manual process for a staging project). I am not sure if we could offer custom domain for free, maybe an instance with custom domain but rate limiting like in the free plan for a cheaper price. as per fly.io that should also work, we actually have an example from the community, tiny bit outdated: https://github.com/tinco/kratos-service The main issue you had was testing your UI code deployed on your domain example.com against Ory Network, right?
b
Awesome, having staging/dev + prod would help tremendously in any case! I would also be ok with a user limit of 10 for example if it’s (almost free) btw. It’s just about the initial need to put down money. Thank you for the repo, I’ll check it out!
That was the issue, yes. The 303 redirect answer tries to set a cookie which is obviously not set due to different domains, so my UI is confused as to why it doesn’t get a cookie.
Let me know if you need any input or anything else, glad to help!
Maybe some more details that could help: I’m also the CTO of a SaaS startup where we use keycloak (the world looked different three years ago) and I like to use my side projects as experimental basis for my main gig. I would love to replace keycloak somewhere down the line. So I wanted to get some exposure to kratos first. So a proper dev experience goes a long way, but I guess you folks knew that already 😉 it’s been great except for this minor detail.
m
use my side projects as experimental basis for my main gig
yes a lot of people do that, I think its a very good practice! Thats why I am very uhm passionate about people being able to do that on Ory Network. I am leaving for a longer vacation tomorrow, but will be sure to follow this up after 🙏 fyi @fast-lunch-54279
b
Awesome, thank you! Enjoy your time off 😉