Compare commits

..

No commits in common. "test/ssh" and "master" have entirely different histories.

5 changed files with 0 additions and 135 deletions

View File

@ -1,27 +0,0 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
# Binaries
*.exe
/pixelqr
# Test files
*.test

View File

@ -1,15 +0,0 @@
FROM golang:1.9-alpine
COPY . ${GOPATH}/src/git.icedream.tech/icedream/pixelqr
RUN cd "${GOPATH}/src/git.icedream.tech/icedream/pixelqr/testssh" \
&& apk add --no-cache --virtual .build-deps git \
&& echo == Downloading... == \
&& go get -v -d ./... \
&& echo == Building... == \
&& go build -v \
&& mv testssh /usr/local/bin \
&& cd / \
&& rm -r ${GOPATH} \
&& apk del --no-cache .build-deps
CMD ["testssh"]

View File

@ -1,24 +0,0 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
testssh
*.exe
*.test

24
testssh/.gitignore vendored
View File

@ -1,24 +0,0 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
testssh
*.exe
*.test

View File

@ -1,45 +0,0 @@
package main
import (
"bytes"
"io"
"log"
"github.com/fatih/color"
"github.com/gliderlabs/ssh"
"github.com/qpliu/qrencode-go/qrencode"
"git.icedream.tech/icedream/pixelqr/internal"
)
func main() {
greeting := "https://git.icedream.tech/icedream/pixelqr"
color.NoColor = false
ssh.Handle(func(s ssh.Session) {
grid, err := qrencode.Encode(greeting, qrencode.ECLevelQ)
if err != nil {
log.Println(err)
return
}
w := new(bytes.Buffer)
err = internal.ConvertGridToUnicode(w, grid)
if err != nil {
log.Println(err)
return
}
qrs := string(w.Bytes())
io.WriteString(s, "Scan this QR code for the link to the library that generated it:\n\n")
io.WriteString(s, qrs)
io.WriteString(s, "\n\nThank you!\n")
for err == nil {
_, err = s.Read([]byte{})
}
})
log.Fatal(ssh.ListenAndServe(":2020", nil))
}