Browse Source

update version 1.0.3

luamas 1 year ago
parent
commit
fd13f4aa8e
4 changed files with 16 additions and 5 deletions
  1. 1
    1
      config.sh
  2. 1
    1
      help/version.go
  3. 7
    1
      jetbrain/jetbrains.go
  4. 7
    2
      main.go

+ 1
- 1
config.sh View File

@@ -1,3 +1,3 @@
1 1
 #!/usr/bin/env bash
2 2
 
3
-version=v1.0.3
3
+version=v1.0.4

+ 1
- 1
help/version.go View File

@@ -5,7 +5,7 @@ import (
5 5
 	"runtime"
6 6
 )
7 7
 
8
-const version="v1.0.3"
8
+const version="v1.0.4"
9 9
 
10 10
 func Version() {
11 11
 	fmt.Printf("license-server_%s_%s(%s)\n", runtime.GOOS, runtime.GOARCH, version)

+ 7
- 1
jetbrain/jetbrains.go View File

@@ -17,6 +17,9 @@ type JetbrainBaseResponse struct {
17 17
 	ResponseCode string `xml:"responseCode"`
18 18
 	Message      string `xml:"message"`
19 19
 	Salt         string `xml:"salt"`
20
+	Action         string `xml:"action"`
21
+	ValidationPeriod int64 `xml:"validationPeriod"`
22
+	ValidationDeadlinePeriod int64 `xml:"validationDeadlinePeriod"`
20 23
 }
21 24
 
22 25
 type PingResponse struct {
@@ -40,11 +43,14 @@ type ReleaseTicketResponse struct {
40 43
 	JetbrainBaseResponse
41 44
 }
42 45
 
43
-func Jetbrains(w http.ResponseWriter, r *http.Request, userName string, prolongationPeriod int64) {
46
+func Jetbrains(w http.ResponseWriter, r *http.Request, userName string, prolongationPeriod int64, validationPeriod int64, validationDeadlinePeriod int64) {
44 47
 	salt := r.FormValue("salt")
45 48
 	jetbrainBaseResponse := JetbrainBaseResponse{
46 49
 		ResponseCode: "OK",
47 50
 		Salt:         salt,
51
+		Action:         "NONE",
52
+		ValidationPeriod: validationPeriod,
53
+		ValidationDeadlinePeriod: validationDeadlinePeriod,
48 54
 	}
49 55
 	var xmlResponse string
50 56
 	isPing, err1 := regexp.MatchString("/rpc/ping.*", r.URL.Path)

+ 7
- 2
main.go View File

@@ -18,6 +18,8 @@ import (
18 18
 
19 19
 var userName string
20 20
 var prolongationPeriod int64
21
+var validationPeriod int64
22
+var validationDeadlinePeriod int64
21 23
 var isUserNameEnv bool
22 24
 
23 25
 
@@ -26,7 +28,10 @@ func main() {
26 28
 	log.SetOutput(os.Stdout)
27 29
 	versionMode := flag.Bool("v", false, "show version")
28 30
 	host := flag.String("host", "0.0.0.0", "bind on host")
29
-	flag.Int64Var(&prolongationPeriod, "prolongationPeriod", 607875500, "prolong ation period")
31
+	flag.Int64Var(&prolongationPeriod, "prolongationPeriod", 607875500, "prolong ation period(延长期)")
32
+	flag.Int64Var(&validationPeriod, "validationPeriod", 607875500, "validation period(验证周期)")
33
+	flag.Int64Var(&validationDeadlinePeriod, "validationDeadlinePeriod", 607875500, "validation deadline period(验证截止期限)")
34
+
30 35
 	port := flag.Int("port", 22508, "port number")
31 36
 	if userName == "" {
32 37
 		flag.StringVar(&userName, "u", "luamas", "If you want to use a local user name, fill in empty such, -u empty")
@@ -101,7 +106,7 @@ func urlMatcher(_ http.Handler) http.Handler {
101 106
 		}
102 107
 		isJetbrains, err2 := regexp.MatchString("/rpc/.*\\.action", r.URL.Path)
103 108
 		if err2 == nil && isJetbrains {
104
-			jetbrain.Jetbrains(w, r, userName, prolongationPeriod)
109
+			jetbrain.Jetbrains(w, r, userName, prolongationPeriod,validationPeriod,validationDeadlinePeriod)
105 110
 			return
106 111
 		}
107 112
 		isJetbrainsMybatis, err2 := regexp.MatchString("/activate", r.URL.Path)

Loading…
Cancel
Save