Skip to content

codenotify/codenotify.run

Repository files navigation

codenotify.run

Codenotify as a Service.

What?

Codenotify.run is a GitHub App backend of Codenotify that lets you subscribe to file changes in pull requests. It's a great way to stay up to date with changes to files you care about.

Why?

The GitHub Action offered by the upstream Codenotify uses the designated GITHUB_TOKEN which has some shortcomings:

  1. It cannot mention teams in pull request comments
  2. It cannot post comments if the pull request is coming from a fork repository

Using a personal access token would of course solve the first problem, but a personal access token is too powerful and it is impractical to add it to all fork repositories (i.e. can't solve the second problem).

How?

Free public server

Free public server comes with absolutely shitty availability.

  1. Install the Codenotify GitHub App on your repositories.
  2. Add some CODENOTIFY files.

Run your own server

Docker images for the Codenotify.run server are available both on Docker Hub and GitHub Container Registry.

Note The latest tag represents the latest build from the main branch.

You need to create a custom directory for the configuration file app.ini:

$ mkdir -p custom/conf
$ touch custom/conf/app.ini

Please refer to Local development > Step 2: Create a test GitHub App for creating a GitHub App, setting up a reverse proxy and filling out necessary configuration options. View conf/app.ini for all available configuration options.

Note The Caddy web server is recommended for production use with automatic HTTPS.

Then volume the custom directory into the Docker container for it being able to start (/app/codenotify.run/custom is the path inside the container):

$ docker run \
    --name=codenotify.run \
    -p 12830:2830 \
    -v $(pwd)/custom:/app/codenotify.run/custom \
    unknwon/codenotify.run

Local development

Step 1: Install dependencies

macOS

  1. Install Homebrew.

  2. Install dependencies:

    brew install git go go-task/tap/go-task ngrok
    go install https://github.com/sourcegraph/[email protected]
    
    # In the root directory of the repository
    ln -s $(go env GOPATH)/bin/codenotify $(pwd)/.bin/codenotify

Step 2: Create a test GitHub App

You need to use the ngrok to get a public URL for your local development server to be able to receive GitHub webhooks:

$ ngrok http 2830

Follow this magic link to create your test GitHub App.

Once you have created your test GitHub App, put the App ID and Private key in the custom/conf/app.ini file:

[github_app]
APP_ID = 123456
PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----"""

Step 3: Start the server

$ task

By default, the server will listen on address 0.0.0.0:2830, but you can change it by setting the FLAMEGO_ADDR environment variable:

$ FLAMEGO_ADDR=localhost:8888 task

Don't forget to restart your ngrok and update your custom/conf/app.ini file before you changed the port!

[server]
EXTERNAL_URL = http://localhost:8888

Credits

The logo is a remix of two icons from flaticon.com.

License

This project is under the MIT License. See the LICENSE file for the full license text.