1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-15 02:37:27 +08:00
docker-labs/www/welcome.html
Jonathan Leibiusky @xetorthio af9986c0f8 Validates that user is a human.
Add google recaptcha as an initial page before creating any session.
To configure recaptcha there are 2 environment variables that are needed
`GOOGLE_RECAPTCHA_SITE_KEY` and `GOOGLE_RECAPTCHA_SITE_SECRET`.
The code contains development defaults that should be set in production
to real values.
**NOTICE: Development defaults assume that the domain is `localhost`**
2016-11-15 16:53:44 -03:00

28 lines
988 B
HTML

{{define "GOOGLE_RECAPTCHA_SITE_KEY"}}
<!doctype html>
<html ng-app="DockerPlay" ng-controller="PlayController">
<head>
<title>Docker Playground</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">
<link rel="stylesheet" href="/assets/style.css" />
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body class="welcome">
<div>
<h1>Welcome!</h1>
<h2>Before starting we need to verify you are a human</h2>
<form id="welcomeForm" method="POST" action="/">
<div class="g-recaptcha" data-callback="iAmHuman" data-sitekey="{{.}}"></div>
</form>
<img src="/assets/large_h.png" />
</div>
<script>
function iAmHuman(resp) {
document.getElementById('welcomeForm').submit();
}
</script>
</body>
</html>
{{end}}