One link of a non-jekyll github page site not working. Is there any cache of something I need to delete (non-local)? - github

So I need to put a specific file with some specific text (location-> .well-known/acme-challenge/filename) where .well-known is at the publishing directory/source, so that I can obtain my SSL/TLS certificate from LetsEncrypt. However, once I try to create this, ALL links work except username.github.io/.well-known/acme-challenge/filename. If I modify .well-known or acme-challenge parts, the links work. I don't know why this is happening. Is there some cache somewhere I need to delete? I've run the links on private no-cache, no-cookies browsers too, they don't seem to work.

Related

How long does it take for an Amazon S3 object redirect to take effect?

I have a very simple, static web site in an Amazon S3 bucket.
Everything works, or used to work, except that one redirect does not work any more.
to be more specific:
I have one object, /A.zip, say, in the bucket.
It used to redirect to /A-v1.1.zip. That worked so far.
Now, I have just changed the redirect for A.zip to redirect to /A-v1.2.zip.
And I have deleted the object A-v1.1.zip .
But it seems that A.zip is still pointing to A-v1.1.zip!
Some browsers still load the old A-v1.1.zip when I try to get A.zip (probably out of a cache), and some browsers give me a 404, with error details "Message: The specified key does not exist.
Key: A-v1.1.zip".
I am not using CloudFront.
Also, Cache-Control is set to max-age=120.
Did I make a mistake?
Or is there anything I need to do to make the change in redirection effective?
(I have already checked the metatags in S3, they are correct.)
Thanks a lot in advance.

Need help w/ custom domain

