1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Bumped version

Former-commit-id: 5e192a6399227a3a5e2fea5d2edb9909a0f7082d [formerly 86ff88b2c1b4105d5714505260617c707d16d3a1] [formerly 067ff986f8031cf22266756e3b4446e99b672433 [formerly 477838db7b]]
Former-commit-id: 79df6b5b8c1b885419dac3a36ba7268463882d7b [formerly 3c8f5bc04ead1f3b535a838350c22859c2a8a5a6]
Former-commit-id: c0469a373651bda29a09c73aa7ea753273e86458
This commit is contained in:
Zack Scholl 2016-02-15 17:22:06 -05:00
parent a1c5ab12da
commit 974c37f5ac
2 changed files with 18 additions and 9 deletions

View File

@ -33,8 +33,18 @@ binaries:
rm -f awwkoala
mkdir binaries
env GOOS=linux GOARCH=amd64 go build -o awwkoala -v *.go
zip -9 -r awwkoala-linux-amd64.zip awwkoala static/* templates/*
zip -9 -r awwkoala-linux-64bit.zip awwkoala static/* templates/*
rm -f awwkoala
env GOOS=windows GOARCH=amd64 go build -o awwkoala.exe -v *.go
zip -9 -r awwkoala-windows-64bit.zip awwkoala.exe static/* templates/*
rm -f awwkoala.exe
env GOOS=linux GOARCH=arm go build -o awwkoala -v *.go
zip -9 -r awwkoala-raspberrypi.zip awwkoala static/* templates/*
rm -f awwkoala
env GOOS=darwin GOARCH=amd64 go build -o awwkoala -v *.go
zip -9 -r awwkoala-macosx-64bit.zip awwkoala static/* templates/*
rm -f awwkoala
mv *.zip binaries/
.PHONY: install

15
main.go
View File

@ -4,10 +4,8 @@ import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path"
"runtime"
"github.com/boltdb/bolt"
"github.com/gin-gonic/gin"
@ -37,8 +35,8 @@ var RuntimeArgs struct {
var VersionNum string
func main() {
VersionNum = "1.1"
_, executableFile, _, _ := runtime.Caller(0) // get full path of this file
VersionNum = "1.2"
// _, executableFile, _, _ := runtime.Caller(0) // get full path of this file
cwd, _ := os.Getwd()
databaseFile := path.Join(cwd, "data.db")
flag.StringVar(&RuntimeArgs.Port, "p", ":8003", "port to bind")
@ -63,7 +61,7 @@ Options:`)
if RuntimeArgs.ExternalIP == "" {
RuntimeArgs.ExternalIP = GetLocalIP() + RuntimeArgs.Port
}
RuntimeArgs.SourcePath = path.Dir(executableFile)
RuntimeArgs.SourcePath = cwd
Open(RuntimeArgs.DatabaseLocation)
defer Close()
@ -87,7 +85,6 @@ Options:`)
// var q WikiData
// q.load("about")
// fmt.Println(getImportantVersions(q))
log.Println(RuntimeArgs.AdminKey)
r := gin.Default()
r.LoadHTMLGlob(path.Join(RuntimeArgs.SourcePath, "templates/*"))
@ -100,13 +97,15 @@ Options:`)
if RuntimeArgs.ServerCRT != "" && RuntimeArgs.ServerKey != "" {
RuntimeArgs.Socket = "wss"
fmt.Println("--------------------------")
fmt.Println("AwwKoala is up and running on https://" + RuntimeArgs.ExternalIP)
fmt.Println("AwwKoala (version " + VersionNum + ") is up and running on https://" + RuntimeArgs.ExternalIP)
fmt.Println("Admin key: " + RuntimeArgs.AdminKey)
fmt.Println("--------------------------")
r.RunTLS(RuntimeArgs.Port, RuntimeArgs.ServerCRT, RuntimeArgs.ServerKey)
} else {
RuntimeArgs.Socket = "ws"
fmt.Println("--------------------------")
fmt.Println("AwwKoala is up and running on http://" + RuntimeArgs.ExternalIP)
fmt.Println("AwwKoala (version " + VersionNum + ") is up and running on http://" + RuntimeArgs.ExternalIP)
fmt.Println("Admin key: " + RuntimeArgs.AdminKey)
fmt.Println("--------------------------")
r.Run(RuntimeArgs.Port)
}