Code Monkey home page Code Monkey logo

forkrefresh's Introduction

Forkrefresh

Bring Git forks up to date with the original source repositories without downloading/cloning anything to your local environment.

Uses only the Github/Bitbucket API calls to sync.

Demo

Try it live

Running as a docker container

  docker run -it --rm -v forkrefresh:/root/.config/configstore -p 8080:8080 alexivkin/forkrefresh

The first time it runs docker will download the latest pre-built image. You can then access the webapp via http://localhost:8080

Running natively

  1. Install NodeJS 14+
  2. Clone this repository
  3. Run npm install
  4. Register the app with the OAuth provider (see the "configuring authentication" section below)
  5. Now run it as node server.js

Configuring authentication

It uses the full flow OAuth2. You will need to register your app on the server and then configure the app before you can login.

  • GitHub - go to new OAuth app, name the app, point the callback to http://yourhost:port/gh/callback. No need to specify permissions scopes as they are handled at the access time. Copy key and secret and then set GH_OAUTH2_ID and GH_OAUTH2_SECRET environment variables and run the app so it can store them. With docker you can do it using the docker -e option.
  • Bitbucket - go to new OAuth consumer. Give read permissions to the account and the repositories. Point the callback to http://yourhost:port/bb/callback. Copy key and secret and then set BB_OAUTH2_ID and BB_OAUTH2_SECRET environment variables and run the app so it can store them

Authentication details are saved in the configstore, so you only need to do it once. To reset authentication simply remove .config/configstore.

Notes

  • This is a full stack app (server and client js). It could be done as a client-only single page app, but handling the GitHub OAuth SPA flow and API pagination would be tricky.
  • Tested against GitHub API v3
  • This code is full of hacks to bring the origial GH API v14 implementation to v18. It's neither pretty nor the best designed.
  • Bitbucket and the CLI parts have been falling by the wayside and no longer working.

References

forkrefresh's People

Contributors

alexivkin avatar dependabot[bot] avatar luomoxu avatar

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.