Beginnings of terminal support, but tinyproxy doesn't handle UPGRADE
This commit is contained in:
parent
3646cb1777
commit
0e55f6a2d9
@ -1,5 +1,5 @@
|
|||||||
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as build
|
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as build
|
||||||
RUN apk add crystal shards yaml-dev openssl-dev zlib-dev libxml2-dev
|
RUN apk update && apk add crystal shards yaml-dev openssl-dev zlib-dev libxml2-dev && apk cache clean
|
||||||
RUN addgroup -S app && adduser app -S -G app
|
RUN addgroup -S app && adduser app -S -G app
|
||||||
WORKDIR /home/app
|
WORKDIR /home/app
|
||||||
COPY shard.yml ./
|
COPY shard.yml ./
|
||||||
@ -10,7 +10,7 @@ RUN shards build -d --error-trace
|
|||||||
RUN strip bin/*
|
RUN strip bin/*
|
||||||
|
|
||||||
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship
|
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship
|
||||||
RUN apk add tinyproxy multirun openssl zlib yaml pcre2 gc libevent libgcc libxml2
|
RUN apk update && apk add tinyproxy multirun openssl zlib yaml pcre2 gc libevent libgcc libxml2 ttyd && apk cache clean
|
||||||
|
|
||||||
# Unprivileged user
|
# Unprivileged user
|
||||||
RUN addgroup -S app && adduser app -S -G app
|
RUN addgroup -S app && adduser app -S -G app
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
require "./funko.cr"
|
require "./funko.cr"
|
||||||
require "./proxyconf.cr"
|
require "./proxyconf.cr"
|
||||||
require "./secrets.cr"
|
require "./secrets.cr"
|
||||||
|
require "./terminal.cr"
|
||||||
require "compress/gzip"
|
require "compress/gzip"
|
||||||
require "crystar"
|
require "crystar"
|
||||||
require "docr"
|
require "docr"
|
||||||
|
@ -39,6 +39,7 @@ module Proxy
|
|||||||
ReverseOnly Yes
|
ReverseOnly Yes
|
||||||
ReverseMagic Yes
|
ReverseMagic Yes
|
||||||
ReversePath "/admin/" "http://127.0.0.1:3000/"
|
ReversePath "/admin/" "http://127.0.0.1:3000/"
|
||||||
|
ReversePath "/admin/terminal/" "http://127.0.0.1:7681"
|
||||||
) + funkos.map { |funko| %(ReversePath "/faaso/#{funko.split("-")[0]}/" "http://#{funko}:3000/") }.join("\n")
|
) + funkos.map { |funko| %(ReversePath "/faaso/#{funko.split("-")[0]}/" "http://#{funko}:3000/") }.join("\n")
|
||||||
|
|
||||||
if @@current_config != config
|
if @@current_config != config
|
||||||
|
20
src/daemon/terminal.cr
Normal file
20
src/daemon/terminal.cr
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
module Terminal
|
||||||
|
extend self
|
||||||
|
|
||||||
|
@@terminal_process : Process | Nil = nil
|
||||||
|
|
||||||
|
def start_terminal(_args = ["bash"], readonly = false)
|
||||||
|
args = ["-p", "7681", "-c", "admin:admin", "-o"]
|
||||||
|
args += ["-W"] unless readonly
|
||||||
|
args += _args
|
||||||
|
# We have a process there, kill it
|
||||||
|
@@terminal_process.as(Process).terminate if !@@terminal_process.nil?
|
||||||
|
@@terminal_process = Process.new(
|
||||||
|
command: "/usr/bin/ttyd",
|
||||||
|
args: args)
|
||||||
|
Log.info {"Terminal started on port 7681"}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Terminal.start_terminal
|
@ -8,3 +8,5 @@
|
|||||||
ReverseOnly Yes
|
ReverseOnly Yes
|
||||||
ReverseMagic Yes
|
ReverseMagic Yes
|
||||||
ReversePath "/admin/" "http://127.0.0.1:3000/"
|
ReversePath "/admin/" "http://127.0.0.1:3000/"
|
||||||
|
ReversePath "/admin/terminal" "http://127.0.0.1:7681"
|
||||||
|
ReversePath "/faaso/hello/" "http://hello-d89veq:3000/"
|
Loading…
Reference in New Issue
Block a user