Compare commits
No commits in common. "5bf920255f8b8fbd4f1c12f1d54585d1aa632b98" and "ba5a9c17c8d3394341749b1e079e173ad74bdfeb" have entirely different histories.
5bf920255f
...
ba5a9c17c8
|
@ -96,12 +96,12 @@ steps:
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: combine-manifests
|
name: manifest
|
||||||
depends_on:
|
depends_on:
|
||||||
- build-docker-amd64
|
- build-docker-amd64
|
||||||
- build-docker-arm64
|
- build-docker-arm64
|
||||||
steps:
|
steps:
|
||||||
- name: publish
|
- name: manifest
|
||||||
image: plugins/manifest
|
image: plugins/manifest
|
||||||
settings:
|
settings:
|
||||||
username: JackNet
|
username: JackNet
|
||||||
|
|
|
@ -18,7 +18,7 @@ services:
|
||||||
image: git.jacknet.io/jackhadrill/container-spawner:latest
|
image: git.jacknet.io/jackhadrill/container-spawner:latest
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
CONTAINER_IMAGE: "git.jacknet.io/jackhadrill/code-server:latest"
|
CONTAINER_IMAGE: "codercom/code-server:latest"
|
||||||
CONTAINER_PREFIX: "vscode"
|
CONTAINER_PREFIX: "vscode"
|
||||||
CONTAINER_NETWORK: "vscode_backend"
|
CONTAINER_NETWORK: "vscode_backend"
|
||||||
CONTAINER_PERSIST: "/home/coder"
|
CONTAINER_PERSIST: "/home/coder"
|
||||||
|
@ -36,9 +36,9 @@ $ docker run -d --rm --name ${CONTAINER_PREFIX}-${X-Forwarded-Preferred-User} -v
|
||||||
For example, assuming `X-Forwarded-Preferred-User` is `jack`:
|
For example, assuming `X-Forwarded-Preferred-User` is `jack`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ export CONTAINER_IMAGE="git.jacknet.io/jackhadrill/code-server:latest"
|
$ export CONTAINER_IMAGE="codercom/code-server:latest"
|
||||||
$ export CONTAINER_PREFIX="vscode"
|
$ export CONTAINER_PREFIX="vscode"
|
||||||
$ export CONTAINER_NETWORK="vscode_backend"
|
$ export CONTAINER_NETWORK="vscode_backend"
|
||||||
$ export CONTAINER_PERSIST="/home/coder"
|
$ export CONTAINER_PERSIST="/home/coder"
|
||||||
$ docker run -d --rm --name vscode-jack -v vscode-jack:/home/coder --network vscode_backend git.jacknet.io/jackhadrill/code-server:latest
|
$ docker run -d --rm --name vscode-jack -v vscode-jack:/home/coder --network vscode_backend codercom/code-server:latest
|
||||||
```
|
```
|
||||||
|
|
|
@ -2,14 +2,12 @@
|
||||||
from flask import Flask, make_response, request
|
from flask import Flask, make_response, request
|
||||||
from containerspawner.state import StateManager
|
from containerspawner.state import StateManager
|
||||||
|
|
||||||
HTTP_METHODS = ["GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
state = StateManager()
|
state = StateManager()
|
||||||
|
|
||||||
|
|
||||||
@app.route("/", defaults={"path": ""}, methods=HTTP_METHODS)
|
@app.route("/", defaults={"path": ""})
|
||||||
@app.route("/<path:path>", methods=HTTP_METHODS)
|
@app.route("/<path:path>")
|
||||||
def default(path):
|
def default(path):
|
||||||
"""Catch all endpoint to spawn Docker containers."""
|
"""Catch all endpoint to spawn Docker containers."""
|
||||||
username = request.headers.get("X-Forwarded-Preferred-User")
|
username = request.headers.get("X-Forwarded-Preferred-User")
|
||||||
|
|
Loading…
Reference in New Issue