Compare commits
No commits in common. 'master' and 'v0.4' have entirely different histories.
@ -1,10 +0,0 @@
|
||||
SUBNET=172.16.28
|
||||
EXPOSE_APACHE_WEB_SERVER_ON_PORT=8787
|
||||
EXPOSE_APACHE_WEB_SERVER_ONLY_ON_IP_ADDRESS_COLON=
|
||||
EXPOSE_MARIADB_ON_PORT=3386
|
||||
MARIADB_ROOT_PASSWORD=qwerty
|
||||
MARIADB_USERNAME=root
|
||||
MARIADB_PASSWORD=qwerty
|
||||
MARIADB_HOSTNAME=mariadb
|
||||
MARIADB_PORT=3306
|
||||
MARIADB_DATABASE_NAME=captcheck
|
@ -1,2 +0,0 @@
|
||||
RewriteEngine On
|
||||
RewriteRule ^captcheck.dist.js captcheck.min.js [L]
|
@ -1,23 +1,9 @@
|
||||
Copyright (C) 2017-2021 Netsyms Technologies.
|
||||
Copyright (C) 2017 Netsyms Technologies.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
NETSYMS TECHNOLOGIES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL NETSYMS TECHNOLOGIES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name and other identifying marks of
|
||||
Netsyms Technologies shall not be used in advertising or otherwise to promote
|
||||
the sale, use or other dealings in this Software without prior written
|
||||
authorization from Netsyms Technologies.
|
||||
Except as contained in this notice, the name and other identifying marks of Netsyms Technologies shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Netsyms Technologies.
|
@ -0,0 +1 @@
|
||||
function chooseAnswer(e,t){var a=document.getElementById("captcheck_"+e+"_answer_"+t);return a.checked=!0,!1}function switchMode(e){var t=document.getElementById("captcheck_"+e+"_alt_question_button"),a=document.getElementById("captcheck_"+e+"_question_image"),c=document.getElementById("captcheck_"+e+"_question_access"),n=document.getElementById("captcheck_"+e+"_answer_images"),s=document.getElementById("captcheck_"+e+"_answer_access");"> Text mode"==t.innerHTML?(t.innerHTML="> Image mode",a.style.display="none",c.style.display="initial",n.style.display="none",s.style.display="initial",s.innerHTML="<input type='text' name='captcheck_selected_answer' aria-label='Type your answer here.' autocomplete='off' autofill='off'/>"):(t.innerHTML="> Text mode",a.style.display="initial",c.style.display="none",n.style.display="initial",s.style.display="none",s.innerHTML="")}window.onload=function(){var e="https://captcheck.netsyms.com/api.php",t=document.createElement("style");t.innerHTML=".captcheck_box,.captcheck_label_message,.captcheck_label_message b{color:#000;font-family:Ubuntu,Arial,sans-serif}.captcheck_box{border:1px solid #e0e0e0;border-radius:3px;display:inline-block;padding:3px;margin:5px 2px 5px 1px;background-color:#f5f5f5}.captcheck_answer_label>input{visibility:hidden;position:absolute}.captcheck_answer_label>input+img{cursor:pointer;border:2px solid transparent;border-radius:3px;min-width:32px;width:18%;max-width:64px}.captcheck_answer_label>input:checked+img{cursor:pointer;border:2px solid #424242;border-radius:3px}.captcheck_error_message{color:red}.captcheck_question_image{display:initial}.captcheck_question_access{display:none}.captcheck_alt_question_button{float:right;font-size:80%;cursor:pointer;color:inherit;text-decoration:inherit}.captcheck_answer_images{display:initial}.captcheck_answer_access{display:none}",document.body.appendChild(t),Array.prototype.forEach.call(document.getElementsByClassName("captcheck_container"),function(t){var a=new XMLHttpRequest;a.open("GET",e+"?action=new",!0),a.onreadystatechange=function(){if(4==this.readyState){var a=this.status,c=this.responseText,n=document.createElement("div");if(n.setAttribute("class","captcheck_box"),t.appendChild(n),200==a){for(var s=JSON.parse(c),i=s.id_prefix,r="<div class='captcheck_answer_images' id='captcheck_"+i+"_answer_images'>",o=0,l=s.answers.length;l>o;o++){var p=e+"?action=img&s="+s.session+"&c="+s.answers[o];r+="<a class='captcheck_answer_label' href='' tabindex='0' onClick='chooseAnswer(\""+i+'","'+s.answers[o]+"\"); return false;' onEnter='chooseAnswer(\""+i+'","'+s.answers[o]+"\"); return false;'><input id='captcheck_"+i+"_answer_"+s.answers[o]+"' type='radio' name='captcheck_selected_answer' value='"+s.answers[o]+"' /><img src='"+p+"' /></a>"}r+="</div>";var d=document.createElement("div");d.innerHTML=r+"<div class='captcheck_answer_access' id='captcheck_"+i+"_answer_access'></div>";var _=document.createElement("div");_.setAttribute("class","captcheck_label_message"),_.setAttribute("id","captcheck_"+i+"_label_message"),_.innerHTML="<span class='captcheck_question_image' id='captcheck_"+i+"_question_image'>"+s.question_i+"</span><span class='captcheck_question_access' id='captcheck_"+i+"_question_access'>"+s.question_a+"</span><a href='' class='captcheck_alt_question_button' onClick='switchMode(\""+i+"\"); return false;' onEnter='switchMode(\""+i+"\"); return false;' id='captcheck_"+i+"_alt_question_button' aria-label='Switch between image and text question' tabindex='0'>> Text mode</a>",n.appendChild(_),n.appendChild(d);var h=document.createElement("span");h.innerHTML="<input type='hidden' name='captcheck_session_code' value='"+s.session+"' />",n.appendChild(h)}else n.innerHTML="<span class='captcheck_error_message'>There was a problem loading the CAPTCHA.</span>"}},a.send()})};
|
@ -1,9 +0,0 @@
|
||||
window.onload=function(){function m(c,g){document.getElementById("captcheck_"+c+"_answer_"+g).checked=!0;return!1}function n(c){var g=document.getElementById("captcheck_"+c+"_alt_question_button"),b=document.getElementById("captcheck_"+c+"_question_image"),d=document.getElementById("captcheck_"+c+"_question_access"),f=document.getElementById("captcheck_"+c+"_answer_images");c=document.getElementById("captcheck_"+c+"_answer_access");"> Text mode"==g.innerHTML?(g.innerHTML="> Image mode",b.style.display=
|
||||
"none",d.style.display="initial",f.style.display="none",c.style.display="initial",c.innerHTML="<input type='text' name='captcheck_selected_answer' aria-label='Type your answer here.' autocomplete='off' autofill='off'/>"):(g.innerHTML="> Text mode",b.style.display="initial",d.style.display="none",f.style.display="initial",c.style.display="none",c.innerHTML="")}var k="";Array.prototype.forEach.call(document.getElementsByClassName("captcheck_container"),function(c){c.dataset.stylenonce&&(k=c.dataset.stylenonce);
|
||||
var g=new XMLHttpRequest;g.open("GET","https://captcheck.netsyms.com/api.php?action=new",!0);g.onreadystatechange=function(){if(4==this.readyState){var b=this.status,d=this.responseText;if(""==c.innerHTML.trim()){var f=document.createElement("div");f.setAttribute("class","captcheck_box");c.appendChild(f);if(200==b){d=JSON.parse(d);b=d.id_prefix;for(var h="<div class='captcheck_answer_images' id='captcheck_"+b+"_answer_images'>",e=0,g=d.answers.length;e<g;e++)h+="<a class='captcheck_answer_label' href='' data-prefix='"+
|
||||
b+"' data-answer='"+d.answers[e]+"' tabindex='0' aria-role='button'><input id='captcheck_"+b+"_answer_"+d.answers[e]+"' type='radio' name='captcheck_selected_answer' value='"+d.answers[e]+"' data-prefix='"+b+"' data-answer='"+d.answers[e]+"' /><img src='"+("https://captcheck.netsyms.com/api.php?action=img&s="+d.session+"&c="+d.answers[e])+"' data-prefix='"+b+"' data-answer='"+d.answers[e]+"'/></a>";h+="</div>";e=document.createElement("div");e.innerHTML=h+"<div class='captcheck_answer_access' id='captcheck_"+
|
||||
b+"_answer_access'></div>";h=document.createElement("div");h.setAttribute("class","captcheck_label_message");h.setAttribute("id","captcheck_"+b+"_label_message");h.innerHTML="<span class='captcheck_question_image' id='captcheck_"+b+"_question_image'>"+d.question_i+"</span><span class='captcheck_question_access' id='captcheck_"+b+"_question_access'>"+d.question_a+"</span><a href='' class='captcheck_alt_question_button' data-prefix='"+b+"' id='captcheck_"+b+"_alt_question_button' aria-role='button' aria-label='Switch between image and text question' tabindex='0'>> Text mode</a>";
|
||||
f.appendChild(h);f.appendChild(e);h=document.createElement("span");h.innerHTML="<input type='hidden' name='captcheck_session_code' value='"+d.session+"' />";f.appendChild(h);f=document.querySelectorAll('.captcheck_answer_label[data-prefix="'+b+'"]');for(e=0;e<f.length;e++)f[e].addEventListener("click",function(a){m(a.target.getAttribute("data-prefix"),a.target.getAttribute("data-answer"));a.preventDefault()}),f[e].addEventListener("keydown",function(a){if("Enter"===a.key||13===a.which||13===a.keyCode||
|
||||
" "===a.key||32===a.which||32===a.keyCode)m(a.target.getAttribute("data-prefix"),a.target.getAttribute("data-answer")),a.preventDefault()});document.querySelector('.captcheck_alt_question_button[data-prefix="'+b+'"]').addEventListener("click",function(a){n(a.target.getAttribute("data-prefix"));a.preventDefault()});document.querySelector('.captcheck_alt_question_button[data-prefix="'+b+'"]').addEventListener("keydown",function(a){if("Enter"===a.key||13===a.which||13===a.keyCode||" "===a.key||32===
|
||||
a.which||32===a.keyCode)n(a.target.getAttribute("data-prefix")),a.preventDefault()})}else f.innerHTML="<span class='captcheck_error_message'>There was a problem loading the CAPTCHA.</span>"}}};g.send()});var l=document.createElement("style");""!=k&&l.setAttribute("nonce",k);l.innerHTML=".captcheck_box{font-family:Ubuntu,Arial,sans-serif;color:black;border:1px solid #e0e0e0;border-radius:3px;display:inline-block;padding:3px;margin:5px 2px 5px 1px;background-color:#f5f5f5;text-decoration:none}.captcheck_label_message,.captcheck_label_message b{color:black;font-family:Ubuntu,Roboto,Arial,sans-serif}.captcheck_answer_label{border:0}.captcheck_answer_label>input{visibility:hidden;position:absolute}.captcheck_answer_label>input+img{cursor:pointer;border:2px solid transparent;border-radius:3px;min-width:32px;width:18%;max-width:64px}.captcheck_answer_label>input:checked+img{cursor:pointer;border:2px solid #424242;border-radius:3px}.captcheck_error_message{color:red}.captcheck_question_image{display:initial}.captcheck_question_access{display:none}.captcheck_alt_question_button{float:right;font-size:80%;cursor:pointer;color:inherit;text-decoration:inherit;border:0}.captcheck_answer_images{display:initial}.captcheck_answer_access{display:none}";
|
||||
document.body.appendChild(l)};
|
@ -1,26 +0,0 @@
|
||||
version: "3.6"
|
||||
|
||||
services:
|
||||
web:
|
||||
build: ./docker-web
|
||||
restart: always
|
||||
ports:
|
||||
- ${EXPOSE_APACHE_WEB_SERVER_ONLY_ON_IP_ADDRESS_COLON}${EXPOSE_APACHE_WEB_SERVER_ON_PORT}:80
|
||||
volumes:
|
||||
- .:/var/www/html
|
||||
environment:
|
||||
MARIADB_USERNAME: ${MARIADB_USERNAME}
|
||||
MARIADB_PASSWORD: ${MARIADB_PASSWORD}
|
||||
MARIADB_HOSTNAME: ${MARIADB_HOSTNAME}
|
||||
MARIADB_PORT: ${MARIADB_PORT}
|
||||
MARIADB_DATABASE_NAME: ${MARIADB_DATABASE_NAME}
|
||||
|
||||
mariadb:
|
||||
image: mariadb:10.4
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/var/lib/mysql
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
|
||||
ports:
|
||||
- 127.0.0.1:${EXPOSE_MARIADB_ON_PORT}:${MARIADB_PORT}
|
@ -1,13 +0,0 @@
|
||||
FROM php:7.2-apache
|
||||
|
||||
RUN docker-php-ext-install mysqli pdo pdo_mysql
|
||||
RUN docker-php-ext-enable mysqli
|
||||
|
||||
RUN a2enmod rewrite
|
||||
|
||||
RUN apt-get update && apt-get install -y zlib1g-dev libpng-dev libfreetype6-dev
|
||||
|
||||
RUN docker-php-ext-configure gd --with-gd --with-zlib-dir --with-png-dir --with-freetype-dir
|
||||
|
||||
RUN docker-php-ext-install gd
|
||||
|
@ -1,143 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<meta content="width=device-width,initial-scale=1" name=viewport>
|
||||
<title>Captcheck</title>
|
||||
<link rel="stylesheet" href="https://static.netsyms.net/bootstrap/4/bootstrap.materia.min.css" />
|
||||
<link rel="stylesheet" href="https://static.netsyms.net/prism/prism.css" />
|
||||
<script async src="https://static.netsyms.net/fontawesome/5.2/js/all.min.js"></script>
|
||||
<script defer async src="https://static.netsyms.net/prism/prism.js"></script>
|
||||
<style>
|
||||
h2, h3, p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding-left: 5px;
|
||||
|
||||
}
|
||||
.bg-minty {
|
||||
background-color: #7dffd2;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) and (max-width: 991px) {
|
||||
h2, h3 {
|
||||
text-align: left;
|
||||
}
|
||||
.site-icon {
|
||||
margin-top: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 992px) and (max-width: 1199px) {
|
||||
h2, h3 {
|
||||
text-align: left;
|
||||
}
|
||||
.site-icon {
|
||||
margin-top: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1200px) {
|
||||
h2, h3 {
|
||||
text-align: left;
|
||||
}
|
||||
.site-icon {
|
||||
margin-top: 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: center;" >
|
||||
<img src="logo.png" class="site-icon" style="width: 400px; max-width: 100%;" />
|
||||
</div>
|
||||
</div>
|
||||
<p style="font-size: 15px; line-height: 20px;">Open source reCAPTCHA alternative</p>
|
||||
<div class="d-flex">
|
||||
<ul class="nav nav-pills mx-auto">
|
||||
<li class="nav-item">
|
||||
<span class="nav-link">
|
||||
<i class="fab fa-php"></i> PHP 7
|
||||
</span>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<span class="nav-link">
|
||||
<i class="fas fa-database"></i> MySQL
|
||||
</span>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="https://source.netsyms.com/Netsyms/Captcheck/src/branch/master/LICENSE" style="color: #444;">
|
||||
<i class="fas fa-file-contract"></i> MIT
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="https://source.netsyms.com/Netsyms/Captcheck" style="color: #444;">
|
||||
<i class="fas fa-code-branch"></i> Git
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row my-4">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header bg-minty">
|
||||
<h4 class="card-heading d-flex mb-0"><span class="mr-auto">Demo</span> <a onclick="document.getElementById('demoframe').src = document.getElementById('demoframe').src" title="Reset demo"><i class="fas fa-sync-alt"></i></a></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<iframe style="border: 0px solid white; width: 100%; height: 100%; height: 350px;" src="test.html" id="demoframe"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header bg-minty">
|
||||
<h4 class="card-heading mb-0">Use</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<b>Put this in your page somewhere:</b>
|
||||
<pre><code class="language-html"><script src="https://captcheck.netsyms.com/captcheck.min.js"></script></code></pre>
|
||||
<b>Put this in your form where you want the CAPTCHA:</b>
|
||||
<pre><code class="language-html"><div class="captcheck_container"></div></code></pre>
|
||||
<b>Put this in your server-side form validation (PHP example):</b>
|
||||
<pre><code class="language-php">
|
||||
$url = 'https://captcheck.netsyms.com/api.php';
|
||||
$data = [
|
||||
'session_id' => $_POST['captcheck_session_code'],
|
||||
'answer_id' => $_POST['captcheck_selected_answer'],
|
||||
'action' => "verify"
|
||||
];
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||
'method' => 'POST',
|
||||
'content' => http_build_query($data)
|
||||
]
|
||||
];
|
||||
$context = stream_context_create($options);
|
||||
$result = file_get_contents($url, false, $context);
|
||||
$resp = json_decode($result, TRUE);
|
||||
if (!$resp['result']) {
|
||||
// Replace with error-handling code
|
||||
exit("CAPTCHA did not verify:" . $resp['msg']);
|
||||
} else {
|
||||
// The CAPTCHA is valid.
|
||||
exit("CAPTCHA verified!");
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<b>If you have a strict Content Security Policy, change your div to this:</b>
|
||||
<pre><code class="language-html"><div class="captcheck_container" data-stylenonce="your nonce here"></div></code></pre>
|
||||
|
||||
Note: by using this hosted service, you agree to <a href="https://netsyms.com/legal">these terms</a>. If you don't like them, feel free to host Captcheck on your own server.
|
||||
Popular sites should self-host as well just to be nice.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer"><p>Copyright © 2018 <a href="https://netsyms.com">Netsyms Technologies</a>. MIT License.<br /><a href="https://source.netsyms.com/Netsyms/Captcheck">Get the source</a> and run your own CAPTCHA service.</p></div>
|
||||
</div>
|
@ -1,12 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>Captcheck Sample Form</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="captcheck.js"></script>
|
||||
|
||||
<form action="test.php" method="POST">
|
||||
<input type="text" name="form_field" placeholder="Some random form field" />
|
||||
<div class="captcheck_container">
|
||||
</div>
|
||||
<button type="submit">Submit Form</button>
|
||||
</form>
|
||||
<html>
|
||||
<head>
|
||||
<title>Captcheck Sample Form</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="captcheck.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<form action="test.php" method="POST">
|
||||
<input type="text" name="form_field" placeholder="Some random form field" />
|
||||
<div class="captcheck_container">
|
||||
</div>
|
||||
<button type="submit">Submit Form</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue