Skip to content

Commit

Permalink
Add version info
Browse files Browse the repository at this point in the history
  • Loading branch information
buffrr committed Aug 31, 2021
1 parent f8f5782 commit 7d44c4f
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 63 deletions.
4 changes: 4 additions & 0 deletions builds/macos/Fingertip.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<string>AppIcon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.impervious.fingertip</string>
<key>CFBundleShortVersionString</key>
<string>0.0.2</string>
<key>CFBundleVersion</key>
<string>0.0.2</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSUIElement</key>
Expand Down
2 changes: 1 addition & 1 deletion builds/windows/manifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="0.0.1.0" processorArchitecture="*" name="Impervious.fingertip" type="win32"/>
<assemblyIdentity version="0.0.2.0" processorArchitecture="*" name="Impervious.fingertip" type="win32"/>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
Expand Down
2 changes: 2 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type App struct {
DNSProcPath string
Proxy letsdane.Config
ProxyAddr string
Version string
}

func getOrCreateDir() (string, error) {
Expand Down Expand Up @@ -191,6 +192,7 @@ func (c *contentHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
CertPath: c.config.CertPath,
CertLink: url + "/" + CertFileName,
PACLink: url + "/proxy.pac",
Version: c.config.Version,
})
return
}
Expand Down
122 changes: 62 additions & 60 deletions internal/config/onboarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,72 +6,74 @@ type onBoardingTmplData struct {
CertPath string
CertLink string
PACLink string
Version string
}

var onBoardingTmplContent = `
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-size: 16px;
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
}
h1 {
color:#444444;
}
.c {
max-width:600px;margin:0 auto;margin-top:6em;
}
.step {
background: #0e0e0e;
color: #fff;
width: 1.5em;
height: 1.5em;
display: inline-block;
text-align: center;
line-height: 1.5em;
border-radius: 1.5em;
padding: 0.2em;
margin-right: 0.5em;
font-size: 0.8em;
}
.btn {
background-color: #464646;
color: #fff;
border: none;
border-radius: 4px;
padding: .8em 1.2em;
font-size: 0.8em;
margin-left: .1em;
text-decoration: none;
}
</style>
</head>
<body>
<div class="c">
<h1>Fingertip Setup</h1>
<h3><span class="step">1</span> Install Certificate</h3>
<p>Your private CA is stored at <code>{{.CertPath}}</code>.
</p>
<p>It cannot be used to issue certificates for legacy domains (.com, .net ... etc) since it uses the name constraints extension to exclude legacy TLDs from DANE support. Add this CA to your browser/TLS client trust store to allow Fingertip to issue certificates for decentralized names.</p>
<head>
<style>
body {
font-size: 16px;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
}
h1 {
color: #444444;
}
.c {
max-width: 600px;
margin: 0 auto;
margin-top: 6em;
}
.step {
background: #0e0e0e;
color: #fff;
width: 1.5em;
height: 1.5em;
display: inline-block;
text-align: center;
line-height: 1.5em;
border-radius: 1.5em;
padding: 0.2em;
margin-right: 0.5em;
font-size: 0.8em;
}
.btn {
background-color: #464646;
color: #fff;
border: none;
border-radius: 4px;
padding: 0.8em 1.2em;
font-size: 0.8em;
margin-left: 0.1em;
text-decoration: none;
}
</style>
</head>
<body>
<div class="c">
<h1>Fingertip Setup</h1>
<h3 style="margin-top: 2em;"><span class="step">1</span> Install Certificate</h3>
<p>Your private CA is stored at <code>{{.CertPath}}</code>.</p>
<p>
It cannot be used to issue certificates for legacy domains (.com, .net ... etc) since it uses the name constraints extension to exclude legacy TLDs from DANE support. Add this CA to your browser/TLS client trust store to
allow Fingertip to issue certificates for decentralized names.
</p>
<div style="margin: 2em 0;">
<a href="{{.CertLink}}" class="btn">Download Certificate</a>
</div>
<h3 style="margin-top: 4em;"><span class="step">2</span> Configure proxy</h3>
<p>Choose Automatic Proxy configuration in your browser/TLS client proxy settings and add this url:</p>
<div style="background: #f2f2f2; padding: 1em 2em; font-weight: bold; color: #444;">{{.PACLink}}</div>
<div style="margin: 2em 0;">
<a href="{{.CertLink}}" class="btn">Download Certificate</a>
</div>
<h3 style="margin-top: 4em;"><span class="step">2</span> Configure proxy</h3>
<p>Choose Automatic Proxy configuration in your browser/TLS client proxy settings and add this url:</p>
<div style="
background: #f2f2f2;
padding: 1em 2em;
font-weight: bold;
color: #444;
">{{.PACLink}}</div>
</div>
</div>
</body>
<footer style="margin-top: 2em; border-top: 1px solid #e5e5e5;">
<small>Fingertip v{{.Version}}</small>
</footer>
</div>
</body>
</html>
`

Expand Down
10 changes: 8 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"time"
)

const Version = "0.0.2"

type App struct {
proc *proc.HNSProc
server *http.Server
Expand All @@ -42,6 +44,8 @@ func setupApp() *App {
log.Fatal(err)
}

c.Version = Version

c.DNSProcPath, err = getProcPath()
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -324,6 +328,8 @@ func getProcPath() (string, error) {
}

func init() {
// set version used in go.mod
letsdane.Version = "0.6-fingertip"
// letsdane shows the version name
// in the footer on errors
// 0.6 is the version used in go.mod
letsdane.Version = fmt.Sprintf("0.6 - fingertip (v%s)", Version)
}

0 comments on commit 7d44c4f

Please sign in to comment.