From 8738b426ce88a3582eb6b27e2ca1481a2e5d4313 Mon Sep 17 00:00:00 2001 From: Jeffery Russell Date: Sat, 7 Mar 2026 11:29:08 -0500 Subject: [PATCH] Feature/gh api deprecation (#42) * Updated jquery version * Updated docker image to run basic node image, fixed GH deprecated authentication method --- .gitignore | 37 +++- Dockerfile | 12 +- README.md | 22 ++- docker-compose.yml | 9 +- server/public/FriendsGraph.html | 4 +- server/public/GraphGenerator.html | 4 +- server/public/GraphTest.html | 4 +- server/public/OrgRepoGraph.html | 4 +- server/public/TimeLineGraph.html | 4 +- server/public/about.html | 4 +- server/public/index.html | 4 +- server/routes/api/v1.js | 17 +- server/routes/api/v2.js | 310 ------------------------------ server/routes/test/v2.js | 11 -- server/server.js | 6 +- 15 files changed, 60 insertions(+), 392 deletions(-) delete mode 100644 server/routes/api/v2.js delete mode 100644 server/routes/test/v2.js diff --git a/.gitignore b/.gitignore index ecc4832..2eebbde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,28 @@ -################################################################################ -# This .gitignore file was automatically created by Microsoft(R) Visual Studio. -################################################################################ - -*/.vs -*/node_modules/.bin -*/node_modules -*/package-lock.json -*/.env \ No newline at end of file +# Dependencies +node_modules/ +package-lock.json + +# Environment variables +.env +server/.env + +# Logs +logs/ +*.log +npm-debug.log* + +# Runtime / OS +.DS_Store +Thumbs.db + +# IDE / Editor +.vs/ +.vscode/ +.idea/ + +# Test coverage +coverage/ +.nyc_output/ + +# Docker volumes +volumes/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8bc22ee..bdbb565 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,6 @@ -FROM ubuntu +FROM node:bookworm-slim LABEL maintainer="Jeffery Russell" -# install all dependencies -RUN apt-get update && \ - apt-get upgrade -y && \ - apt-get install -y build-essential && \ - apt-get install -y sudo curl && \ - curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash - && \ - apt-get install -y nodejs && \ - apt-get update && \ - apt-get clean - # Create a working directory for the container RUN mkdir /github-graphs diff --git a/README.md b/README.md index 0dcefcd..0b22de4 100644 --- a/README.md +++ b/README.md @@ -22,26 +22,30 @@ If you are lucky, you can find the site live [here](https://github-graphs.com/). The easiest way to get started with Github-Graphs is to fork this repository and follow the instructions below. -#### Create a new OAuth app +#### Create a GitHub Personal Access Token (PAT) -The objective of creating an app under your github account is to access an -endpoint through the GitHub API and obtain credentials to set your environment -file. For more information on how to create a new OAuth app, consult the corresponding -Github developer documentation [here](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/). +Authentication is handled via a GitHub Personal Access Token (PAT). The old +OAuth App `client_id`/`client_secret` query parameter method is no longer used, +as GitHub deprecated unauthenticated and OAuth-param-based requests. + +To create a PAT: +1. Go to **GitHub → Settings → Developer settings → Personal access tokens** +2. Choose **Fine-grained tokens** (recommended) or **Tokens (classic)** +3. For a classic token, grant the `public_repo` and `read:user` scopes (read-only is sufficient) +4. Copy the generated token — it will only be shown once #### Create a .env file After forking this repository, run the command `cd server/`. Inside that folder, -setup your environment credentials by creating a `.env file` with the code below filled in. +setup your environment credentials by creating a `.env` file with the values below filled in. ``` -CLIENT_ID = -CLIENT_SECRET = +GITHUB_TOKEN = SESSION_SECRET = PORT = ``` -The creation of your OAuth app and the .env file are required steps, +The creation of your PAT and the `.env` file are required steps, irrespective of your desired deployment environment. For specific directions, continue by following the steps specified below. diff --git a/docker-compose.yml b/docker-compose.yml index d89633e..57a2bf1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,10 @@ - -version: '3.7' - services: github-graphs: build: dockerfile: Dockerfile - image: graph-app:latest + image: graph-app container_name: github-graphs + env_file: + - .env ports: - - "8080:8000" + - "4002:4002" diff --git a/server/public/FriendsGraph.html b/server/public/FriendsGraph.html index 81ca612..2bfbf72 100644 --- a/server/public/FriendsGraph.html +++ b/server/public/FriendsGraph.html @@ -9,9 +9,7 @@ diff --git a/server/public/OrgRepoGraph.html b/server/public/OrgRepoGraph.html index 8b6294f..43c9dab 100644 --- a/server/public/OrgRepoGraph.html +++ b/server/public/OrgRepoGraph.html @@ -10,9 +10,7 @@