Skip to content

Commit e9f28f7

Browse files
authored
Replace pkg.cfssl.org with 'Packages' tab (#1050)
1 parent 44db4a7 commit e9f28f7

File tree

4 files changed

+37
-9
lines changed

4 files changed

+37
-9
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dist/*
2-
cli/serve/static.rice-box.go
2+
cli/serve/rice-box.go
33
coverage.txt
44
profile.out
55
bin

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,35 @@ export GOPROXY := off
77
.PHONY: all
88
all: bin/cfssl bin/cfssl-bundle bin/cfssl-certinfo bin/cfssl-newkey bin/cfssl-scan bin/cfssljson bin/mkbundle bin/multirootca
99

10-
bin/%: $(shell find . -type f -name '*.go')
10+
bin/%: $(shell find . -type f -name '*.go') cli/serve/rice-box.go
1111
@mkdir -p $(dir $@)
1212
go build -ldflags $(LDFLAGS) -o $@ ./cmd/$(@F)
1313

14+
cli/serve/rice-box.go: bin/rice $(shell find cli/serve/static -type f)
15+
cli/serve/rice-box.go:
16+
./bin/rice embed-go -i=./cli/serve
17+
1418
.PHONY: install
1519
install: install-cfssl install-cfssl-bundle install-cfssl-certinfo install-cfssl-newkey install-cfssl-scan install-cfssljson install-mkbundle install-multirootca
1620

1721
.PHONY: install-%
1822
install-%:
1923
go install ./cmd/$(@F:install-%=%)
2024

21-
bin/rice: $(shell find . -type f -name '*.go')
25+
.PHONY: serve
26+
serve: bin/cfssl
27+
serve:
28+
./bin/cfssl serve
29+
30+
bin/rice: $(shell find vendor -type f -name '*.go')
2231
@mkdir -p $(dir $@)
2332
go build -o $@ ./vendor/github.com/GeertJohan/go.rice/rice
2433

25-
bin/golint: $(shell find . -type f -name '*.go')
34+
bin/golint: $(shell find vendor -type f -name '*.go')
2635
@mkdir -p $(dir $@)
2736
go build -o $@ ./vendor/golang.org/x/lint/golint
2837

29-
bin/goose: $(shell find . -type f -name '*.go')
38+
bin/goose: $(shell find vendor -type f -name '*.go')
3039
@mkdir -p $(dir $@)
3140
go build -o $@ ./vendor/bitbucket.org/liamstask/goose/cmd/goose
3241

cli/serve/serve.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ func (hb *httpBox) Open(name string) (http.File, error) {
108108
// staticBox is the box containing all static assets.
109109
var staticBox = &httpBox{
110110
redirects: map[string]string{
111-
"/scan": "/index.html",
112-
"/bundle": "/index.html",
111+
"/scan": "/index.html",
112+
"/bundle": "/index.html",
113+
"/packages": "/index.html",
113114
},
114115
}
115116

cli/serve/static/assets/cfssl.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
navLink('a', '/bundle', Tformat('bundle.title'))
122122
]),
123123
m('ul.nav.navbar-nav.navbar-right', [
124-
m('li', m('a[href="https://pkg.cfssl.org"]', Tformat('common.packages'))),
124+
navLink('a', '/packages', Tformat('common.packages')),
125125
m('li', m('a[href="https://github.com/cloudflare/cfssl"]', 'GitHub')),
126126
])
127127
])
@@ -237,6 +237,23 @@
237237
}
238238
};
239239

240+
var packages = {
241+
controller: function() {
242+
page.title(Tformat('common.packages'));
243+
return;
244+
},
245+
view: function() {
246+
return appWrapper([
247+
m('h1.page-header', Tformat('common.packages')),
248+
m('ul', [
249+
m('li', m('a[href="https://github.com/cloudflare/cfssl/releases"]', 'Download binaries (GitHub)')),
250+
m('li', m('a[href="https://hub.docker.com/r/cloudflare/cfssl"]', 'Docker images')),
251+
m('li', m('a[href="https://pkg.cloudflare.com/"]', 'Install from apt or yum'))
252+
])
253+
]);
254+
}
255+
};
256+
240257
var scan = {
241258
vm: {
242259
init: function(domain) {
@@ -708,7 +725,8 @@
708725
'/bundle': bundle,
709726
'/bundle/:domain': bundle,
710727
'/scan': scan,
711-
'/scan/:domain': scan
728+
'/scan/:domain': scan,
729+
'/packages': packages
712730
});
713731

714732
window.scan = scan;

0 commit comments

Comments
 (0)