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 99425cc64dcc25314a123c1d7fd68932f515afbd [formerly477838db7b
]]] Former-commit-id: 79df6b5b8c1b885419dac3a36ba7268463882d7b [formerly 3c8f5bc04ead1f3b535a838350c22859c2a8a5a6] Former-commit-id: c0469a373651bda29a09c73aa7ea753273e86458 Former-commit-id:974c37f5ac
This commit is contained in:
parent
652d1125e1
commit
d30c8cee0b
12
Makefile
12
Makefile
@ -33,8 +33,18 @@ binaries:
|
|||||||
rm -f awwkoala
|
rm -f awwkoala
|
||||||
mkdir binaries
|
mkdir binaries
|
||||||
env GOOS=linux GOARCH=amd64 go build -o awwkoala -v *.go
|
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
|
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
|
.PHONY: install
|
||||||
|
15
main.go
15
main.go
@ -4,10 +4,8 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"runtime"
|
|
||||||
|
|
||||||
"github.com/boltdb/bolt"
|
"github.com/boltdb/bolt"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@ -37,8 +35,8 @@ var RuntimeArgs struct {
|
|||||||
var VersionNum string
|
var VersionNum string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
VersionNum = "1.1"
|
VersionNum = "1.2"
|
||||||
_, executableFile, _, _ := runtime.Caller(0) // get full path of this file
|
// _, executableFile, _, _ := runtime.Caller(0) // get full path of this file
|
||||||
cwd, _ := os.Getwd()
|
cwd, _ := os.Getwd()
|
||||||
databaseFile := path.Join(cwd, "data.db")
|
databaseFile := path.Join(cwd, "data.db")
|
||||||
flag.StringVar(&RuntimeArgs.Port, "p", ":8003", "port to bind")
|
flag.StringVar(&RuntimeArgs.Port, "p", ":8003", "port to bind")
|
||||||
@ -63,7 +61,7 @@ Options:`)
|
|||||||
if RuntimeArgs.ExternalIP == "" {
|
if RuntimeArgs.ExternalIP == "" {
|
||||||
RuntimeArgs.ExternalIP = GetLocalIP() + RuntimeArgs.Port
|
RuntimeArgs.ExternalIP = GetLocalIP() + RuntimeArgs.Port
|
||||||
}
|
}
|
||||||
RuntimeArgs.SourcePath = path.Dir(executableFile)
|
RuntimeArgs.SourcePath = cwd
|
||||||
Open(RuntimeArgs.DatabaseLocation)
|
Open(RuntimeArgs.DatabaseLocation)
|
||||||
defer Close()
|
defer Close()
|
||||||
|
|
||||||
@ -87,7 +85,6 @@ Options:`)
|
|||||||
// var q WikiData
|
// var q WikiData
|
||||||
// q.load("about")
|
// q.load("about")
|
||||||
// fmt.Println(getImportantVersions(q))
|
// fmt.Println(getImportantVersions(q))
|
||||||
log.Println(RuntimeArgs.AdminKey)
|
|
||||||
|
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
r.LoadHTMLGlob(path.Join(RuntimeArgs.SourcePath, "templates/*"))
|
r.LoadHTMLGlob(path.Join(RuntimeArgs.SourcePath, "templates/*"))
|
||||||
@ -100,13 +97,15 @@ Options:`)
|
|||||||
if RuntimeArgs.ServerCRT != "" && RuntimeArgs.ServerKey != "" {
|
if RuntimeArgs.ServerCRT != "" && RuntimeArgs.ServerKey != "" {
|
||||||
RuntimeArgs.Socket = "wss"
|
RuntimeArgs.Socket = "wss"
|
||||||
fmt.Println("--------------------------")
|
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("--------------------------")
|
fmt.Println("--------------------------")
|
||||||
r.RunTLS(RuntimeArgs.Port, RuntimeArgs.ServerCRT, RuntimeArgs.ServerKey)
|
r.RunTLS(RuntimeArgs.Port, RuntimeArgs.ServerCRT, RuntimeArgs.ServerKey)
|
||||||
} else {
|
} else {
|
||||||
RuntimeArgs.Socket = "ws"
|
RuntimeArgs.Socket = "ws"
|
||||||
fmt.Println("--------------------------")
|
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("--------------------------")
|
fmt.Println("--------------------------")
|
||||||
r.Run(RuntimeArgs.Port)
|
r.Run(RuntimeArgs.Port)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user