Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to godep, remove vendor directory #109

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@ Icon
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
.apdisk

vendor
nohup.out
260 changes: 260 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[[constraint]]
name = "github.com/dimfeld/httptreemux"
version = "^5.0.0"

[[constraint]]
name = "github.com/gorilla/securecookie"
version = "^1.1.0"

[[constraint]]
branch = "master"
name = "github.com/kabukky/feeds"

[[constraint]]
branch = "master"
name = "github.com/kabukky/httpscerts"

[[constraint]]
branch = "master"
name = "github.com/kardianos/osext"

[[constraint]]
name = "github.com/mattn/go-sqlite3"
version = "^2.0.2"

[[constraint]]
name = "github.com/russross/blackfriday"
version = "^1.5.0"

[[constraint]]
name = "github.com/gofrs/uuid"
version = "^3.2.0"

[[constraint]]
branch = "master"
name = "github.com/yuin/gopher-lua"

[[constraint]]
branch = "master"
name = "golang.org/x/crypto"

[[constraint]]
source = "https://github.com/fsnotify/fsnotify/archive/v1.4.7.tar.gz"
name = "gopkg.in/fsnotify.v1"
version = "1.4.7"


[[constraint]]
name = "github.com/crewjam/saml"
version = "0.4.0"

[[constraint]]
name="github.com/lestrrat-go/apache-logformat"
version = "v2.0.4"
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
all: journey

.PHONY: all fmt clean

PACKAGE = github.com/rkuris/journey
PKG_DIRS ?= authentication configuration conversion database date filenames flags \
helpers https notifications plugins server slug structure templates watcher
PKGS := $(foreach dir,$(PKG_DIRS), $(PACKAGE)/$(dir))
PKG_FILES := $(foreach dir,$(PKG_DIRS), $(wildcard $(dir)/*.go))
MAIN_FILES = main.go

VET_LOG = vet.log
vet: vendor
@$(foreach dir,$(PKG_DIRS),go vet $(VET_RULES) $(PACKAGE)/$(dir)|tee -a $(VET_LOG); )
@go vet $(VET_RULES) $(MAIN_FILES) | tee -a $(VET_LOG)
@[ ! -s $(VET_LOG) ]
@rm $(VET_LOG)

GOIMPORTS ?= go imports
GOFMT ?= go fmt
fmt:
@$(GOFMT) $(PKGS)

journey: $(PKG_FILES) vendor
go build

clean:
rm -f journey lint.log vet.log


vendor:
mkdir vendor
6 changes: 4 additions & 2 deletions authentication/password.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package authentication

import (
"github.com/kabukky/journey/database"
"github.com/rkuris/journey/database"
"golang.org/x/crypto/bcrypt"
)

// LoginIsCorrect checks the username/password combo and says ok or not
func LoginIsCorrect(name string, password string) bool {
hashedPassword, err := database.RetrieveHashedPasswordForUser([]byte(name))
if len(hashedPassword) == 0 || err != nil { // len(hashedPassword) == 0 probably not needed.
Expand All @@ -18,8 +19,9 @@ func LoginIsCorrect(name string, password string) bool {
return true
}

// EncryptPassword uses bcrypt to generate a password for a user
func EncryptPassword(password string) (string, error) {
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(password), 10)
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
if err != nil {
return "", err
}
Expand Down
Loading