Code Monkey home page Code Monkey logo

Comments (8)

eahefnawy avatar eahefnawy commented on July 25, 2024 2

@syrys-lbsoft thanks for reporting this. This is a great analysis and I do agree with you. We certainly did not test with these domain setups.

from website.

eahefnawy avatar eahefnawy commented on July 25, 2024 1

@Sh1d0w that makes sense. I'll make that change asap.

from website.

syrys-lbsoft avatar syrys-lbsoft commented on July 25, 2024

culprit for the actual issue:

const getNakedDomain = (domain) => {

you can try copy that function into a JS console and try testing following domains:

  • example.com
  • subdomain.example.com
  • example.co.nz
  • subdomain.example.co.nz

assuming this can be easily fixed, i would still like to know the answer to my 2nd question:

I can easily create a certificate manually, is there a way to tell the component to skip ssl certificate creation and simply provide the certificate arn?

from website.

syrys-lbsoft avatar syrys-lbsoft commented on July 25, 2024

While on the same topic, following can also be improved:

const hostedZone = hostedZonesRes.HostedZones.find(

Basically the logic there is to find the 1st hosted zone with the nakedDomain. im not really sure what the naked domain is in this project, but im going to assume its the top most domain. eg: one.two.example.com, i assume nakedDomain is example.com. Remember, you could have a hosted zone that is a subdomain: two.example.com, one.two.example.com etc. Heck, you could even have 3 hosted zones here: one.two.example.com and two.example.com and example.com. Basically, the find filter above will randomly find the "first" one, because its using includes.

what should be happening is, breaking down the domain into parts: [one, two, example, com], then find the hosted zone that matches most (ofcorse excluding matches on just the tld). and use an exact match rather than includes, because that could then match someothersubdomain.example.com because it contained example.com.

...sorry if this is unnecessary or wrong place to post. my logic may be wrong, if so, please feel free to correct me. :)

from website.

syrys-lbsoft avatar syrys-lbsoft commented on July 25, 2024

@eahefnawy great, looks like easy fixes anyway. but, is there any chance that you guys can make the hostedZoneId and the certificateArn be able to be passed in (that should help people do some manual configurations where needed)? Im a tad unfamiliar with the serverless framework to know if i can do this locally for test and/or have a custom version for my self, so thought id suggest here.

config.domainHostedZoneId = state.domainHostedZoneId

config.certificateArn = state.certificateArn

and while you are at it, you could even make the nakedDomain configurable (1 line up), which will help anyone overwrite any similar cases in the future. I feel like the hostedZone and certificateArn has very good usecases where users have complicated setups in AWS.

from website.

eahefnawy avatar eahefnawy commented on July 25, 2024

@syrys-lbsoft you mean being able to overwrite with some new inputs?

from website.

Sh1d0w avatar Sh1d0w commented on July 25, 2024

Hi, is there any progress on this? It really does not work if you are using it for different environments, with env prefixed domains, e.g. dev.mysite.com, stage.mysite.com etc. It always resolves to the root certificate mysite.com and the deployment is failing because of:

 The certificate that is attached to your distribution doesn't cover the alternate domain name (CNAME) that you're trying to add

IMO the best solution would be to do what serverless-domain-manager plugin is doing - expose an option for certificateName so we can pass *.mysite.com and fallback to auto guessing if it is not provided.

from website.

eahefnawy avatar eahefnawy commented on July 25, 2024

Update: I've published a patch that fixes the issue with domains like co.nz. I've tested it on my end with .com.tr and it works. @syrys-lbsoft would be great to confirm from your side as well.

from website.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.