GitHub Note
- IMPORTANT: Note for Git is not here.
GitHub Pages#
- @2021-10-07
- Hosted a MWE with GitHub Pages
- CRA has Advanced Configuration, like changing
PORTandGENERATE_SOURCEMAP - CRA needs extra settings to Build GitHub Pages for Relative Paths like "https://pablion.github.io/pablion-questions/". In the same page, there are also chapters about hosting on GitHub and Firebase.
- For SPA redirect, repo rafgraph/spa-github-pages is very useful
GH OAuth#
Thought it would be simple but it's a deep rabbit hole! The three steps in Official Guide are
GHOAuth- Request users' GitHub identity by redirect
- Redirect users back by GitHub
- Get user's access token
GHWiki- Feedback and feature request
Request users' GitHub identity by redirect#
- @2021-09-25
- First step of Official Guide:
- CORS problem on First step. Solved by
YT: TheGETmethod is just redirect. CORS is not needed.
Redirect users back by GitHub#
- @2021-09-27
- Second step of Official Guide
- The parameters can be overwritten with
redirect_uriparam, but it has to be a sub domain / subdirectory. - "GitHub OAuth Apps cannot have multiple callback URLs, unlike GitHub Apps", origin: Last line of Official Doc To solve this(for test), I redirect
snippethub.devback tolocalhostwithreact-route-dom. - Learned
URL APIon MDN,URLSearchParamson MDN. - When using
react-route-domnested-routing/nesting, (Usingnested-routingacross my knowledge base) removeexactprop. - Setup Amplify Environment variables after comparing Data Protection in Amplify, following this
Get user's access token#
- @2021-09-28
- Third step of Official Guide
- When talking to GF, I remembered a video of firebase doesn't have this problem. I'll try AWS one more day, then switch to firebase.
-
https://github.com/login/oauth/access_tokenendpoint for creating an OAuth access token does not support CORS requests from Web applications. To solve this, I should setup an AWS API likeTimoSolosaid.Or use something like AWS API Gateway to create your own authorization call and keep your client_secret secret –
- When setting up the AWS API, after setting up a
Custom domain names - API mappings(with Route53api.snippethub.dev), theAPI Gateway domain nameinEndpoint configuration(pattern "https://d-56789qwert.execute-api.eu-west-2.amazonaws.com/${MAPPING_PATH}/${API_METHOD}/") cannot fetch same data as the API URL(pattern "https://54321asdfg.execute-api.eu-west-2.amazonaws.com/staging/items"). The former one hasd-at start.
-
Response header has
"x-amzn-ErrorType" = "ForbiddenException"but following this answer(I commented), and AWS troubleshoot HTTP 403 Forbidden errors from API Gateway- I don't have API Authorization(it's NONE);
- I don't have WAF;
- I have
x-apigw-api-idin the response header; - The default endpoint is not disabled.
* No question on
SO, I formatted this H2 chapter and created one question onSO.
GH Wiki#
Feedback and feature request#
- @2021-09-26
- Download my wiki pages, same as publish wiki from main repo
- Search engines. It cannot be called a WIKI without search. Workaround Permit search engines to index Github wikis
- Editing Tool: Better with VScode Online
- Image import, same-origin markdown import: related to Wiki: allow pasting images into wiki pages, and from year 2015, Re-use documentation => Modular Markdown for README.md to "include" instead of "link" to another file
- Keyboard shortcut button. At least let us(users) easily know this thing exists. Type question mark(
Shift+/), with no focused element on this page, if you have a US keyboard, and you'll see the pop-up. Someone create the feature request 8min before me - @2021-09-29
- Backlink like Obsidian, Roam Research, vscode-markdown-notes, or GitHub action(syntax like
close #NUM). It is hard to edit a chapter name while keeping the links available. They should update automatically(with syntax[[hyperlink|note#chapter]], or at least show reference. I made aFRhere - @2021-11-25
- Waited for a while and
GHis not paying attention to the Wiki function. I wanted to keep building my wiki onGHbut finally I moved toMkDocs.
GitHub release#
- @2021-12-29
- github/licensed
- This is not git version and have nothing to do with it.
Multi-License repo#
- @2021-12-31
- currently github doesn't support multi-license repo.
- more details
GitHub raw file#
- @2022-02-01
- GitHub raw file have a 5 minutes cool down. From Github not update
rawafter commit