Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use a custom domain? #333

Open
leiserfg opened this issue Apr 17, 2019 · 3 comments
Open

How to use a custom domain? #333

leiserfg opened this issue Apr 17, 2019 · 3 comments

Comments

@leiserfg
Copy link

No description provided.

@khornberg
Copy link
Owner

In another project I've used

resources:
  Resources:
   CustomDomain:
     Type: AWS::ApiGateway::DomainName
     Properties:
       CertificateArn:
         'Fn::ImportValue': 'OutputFromAnotherStack'
       DomainName: custom.domain.dev
   BasePathMapping:
     Type: AWS::ApiGateway::BasePathMapping
     Properties:
       DomainName:
         Ref: CustomDomain
       RestApiId: ${self:provider.apiGateway.restApiId}
       Stage: ${self:provider.stage}
   Route53Domain:
     Type: AWS::Route53::RecordSet
     Properties:
       HostedZoneName: 'domain.dev.'
       Name: ${self:resources.Resources.CustomDomain.Properties.DomainName}
       Type: A
       AliasTarget:
         DNSName:
           'Fn::GetAtt': [CustomDomain, 'DistributionDomainName']
         HostedZoneId: zoneID

@rs-garrick
Copy link
Contributor

I just tried to actually use a Custom Domain and couldn't get the authentication to work correctly. It turns out, the Authentication header was coming in lower case. I made a PR for a small patch that allows for this. I have it working on a Custom Domain now.
#881

@rs-garrick
Copy link
Contributor

rs-garrick commented Apr 20, 2022

To have pip finally work with elasticpypi through a Custom Domain, I had to make one other change (but it breaks working without a custom domain):

diff --git a/elasticpypi/templates/links.html b/elasticpypi/templates/links.html
index f08c74e..44608ec 100644
--- a/elasticpypi/templates/links.html
+++ b/elasticpypi/templates/links.html
@@ -5,7 +5,7 @@
   <body>
     <h1>Links for {{ package }}</h1>
     {% for package in packages %}
-    <a href="{{ stage }}/packages/{{ package.0 }}">{{ package.1 }}</a></br>
+    <a href="/packages/{{ package.0 }}">{{ package.1 }}</a></br>
     {% endfor %}
   </body>
 </html>
diff --git a/elasticpypi/templates/simple.html b/elasticpypi/templates/simple.html
index 5effd25..d16670d 100644
--- a/elasticpypi/templates/simple.html
+++ b/elasticpypi/templates/simple.html
@@ -4,7 +4,7 @@
   </head>
   <body>
     {% for prefix in prefixes %}
-    <a href="{{ stage }}/simple/{{ prefix.0 }}/">{{ prefix.1 }}</a><br/>
+    <a href="/simple/{{ prefix.0 }}/">{{ prefix.1 }}</a><br/>
     {% endfor %}
   </body>
 </html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants