Giter Club home page Giter Club logo

repo-view's Introduction

~: repo-view :~

โ€” It is a static web page that uses Github REST API to preview repos.
It lets employers see your private GitHub repositories in your CV (with your permission of course) without making them public ๐Ÿ’ตโ†—๏ธโ†—๏ธ

Overview :-

let's say you have a really good private repo that you wanna add to your CV.
wait! it is private. right ? then how ?? would you make it public ???
hell NO! it is private and MUST stay as is.
sure you don't wanna your business proprietary code base be published as open-source.
man!, you just wanna show it only to some employers.
of course you can add these employers as collaborators with read-only permissions to this private repo.
but, first you will have to get their GitHub usernames. also, you will have to add them one by one.
maybe you gonna use a cloud storage service with code syntax highlighting ?
oh, what about synchronization between your Github repo and these cloud services ??
what if the cloud shared folder got found by search engines ???

Solution :-

there is a website called GitFront.io :
    it can host your private repo and provide a presentation url that is accessible to anyone who has it.
- problem with GitFront is that: it allows hosting only less-than 100 MB repo for free account.
    if your private repo is larger than that, you gonna have to pay ๐Ÿ’ต๐Ÿ’ต๐Ÿ’ฒ
    ( this was the reason why I created this project )
- your GitFront repo does not get directly synchronized with GitHub
my repo-view does exactly the same except that:
- it is a static web page (no backend) -> your code exists only on GitHub. it does not goto any 3rd party server
- it uses official GitHub REST API, it gets files directly from GitHub
- no problem if repo is larger than 100 MB. you still can preview it
- it is a single page application
- it has some extra features eg: dark theme switch, preview pdf, detect internet disconnect...


Usage :-

Manual Usage [deprecated]
it is a static web page. so, configuration is gonna be passed as url params.

params :-

token : string => github access_token warning: use only tokens with only permissions: repos read-only
repo : string => the repo name on github
owner : string => the repo owner username (or organization username) on github if omitted, it would be fetched from Github (the username who created the access_token). so, if that username is not the owner of the repo, you gonna get ERROR 404
token_ready : bool => it is optional: default is "false" => if true: provide token param is gonna be used as is else: the provided token param must be provied as encodes base64 string using js "btoa" method it first will be decoded back ( using js "atob" method ) why? - the token does not exist readily on url: if any web scrapper found the url and got the token and tried it on their terminal: it wont work. it fist need to be decoded - if the one ,to whom you send the url, tried to use the token (in their terminal) before they view the url on web browser. and it worked. they may think they got hands on a treasure. and they may exploit this token. but if it did not work (ie: it was base64-encoded): sooner or later, after they open the url, they gonna find that they can just get the real token from the web page. so, they wont get too excited about that token.
so, the url would be: https://ibrahemesam.github.io/repo-view/?token=<token>&repo=<repo-name>&owner=<owner-username>

New way of usage:-

First, go to this page ๐Ÿ‘‰ Create repo-view URL

Then, ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡

NB:
Github Repository: should be just the repo name. Not the whole url. ie: "foo" instead of "https://github.com/username/foo"
NB:
The resulting repo-view url has its token as encrypted string.
- Why being encrypted?
= Because when putting the url in a github.io page (or anywhere on Github),
  if the token is not encrypted, Github detects it and think it exists by mistake as a vulnerability.
  So, Github immediately disables the token, and the repo-view url is disabled as well.

DEMO :-

this demo repo is a private github repository. if you visit it, you get 404 because it is Private.
NB: this DEMO url EXPIRES on 12 May 2024. (this expiration is related to GitHub's fine-gained token settings)
NB:  public repos can also be viewed

!! Warning !!: any one with the url can preview and clone the repo
    so, put it only on your CV and send it only to employers
        do NOT put it on places where it may be stolen eg: https://<your_username>.github.io
            or the production business website of the private repo

To create a token :-

1 - go to Github > settings > Developer settings > Personal access tokens > Fine-gained tokens
2 - set "Token name" and "Expiration" date.
3 - on "Repository access" section: select "Only select repositories" then select the repo you wanna use.
4 - under "Permissions section": under "Repository permissions": select "Contents" with "Read-only" access level.
5 - click "Generate token" then copy it.
!! Warning !!: any one with the url can get the token.
    so, when creating the token, do NOT add any permissions to the token other than
        read-only access to repository content (access to only one private repo. NOT all !).
    otherwise, the token may be exploited !!

feel free to report any bug through issues section

if you like this project, give it a Star โญ

LICENSE :-

This project is provided "AS IS" with absolutely "NO WARRANTY".
If you gonna use its source-code somewhere: make a clear credit refering to this repo-view repository.

TODO

[ ] create a Download button
[ ] add url_param option to hide the "repo-view created with โ™ฅ๏ธ by Ibrahem Essam"

repo-view's People

Contributors

ibrahemesam avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

repo-view's Issues

Proposal: Create a Download Button

Here, I only see a Clone button. Could you create a Download button? Because the people who will visit my private repository are not programmers. They will definitely look for a download button.

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.