Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Add favicon and stuff #473

Merged
merged 2 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added cmd/server/assets/favicon.ico
Binary file not shown.
12 changes: 11 additions & 1 deletion cmd/server/assets/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta data-build-id="{{.build_id}}" data-build-tag="{{.build_tag}}">

<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="manifest" href="/static/site.webmanifest">
<link rel="mask-icon" href="/static/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/static/favicon.ico">
<meta name="msapplication-TileColor" content="#ff0554">
<meta name="msapplication-config" content="/static/browserconfig.xml">
<meta name="theme-color" content="#ffffff">

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link rel="stylesheet"
Expand Down Expand Up @@ -194,7 +204,7 @@ <h6 class="dropdown-header">System admin</h6>
<a class="dropdown-item" href="/admin/realms">Realms</a>
<div class="dropdown-divider"></div>
{{end}}

<h6 class="dropdown-header">Actions</h6>
{{if gt (len .currentUser.Realms) 1}}
<a class="dropdown-item" href="/realm">Change realm</a>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cmd/server/assets/static/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions cmd/server/assets/static/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#ff0000</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added cmd/server/assets/static/favicon-16x16.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 added cmd/server/assets/static/favicon-32x32.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 added cmd/server/assets/static/favicon.ico
Binary file not shown.
Binary file added cmd/server/assets/static/mstile-144x144.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 added cmd/server/assets/static/mstile-150x150.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 added cmd/server/assets/static/mstile-310x150.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 added cmd/server/assets/static/mstile-310x310.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 added cmd/server/assets/static/mstile-70x70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions cmd/server/assets/static/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions cmd/server/assets/static/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Verification Server",
"short_name": "Verification Server",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
7 changes: 7 additions & 0 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"net/http"
"os"
"path/filepath"
"strconv"

"github.com/google/exposure-notifications-verification-server/pkg/buildinfo"
Expand Down Expand Up @@ -184,6 +185,12 @@ func realMain(ctx context.Context) error {
requireSystemAdmin := middleware.RequireAdmin(ctx, h)
rateLimit := httplimiter.Handle

{
static := filepath.Join(config.AssetsPath, "static")
fs := http.FileServer(http.Dir(static))
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", fs))
}

{
loginController := login.New(ctx, auth, config, db, h)
{
Expand Down
4 changes: 4 additions & 0 deletions pkg/render/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ func loadTemplates(tmpl *template.Template, root string) error {
return nil
}

if !strings.HasSuffix(info.Name(), ".html") {
return nil
}

if _, err := tmpl.ParseFiles(path); err != nil {
return fmt.Errorf("failed to parse %s: %w", path, err)
}
Expand Down