işleme
e4f593d2cb
9 değiştirilmiş dosya ile 92 ekleme ve 95 silme
|
@ -6,4 +6,3 @@ Readme.md
|
|||
slides/
|
||||
node_modules/
|
||||
vendor/
|
||||
*.go
|
||||
|
|
23
Dockerfile
23
Dockerfile
|
@ -1,8 +1,23 @@
|
|||
FROM golang:1.12 AS compiler
|
||||
|
||||
WORKDIR $GOPATH/src/github.com/msoedov/hacker-slides
|
||||
|
||||
ENV GO111MODULE on
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN GOOS=linux CGO_ENABLE=0 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /bin/app *.go
|
||||
|
||||
|
||||
|
||||
FROM alpine:3.8
|
||||
|
||||
WORKDIR /app
|
||||
WORKDIR /srv
|
||||
|
||||
COPY . /app
|
||||
ENV GIN_MODE=release
|
||||
|
||||
CMD ./main $PORT
|
||||
RUN mkdir slides
|
||||
COPY --from=compiler /bin/app /bin/app
|
||||
COPY static static
|
||||
COPY templates templates
|
||||
COPY initial-slides.md initial-slides.md
|
||||
CMD app $PORT
|
||||
|
|
1
Makefile
1
Makefile
|
@ -7,7 +7,6 @@ repo:
|
|||
@echo $(DOCKER_IMAGE)
|
||||
|
||||
build:
|
||||
@GOOS=linux CGO_ENABLE=0 go build main.go
|
||||
@docker build -t $(DOCKER_IMAGE) .
|
||||
@docker tag $(DOCKER_IMAGE) $(REPO)
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"os"
|
||||
"strconv"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/gin-gonic/gin"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func Header(c *gin.Context, key string) string {
|
||||
|
|
74
glide.lock
üretilen
74
glide.lock
üretilen
|
@ -1,74 +0,0 @@
|
|||
hash: 0e3d28470984716f7203fe14687de6123130847959243865dd98b14def60cce9
|
||||
updated: 2018-02-24T13:05:48.213797-05:00
|
||||
imports:
|
||||
- name: github.com/atrox/haikunatorgo
|
||||
version: a67e32b6e89f0f2d91d81d300787fc01ca0dfd86
|
||||
- name: github.com/boj/redistore
|
||||
version: 4562487a4bee9a7c272b72bfaeda4917d0a47ab9
|
||||
- name: github.com/bradfitz/gomemcache
|
||||
version: 1952afaa557dc08e8e0d89eafab110fb501c1a2b
|
||||
subpackages:
|
||||
- memcache
|
||||
- name: github.com/bradleypeabody/gorilla-sessions-memcache
|
||||
version: 75ee37df8664a47cd5d9eb84d41e1f2b08086893
|
||||
- name: github.com/garyburd/redigo
|
||||
version: d1ed5c67e5794de818ea85e6b522fda02623a484
|
||||
subpackages:
|
||||
- internal
|
||||
- redis
|
||||
- name: github.com/gin-contrib/sessions
|
||||
version: fda3be6efa2da56e31a1a72bffd65279191e8009
|
||||
- name: github.com/gin-contrib/sse
|
||||
version: 22d885f9ecc78bf4ee5d72b937e4bbcdc58e8cae
|
||||
- name: github.com/gin-gonic/gin
|
||||
version: d459835d2b077e44f7c9b453505ee29881d5d12d
|
||||
subpackages:
|
||||
- binding
|
||||
- render
|
||||
- name: github.com/golang/protobuf
|
||||
version: bbd03ef6da3a115852eaf24c8a1c46aeb39aa175
|
||||
subpackages:
|
||||
- proto
|
||||
- name: github.com/gorilla/context
|
||||
version: 08b5f424b9271eedf6f9f0ce86cb9396ed337a42
|
||||
- name: github.com/gorilla/securecookie
|
||||
version: e59506cc896acb7f7bf732d4fdf5e25f7ccd8983
|
||||
- name: github.com/gorilla/sessions
|
||||
version: 7087b4d669d1bc3da42fb4e2eda73ae139a24439
|
||||
- name: github.com/hashicorp/golang-lru
|
||||
version: 0fb14efe8c47ae851c0034ed7a448854d3d34cf3
|
||||
subpackages:
|
||||
- simplelru
|
||||
- name: github.com/kidstuff/mongostore
|
||||
version: 256d65ac5b0e35e7c5ebb3f175c0bed1e5c2b253
|
||||
- name: github.com/mattn/go-isatty
|
||||
version: 6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c
|
||||
- name: github.com/Sirupsen/logrus
|
||||
version: d682213848ed68c0a260ca37d6dd5ace8423f5ba
|
||||
- name: github.com/ugorji/go
|
||||
version: 16f09ef744fd4227190f626f14cfdefb14362b3b
|
||||
subpackages:
|
||||
- codec
|
||||
- name: golang.org/x/crypto
|
||||
version: 49796115aa4b964c318aad4f3084fdb41e9aa067
|
||||
subpackages:
|
||||
- ssh/terminal
|
||||
- name: golang.org/x/sys
|
||||
version: 88d2dcc510266da9f7f8c7f34e1940716cab5f5c
|
||||
subpackages:
|
||||
- unix
|
||||
- windows
|
||||
- name: gopkg.in/go-playground/validator.v8
|
||||
version: 5f1438d3fca68893a817e4a66806cea46a9e4ebf
|
||||
- name: gopkg.in/mgo.v2
|
||||
version: 3f83fa5005286a7fe593b055f0d7771a7dce4655
|
||||
subpackages:
|
||||
- bson
|
||||
- internal/json
|
||||
- internal/sasl
|
||||
- internal/scram
|
||||
- name: gopkg.in/yaml.v2
|
||||
version: 7f97868eec74b32b0982dd158a51a446d1da7eb5
|
||||
testImports:
|
||||
- name: github.com/franela/goblin
|
||||
version: 74c9fe110d4bfd04c222a089a309e0a97e258534
|
13
glide.yaml
13
glide.yaml
|
@ -1,13 +0,0 @@
|
|||
package: github.com/msoedov/hacker-slides
|
||||
import:
|
||||
- package: github.com/Sirupsen/logrus
|
||||
version: ^1.0.4
|
||||
- package: github.com/atrox/haikunatorgo
|
||||
version: ^2.0.0
|
||||
- package: github.com/gin-contrib/sessions
|
||||
- package: github.com/gin-gonic/gin
|
||||
version: ^1.2.0
|
||||
- package: github.com/hashicorp/golang-lru
|
||||
testImport:
|
||||
- package: github.com/franela/goblin
|
||||
version: ^0.0.1
|
12
go.mod
Normal dosya
12
go.mod
Normal dosya
|
@ -0,0 +1,12 @@
|
|||
module github.com/msoedov/hacker-slides
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/atrox/haikunatorgo v2.0.0+incompatible
|
||||
github.com/franela/goblin v0.0.0-20181003173013-ead4ad1d2727
|
||||
github.com/gin-contrib/sessions v0.0.0-20190512062852-3cb4c4f2d615
|
||||
github.com/gin-gonic/gin v1.4.0
|
||||
github.com/hashicorp/golang-lru v0.5.1
|
||||
github.com/sirupsen/logrus v1.4.2
|
||||
)
|
59
go.sum
Normal dosya
59
go.sum
Normal dosya
|
@ -0,0 +1,59 @@
|
|||
github.com/atrox/haikunatorgo v2.0.0+incompatible h1:ZSMT/63RgDmkfUDwL4G42n7eOzGQYKJLOcPerT7rxJw=
|
||||
github.com/atrox/haikunatorgo v2.0.0+incompatible/go.mod h1:MHj1/eyyfKYC9TpTeEj+CkcAWRyMU3KCIa/qRBzNdJw=
|
||||
github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff/go.mod h1:+RTT1BOk5P97fT2CiHkbFQwkK3mjsFAP6zCYV2aXtjw=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20190329173943-551aad21a668/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
|
||||
github.com/bradleypeabody/gorilla-sessions-memcache v0.0.0-20181103040241-659414f458e1/go.mod h1:dkChI7Tbtx7H1Tj7TqGSZMOeGpMP5gLHtjroHd4agiI=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/franela/goblin v0.0.0-20181003173013-ead4ad1d2727 h1:eouy4stZdUKn7n98c1+rdUTxWMg+jvhP+oHt0K8fiug=
|
||||
github.com/franela/goblin v0.0.0-20181003173013-ead4ad1d2727/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
|
||||
github.com/gin-contrib/sessions v0.0.0-20190512062852-3cb4c4f2d615 h1:2KRlm9Qh15+8BjkbOCcZtfC7aFVQd2mELjpHjrDmv1s=
|
||||
github.com/gin-contrib/sessions v0.0.0-20190512062852-3cb4c4f2d615/go.mod h1:iziXm/6pvTtf7og1uxT499sel4h3S9DfwsrhNZ+REXM=
|
||||
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g=
|
||||
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
|
||||
github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ=
|
||||
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
|
||||
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
|
||||
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||
github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=
|
||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
|
||||
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
||||
github.com/gorilla/sessions v1.1.1/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w=
|
||||
github.com/gorilla/sessions v1.1.3 h1:uXoZdcdA5XdXF3QzuSlheVRUvjl+1rKY7zBXL68L9RU=
|
||||
github.com/gorilla/sessions v1.1.3/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w=
|
||||
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/kidstuff/mongostore v0.0.0-20181113001930-e650cd85ee4b/go.mod h1:g2nVr8KZVXJSS97Jo8pJ0jgq29P6H7dG0oplUA86MQw=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc=
|
||||
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/memcachier/mc v2.0.1+incompatible/go.mod h1:7bkvFE61leUBvXz+yxsOnGBQSZpBSPIMUQSmmSHvuXc=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/quasoft/memstore v0.0.0-20180925164028-84a050167438/go.mod h1:wTPjTepVu7uJBYgZ0SdWHQlIas582j6cn2jgk4DDdlg=
|
||||
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw=
|
||||
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
|
||||
gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ=
|
||||
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
2
main.go
2
main.go
|
@ -8,7 +8,6 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
haikunator "github.com/atrox/haikunatorgo"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-contrib/sessions/cookie"
|
||||
|
@ -16,6 +15,7 @@ import (
|
|||
cache "github.com/hashicorp/golang-lru"
|
||||
"github.com/msoedov/hacker-slides/auth"
|
||||
"github.com/msoedov/hacker-slides/files"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const sessionHeader = "slide-session"
|
||||
|
|
Yükleniyor…
Yeni konuda referans