Skip to content

Code-Server

Run VS Code on any machine anywhere and access it in the browser.

egg-code-server.json

updated

Ports

Add an allocation on the node for each port.

  • Game 8080

Install

Installer image
ghcr.io/ptero-eggs/installers:debian
Install script
48 lines

Images

New servers use the first image. Users can change it on the Startup page.

  • Node.js 12 default ghcr.io/ptero-eggs/yolks:nodejs_12
  • Node.js 14 ghcr.io/ptero-eggs/yolks:nodejs_14
  • Node.js 16 ghcr.io/ptero-eggs/yolks:nodejs_16
  • Node.js 17 ghcr.io/ptero-eggs/yolks:nodejs_17
  • Node.js 18 ghcr.io/ptero-eggs/yolks:nodejs_18

Startup

The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.

2 variables

Startup command

sh .local/lib/code-server-latest/bin/code-server
  • Password to login to your Code-Server instance

    PASSWORDUsers can edit

    required|string|max:32

  • Version for (re)installation such as 3.9.3. Defaults to latest version if no valid version is provided

    VERSIONUsers can edit

    string|max:20

Wings

Stop command
^^C
Running when the console shows
HTTP server listening on

Files Wings edits

Wings sets these values in these files before each start.

.config/code-server/config.yaml file

password
password: {{server.build.env.PASSWORD}}
bind-addr
bind-addr: 0.0.0.0:{{server.build.default.port}}

Readme

Code-Server

From the Code-Server GitHub

Run VS Code on any machine anywhere and access it in the browser.

Server Ports

Ports required to run the server in a table format.

Port default
Game 8080

Changes

  1. fix docker images path

    · Daniel Barton · 7d2b714

  2. Replace docker images

    · Daniel Barton · 3759ed6

  3. Add software

    · rowansc1 · 9b56a00

All changes on GitHub

Problem with this egg?

Open an issue on GitHub. Include your Panel and Wings versions.

Install script 48 lines bash in ghcr.io/ptero-eggs/installers:debian Show
apt update
apt install -y curl jq


ARCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")
MATCH=linux-${ARCH}
# Create initial directories
mkdir -p /mnt/server
cd /mnt/server

echo ${ARCH}
echo ${MATCH}
# Create needed directories
mkdir -p /mnt/server/.local/lib /mnt/server/.local/bin /mnt/server/.config/code-server /mnt/server/projects

# Change permission of projects directory so it can be accessed by code-server
chmod 777 /mnt/server/projects
touch "/mnt/server/projects/PLACE YOUR PROJECTS HERE"

# Check for available versions. Defaults to latest if no valid version is found.
LATEST_JSON=$(curl --silent "https://api.github.com/repos/coder/code-server/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/coder/code-server/releases")

if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
    DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})
else
    VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "v${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
    if [ "v${VERSION}" == "${VERSION_CHECK}" ]; then
        DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "v${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})
    else
        echo -e "defaulting to latest release"
        DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)
    fi
fi

# Download the given Version and extract it
echo "Downloading $DOWNLOAD_URL"
curl -fL $DOWNLOAD_URL | tar -C /mnt/server/.local/lib -xz
mv /mnt/server/.local/lib/code-server-*linux-${ARCH} /mnt/server/.local/lib/code-server-${VERSION}


PATH="/mnt/server/.local/bin:$PATH"
echo "password: changeme
bind-addr: 0.0.0.0
auth: password
cert: false" > /mnt/server/.config/code-server/config.yaml

echo "Install complete"