Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fef5c37cb | |||
| 59abd3c50c | |||
| 610563b35c | |||
| f3ad1fba8a | |||
| 9268c4da4c | |||
| 9361e7ddec | |||
| ee59a4a773 | |||
| 2047762e62 | |||
| 16aa97b6e5 |
2
.hgtags
Normal file
2
.hgtags
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
769fad81e3f8db8f7e5f5c164656a382a169d735 release-1.0.0
|
||||||
|
9ed95938d809a8226aca529e34b655e6d8c8c379 release-1.0.1
|
||||||
22
Config.go
22
Config.go
@@ -2,22 +2,22 @@ package main
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
App struct {
|
App struct {
|
||||||
Name string
|
Name string `json:"name"`
|
||||||
Version string
|
Version string `json:"version"`
|
||||||
MotdHTML string
|
MotdHTML string `json:"motd"`
|
||||||
Debug bool
|
Debug bool `json:"debug"`
|
||||||
}
|
}
|
||||||
|
|
||||||
Web struct {
|
Web struct {
|
||||||
Port int
|
Port int `json:"port"`
|
||||||
BindTo string
|
BindTo string `json:"bind_to"`
|
||||||
Extern string
|
Extern string `json:"extern"`
|
||||||
Title string
|
Title string `json:"title"`
|
||||||
}
|
}
|
||||||
|
|
||||||
Hub struct {
|
Hub struct {
|
||||||
Address string
|
Address string `json:"address"`
|
||||||
Port int
|
Port int `json:"port"`
|
||||||
Tag string
|
Tag string `json:"tag"`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,21 @@ Chat in real-time on your NMDC hub using a web browser. This project forks and d
|
|||||||
|
|
||||||
Written in Golang
|
Written in Golang
|
||||||
|
|
||||||
|
Tags: nmdc
|
||||||
|
|
||||||
=UPGRADING FROM DCWEBUI2=
|
=UPGRADING FROM DCWEBUI2=
|
||||||
|
|
||||||
- The configuration file format is identical, but please now ensure it's valid json instead of just a .js file. This means no assignment, use double-quoted strings, and no comments.
|
- The configuration file format is identical, but please now ensure it's valid json instead of just a .js file. This means no assignment, use double-quoted strings, and no comments.
|
||||||
|
|
||||||
=CHANGELOG=
|
=CHANGELOG=
|
||||||
|
|
||||||
|
2016-11-29 1.0.2
|
||||||
|
- Rebuild with libnmdc 0.11
|
||||||
|
- Fix an issue with not setting a version in the client tag
|
||||||
|
|
||||||
|
2016-10-08 1.0.1
|
||||||
|
- Fix an issue with backward compatibility with `dcwebui2` configuration file format
|
||||||
|
|
||||||
2016-10-08 1.0.0
|
2016-10-08 1.0.0
|
||||||
- Port `dcwebui2` from Node.js (Javascript) to Go
|
- Port `dcwebui2` from Node.js (Javascript) to Go
|
||||||
- Fix a cosmetic issue with not clearing userlist on disconnection
|
- Fix a cosmetic issue with not clearing userlist on disconnection
|
||||||
|
|||||||
11
build.sh
11
build.sh
@@ -165,6 +165,17 @@ main() {
|
|||||||
GOARCH=amd64 GOOS=linux single_build "$version"
|
GOARCH=amd64 GOOS=linux single_build "$version"
|
||||||
GOARCH=386 GOOS=linux single_build "$version"
|
GOARCH=386 GOOS=linux single_build "$version"
|
||||||
|
|
||||||
|
# Also make source tarball
|
||||||
|
|
||||||
|
local SOURCE_FILES=(
|
||||||
|
client/
|
||||||
|
build.sh
|
||||||
|
Config.go
|
||||||
|
main.go
|
||||||
|
nmdc-webfrontend.conf.SAMPLE
|
||||||
|
)
|
||||||
|
XZ_OPT='-9' tar caf "_dist/$(get_package_name)-${version}-src.tar.xz" "${SOURCE_FILES[@]}" --owner=0 --group=0 >/dev/null
|
||||||
|
|
||||||
echo "[INFO] Build complete."
|
echo "[INFO] Build complete."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
main.go
6
main.go
@@ -8,9 +8,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"code.ivysaur.me/libnmdc"
|
||||||
"github.com/googollee/go-socket.io"
|
"github.com/googollee/go-socket.io"
|
||||||
|
|
||||||
"libnmdc"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ActiveConnection struct {
|
type ActiveConnection struct {
|
||||||
@@ -49,6 +48,7 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
|
|||||||
|
|
||||||
selfUser := libnmdc.NewUserInfo(Nick)
|
selfUser := libnmdc.NewUserInfo(Nick)
|
||||||
selfUser.ClientTag = this.cfg.Hub.Tag
|
selfUser.ClientTag = this.cfg.Hub.Tag
|
||||||
|
selfUser.ClientVersion = libnmdc.DEFAULT_CLIENT_VERSION
|
||||||
|
|
||||||
hco := libnmdc.HubConnectionOptions{
|
hco := libnmdc.HubConnectionOptions{
|
||||||
Address: libnmdc.HubAddress(fmt.Sprintf("%s:%d", this.cfg.Hub.Address, this.cfg.Hub.Port)),
|
Address: libnmdc.HubAddress(fmt.Sprintf("%s:%d", this.cfg.Hub.Address, this.cfg.Hub.Port)),
|
||||||
@@ -112,7 +112,7 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
|
|||||||
} else if hev.StateChange == libnmdc.CONNECTIONSTATE_DISCONNECTED {
|
} else if hev.StateChange == libnmdc.CONNECTIONSTATE_DISCONNECTED {
|
||||||
so.Emit("close")
|
so.Emit("close")
|
||||||
} else {
|
} else {
|
||||||
so.Emit("sys", hev.StateChange.Format())
|
so.Emit("sys", hev.StateChange.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
case libnmdc.EVENT_HUBNAME_CHANGED:
|
case libnmdc.EVENT_HUBNAME_CHANGED:
|
||||||
|
|||||||
Reference in New Issue
Block a user