don't require extern

This commit is contained in:
mappu 2017-02-06 16:20:31 +13:00
parent ba941adfdd
commit 3448cb7eeb
3 changed files with 5 additions and 7 deletions

View File

@ -8,7 +8,6 @@ type Config struct {
Web struct {
Port int `json:"port"`
BindTo string `json:"bind_to"`
Extern string `json:"extern"`
Title string `json:"title"`
CustomFavicon bool `json:"custom_favicon"`

View File

@ -5,6 +5,7 @@
var SENTINEL_PASSWORD = "************";
var CHAT_SCROLLBACK_LIMIT = 50; // Once over 2x $limit, the first $limit will be trimmed off the list
var EXTERN_ROOT = window.location.protocol + "//" + window.location.host + "/";
var $ = (document.querySelectorAll ?
function(s) {
@ -155,7 +156,7 @@ var notify = function(title, body) {
case "granted": {
new Notification(title, {
body: body,
icon: DCWEBUI_CONF.extern + "/favicon.ico"
icon: EXTERN_ROOT + "/favicon.ico"
});
} break;
@ -1039,7 +1040,7 @@ window.onload = function() {
// Socket event handlers
sock = io.connect(DCWEBUI_CONF.extern);
sock = io.connect(EXTERN_ROOT);
sock.on('cls', function() {
transition(STATE_READY_FOR_LOGIN);

View File

@ -188,11 +188,9 @@ func (this *App) customFaviconHandler(w http.ResponseWriter, r *http.Request) {
func (this *App) ConfigRequestHandler(w http.ResponseWriter, r *http.Request) {
confStruct := struct {
Extern string `json:"extern"`
Title string `json:"title"`
Title string `json:"title"`
}{
Extern: this.cfg.Web.Extern,
Title: this.cfg.Web.Title,
Title: this.cfg.Web.Title,
}
confBytes, _ := json.Marshal(confStruct)