Usage

To use MMRTracker you need to setup three things: GitHub SSH access, Docker and VSCode.

GitHub SSH setup

You can choose to do this in several different ways, using whichever Windows SSH client you prefer. This guide will use the OpenSSH client built into Windows 10/11

  1. Open an admin Powershell terminal as administrator

    • Right-click the Start/Windows button and select Windows PowerShell (Admin)

  2. Execute

    $ Set-Service ssh-agent -StartupType Automatic
    $ Start-Service ssh-agent
    $ Get-Service ssh-agent
    
  3. Generate an ssh key (no need to change default prompts)

    $ ssh-keygen
    

You can see your newly created key by executing ``cat ~/.ssh/id_rsa.pub`` in a local terminal

  1. Open/Create C:\Users\<User>\.ssh\config in any text editor. Add the following contents

    Host *
        AddKeysToAgent yes
        IdentityFile ~/.ssh/id_rsa
    
  2. Add the GitHub server public SSH host keys to your computer:

    $ ssh-keyscan github.com >> ~/.ssh/known_hosts
    

Configure GitHub keys and tokens

  1. Login into GitHub, then go to the SSH settings page and add your key

  2. Create a GitHub personal access token here with repo, workflow, write:packages and delete:packages permissions

Setup environment variables

  1. Open the windows Environment Variables editor

  2. Add the following to the User section, by clicking the [New...] button:

    GITHUB_ACTOR="your-github-username"
    GITHUB_TOKEN="your-github-token"
    

Login into GitHub Container Registry (GHCR)

  1. Make sure your environment variables are usable. If echo %GITHUB_ACTOR% doesn’t output your environment variable value, restart your computer.

  2. Login by running:

    echo %GITHUB_TOKEN% | docker login ghcr.io -u %GITHUB_ACTOR% --password-stdin
    

Docker setup

  1. Install Docker Desktop

    • Use WSL 2 (recommended) when prompted

  2. Start Docker

    • Might need to install some WSL 2 prerequisites to get it working. See this guide.

  3. Check docker is working, by opening a new terminal window and running

    docker --version
    # Docker version 18.09.2, build 6247962
    
  4. Download the container

    docker pull ghcr.io/luke-95/mmrtracker:latest
    
  5. Create a shared docker volume

    docker volume create mmrtracker-state
    

VSCode setup

  1. Install the Dev Containers Extension.

    Note

    Add some default container extensions for VSCode, by adding something like this to settings.json (feel free to use your favorite extensions):

    "dev.containers.defaultExtensions": [
        "eamodio.gitlens",
        "GitHub.vscode-pull-request-github",
        "VisualStudioExptTeam.vscodeintellicode",
    ]
    
  2. Run the project in a container, using VSCode:

    1. Open Docker

    2. Open VSCode

    3. In VSCode:

      1. Open the command pallette by pressing [CTRL] + [SHIFT] + [P]

      2. Select Dev Containers: Clone Repository in Container Volume

      3. Select Git, then select the MMRTracker repository from the dropdown

This should prompt VSCode to load the latest MMRTracker container image from ghcr.io, build it locally, run it in docker, clone the MMRTracker repository inside it, and then connect VSCode to it.

Congratulations! You can now work on the project