v2.31.0-dev2 4b72742

mobileconfig.go RawHistoryFolder

1package pki
2
3import (
4	"encoding/base64"
5	"fmt"
6	"html"
7
8	"github.com/google/uuid"
9)
10
11// GenerateMobileconfig generates an iOS configuration profile containing
12// the root CA certificate for one-tap trust installation.
13func GenerateMobileconfig(rootDER []byte, rootCN string) []byte {
14	b64Cert := base64.StdEncoding.EncodeToString(rootDER)
15	profileUUID := uuid.New().String()
16	certUUID := uuid.New().String()
17
18	safeCN := html.EscapeString(rootCN)
19	profile := fmt.Sprintf(`<?xml version="1.0" encoding="UTF-8"?>
20<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
21<plist version="1.0">
22<dict>
23	<key>PayloadContent</key>
24	<array>
25		<dict>
26			<key>PayloadCertificateFileName</key>
27			<string>gordon-ca.crt</string>
28			<key>PayloadContent</key>
29			<data>%s</data>
30			<key>PayloadDescription</key>
31			<string>Installs the Gordon internal CA root certificate</string>
32			<key>PayloadDisplayName</key>
33			<string>%s</string>
34			<key>PayloadIdentifier</key>
35			<string>dev.gordon.ca.%s</string>
36			<key>PayloadType</key>
37			<string>com.apple.security.root</string>
38			<key>PayloadUUID</key>
39			<string>%s</string>
40			<key>PayloadVersion</key>
41			<integer>1</integer>
42		</dict>
43	</array>
44	<key>PayloadDescription</key>
45	<string>Trust Gordon's internal Certificate Authority for HTTPS access</string>
46	<key>PayloadDisplayName</key>
47	<string>Gordon CA Trust</string>
48	<key>PayloadIdentifier</key>
49	<string>dev.gordon.ca-profile</string>
50	<key>PayloadType</key>
51	<string>Configuration</string>
52	<key>PayloadUUID</key>
53	<string>%s</string>
54	<key>PayloadVersion</key>
55	<integer>1</integer>
56</dict>
57</plist>`, b64Cert, safeCN, certUUID, certUUID, profileUUID)
58
59	return []byte(profile)
60}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close