1
0
Fork
You've already forked codeberg-github-org-invite
0
Web server that does Codeberg and GitHub OAuth and then adds the GitHub user to a GitHub organisation
  • JavaScript 86.4%
  • HTML 13.1%
  • Dockerfile 0.5%
Find a file
2025年10月21日 18:21:07 +02:00
src Initial commit 2025年10月21日 17:43:45 +02:00
views Initial commit 2025年10月21日 17:43:45 +02:00
.dockerignore Initial commit 2025年10月21日 17:43:45 +02:00
.gitignore Initial commit 2025年10月21日 17:43:45 +02:00
docker-compose.yml Add README 2025年10月21日 18:21:07 +02:00
Dockerfile Initial commit 2025年10月21日 17:43:45 +02:00
LICENSE.txt Add GPLv2 license text 2025年10月21日 17:51:18 +02:00
package.json Initial commit 2025年10月21日 17:43:45 +02:00
README.md Add README 2025年10月21日 18:21:07 +02:00
yarn.lock Initial commit 2025年10月21日 17:43:45 +02:00

Codeberg Github Org Invite

What is this?

This is a silly server written using Express JS which allows a user to log in with Codeberg, then with GitHub, then join a GitHub organisation.

It is currently in a minimum viable product, proof of concept state.

How to run

1. .env file

Create a .env file with the following contents:

HOST=https://fill-me-with-actual.data
COOKIE_SECRET=fill me with actual data
GITHUB_ORG_TOKEN=fill me with actual data
GITHUB_ORG_NAME=fill me with actual data
OAUTH_CODEBERG_CLIENT_ID=fill me with actual data
OAUTH_CODEBERG_CLIENT_SECRET=fill me with actual data
OAUTH_GITHUB_CLIENT_ID=fill me with actual data
OAUTH_GITHUB_CLIENT_SECRET=fill me with actual data

The meaning of each environment variable is:

Variable Meaning
HOST The website where the webapp is accessible
COOKIE_SECRET Secret used for storing the session with cookies
GITHUB_ORG_TOKEN A personal access token for the GitHub organisation, with read and write access to members (obtain here)
GITHUB_ORG_NAME The name of the GitHub organisation (as in, the name appearing in the URL)
OAUTH_CODEBERG_CLIENT_ID OAuth client ID for Codeberg (obtain here)
OAUTH_CODEBERG_CLIENT_SECRET OAuth client secret for Codeberg
OAUTH_GITHUB_CLIENT_ID OAuth client ID for GitHub (obtain here)
OAUTH_GITHUB_CLIENT_SECRET OAuth client secret for GitHub
LISTEN_PORT (optional; default: 3000) The port to listen on
LISTEN_HOST (optional; default: ::) The host to listen on (see NodeJS docs)
DB_PATH (optional; default: ./db.sqlite) Path for SQLite database

Check src/config.js for more info.

2.a) Run locally

With the dotenv utility installed, run:

yarn install
dotenv -- node src/index.js

Without the dotenv utility, manually set the environment variables using your shell:

yarn install
HOST=https://example.com \
AND_THE=OTHER_VARIABLES \
node src/index.js

2.b) Docker Compose

Dockerfile and docker-compose.yml files are already provided.

Simply run docker compose up -d --build.

You might consider editing the exposed port in the docker-compose.yml file.