mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-24 04:54:25 +00:00
Compare commits
8 Commits
f189dfc503
...
b5e3051156
Author | SHA1 | Date | |
---|---|---|---|
|
b5e3051156 | ||
|
113b502abb | ||
|
ddca6a4663 | ||
|
8dd044c7cf | ||
|
4b7715e6b3 | ||
|
546ac8d62b | ||
|
3557ea60a6 | ||
|
af11e3a19b |
42
.github/workflows/pre-release.yaml
vendored
42
.github/workflows/pre-release.yaml
vendored
@ -1,36 +1,42 @@
|
|||||||
---
|
---
|
||||||
name: "pre-release"
|
name: "pre-release"
|
||||||
|
|
||||||
on:
|
on: [push]
|
||||||
push:
|
|
||||||
branches:
|
env:
|
||||||
- "master"
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pre-release-docker:
|
pre-release-docker:
|
||||||
name: "Pre Release Docker"
|
name: "Pre Release Docker"
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
-
|
||||||
|
name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
images: ${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
type=sha,format=long
|
||||||
|
type=sha
|
||||||
|
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
|
||||||
|
type=semver,pattern=v{{major}}.{{minor}}
|
||||||
|
type=semver,pattern=v{{major}}
|
||||||
|
type=ref,event=tag
|
||||||
|
type=ref,event=branch
|
||||||
|
|
||||||
- uses: docker/setup-qemu-action@v1
|
- uses: docker/setup-qemu-action@v2
|
||||||
|
- uses: docker/setup-buildx-action@v2
|
||||||
- uses: docker/setup-buildx-action@v1
|
- uses: docker/login-action@v2
|
||||||
|
|
||||||
- uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
username: "${{ secrets.DOCKER_HUB_USER }}"
|
username: "${{ secrets.DOCKER_HUB_USER }}"
|
||||||
password: "${{ secrets.DOCKER_HUB_TOKEN }}"
|
password: "${{ secrets.DOCKER_HUB_TOKEN }}"
|
||||||
|
|
||||||
- name: "Build and push docker image"
|
- name: "Build and push docker image"
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: "${{ secrets.DOCKER_REPO }}:latest"
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Bootstrap v5.2.0 (https://getbootstrap.com/)
|
* Bootstrap v5.3.2 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -26,8 +26,7 @@ bootstrap
|
|||||||
MIT
|
MIT
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2011-2022 Twitter, Inc.
|
Copyright (c) 2011-2023 The Bootstrap Authors
|
||||||
Copyright (c) 2011-2022 The Bootstrap Authors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
4525
js/package-lock.json
generated
4525
js/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -3,29 +3,29 @@
|
|||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bootstrap": "^5.1.9",
|
"@types/bootstrap": "^5.2.10",
|
||||||
"compression-webpack-plugin": "^9.2.0",
|
"compression-webpack-plugin": "^9.2.0",
|
||||||
"license-loader": "^0.5.0",
|
"license-loader": "^0.5.0",
|
||||||
"license-webpack-plugin": "^4.0.2",
|
"license-webpack-plugin": "^4.0.2",
|
||||||
"purgecss": "^4.1.3",
|
"purgecss": "^4.1.3",
|
||||||
"sass": "^1.54.5",
|
"sass": "^1.70.0",
|
||||||
"sass-loader": "^12.6.0",
|
"sass-loader": "^12.6.0",
|
||||||
"terser-webpack-plugin": "^5.3.1",
|
"terser-webpack-plugin": "^5.3.10",
|
||||||
"ts-loader": "^8.3.0",
|
"ts-loader": "^8.4.0",
|
||||||
"typescript": "^4.3.2",
|
"typescript": "^4.9.5",
|
||||||
"webpack": "^5.76.0",
|
"webpack": "^5.90.1",
|
||||||
"webpack-cli": "^4.7.0",
|
"webpack-cli": "^4.10.0",
|
||||||
"webpack-dev-server": "^4.11.1"
|
"webpack-dev-server": "^4.15.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@popperjs/core": "^2.11.5",
|
"@popperjs/core": "^2.11.8",
|
||||||
"bootstrap": "^5.1.3",
|
"bootstrap": "^5.3.2",
|
||||||
"css-loader": "^5.2.6",
|
"css-loader": "^5.2.7",
|
||||||
"debounce": "^1.2.1",
|
"debounce": "^1.2.1",
|
||||||
"preact": "^10.7.1",
|
"preact": "^10.19.4",
|
||||||
"react-bootstrap": "^2.2.3",
|
"react-bootstrap": "^2.10.1",
|
||||||
"style-loader": "^2.0.0",
|
"style-loader": "^2.0.0",
|
||||||
"xterm": "^4.12.0",
|
"xterm": "^4.19.0",
|
||||||
"xterm-addon-fit": "^0.5.0",
|
"xterm-addon-fit": "^0.5.0",
|
||||||
"xterm-addon-web-links": "^0.4.0",
|
"xterm-addon-web-links": "^0.4.0",
|
||||||
"xterm-addon-webgl": "^0.10.0",
|
"xterm-addon-webgl": "^0.10.0",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { createRef, Component, ComponentChildren } from "preact";
|
import { createRef, Component, ComponentChildren } from "preact";
|
||||||
import { Modal } from "bootstrap";
|
import { Modal } from "bootstrap";
|
||||||
import './bootstrap.scss';
|
import './bootstrap.scss';
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
interface ModalProps {
|
interface ModalProps {
|
||||||
children: ComponentChildren;
|
children: ComponentChildren;
|
||||||
|
1
js/src/bootstrap.scss
vendored
1
js/src/bootstrap.scss
vendored
@ -6,6 +6,7 @@
|
|||||||
// Configuration
|
// Configuration
|
||||||
@import "functions";
|
@import "functions";
|
||||||
@import "variables";
|
@import "variables";
|
||||||
|
@import "variables-dark";
|
||||||
@import "maps";
|
@import "maps";
|
||||||
@import "mixins";
|
@import "mixins";
|
||||||
@import "utilities";
|
@import "utilities";
|
||||||
|
11
js/src/style.scss
Normal file
11
js/src/style.scss
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#terminal {
|
||||||
|
width: auto;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.terminal {
|
||||||
|
padding: 5px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,37 @@
|
|||||||
import { Terminal, IDisposable } from "xterm";
|
import { Terminal, IDisposable, ITerminalOptions, ITheme } from "xterm";
|
||||||
import { FitAddon } from 'xterm-addon-fit';
|
import { FitAddon } from 'xterm-addon-fit';
|
||||||
import { WebLinksAddon } from 'xterm-addon-web-links';
|
import { WebLinksAddon } from 'xterm-addon-web-links';
|
||||||
import { WebglAddon } from 'xterm-addon-webgl';
|
import { WebglAddon } from 'xterm-addon-webgl';
|
||||||
import { ZModemAddon } from "./zmodem";
|
import { ZModemAddon } from "./zmodem";
|
||||||
|
|
||||||
|
const termOptions = {
|
||||||
|
fontSize: 13,
|
||||||
|
fontFamily: 'Menlo For Powerline,Consolas,Liberation Mono,Menlo,Courier,monospace',
|
||||||
|
macOptionClickForcesSelection: true,
|
||||||
|
macOptionIsMeta: true,
|
||||||
|
theme: {
|
||||||
|
foreground: '#d4d4d4',
|
||||||
|
background: '#1e1e1e',
|
||||||
|
cursor: '#adadad',
|
||||||
|
black: '#000000',
|
||||||
|
red: '#d81e00',
|
||||||
|
green: '#5ea702',
|
||||||
|
yellow: '#cfae00',
|
||||||
|
blue: '#427ab3',
|
||||||
|
magenta: '#89658e',
|
||||||
|
cyan: '#00a7aa',
|
||||||
|
white: '#dbded8',
|
||||||
|
brightBlack: '#686a66',
|
||||||
|
brightRed: '#f54235',
|
||||||
|
brightGreen: '#99e343',
|
||||||
|
brightYellow: '#fdeb61',
|
||||||
|
brightBlue: '#84b0d8',
|
||||||
|
brightMagenta: '#bc94b7',
|
||||||
|
brightCyan: '#37e6e8',
|
||||||
|
brightWhite: '#f1f1f0',
|
||||||
|
} as ITheme,
|
||||||
|
} as ITerminalOptions;
|
||||||
|
|
||||||
export class OurXterm {
|
export class OurXterm {
|
||||||
// The HTMLElement that contains our terminal
|
// The HTMLElement that contains our terminal
|
||||||
elem: HTMLElement;
|
elem: HTMLElement;
|
||||||
@ -27,7 +55,7 @@ export class OurXterm {
|
|||||||
|
|
||||||
constructor(elem: HTMLElement) {
|
constructor(elem: HTMLElement) {
|
||||||
this.elem = elem;
|
this.elem = elem;
|
||||||
this.term = new Terminal();
|
this.term = new Terminal(termOptions);
|
||||||
this.fitAddOn = new FitAddon();
|
this.fitAddOn = new FitAddon();
|
||||||
this.zmodemAddon = new ZModemAddon({
|
this.zmodemAddon = new ZModemAddon({
|
||||||
toTerminal: (x: Uint8Array) => this.term.write(x),
|
toTerminal: (x: Uint8Array) => this.term.write(x),
|
||||||
|
4
main.go
4
main.go
@ -3,7 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@ -68,7 +68,7 @@ func main() {
|
|||||||
|
|
||||||
if appOptions.Quiet {
|
if appOptions.Quiet {
|
||||||
log.SetFlags(0)
|
log.SetFlags(0)
|
||||||
log.SetOutput(ioutil.Discard)
|
log.SetOutput(io.Discard)
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.IsSet("credential") {
|
if c.IsSet("credential") {
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"html/template"
|
"html/template"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
noesctmpl "text/template"
|
noesctmpl "text/template"
|
||||||
@ -45,7 +45,7 @@ func New(factory Factory, options *Options) (*Server, error) {
|
|||||||
}
|
}
|
||||||
if options.IndexFile != "" {
|
if options.IndexFile != "" {
|
||||||
path := homedir.Expand(options.IndexFile)
|
path := homedir.Expand(options.IndexFile)
|
||||||
indexData, err = ioutil.ReadFile(path)
|
indexData, err = os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to read custom index file at `%s`", path)
|
return nil, errors.Wrapf(err, "failed to read custom index file at `%s`", path)
|
||||||
}
|
}
|
||||||
@ -253,7 +253,7 @@ func (server *Server) setupHTTPServer(handler http.Handler) (*http.Server, error
|
|||||||
|
|
||||||
func (server *Server) tlsConfig() (*tls.Config, error) {
|
func (server *Server) tlsConfig() (*tls.Config, error) {
|
||||||
caFile := homedir.Expand(server.options.TLSCACrtFile)
|
caFile := homedir.Expand(server.options.TLSCACrtFile)
|
||||||
caCert, err := ioutil.ReadFile(caFile)
|
caCert, err := os.ReadFile(caFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("could not open CA crt file " + caFile)
|
return nil, errors.New("could not open CA crt file " + caFile)
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@ -31,7 +31,7 @@ func (wsw *wsWrapper) Read(p []byte) (n int, err error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
b, err := ioutil.ReadAll(reader)
|
b, err := io.ReadAll(reader)
|
||||||
if len(b) > len(p) {
|
if len(b) > len(p) {
|
||||||
return 0, errors.Wrapf(err, "Client message exceeded buffer size")
|
return 0, errors.Wrapf(err, "Client message exceeded buffer size")
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
@ -114,7 +113,7 @@ func ApplyConfigFile(filePath string, options ...interface{}) error {
|
|||||||
|
|
||||||
fileString := []byte{}
|
fileString := []byte{}
|
||||||
log.Printf("Loading config file at: %s", filePath)
|
log.Printf("Loading config file at: %s", filePath)
|
||||||
fileString, err := ioutil.ReadFile(filePath)
|
fileString, err := os.ReadFile(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user