Pārlūkot izejas kodu

Migrate to go mod

- Update look and feel
Alexey Edelev 5 gadi atpakaļ
vecāks
revīzija
a42d7efd03

+ 2 - 2
auth/authenticator.go

@@ -31,8 +31,8 @@ import (
 	"os"
 	"strings"
 
-	config "../config"
-	utils "../utils"
+	config "git.semlanik.org/semlanik/gostfix/config"
+	utils "git.semlanik.org/semlanik/gostfix/utils"
 )
 
 type Authenticator struct {

+ 1 - 4
build.sh

@@ -1,10 +1,8 @@
-export GOPATH=$PWD
 export PATH=$PATH:$PWD/bin
 export GOBIN=$PWD/bin
 export RPC_PATH=$PWD/common
 
-go get github.com/golang/protobuf/protoc-gen-go
-go install ./src/github.com/golang/protobuf/protoc-gen-go
+go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.4
 
 # mkdir -p $RPC_PATH
 rm -f $RPC_PATH/*.pb.go
@@ -21,5 +19,4 @@ cp -a web/css data/
 cp -a web/js data/
 cp -a web/templates data/
 
-go get -v
 go build -o $GOBIN/gostfix

+ 3 - 1
common/gostfix.pb.go

@@ -199,7 +199,9 @@ func init() {
 	proto.RegisterType((*Mail)(nil), "common.Mail")
 }
 
-func init() { proto.RegisterFile("gostfix.proto", fileDescriptor_0ab36b6dc6e1dcaa) }
+func init() {
+	proto.RegisterFile("gostfix.proto", fileDescriptor_0ab36b6dc6e1dcaa)
+}
 
 var fileDescriptor_0ab36b6dc6e1dcaa = []byte{
 	// 230 bytes of a gzipped FileDescriptorProto

+ 1 - 1
config/config.go

@@ -30,7 +30,7 @@ import (
 	"strings"
 	"sync"
 
-	utils "../utils"
+	utils "git.semlanik.org/semlanik/gostfix/utils"
 	ini "gopkg.in/go-ini/ini.v1"
 )
 

+ 11 - 0
go.mod

@@ -0,0 +1,11 @@
+module git.semlanik.org/semlanik/gostfix
+
+go 1.12
+
+require (
+	github.com/fsnotify/fsnotify v1.4.7
+	github.com/golang/protobuf v1.3.4
+	github.com/gorilla/sessions v1.2.0
+	golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
+	gopkg.in/go-ini/ini.v1 v1.52.0
+)

+ 12 - 0
go.sum

@@ -0,0 +1,12 @@
+github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
+github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
+github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
+github.com/gorilla/sessions v1.2.0 h1:S7P+1Hm5V/AT9cjEcUD5uDaQSX0OE577aCXgoaKpYbQ=
+github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
+golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
+golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+gopkg.in/go-ini/ini.v1 v1.52.0 h1:yMvPaeTxANcf7r7drd9RfUElqzXt7BMoVb9u+Yi0JMo=
+gopkg.in/go-ini/ini.v1 v1.52.0/go.mod h1:M74/hG4RTwbkZyTEZ9iQwM4v6dFD4u6QBjoqT/pM8Kg=

+ 2 - 2
main.go

@@ -26,8 +26,8 @@
 package main
 
 import (
-	scanner "./scanner"
-	web "./web"
+	scanner "git.semlanik.org/semlanik/gostfix/scanner"
+	web "git.semlanik.org/semlanik/gostfix/web"
 )
 
 type GofixEngine struct {

+ 2 - 2
scanner/mailscanner.go

@@ -32,8 +32,8 @@ import (
 	"os"
 	"strings"
 
-	config "../config"
-	utils "../utils"
+	config "git.semlanik.org/semlanik/gostfix/config"
+	utils "git.semlanik.org/semlanik/gostfix/utils"
 	fsnotify "github.com/fsnotify/fsnotify"
 )
 

+ 2 - 1
web/css/controls.css

@@ -206,4 +206,5 @@
 
 .folderBtn {
 
-}
+}
+

+ 6 - 2
web/css/index.css

@@ -26,13 +26,17 @@ table {
 
     margin-left: 150pt!important;
     margin-top: 5pt!important;
-    margin-right: 5pt!important;
+    margin-right: 15pt!important;
 
     padding: 5pt
 }
 
 .emailDetails {
     background-color: white;
+    margin-left: 158pt!important;
+    margin-top: 13pt!important;
+    margin-bottom: -8pt!important;
+    margin-right: 8pt!important;
 }
 
 .foldersBox {
@@ -42,7 +46,7 @@ table {
     right: 0;
     bottom: 0;
 
-    margin-left: 5pt!important;
+    margin-left: 2pt!important;
     margin-top: 5pt!important;
     margin-right: 5pt!important;
     margin-bottom: 30pt!important;

+ 1 - 1
web/css/styles.css

@@ -59,7 +59,7 @@ td.dateCol {
 }
 
 .materialLevel2 {
-    box-shadow: 0 1pt 4pt rgba(0, 0, 0, .6);
+    box-shadow: 0 2pt 6pt rgba(0, 0, 0, .6);
     margin-top: 1pt;
     margin-bottom: 1pt;
     margin-left: 5pt;

+ 2 - 0
web/js/index.js

@@ -49,6 +49,7 @@ function requestDetails() {
                 data: {detailsUrl: messageId},
                 success: function(result) {
                     $("#details").html(result);
+                    $("#maillist").css({pointerEvents: "none"})
                     $("#details").show()
                 },
                 error: function(jqXHR, textStatus, errorThrown) {
@@ -58,6 +59,7 @@ function requestDetails() {
         }
     } else {
         $("#details").hide()
+        $("#maillist").css({pointerEvents: "auto"})
     }
 }
 

+ 4 - 4
web/server.go

@@ -33,10 +33,10 @@ import (
 	"net/http"
 	"strings"
 
-	auth "../auth"
-	common "../common"
-	config "../config"
-	utils "../utils"
+	auth "git.semlanik.org/semlanik/gostfix/auth"
+	common "git.semlanik.org/semlanik/gostfix/common"
+	config "git.semlanik.org/semlanik/gostfix/config"
+	utils "git.semlanik.org/semlanik/gostfix/utils"
 	"github.com/gorilla/sessions"
 )
 

+ 1 - 1
web/templates/maillist.html

@@ -1,4 +1,4 @@
-<div class="scrollable">
+<div id="maillist" class="scrollable">
     <div class="fadeIn" style="position: absolute; top: 5pt; left: 0; right: 0; height: 10pt"></div>
         <table class="mailList" >
             <tbody>