Browse Source

Edit README.md and fix build issue

Sasan Torabkheslat 5 years ago
parent
commit
ee1f9d757c
6 changed files with 45 additions and 13 deletions
  1. 4 0
      .idea/deployment.xml
  2. 8 0
      .idea/sshConfigs.xml
  3. 14 0
      .idea/webServers.xml
  4. 3 0
      README.md
  5. 10 3
      handler.go
  6. 6 10
      vendor/github.com/labstack/echo/echo.go

+ 4 - 0
.idea/deployment.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="PublishConfigData" serverName="Stretch-Local" />
+</project>

+ 8 - 0
.idea/sshConfigs.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="SshConfigs">
+    <configs>
+      <sshConfig authType="PASSWORD" host="172.16.15.130" id="b6a188b1-6871-45ba-a65b-b9c9cb466fbc" port="22" nameFormat="DESCRIPTIVE" username="root" />
+    </configs>
+  </component>
+</project>

+ 14 - 0
.idea/webServers.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="WebServers">
+    <option name="servers">
+      <webServer id="67313ede-d076-4fe6-b3c8-3e957bc43418" name="Stretch-Local">
+        <fileTransfer rootFolder="/root" accessType="SFTP" host="172.16.15.130" port="22" sshConfigId="b6a188b1-6871-45ba-a65b-b9c9cb466fbc" sshConfig="root@172.16.15.130:22 password">
+          <advancedOptions>
+            <advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
+          </advancedOptions>
+        </fileTransfer>
+      </webServer>
+    </option>
+  </component>
+</project>

+ 3 - 0
README.md

@@ -6,6 +6,9 @@ A template with the following features for internal projects of Sysbo-Team at Zi
 * FreeIPA
 
 ## How to run
+openssl s_client -connect ipa.sf.faraborddi.dc:443 >/usr/local/share/ca-certificates/ipa.crt;update-ca-certificates
 
 `go build .`
 
+./CMD IP PORT
+

+ 10 - 3
handler.go

@@ -1,6 +1,7 @@
 package main
 
 import (
+	"crypto/tls"
 	"encoding/json"
 	"fmt"
 	"io/ioutil"
@@ -83,9 +84,12 @@ func (h *handler) login(c echo.Context) error {
 	params.Add("user", username)
 	params.Add("password", password)
 	payload := strings.NewReader(params.Encode())
-	client := &http.Client{}
+	tr := &http.Transport{
+		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
+	}
+	client := &http.Client{Transport: tr}
 	req, err := http.NewRequest(method, _url, payload)
-	audit("Recieved Login request from:" + RealIP)
+	audit("Recieved Login request from: " + RealIP)
 	if err != nil {
 		fmt.Println(err)
 	}
@@ -129,7 +133,10 @@ func getUserInfo(cockie []*http.Cookie, username string) userInfo {
 `, username)
 
 	payload := strings.NewReader(_json)
-	client := &http.Client{}
+	tr := &http.Transport{
+		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
+	}
+	client := &http.Client{Transport: tr}
 	req, err := http.NewRequest(method, url, payload)
 
 	if err != nil {

+ 6 - 10
vendor/github.com/labstack/echo/echo.go

@@ -217,21 +217,17 @@ const (
 )
 
 const (
-	Version = "3.3.6"
-	website = "https://echo.labstack.com"
-	// http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo
-	banner = `
-   ____    __
-  / __/___/ /  ___
- / _// __/ _ \/ _ \
-/___/\__/_//_/\___/ %s
-High performance, minimalist Go web framework
+        Version = "3.3.6"
+        website = "https://zi-tel.com"
+        // http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo
+        banner = `
+FDIACS-API %s
+High performance, minimalist API written with Go web framework
 %s
 ____________________________________O/_______
                                     O\
 `
 )
-
 var (
 	methods = [...]string{
 		CONNECT,