I purchased a custom domain from Google (kairns.rocks) but am having trouble linking it to my Github repo (https://0n11san.github.io/p1/).
I tried "forwarding the domain" but that didn't accomplish what I wanted (for the address bar to read "kairns.rocks" as opposed to "https://0n11san.github.io/p1/"). Moreover, in some browsers (Chrome), I'm noticing the URL cannot be found, yet in others (Firefox / IE) the URL resolves to the github URL. Of course, even in the latter case, this is still problematic b/c I want the address bar to read "kairns.rocks" instead (not merely re-direct).
I've tried adding a CNAME file to the Github repo w/ both "kairns.rocks" and "www.kairns.rocks" listed. I've also tried changing the "DNS settings" > "Custom resource records" on Google domains to list GH's IP address and my GH page URL, but that doesn't seem to work either. Is there some sort of time requirement for the server(s) to catch up or something else I'm missing?
In addition to the CNAME file, ensure your github pages settings have kairn.rocks in the custom domain section.
go to custom resource records and set name: www, TYPE: CNAME, TTL: 1h, and DATA: https://0n11san.github.io/Project1
Once this is all done, you'll need to wait anywhere from 1 hour to 48 hours for the settings to all settle down.
Here are some good resources to help you troubleshoot:
- https://help.github.com/articles/troubleshooting-custom-domains/#github-repository-setup-errors
- https://help.github.com/articles/troubleshooting-custom-domains/#dns-configuration-errors
So to anyone following along, I was receiving 302 / 404 errors not due to an incorrect handling of data but rather b/c the servers were still catching up. I suggest following the guides #cptwonton references and then working on something else for at least and hr or so (if not more time, especially if your website is robust or your hosting service is less accommodating).

Amazon S3 Redirect Rule - Preserve Query Params

I noticed Amazon S3 Redirect rule - GET data is missing but after following the accepted answer my query params still are not being preserved.
I have a site that uses React and React Router, meaning I have several URLs that load identical HTML and JS and then the JS figures out which part of the app to load based on the URL.
For example:
/foo, /bar, /baz all should load index.html, which loads bundle.js. Then bundle.js observes the URL and routes to some React component (also in bundle.js).
However no foo, bar, or baz file exists in S3, only index.html. What I want to do is when I get a 404, redirect to /#!/{URL} (eg. /foo redirects to /#!/foo). This works fine with my redirect rule (below). However, I also want to bring query params with me (eg. /foo?ping=pong redirects to /#!/foo?ping=pong) but instead /foo?ping=pong just redirects to /#!/foo.
Here are my redirect rules:
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<Protocol>http</Protocol>
<HostName>www.mydomain.com</HostName>
<ReplaceKeyPrefixWith>#!/</ReplaceKeyPrefixWith>
</Redirect>
</RoutingRule>
</RoutingRules>
Any ideas on some way I can achieve this? Ideally without having to go change something in S3/CloudFront every time I add a new page?
The problem was that I had the origin set up in CloudFront not to forward Query Strings so when S3 got the request it would redirect properly without the query params. You can find this setting in CloudFront > Behaviors > Forward Query Strings.
If you want to have clear urls though you can also check out this trick. You need to setup cloudfront distribution and then alter 404 behaviour in "Error Pages" section of your distribution. That way you can again domain.com/foo/bar links :)
The menus and options in CloudFront/S3 change a lot over time.
Here is a December 2021 solution.
Step 1) Create a "Request" Policy in CloudFront that allows QueryStrings
Note: you might want to also add some Headers like Origin or Access-Control-... headers for CORS.
Step 2) Go to your Distribution > Update the Origin request policy
Step 3) Kick a new Invalidation on /*
Additional Notes for Debuging/Testing
I would recommend testing with curl in terminal rather than a browser to avoid caching and also seeing the details. I do curl -v https://example.com/cb?foo=bar1.
Keep increasing the value of the query string (bar1 in the above example, to bar2, bar3) with every test to make such there is no caching again.

Jenkins embeddable build status icon not shown

I want to use the Embeddable Build Status Plugin for Jenkins. I am using Cloudbees. I granted Job/ViewStatus permissions to the anonymous user. When I add the Markdown to the README.md no icon is shown. I tried both the protected and the unprotected link.
# protected
[![Build Status](https://johnjohndoe.ci.cloudbees.com/job/TypedPreferences/badge/icon)](https://johnjohndoe.ci.cloudbees.com/job/TypedPreferences/)
# unprotected
[![Build Status](https://johnjohndoe.ci.cloudbees.com/buildStatus/icon?job=TypedPreferences)](https://johnjohndoe.ci.cloudbees.com/job/TypedPreferences/)
By default DEV#cloud Jenkins instances are not visible, at all, to anonymous users. If you have configured role-based security and want anonymous users to have the selected roles, configure your system and check the box Enable read-only access for anonymous users.
Well, the question has been asked some time ago, but for others reaching it here, having the problem, that the image is still not shown within the Readme.md on GitHub/GitHub-Enterprise after performing the above mentioned configuration:
Make sure that both services are using the same protocol. In my case, we had GitHub-Enterprise running under HTTPS and Jenkins was running on HTTP.
The badge will not be shown in this case because of the possible security breach introduced by mixed content. You will find an appropriate error message in the console output of your browser (i.e. F12 in Chrome):
Mixed Content: The page at 'https://.../README.md' was loaded over HTTPS,
but requested an insecure image 'http://.../job/master/badge/icon'.
This request has been blocked; the content must be served over HTTPS.
It's of course quite obvious but something that can also be easily missed when searching on the wrong track.
I had an issue with space in the project name, so do not forget to replace spaces with %20
example:
[![Build Status](../Long%20Project%20Name/...)](.../Long%20Project%20Name/...)

Fiddler: Respond to Requests Requiring a Client Certificate

I'm trying to scrape a website that first asks for a certificate. After you are authenticated it then will ask you to provide a username and password. Anyway I'm trying to use fiddler to see what i need to replicate and when i turn on it to "Capture traffic" and then I go to internet explorer and try to access the site it says " Internet Explorer cannot display the webpage " then when i turn off fiddler and try it again it brings me to the login page.
I've tried this link and i tried everything (Turning it into a .cer file and dragging into the folder also tried copy and pasting the code into the rule file to accept the certificate) and neither way worked. Does anyone have any other ideas.
Am I suppose to replace the fiddler root certificate somehow? or is there any solution that someone can suggest?
I figured out this problem. Just incase this trips someone else up. The oSession bit of code needed to be the first line after the OnBeforeRequest line. I don't remember where it was before but it didn't work. Example:
static function OnBeforeRequest(oSession: Session) {
oSession["https-Client-Certificate"]= "C:\\Yourcerfilelocation.cer";
//I omitted the standard code
}
Edit: OnBeforeRequest is a better method to place it instead of OnPeekAtRequestHeaders.