Skip to content

Commit

Permalink
chore: update the icon and cert
Browse files Browse the repository at this point in the history
Signed-off-by: saltbo <saltbo@foxmail.com>
  • Loading branch information
saltbo committed Mar 19, 2023
1 parent bb15219 commit fe2113e
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 32 deletions.
Binary file modified build/appicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/windows/icon.ico
Binary file not shown.
8 changes: 8 additions & 0 deletions hack/certs/openssl-gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -ex
# generate CA's key
openssl genrsa -aes256 -passout pass:1 -out ca.key.pem 4096
openssl rsa -passin pass:1 -in ca.key.pem -out ca.key.pem.tmp
mv ca.key.pem.tmp ca.key.pem

openssl req -config openssl.cnf -key ca.key.pem -new -x509 -days 7300 -sha256 -extensions v3_ca -out ca.pem
39 changes: 39 additions & 0 deletions hack/certs/openssl.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[ ca ]
default_ca = CA_default
[ CA_default ]
default_md = sha256
[ v3_ca ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer
basicConstraints = critical,CA:true
[ req ]
distinguished_name = req_distinguished_name
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = IL
countryName_min = 2
countryName_max = 2

stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Center

localityName = Locality Name (eg, city)
localityName_default = Lod

0.organizationName = Organization Name (eg, company)
0.organizationName_default = Bonaysoft

# we can do this but it is not needed normally :-)
#1.organizationName = Second Organization Name (eg, company)
#1.organizationName_default = World Wide Web Pty Ltd

organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = Bonaysoft

commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_default = relingo-desktop
commonName_max = 64

emailAddress = Email Address
emailAddress_default = saltbo@foxmail.com
emailAddress_max = 64
3 changes: 3 additions & 0 deletions pkg/proxy/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import _ "embed"
//go:embed ca.pem
var ca []byte

//go:embed ca.key
var caKey []byte

func GetCert() []byte {
return ca
}
51 changes: 51 additions & 0 deletions pkg/proxy/ca.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-----BEGIN RSA PRIVATE KEY-----
MIIJKAIBAAKCAgEAqV05Qlg3Lqs0eRO93kyozXXxnyEALj2usxhcz0LZ8vjWpyEP
0gKehlfMzEv+rMXg1D1ouMcGCXgPekdZREbcxPeF7zLeexRoowuhWmwy0Pk20m41
XWtGRQxtwAwFZALjcxRNFCk4KO7hulLv2qTa5L+PU2aJ5JcWVbQE1M69f9RGAJU0
8MvcjJcie6Y7AIo5gdX3Klt7Of+UgqZunzZU43yoDQTjGrJJk1UVNFhuNsvrRhM4
5ZgIInL3JLDhPPvqiKUEoo+ylfdDNjNG3BwNZ+mrC5qUyPdPJY2atJXOGuhF9VZ9
1Aeh0c380icdxWI5UFF78uztUFLv13ZiJc2Tsm1XFA17d308iqWIB1X1lZdDLUlu
BIak+aEfNVCC8BeNwy6i54+K1rke5dNzJlITRv7dmXqxwCy3qMsI1ppwPqk/f+cc
Drav/AyhNtJvkQamBYVwKNT8k7wBv3V7ZNelaC7epUkMG3eZB6B6kZBUmU2jB0KB
Y0iY9i4wtkF6UztfrqFEMT4fuiGp+qYIYW8Pqspz45kkurpQLFuGAYO0r0+3ah4A
UC8yVRSyvQdUVemTEux++NHsN7HAoV76iqUnK4JA4cZvPDpy+9J3wn3lBAeJ9ddw
kFsyV+x0QtiiWM6fmE8y+dLHpF4gJOF3k1S6+kp4CDMTyvNN+1ar3h8/N3sCAwEA
AQKCAgBHuykeNVih1ncx9K+M8HDqHFMKr6Jw80UDq4Tbb5f5tXTMck9OBjf39EXU
HTevG1v+6EdrQzgGWKhNhNyE83Jbpe4/Ag+Cl4E91RYwwvS+115lv7GwcFfhtMLi
/PRniGWm/ukqac7U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rZF96sGdF9Yt9KG9S8tWfeqhc2oXmXRGdsoecyCHqe
c/WFgpr07CHkUyFxve/2YDsbip1bI+69MAZVN46GSnCjYawmJXotLSblLMV7U48C
jYr+qg3FTy1EyPMoPzLrDqDZbiinHZ34WnemudkGVdHMkRYen0ms3Iq7G30=
-----END RSA PRIVATE KEY-----
64 changes: 32 additions & 32 deletions pkg/proxy/ca.pem
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
-----BEGIN CERTIFICATE-----
MIIF9DCCA9ygAwIBAgIJAODqYUwoVjJkMA0GCSqGSIb3DQEBCwUAMIGOMQswCQYD
VQQGEwJJTDEPMA0GA1UECAwGQ2VudGVyMQwwCgYDVQQHDANMb2QxEDAOBgNVBAoM
B0dvUHJveHkxEDAOBgNVBAsMB0dvUHJveHkxGjAYBgNVBAMMEWdvcHJveHkuZ2l0
aHViLmlvMSAwHgYJKoZIhvcNAQkBFhFlbGF6YXJsQGdtYWlsLmNvbTAeFw0xNzA0
MDUyMDAwMTBaFw0zNzAzMzEyMDAwMTBaMIGOMQswCQYDVQQGEwJJTDEPMA0GA1UE
CAwGQ2VudGVyMQwwCgYDVQQHDANMb2QxEDAOBgNVBAoMB0dvUHJveHkxEDAOBgNV
BAsMB0dvUHJveHkxGjAYBgNVBAMMEWdvcHJveHkuZ2l0aHViLmlvMSAwHgYJKoZI
hvcNAQkBFhFlbGF6YXJsQGdtYWlsLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIP
ADCCAgoCggIBAJ4Qy+H6hhoY1s0QRcvIhxrjSHaO/RbaFj3rwqcnpOgFq07gRdI9
3c0TFKQJHpgv6feLRhEvX/YllFYu4J35lM9ZcYY4qlKFuStcX8Jm8fqpgtmAMBzP
sqtqDi8M9RQGKENzU9IFOnCV7SAeh45scMuI3wz8wrjBcH7zquHkvqUSYZz035t9
V6WTrHyTEvT4w+lFOVN2bA/6DAIxrjBiF6DhoJqnha0SZtDfv77XpwGG3EhA/qoh
hiYrDruYK7zJdESQ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LITQjPNNqF9j7fwkv6bhr1cEzoe3+whidlQ1tIFMfQZNJCO2gV
/lHR2JAjXy+O3s3YnwYwwxHZafkReLcaLZ/rWTK0Zeo3MW9X2Bh1VULpScl/9Q==
-----END CERTIFICATE-----
7 changes: 7 additions & 0 deletions pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package proxy
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"io"
"log"
Expand Down Expand Up @@ -30,6 +31,12 @@ func NewProxy(query *query.Query, rc *relingo.Client) *Proxy {
}

func (p *Proxy) Run() error {
var caErr error
goproxy.GoproxyCa, caErr = tls.X509KeyPair(ca, caKey)
if caErr != nil {
return caErr
}

proxy := goproxy.NewProxyHttpServer()
proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm)
proxy.OnRequest(goproxy.ReqHostIs("api.relingo.net:443")).DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) {
Expand Down

0 comments on commit fe2113e

Please sign in to comment.