diff --git a/caddy/site/links/index.js b/caddy/site/links/index.js index 4d69125..b1a8968 100644 --- a/caddy/site/links/index.js +++ b/caddy/site/links/index.js @@ -1,37 +1,4 @@ -// hack file:// load -if (/^file:\/\/\//.test(location.href)) { - let path = './'; - let orig = fetch; - window.fetch = (resource) => ((/^[^/:]*:/.test(resource)) ? - orig(resource) : - new Promise(function(resolve, reject) { - let request = new XMLHttpRequest(); - - let fail = (error) => {reject(error)}; - ['error', 'abort'].forEach((event) => { request.addEventListener(event, fail); }); - - let pull = (expected) => (new Promise((resolve, reject) => { - if ( - request.responseType == expected || - (expected == 'text' && !request.responseType) - ) - resolve(request.response); - else - reject(request.responseType); - })); - - request.addEventListener('load', () => (resolve({ - arrayBuffer : () => (pull('arraybuffer')), - blob : () => (pull('blob')), - text : () => (pull('text')), - json : () => (pull('json')) - }))); - request.open('GET', resource.replace(/^\//, path)); - request.send(); - }) - ); -} - +// app var app = new Vue({ el: '#app', data: { diff --git a/caddy/site/links/links.json b/caddy/site/links/links.json index 490e058..a6e510a 100644 --- a/caddy/site/links/links.json +++ b/caddy/site/links/links.json @@ -1,6 +1,14 @@ [ {"href": "http://n2-plus.local:19999/", "text": "netdata", "port": "19999"}, {"href": "http://n2-plus.local:9000/", "text": "portainer", "port": "9000"}, - {"href": "http://n2-plus.local", "text": "index", "port": ""}, + {"href": "http://n2-plus.local:9981/", "text": "tvheadend", "port": "9981"}, + {"href": "http://n2-plus.local:8088/", "text": "tiddly", "port": "8088"}, + {"href": "http://n2-plus.local:8002/", "text": "piwigo", "port": "8002"}, + {"href": "http://n2-plus.local:3030/", "text": "fuseki", "port": "3030"}, + {"href": "http://n2-plus.local:8002/", "text": "portainer", "port": "8002"}, + {"href": "http://n2-plus.local:8443/", "text": "code-server", "port": "8443"}, + {"href": "http://n2-plus.local:8444/", "text": "code-server4", "port": "8444"}, + {"href": "http://n2-plus.local:8300/", "text": "gitea", "port": "8300"}, + {"href": "http://n2-plus.local", "text": "caddy", "port": "80"}, {"href": "http://fish.local", "text": "fish", "port": ""} ] \ No newline at end of file diff --git a/code-server4/Dockerfile b/code-server4/Dockerfile new file mode 100644 index 0000000..d4ec9f5 --- /dev/null +++ b/code-server4/Dockerfile @@ -0,0 +1,26 @@ +# +# add openjdk 11 and basex on code-server docker image +# @author Andy Bunce +FROM alpine:latest AS builder +RUN apk --no-cache add zip +ADD https://files.basex.org/releases/9.5/BaseX95.zip /srv +RUN cd /srv && unzip *.zip && rm *.zip + +# custom options +COPY .basex /srv/basex/ + +# Main image +FROM ghcr.io/linuxserver/code-server:version-v3.9.1 +LABEL author="Andy Bunce" +LABEL company="Quodatum Ltd" +LABEL maintainer="andy@quodatum.com" + + +ENV JAVA_HOME="/usr/lib/jvm/default-jvm/" +RUN apk add --no-cache bash openjdk11-jre-headless +# Has to be set explictly to find binaries +ENV PATH=$PATH:${JAVA_HOME}/bin + +RUN adduser -h /srv -D -u 1000 basex +COPY --from=builder --chown=basex:basex /srv/ /srv + diff --git a/code-server4/README.md b/code-server4/README.md new file mode 100644 index 0000000..fc6e6f3 --- /dev/null +++ b/code-server4/README.md @@ -0,0 +1,3 @@ +# code-server + +Installs `code-server:version-v3.9.1` with JRE and BaseX. \ No newline at end of file diff --git a/code-server4/config/.gitignore b/code-server4/config/.gitignore new file mode 100644 index 0000000..1e04ba0 --- /dev/null +++ b/code-server4/config/.gitignore @@ -0,0 +1,8 @@ +# .gitignore sample +################### + +# Ignore all files in this dir... +* + +# ... except for this one. +!.gitignore diff --git a/code-server4/docker-compose.yml b/code-server4/docker-compose.yml new file mode 100644 index 0000000..13588dd --- /dev/null +++ b/code-server4/docker-compose.yml @@ -0,0 +1,18 @@ +--- +version: "2.1" +services: + code-server: + image: ghcr.io/linuxserver/code-server:4.0.1 + container_name: code-server4 + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/London + - SUDO_PASSWORD=password #optional + - SUDO_PASSWORD_HASH= #optional + volumes: + - ./config:/config + - /var/run/docker.sock:/var/run/docker.sock:ro + ports: + - 8444:8443 + restart: unless-stopped