-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Labbs/init
init project
- Loading branch information
Showing
59 changed files
with
5,704 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
root = "." | ||
testdata_dir = "testdata" | ||
tmp_dir = "tmp" | ||
|
||
[build] | ||
args_bin = [] | ||
bin = "./tmp/main tmux new -A -s ttyd bash" | ||
cmd = "go build -o ./tmp/main ." | ||
delay = 0 | ||
exclude_dir = ["assets", "tmp", "vendor", "testdata"] | ||
exclude_file = [] | ||
exclude_regex = ["_test.go"] | ||
exclude_unchanged = false | ||
follow_symlink = false | ||
full_bin = "" | ||
include_dir = [] | ||
include_ext = ["go", "tpl", "tmpl", "html"] | ||
include_file = [] | ||
kill_delay = "0s" | ||
log = "build-errors.log" | ||
poll = false | ||
poll_interval = 0 | ||
rerun = false | ||
rerun_delay = 500 | ||
send_interrupt = false | ||
stop_on_error = false | ||
|
||
[color] | ||
app = "" | ||
build = "yellow" | ||
main = "magenta" | ||
runner = "green" | ||
watcher = "cyan" | ||
|
||
[log] | ||
main_only = false | ||
time = false | ||
|
||
[misc] | ||
clean_on_exit = true | ||
|
||
[screen] | ||
clear_on_rebuild = false | ||
keep_scroll = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
# go-version: 1.19 | ||
go-version-file: go.mod | ||
# The builtin cache feature ensures that installing golangci-lint | ||
# is consistently fast. | ||
cache: true | ||
cache-dependency-path: go.sum | ||
|
||
- uses: nowsprinting/check-version-format-action@v3 | ||
if: github.event_name != 'pull_request' | ||
id: version | ||
with: | ||
prefix: 'v' | ||
|
||
- name: Build app | ||
run: CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -installsuffix cgo -ldflags="-X 'main.version=${{ steps.version.outputs.full }}'" -o bin/webtty . | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
generate_release_notes: true | ||
files: bin/webtty | ||
prerelease: ${{ steps.version.outputs.is_stable }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: golangci-lint | ||
on: | ||
pull_request: | ||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
# pull-requests: read | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
# go-version: 1.19 | ||
go-version-file: go.mod | ||
# The builtin cache feature ensures that installing golangci-lint | ||
# is consistently fast. | ||
cache: true | ||
cache-dependency-path: go.sum | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
args: --timeout 3m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ | |
|
||
# Go workspace file | ||
go.work | ||
|
||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# webtty | ||
TTY over HTTP | ||
|
||
This a fork of [Gotty](https://github.com/yudai/gotty). It is a tool for sharing terminal over the web. | ||
It has been updated for some dependencies and also the addition of features. | ||
- Session recording | ||
- Word blacklisting | ||
|
||
Work is still in progress for recording and word blacklisting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Package localcommand provides an implementation of webtty.Slave | ||
// that launches a local command with a PTY. | ||
package localcommand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package localcommand | ||
|
||
import ( | ||
"syscall" | ||
"time" | ||
|
||
"github.com/labbs/webtty/server" | ||
) | ||
|
||
type Options struct { | ||
CloseSignal int | ||
CloseTimeout int | ||
} | ||
|
||
type Factory struct { | ||
command string | ||
argv []string | ||
options *Options | ||
opts []Option | ||
} | ||
|
||
func NewFactory(command string, argv []string, options *Options) (*Factory, error) { | ||
opts := []Option{WithCloseSignal(syscall.Signal(options.CloseSignal))} | ||
if options.CloseTimeout >= 0 { | ||
opts = append(opts, WithCloseTimeout(time.Duration(options.CloseTimeout)*time.Second)) | ||
} | ||
|
||
return &Factory{ | ||
command: command, | ||
argv: argv, | ||
options: options, | ||
opts: opts, | ||
}, nil | ||
} | ||
|
||
func (factory *Factory) Name() string { | ||
return "local command" | ||
} | ||
|
||
func (factory *Factory) New(params map[string][]string) (server.Slave, error) { | ||
argv := make([]string, len(factory.argv)) | ||
copy(argv, factory.argv) | ||
if params["arg"] != nil && len(params["arg"]) > 0 { | ||
argv = append(argv, params["arg"]...) | ||
} | ||
|
||
return New(factory.command, argv, factory.opts...) | ||
} |
Oops, something went wrong.