Skip to content

Commit

Permalink
Cimulative update
Browse files Browse the repository at this point in the history
  • Loading branch information
vit1251 committed Apr 11, 2020
1 parent 9cebe86 commit cdca4de
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 17 deletions.
8 changes: 8 additions & 0 deletions Application.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"flag"
"github.com/vit1251/golden/pkg/area"
"github.com/vit1251/golden/pkg/charset"
"github.com/vit1251/golden/pkg/file"
Expand Down Expand Up @@ -31,6 +32,12 @@ func NewApplication() *Application {

func (self *Application) Run() {

/* Parse parameters */
var servicePort int
flag.IntVar(&servicePort, "P", 8080, "Set HTTP service port")
flag.Parse()
log.Printf("servicePort - %+v", servicePort)

/* Create managers */
if err := self.Container.Provide(installer.NewMigrationManager); err != nil {
panic(err)
Expand Down Expand Up @@ -82,6 +89,7 @@ func (self *Application) Run() {
/* Start service */
self.Container.Invoke(func() {
newGoldenSite := ui.NewGoldenSite(self.Container)
newGoldenSite.SetPort(servicePort)
go newGoldenSite.Start()
})

Expand Down
10 changes: 10 additions & 0 deletions DEBIAN/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
gpoint (1.2.11-1) stable; urgency=medium
- Customize HTTP service port enhancement
- Implement basic audio event enhancement
- Widget base views enhancement
- Make storage schema migration subsystem enhancement
- Make 386 and amd64 building under Windows platform enhancement
- Default path does not exists on Windows platform bug
- Installation instruction for newcomers documentation enhancement help wanted
- Reply message auto quote bug enhancement
- Wrong message kludge parser bug
gpoint (1.2.10-1) stable; urgency=medium
* Fix charset error in message header: To, From, Subject
* Add "@REPLY" kludge in reply action
Expand Down
2 changes: 1 addition & 1 deletion DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: gpoint
Version: 1.2.3-1
Version: 1.2.11-1
Section: misc
Architecture: amd64
Depends:
Expand Down
2 changes: 1 addition & 1 deletion pkg/mailer/Mailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,5 @@ func (self *Mailer) writeHeader(stat string) error {
}

func (self *Mailer) GetVersion() string {
return "1.2.10"
return "1.2.11"
}
7 changes: 2 additions & 5 deletions pkg/setup/SetupManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,15 @@ func (self *ConfigManager) restoreDefault() error {
self.Set("main", "Address", "2:5030/1592.15")
self.Set("main", "Link", "2:5030/1592.0")

ver := "1.2.10"
stamp := "2020-03-16 10:00 MSK"
ver := "1.2.11"
stamp := "2020-04-11 14:30 MSK"
branch := "master"

if runtime.GOOS == "windows" {

/* Tearline */
arch := "WIN"

//newTearline := "Golden/WIN 1.2.10 2020-03-16 10:00 MSK (master)"
newTearline := fmt.Sprintf("Golden/%s %s %s (%s)", arch, ver, stamp, branch)
self.Set("main", "TearLine", newTearline)

Expand All @@ -154,7 +153,6 @@ func (self *ConfigManager) restoreDefault() error {
} else if runtime.GOOS == "linux" {

arch := "LNX"
//newTearline := "Golden/WIN 1.2.10 2020-03-16 10:00 MSK (master)"
newTearline := fmt.Sprintf("Golden/%s %s %s (%s)", arch, ver, stamp, branch)
self.Set("main", "TearLine", newTearline)

Expand All @@ -174,7 +172,6 @@ func (self *ConfigManager) restoreDefault() error {
} else {

arch := "UNKNOWN"
//newTearline := "Golden/WIN 1.2.10 2020-03-16 10:00 MSK (master)"
newTearline := fmt.Sprintf("Golden/%s %s %s (%s)", arch, ver, stamp, branch)
self.Set("main", "TearLine", newTearline)

Expand Down
4 changes: 2 additions & 2 deletions pkg/tosser/TosserManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (self *TosserManager) WriteEchoMessage(em *EchoMessage) error {
msgBody.AddKludge("CHRS", "CP866 2")
msgBody.AddKludge("MSGID", fmt.Sprintf("%s %08x", myAddr, hs))
msgBody.AddKludge("UUID", fmt.Sprintf("%s", u1))
msgBody.AddKludge("TID", "golden/win 1.2.10 2020-03-16 10:00 MSK (master)")
msgBody.AddKludge("TID", "golden/win 1.2.11 2020-04-11 14:30 MSK (master)")
if em.Reply != "" {
msgBody.AddKludge("REPLY", em.Reply)
}
Expand Down Expand Up @@ -314,7 +314,7 @@ func (self *TosserManager) WriteNetmailMessage(nm *NetmailMessage) error {
msgBody.AddKludge("CHRS", "CP866 2")
msgBody.AddKludge("MSGID", fmt.Sprintf("%s %08x", params.From, hs))
msgBody.AddKludge("UUID", fmt.Sprintf("%s", u1))
msgBody.AddKludge("TID", "golden/win 1.2.10 2020-03-16 10:00 MSK (master)")
msgBody.AddKludge("TID", "golden/win 1.2.11 2020-04-11 14:30 MSK (master)")
msgBody.AddKludge("FMPT", fmt.Sprintf("%d", msgHeader.OrigAddr.Point))
msgBody.AddKludge("TOPT", fmt.Sprintf("%d", msgHeader.DestAddr.Point))

Expand Down
16 changes: 12 additions & 4 deletions pkg/ui/GoldenSite.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ui

import (
"fmt"
"github.com/gorilla/mux"
"github.com/vit1251/golden/pkg/ui/api"
"go.uber.org/dig"
Expand All @@ -26,13 +27,17 @@ type WebSite struct {

type GoldenSite struct {
Container *dig.Container
WebSite *WebSite /* Web site common type */
port int
WebSite *WebSite /* Web site common type */
rtr *mux.Router
addr string
}

func NewGoldenSite(c *dig.Container) *GoldenSite {

site := new(GoldenSite)
site.addr = "127.0.0.1"
site.port = 8080
site.Container = c

/* Create router */
Expand Down Expand Up @@ -92,12 +97,11 @@ func (self *GoldenSite) Start() (error) {
self.Register("/setup/complete", NewSetupCompleteAction())
self.Register("/help", NewHelpAction())

//
INTERFACE := "127.0.0.1:8080"
serviceAddr := fmt.Sprintf("%s:%d", self.addr, self.port)

srv := &http.Server{
Handler: self.rtr,
Addr: INTERFACE,
Addr: serviceAddr,
// Good practice: enforce timeouts for servers you create!
WriteTimeout: 10 * time.Minute,
ReadTimeout: 10 * time.Minute,
Expand All @@ -116,3 +120,7 @@ func (self *GoldenSite) Stop() (error) {

return nil
}

func (self *GoldenSite) SetPort(port int) {
self.port = port
}
2 changes: 1 addition & 1 deletion pkg/version/VersionManager.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package version

func GetVersion() string {
return "1.2.10"
return "1.2.11"
}

7 changes: 4 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ def depend(c):
c.run('go get -v -u', echo=True)

@task
def package(c):
def package(c, version="1.2.11"):
c.run('install -m 0755 -d ./package')
c.run('install -m 0755 -d ./package/DEBIAN')
c.run('install -m 0755 -d ./package/usr/local/bin')
c.run('install -m 0755 -d ./dist')
c.run('cp ./DEBIAN/control ./package/DEBIAN/control')
c.run('cp ./golden ./package/usr/local/bin/golden')
c.run('dpkg-deb -v --build ./package golden-1.2.3.deb')
c.run('cp ./golden-1.2.3.deb ./dist/golden-1.2.3.deb')
c.run('dpkg-deb -v --build ./package golden-{version}.deb'.format(version=version))
c.run('cp ./golden-{version}.deb ./dist/golden-{version}.deb'.format(version=version))

@task
def check(c):
Expand Down Expand Up @@ -53,6 +53,7 @@ def package(c):
c.run('7z a -tzip {package_name} golden-windows-amd64.exe'.format(package_name=package_name), echo=True, env={"PATH": "C:\\Program Files\\7-Zip"})
c.run('7z a -tzip {package_name} README.md'.format(package_name=package_name), echo=True, env={"PATH": "C:\\Program Files\\7-Zip"})
c.run('7z a -tzip {package_name} LICENSE'.format(package_name=package_name), echo=True, env={"PATH": "C:\\Program Files\\7-Zip"})
c.run('7z a -tzip {package_name} static'.format(package_name=package_name), echo=True, env={"PATH": "C:\\Program Files\\7-Zip"})

@task
def debug(c):
Expand Down

0 comments on commit cdca4de

Please sign in to comment.