website/index.min.54509ba7c5e639f5e...

1 line
71 KiB
JavaScript

var suggestions=document.getElementById('suggestions'),userinput=document.getElementById('userinput');document.addEventListener('keydown',inputFocus);function inputFocus(a){a.keyCode===191&&(a.preventDefault(),userinput.focus()),a.keyCode===27&&(userinput.blur(),suggestions.classList.add('d-none'))}document.addEventListener('click',function(a){var b=suggestions.contains(a.target);b||suggestions.classList.add('d-none')}),document.addEventListener('keydown',suggestionFocus);function suggestionFocus(b){const d=suggestions.querySelectorAll('a'),e=[...d],a=e.indexOf(document.activeElement);let c=0;b.keyCode===38?(b.preventDefault(),c=a>0?a-1:0,d[c].focus()):b.keyCode===40&&(b.preventDefault(),c=a+1<e.length?a+1:a,d[c].focus())}(function(){var b=new FlexSearch({preset:'score',cache:!0,doc:{id:'id',field:['title','description','content'],store:['href','title','description']}}),c=[{id:0,href:"/docs/webmasters/installing-captcha/",title:"Installing mCaptcha on your website",description:"Interested in deploying mCpatcha? From deploying a self-hosted instance to installing the CAPTCHA on your website, this guide will have you covered!",content:'\u003cp\u003emCaptcha can protect your website from DDoS attacks. In this guide we\u0026rsquo;ll\nexplore how to install mCaptcha on your website. The end result will be\nsomething like this, on your website:\u003c/p\u003e\n\u003cfigure\u003e\n \u003cimg class="img-fluid lazyload blur-up" data-sizes="auto" src="/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_20x0_resize_box_2.png" data-srcset="/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_800x0_resize_box_2.png 800w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_700x0_resize_box_2.png 700w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_600x0_resize_box_2.png 600w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_500x0_resize_box_2.png 500w" width="618" height="669" alt="A registration form with mCaptcha widget installed"\u003e\n \u003cnoscript\u003e\u003cimg class="img-fluid" sizes="100vw" srcset="/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_800x0_resize_box_2.png 800w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_700x0_resize_box_2.png 700w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_600x0_resize_box_2.png 600w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_500x0_resize_box_2.png 500w" src="/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result.png" width="618" height="669" alt="A registration form with mCaptcha widget installed"\u003e\u003c/noscript\u003e\n\u003c/figure\u003e\n\u003cp\u003eFor the purpose of this demo, we will be using\n\u003ca href="https://demo.mcaptcha.org"\u003edemo.mcaptcha.org\u003c/a\u003e, a demo instance running\nin @realaravinth\u0026rsquo;s bedroom(for this same reason, it shouldn\u0026rsquo;t be used\nfor anything serious)\u003c/p\u003e\n\u003ch2 id="1-create-an-account-and-sign-into-the-mcaptcha-dashboard"\u003e1. Create an account and sign into the mCaptcha dashboard\u003c/h2\u003e\n\u003cp\u003eHead over to \u003ca href="https://demo.mcaptcha.org/join"\u003edemo.mcaptcha.org\u003c/a\u003e and\ncreate an account. When ready, sign in.\u003c/p\u003e\n\u003ch2 id="2-create-new-site-key"\u003e2. Create new site key\u003c/h2\u003e\n\u003cp\u003eA \u003ca href="/docs/terminology/sitekey/"\u003esite key\u003c/a\u003e is how a new CAPTCHA is configured within mCaptcha. To create\na new site key, click on \u0026ldquo;New Site\u0026rdquo; button in the dashboard.\u003c/p\u003e\n\u003cfigure\u003e\n \u003cimg class="img-fluid lazyload blur-up" data-sizes="auto" src="/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_20x0_resize_box_2.png" data-srcset="/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_900x0_resize_box_2.png 900w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_800x0_resize_box_2.png 800w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_700x0_resize_box_2.png 700w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_600x0_resize_box_2.png 600w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_500x0_resize_box_2.png 500w" width="1825" height="857" alt="mCaptcha dashboard with the \u0026#39;new site key\u0026#39; button highlighted"\u003e\n \u003cnoscript\u003e\u003cimg class="img-fluid" sizes="100vw" srcset="/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_900x0_resize_box_2.png 900w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_800x0_resize_box_2.png 800w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_700x0_resize_box_2.png 700w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_600x0_resize_box_2.png 600w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_500x0_resize_box_2.png 500w" src="/docs/webmasters/installing-captcha/new-sitekey-btn.png" width="1825" height="857" alt="mCaptcha dashboard with the \u0026#39;new site key\u0026#39; button highlighted"\u003e\u003c/noscript\u003e\n\u003c/figure\u003e\n\u003cp\u003eThere are two options to create a new site key, easy and advanced. \u003cstrong\u003eWe\nare going to use the \u003ca href="/docs/webmasters/configuring-difficulty-factor#easy-option"\u003eeasy mode\u003c/a\u003e in this tutorial.\u003c/strong\u003e If you are interested\nin learning more about the advance mode, please see \u003ca href="/docs/introduction/configuring-difficulty-factor/#advance-option"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eFill the form and submit it.\u003c/p\u003e\n\u003cfigure\u003e\n \u003cimg class="img-fluid lazyload blur-up" data-sizes="auto" src="/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_20x0_resize_box_2.png" data-srcset="/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_900x0_resize_box_2.png 900w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_800x0_resize_box_2.png 800w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_700x0_resize_box_2.png 700w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_600x0_resize_box_2.png 600w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_500x0_resize_box_2.png 500w" width="720" height="452" alt="mCaptcha dashboard with the \u0026#39;new site key\u0026#39; form in easy mode, with details filled in"\u003e\n \u003cnoscript\u003e\u003cimg class="img-fluid" sizes="100vw" srcset="/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_900x0_resize_box_2.png 900w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_800x0_resize_box_2.png 800w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_700x0_resize_box_2.png 700w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_600x0_resize_box_2.png 600w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_500x0_resize_box_2.png 500w" src="/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled.png" width="720" height="452" alt="mCaptcha dashboard with the \u0026#39;new site key\u0026#39; form in easy mode, with details filled in"\u003e\u003c/noscript\u003e\n\u003c/figure\u003e\n\u003ch2 id="3-copy-widget-link"\u003e3. Copy widget link\u003c/h2\u003e\n\u003cp\u003eSubmitting the form will take you to a page where site key configuration\ncan be viewed. \u0026ldquo;View deployment\u0026rdquo; link will display CAPTCHA widget with\nthe supplied configuration. Click on it and grab the widget link.\u003c/p\u003e\n\u003ch2 id="4-install-mcaptcha-on-your-website"\u003e4. Install mCaptcha on your website\u003c/h2\u003e\n\u003cp\u003eIntegration support is available for some frontend JavaScript\nframeworks. To see full list of supported frameworks, please see\n\u003ca href="https://github.com/mCaptcha/glue#framework-support"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eThere are two options to use the integration library to integrate\nmCaptcha on your website:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eServe the integration library yourself\u003c/li\u003e\n\u003cli\u003eUse a CDN like unpkg.com\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eIn this tutorial, we\u0026rsquo;ll be using the CDN.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003ePasting the following snippet on the page, within the form\u003c/strong\u003e that requires to be protected\nwill load the mCaptcha widget with the configuration supplied. Be sure\nto replace \u003ccode\u003eYour {{paste your widget link}}\u003c/code\u003e with the link obtained from\nthe previous step.\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-html" data-lang="html"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 1\u003c/span\u003e\u0026lt;\u003cspan style="color:#ff79c6"\u003elabel\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 2\u003c/span\u003e \u003cspan style="color:#50fa7b"\u003edata-mcaptcha_url\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026#34;{{paste your widget link here}}\u0026#34;\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 3\u003c/span\u003e \u003cspan style="color:#50fa7b"\u003efor\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026#34;mcaptcha__token\u0026#34;\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 4\u003c/span\u003e \u003cspan style="color:#50fa7b"\u003eid\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026#34;mcaptcha__token-label\u0026#34;\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 5\u003c/span\u003e\u0026gt;\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 6\u003c/span\u003e mCaptcha authorization token.\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 7\u003c/span\u003e \u0026lt;\u003cspan style="color:#ff79c6"\u003ea\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 8\u003c/span\u003e \u003cspan style="color:#50fa7b"\u003ehref\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026#34;https://mcaptcha.org/docs/user-manual/how-to-mcaptcha-without-js/\u0026#34;\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 9\u003c/span\u003e \u0026gt;Instructions\u0026lt;/\u003cspan style="color:#ff79c6"\u003ea\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e10\u003c/span\u003e \u0026gt;.\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e11\u003c/span\u003e \u0026lt;\u003cspan style="color:#ff79c6"\u003einput\u003c/span\u003e \u003cspan style="color:#50fa7b"\u003etype\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026#34;text\u0026#34;\u003c/span\u003e \u003cspan style="color:#50fa7b"\u003ename\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026#34;mcaptcha__token\u0026#34;\u003c/span\u003e \u003cspan style="color:#50fa7b"\u003eid\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026#34;mcaptcha__token\u0026#34;\u003c/span\u003e /\u0026gt;\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e12\u003c/span\u003e\u0026lt;/\u003cspan style="color:#ff79c6"\u003elabel\u003c/span\u003e\u0026gt;\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e13\u003c/span\u003e\u0026lt;\u003cspan style="color:#ff79c6"\u003ediv\u003c/span\u003e \u003cspan style="color:#50fa7b"\u003eid\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026#34;mcaptcha__widget-container\u0026#34;\u003c/span\u003e\u0026gt;\u0026lt;/\u003cspan style="color:#ff79c6"\u003ediv\u003c/span\u003e\u0026gt;\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e14\u003c/span\u003e\u0026lt;\u003cspan style="color:#ff79c6"\u003escript\u003c/span\u003e \u003cspan style="color:#50fa7b"\u003esrc\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026#34;https://unpkg.com/@mcaptcha/vanilla-glue@0.1.0-rc2/dist/index.js\u0026#34;\u003c/span\u003e\u0026gt;\u0026lt;/\u003cspan style="color:#ff79c6"\u003escript\u003c/span\u003e\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eA full example is available\n\u003ca href="https://github.com/mCaptcha/glue/blob/ea576d875457de54d82bed3edfc4ee68302fa4d8/packages/vanilla/static/embeded.html"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\u003ch2 id="5-configure-backend-to-authenticate-captcha-tokens"\u003e5. Configure backend to authenticate CAPTCHA tokens\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eGet \u003ca href="/docs/webmasters/terminology/#authorization-token"\u003eauthorization token\u003c/a\u003e from the user\u0026rsquo;s\nform submission payload. The access token will be associated with a\nparameter called \u003ccode\u003emcaptcha__token\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-python" data-lang="python"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003e mcaptcha_token \u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e request\u003cspan style="color:#ff79c6"\u003e.\u003c/span\u003eform[\u003cspan style="color:#f1fa8c"\u003e\u0026#34;mcaptcha__token\u0026#34;\u003c/span\u003e]\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eValidate access token with mCaptcha instance\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-python" data-lang="python"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 1\u003c/span\u003epayload \u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e {\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 2\u003c/span\u003e \u003cspan style="color:#f1fa8c"\u003e\u0026#34;token\u0026#34;\u003c/span\u003e: mcaptcha_token,\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 3\u003c/span\u003e \u003cspan style="color:#f1fa8c"\u003e\u0026#34;key\u0026#34;\u003c/span\u003e: mcaptcha_sitekey, \u003cspan style="color:#6272a4"\u003e# captcha site key\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 4\u003c/span\u003e \u003cspan style="color:#6272a4"\u003e# mCaptcha account secret; available in settings\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 5\u003c/span\u003e \u003cspan style="color:#f1fa8c"\u003e\u0026#34;secret\u0026#34;\u003c/span\u003e: mcaptcha_account_secret,\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 6\u003c/span\u003e}\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 7\u003c/span\u003eresp \u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e requests\u003cspan style="color:#ff79c6"\u003e.\u003c/span\u003epost(\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 8\u003c/span\u003e \u003cspan style="color:#f1fa8c"\u003e\u0026#34;https://demo.mcaptha.org/api/v1/pow/siteverify\u0026#34;\u003c/span\u003e, json\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003epayload\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e 9\u003c/span\u003e)\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e10\u003c/span\u003eresp \u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e resp\u003cspan style="color:#ff79c6"\u003e.\u003c/span\u003ejson()\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e: secret (\u003ccode\u003emcaptcha_account_secret\u003c/code\u003e from above) is available in Dashboard \u0026gt; Settings \u0026gt; Secret\u003c/p\u003e\n\u003col start="3"\u003e\n\u003cli\u003eIf access token is valid, allow access to protected resource or deny\naccess.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-python" data-lang="python"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003e \u003cspan style="color:#ff79c6"\u003eif\u003c/span\u003e resp[\u003cspan style="color:#f1fa8c"\u003e\u0026#34;valid\u0026#34;\u003c/span\u003e] \u003cspan style="color:#ff79c6"\u003e==\u003c/span\u003e False:\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003e \u003cspan style="color:#ff79c6"\u003ereturn\u003c/span\u003e \u003cspan style="color:#f1fa8c"\u003e\u0026#34;invalid captcha\u0026#34;\u003c/span\u003e, \u003cspan style="color:#bd93f9"\u003e400\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e3\u003c/span\u003e \u003cspan style="color:#ff79c6"\u003eelse\u003c/span\u003e:\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e4\u003c/span\u003e \u003cspan style="color:#ff79c6"\u003ereturn\u003c/span\u003e allow_access_to_protected_resource(request\u003cspan style="color:#ff79c6"\u003e.\u003c/span\u003eform)\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003ePlease see here for a complete \u003ca href="https://github.com/mCaptcha/dos/tree/8f2b53ab46d64fa78a8300dc8ce9d78578ffce12/server"\u003eFlask example\u003c/a\u003e and here for an \u003ca href="https://github.com/mCaptcha/dos/tree/8f2b53ab46d64fa78a8300dc8ce9d78578ffce12/rust-server/demo-server"\u003eActix\nWeb example\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eCongratulations, mCaptcha is now integrated with your website!\u003c/p\u003e\n'},{id:1,href:"/docs/webmasters/configuring-difficulty-factor/",title:"Configuring Difficulty Factor",description:"mCaptcha has options to configure its proof of work engine behavior, this page explains how to determine difficulty facotrs that work best for your website!",content:'\u003cp\u003emCaptcha is highly responsive to detecting DDoS attacks. Admins are\nadvised to take advantage of it by setting low \u003ca href="/docs/terminology/difficulty-factor/"\u003edifficulty\nfactors\u003c/a\u003e for normal traffic levels\nfor their website.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eLowest advisable difficulty factor is 5000.\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eFor instance, if it is normal for my website to get 2000 requests for\nevery 30 seconds, I will set a \u003ca href="/docs/terminology/cooldown-period"\u003ecool\ndown\u003c/a\u003e period of 30 seconds and the\nfirst level of difficulty configuration will have a \u003ca href="/docs/terminology/visitor-threshold"\u003evisitor threshold\u003c/a\u003e of 2000 with a\ndifficulty factor of 5000.\u003c/p\u003e\n\u003cp\u003eThere are two modes to setting difficulty factor for your website on\nmCaptcha:\u003c/p\u003e\n\u003ch3 id="easy-option"\u003eEasy option\u003c/h3\u003e\n\u003cp\u003eEasy mode asks a few basic statistics about your website and generates a\nconfiguration that should work for your website. Currently, easy mode is\nguided by assumptions on suitable difficulty factors to protect a\nwebsite but it will be fine-tuned as mCaptcha sees more deployment.\u003c/p\u003e\n\u003cp\u003eConfiguration generated by easy mode can be tweaked later using the\nadvance mode, as you become more familiar with how mCaptcha works.\u003c/p\u003e\n\u003cfigure\u003e\n \u003cimg class="img-fluid lazyload blur-up" data-sizes="auto" src="/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_20x0_resize_box_2.png" data-srcset="/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_900x0_resize_box_2.png 900w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_800x0_resize_box_2.png 800w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_700x0_resize_box_2.png 700w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_600x0_resize_box_2.png 600w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_500x0_resize_box_2.png 500w" width="720" height="452" alt="new sitekey form in easy mode"\u003e\n \u003cnoscript\u003e\u003cimg class="img-fluid" sizes="100vw" srcset="/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_900x0_resize_box_2.png 900w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_800x0_resize_box_2.png 800w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_700x0_resize_box_2.png 700w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_600x0_resize_box_2.png 600w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_500x0_resize_box_2.png 500w" src="/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode.png" width="720" height="452" alt="new sitekey form in easy mode"\u003e\u003c/noscript\u003e\n\u003c/figure\u003e\n\u003ch3 id="advance-option"\u003eAdvance option\u003c/h3\u003e\n\u003cp\u003eAdvance mode gives the admin granular control over how mCaptcha behaves\non their website. It has options to set the difficulty factor for each\nlevel of traffic(or visitor threshold, in mCaptcha speak), fully taking\nadvantage of mCaptcha\u0026rsquo;s variable difficulty factor feature.\u003c/p\u003e\n\u003cp\u003eFor instance, if it is normal for a website to get 200 requests over 30\nseconds, then setting a very low difficulty factor for a visitor\nthreshold of 200 and a cool down period of 30 seconds will allow the\nusers to pass through without waiting on the CAPTCHA. But if 1000\nrequests over 30 seconds will bring down the service, then the admin can\nconfigure increasing levels of difficulty factor of increasing traffic\nlevels, effectively rate limiting its users and protecting the\nunderlying website.\u003c/p\u003e\n\u003cfigure\u003e\n \u003cimg class="img-fluid lazyload blur-up" data-sizes="auto" src="/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_20x0_resize_box_2.png" data-srcset="/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_900x0_resize_box_2.png 900w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_800x0_resize_box_2.png 800w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_700x0_resize_box_2.png 700w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_600x0_resize_box_2.png 600w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_500x0_resize_box_2.png 500w" width="720" height="407" alt="new sitekey form in advance mode"\u003e\n \u003cnoscript\u003e\u003cimg class="img-fluid" sizes="100vw" srcset="/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_900x0_resize_box_2.png 900w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_800x0_resize_box_2.png 800w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_700x0_resize_box_2.png 700w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_600x0_resize_box_2.png 600w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_500x0_resize_box_2.png 500w" src="/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode.png" width="720" height="407" alt="new sitekey form in advance mode"\u003e\u003c/noscript\u003e\n\u003c/figure\u003e\n'},{id:2,href:"/docs/self-hosting/getting-started/",title:"Getting started",description:"Get started with self-hosting mCaptcha",content:'\u003ch2 id="get-started"\u003eGet started\u003c/h2\u003e\n\u003cp\u003eThere are two main ways to self-host mCaptcha:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003ca href="../bare-metal"\u003eBare metal\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href="../docker"\u003eWith Docker\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href="../ansible"\u003eWith Ansible\u003c/a\u003e\u003c/li\u003e\n\u003c/ol\u003e\n'},{id:3,href:"/docs/self-hosting/bare-metal/",title:"Deploy bare metal",description:"Bare metal deployment is tedious, most of this will be automated with a script in the future.",content:'\u003ch2 id="1-install-database"\u003e1. Install Database\u003c/h2\u003e\n\u003cp\u003eThe following databases are supported:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003ePostgres\u003c/li\u003e\n\u003cli\u003eMariaDB\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003ePlease install the database of your choice. Then:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eCreate new database user for mCaptcha\u003c/li\u003e\n\u003cli\u003eCreate new database for mCaptcha\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003emCaptcha binary has migrations baked-in and is applied on start up. The\nchoice of database is described using the \u003ca href="https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#scheme"\u003escheme\u003c/a\u003e of the database URL. For\ninstance:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003ePostgres: \u003ccode\u003epostgres://mcaptcha:password@localhost:5432/mcaptcha\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eMariadb: \u003ccode\u003emysql://mcaptcha:password@localhost:3306/mcaptcha\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id="2-optionally-install-mcaptchacache"\u003e2. Optionally, install mCaptcha/cache\u003c/h2\u003e\n\u003cp\u003eWe recommend this for larger instances. For single-user instances or for\ninstances that protect personal websites, we recommend using the\ninternal cache system. To do so, please comment out the\n\u003ca href="https://github.com/mCaptcha/mCaptcha/blob/d4967626ee59504b32b0f85e409b4e3444ddc4f0/config/default.toml#L54"\u003e\u003ccode\u003eredis\u003c/code\u003e\u003c/a\u003e section of the configuration file.\u003c/p\u003e\n\u003cp\u003ePlease see \u003ca href="https://github.com/mCaptcha/cache"\u003e\u003ccode\u003emCaptcha/cache\u003c/code\u003e\u003c/a\u003e for more details.\u003c/p\u003e\n\u003ch2 id="3-install-mcaptcha"\u003e3. Install mCaptcha\u003c/h2\u003e\n\u003ch3 id="31-install-from-source"\u003e3.1 Install from source\u003c/h3\u003e\n\u003cp\u003eTo build \u003ccode\u003emcaptcha\u003c/code\u003e, you need the following dependencies:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003erust\u003c/li\u003e\n\u003cli\u003enode(\u003ccode\u003ev20\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003eyarn(JavaScript package manager)\u003c/li\u003e\n\u003cli\u003emake\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eWith all dependencies installed, run:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003emake dev-env \u0026amp;\u0026amp; make release\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eAnd the following commands to install the compiled binary:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003esudo cp ./target/release/mcaptcha /usr/bin/ \u0026amp;\u0026amp; \\\n mkdir sudo /etc/mcaptcha \u0026amp;\u0026amp; \\\n sudo cp config/default.toml /etc/mcaptcha/config.toml\n\u003c/code\u003e\u003c/pre\u003e\u003ch3 id="32-install-pre-compiled-binary"\u003e3.2 Install pre-compiled binary\u003c/h3\u003e\n\u003ch4 id="i-download-assets"\u003ei. Download assets\u003c/h4\u003e\n\u003cpre\u003e\u003ccode\u003ewget https://dl.mcaptcha.org/mcaptcha/mCaptcha/master/mcaptcha-master-linux-amd64.tar.gz.asc\nwget https://dl.mcaptcha.org/mcaptcha/mCaptcha/master/mcaptcha-master-linux-amd64.tar.gz.sha256\nwget https://dl.mcaptcha.org/mcaptcha/mCaptcha/master/mcaptcha-master-linux-amd64.tar.gz\n\u003c/code\u003e\u003c/pre\u003e\u003ch3 id="ii-verify-checksum"\u003eii Verify checksum\u003c/h3\u003e\n\u003cpre\u003e\u003ccode\u003esha256sum -c mcaptcha-master-linux-amd64.tar.gz.sha256\n\u003c/code\u003e\u003c/pre\u003e\u003ch3 id="iii-verify-gpg-signature"\u003eiii Verify GPG signature\u003c/h3\u003e\n\u003cp\u003eAll mcaptcha binaries are signed with \u003ca href="https://keyserver.ubuntu.com/pks/lookup?search=73DAC973A9ADBB9ADCB5CDC4595A08135BA9FF73\u0026amp;fingerprint=on\u0026amp;op=index"\u003eour GPG\nkey\u003c/a\u003e.\nPlease verify signatures to verify authenticity.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003egpg --keyserver keyserver.ubuntu.com --recv 73DAC973A9ADBB9ADCB5CDC4595A08135BA9FF73\ngpg --verify mcaptcha-master-linux-amd64.tar.gz.asc\n\u003c/code\u003e\u003c/pre\u003e\u003ch3 id="iv-install"\u003eiv. Install\u003c/h3\u003e\n\u003cpre\u003e\u003ccode\u003etar -xvzf mcaptcha-master-linux-amd64.tar.gz \\\n \u0026amp;\u0026amp; sudo cp mcaptcha-master-linux-amd64/mcaptcha /usr/local/bin \\\n \u0026amp;\u0026amp; sudo mkdir /etc/mcaptcha \\\n \u0026amp;\u0026amp; sudo cp mcaptcha-master-linux-amd64/config.toml /etc/mcaptcha/\n\u003c/code\u003e\u003c/pre\u003e\u003ch3 id="4-configuration"\u003e4. Configuration\u003c/h3\u003e\n\u003cp\u003emCaptcha is highly configurable.\u003c/p\u003e\n\u003cp\u003eConfiguration is applied/merged in the following order:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003epath to configuration file passed in via \u003ccode\u003eMCAPTCHA_CONFIG\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e./config/default.toml\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e/etc/mcaptcha/config.toml\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eenvironment variables. Please see\n\u003ca href="https://github.com/mCaptcha/mCaptcha/blob/master/docs/CONFIGURATION.md"\u003ehere\u003c/a\u003e for a full list of environment variables.\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch3 id="5-systemd-service-configuration"\u003e5. Systemd service configuration:\u003c/h3\u003e\n\u003col\u003e\n\u003cli\u003eCopy the following to \u003ccode\u003e/etc/systemd/system/mcaptcha.service\u003c/code\u003e:\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003e\u003ccode\u003e[Unit]\nDescription=mCaptcha: a CAPTCHA system that gives attackers a run for their money\n\n[Service]\nType=simple\nUser=mcaptcha\nExecStart=/usr/bin/mcaptcha\nRestart=on-failure\nRestartSec=1\nSuccessExitStatus=3 4\nRestartForceExitStatus=3 4\nSystemCallArchitectures=native\nMemoryDenyWriteExecute=true\nNoNewPrivileges=true\nEnvironment=\u0026quot;RUST_LOG=info\u0026quot;\n\n[Unit]\nAfter=sound.target\nWants=network-online.target\nWants=network-online.target\nRequires=postgresql.service\nAfter=syslog.target\n\n[Install]\nWantedBy=multi-user.target\n\u003c/code\u003e\u003c/pre\u003e\u003col start="2"\u003e\n\u003cli\u003eEnable service:\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003e\u003ccode\u003esudo systemctl daemon-reload \u0026amp;\u0026amp; \\\n sudo systemctl enable mcaptcha \u0026amp;\u0026amp; \\ # Auto startup during boot\n sudo systemctl start mcaptcha\n\u003c/code\u003e\u003c/pre\u003e\u003ch3 id="6-install-and-configure-nginx"\u003e6. Install and configure Nginx\u003c/h3\u003e\n\u003cp\u003emCaptcha doesn\u0026rsquo;t implement SSL yet. Please use a reverse proxy like\nNginx to add SSL to your deployment. Here\u0026rsquo;s an example virtual host\nconfiguration for Nginx:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eserver {\n server_name \u0026lt;your mcaptcha hostname\u0026gt;;\n listen 80;\n listen [::]:80;\n\n location / {\n proxy_pass http://127.0.0.1:\u0026lt;mcaptcha_port\u0026gt;;\n proxy_set_header Host $host;\n proxy_set_header Host $host;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection \u0026quot;upgrade\u0026quot;;\n proxy_set_header X-Forwarded-For $remote_addr;\n proxy_set_header X-Forwarded-Proto $scheme;\n }\n\n}\n\u003c/code\u003e\u003c/pre\u003e'},{id:4,href:"/docs/self-hosting/ansible/",title:"Using Ansible",description:"Deploy mCaptcha software using Ansible playbooks",content:'\u003cp\u003eAnsible playbooks to install mCaptcha are available \u003ca href="https://git.batsense.net/mCaptcha/iac"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\u003ch2 id="instructions"\u003eInstructions\u003c/h2\u003e\n\u003ch3 id="installation"\u003eInstallation\u003c/h3\u003e\n\u003col\u003e\n\u003cli\u003eClone the repository:\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003egit clone https://git.batsense.net/mCaptcha/iac \u003cspan style="color:#ff79c6"\u003e\u0026amp;\u0026amp;\u003c/span\u003e \u003cspan style="color:#8be9fd;font-style:italic"\u003ecd\u003c/span\u003e iac\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003col start="2"\u003e\n\u003cli\u003e\n\u003cp\u003eCreate inventory file. You should have SSH access to the remote\nmachine, and the user must have \u003ccode\u003esudo\u003c/code\u003e privileges. Example inventory\nfile:\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-ini" data-lang="ini"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e[mcaptcha_hosts]\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003e\u003cspan style="color:#50fa7b"\u003e\u0026#34;mcaptcha_hosts\u0026#34;\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e3\u003c/span\u003e\u003cspan style="color:#50fa7b"\u003e\u0026lt;node name\u0026gt; ansible_host\u003c/span\u003e\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003e\u003cspan style="color:#f1fa8c"\u003e\u0026lt;node IP\u0026gt; ansible_user=\u0026lt;remote username\u0026gt;\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eIt is important that the group name be \u003ccode\u003emcaptcha_hosts\u003c/code\u003e.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eConfigure installation by editing \u003ca href="https://git.batsense.net/mCaptcha/iac/src/branch/master/ansible/vars/mcaptcha/vars.yml"\u003eansible/vars/mcaptcha/vars.yml\u003c/a\u003e. Most parameters have defaults, and the required parameters are annotated.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eRun playbook:\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003e ansible-playbook -i path/to/inventory-file -f \u003cspan style="color:#bd93f9"\u003e10\u003c/span\u003e ./ansible/mcaptcha.yml\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id="update"\u003eUpdate\u003c/h3\u003e\n\u003col\u003e\n\u003cli\u003ePull changes from Git repository\u003c/li\u003e\n\u003cli\u003eRerun playbook\u003c/li\u003e\n\u003c/ol\u003e\n'},{id:5,href:"/docs/self-hosting/docker/",title:"Using Docker",description:"Deploy mCaptcha using docker",content:'\u003ch2 id="with-docker"\u003eWith Docker\u003c/h2\u003e\n\u003ch3 id="1-configure"\u003e1. Configure\u003c/h3\u003e\n\u003cp\u003emcaptcha is highly configurable.\u003c/p\u003e\n\u003cp\u003eConfiguration is applied/merged in the following order:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003epath to configuration file passed in via \u003ccode\u003eMCAPTCHA_CONFIG\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e./config/default.toml\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003e/etc/mcaptcha/config.toml\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eenvironment variables.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eSee\n\u003ca href="https://github.com/mCaptcha/mCaptcha/tree/master/docs/CONFIGURATION.md"\u003eCONFIGURATION.md\u003c/a\u003e\nfor configurable options.\u003c/p\u003e\n\u003ch3 id="2-run-image"\u003e2. Run image\u003c/h3\u003e\n\u003cp\u003eIf you have already have a Postgres instance running, then:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003edocker run -p \u0026lt;host-machine-port\u0026gt;:\u0026lt;port-in-configuration-file\u0026gt; \\\n --add-host=database:\u0026lt;database-ip-addrss\u0026gt; \\\n -e RUST_LOG=debug \\\n -e DATABASE_URL=\u0026quot;postgres://\u0026lt;db-user\u0026gt;:\u0026lt;db-password\u0026gt;@database:\u0026lt;db-port\u0026gt;/\u0026lt;db-name\u0026gt;\u0026quot; \\\n mcaptcha/mcaptcha:latest\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eIf you don\u0026rsquo;t have a Postgres instance running, you can either install\none using a package manager or launch one with docker.\u003c/p\u003e\n\u003ch2 id="with-docker-compose"\u003eWith docker-compose\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eDownload docker-compose file and the configuration file:\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003e\u003ccode\u003ewget https://raw.githubusercontent.com/mCaptcha/mCaptcha/master/.env.docker-compose\nwget https://raw.githubusercontent.com/mCaptcha/mCaptcha/master/docker-compose.yml\n\u003c/code\u003e\u003c/pre\u003e\u003col start="2"\u003e\n\u003cli\u003e\n\u003cp\u003eConfigure deployment using \u003ccode\u003e.env.docker-compose\u003c/code\u003e environment variable\nfile\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eLaunch containers:\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003e\u003ccode\u003edocker-compose up -d\n\u003c/code\u003e\u003c/pre\u003e\u003col start="4"\u003e\n\u003cli\u003eConfigure SSL using reverse proxy: mCaptcha doesn\u0026rsquo;t support SSL at\nthe moment, so please use a reverse proxy to secure your instance. A\nreference nginx virtual host configuration file is available \u003ca href="../bare-metal/#6-install-and-configure-nginx"\u003ehere\u003c/a\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n'},{id:6,href:"/docs/help/troubleshooting/",title:"Troubleshooting",description:"Solutions to common problems.",content:'\u003ch2 id="q-i-just-setup-an-instance-but-i-am-unable-to-login"\u003eQ: I just setup an instance but I am unable to login\u003c/h2\u003e\n\u003cp\u003emCaptcha by default is configured to server at \u003ccode\u003elocalhost\u003c/code\u003e hostname. If\nthe instance is deployed at another hostname, please try setting\n\u003ccode\u003eMCAPTCHA_SERVER_DOMAIN\u003c/code\u003e environment variable to the hostname at which\nyour instance is deployed or setting the equivalent in config.toml:\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-toml" data-lang="toml"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003e[server]\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003edomain=mydomain\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e'},{id:7,href:"/docs/api/browser/",title:"Browser libraries",description:"API documenttion for mCaptcha WASM library",content:'\u003cp\u003eThe browser part of mCaptcha is divided into three components.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eGlue code\u003c/li\u003e\n\u003cli\u003eWidget program\u003c/li\u003e\n\u003cli\u003eProof-of-Work libraries(WebAssembly and JavaScript polyfill)\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id="glue-code"\u003eGlue code\u003c/h2\u003e\n\u003cp\u003eThis is the code that links mCaptcha with your website\u0026rsquo;s frontend code.\nIt creates an \u003ccode\u003eiframe\u003c/code\u003e containing the mCaptcha widget and injects the\nreceived verification proof token into a hidden input field.\u003c/p\u003e\n\u003cp\u003eSupport is available for various frameworks, see\n\u003ca href="https://github.com/mCaptcha/glue"\u003e\u003ccode\u003emCaptcha/glue\u003c/code\u003e\u003c/a\u003e for the full list.\u003c/p\u003e\n\u003cp\u003eFor frameworks without official support, a low-level library,\n\u003ca href="https://www.npmjs.com/package/@mcaptcha/core-glue"\u003e\u003ccode\u003e@mcaptcha/core-glue\u003c/code\u003e\u003c/a\u003e,\ncan be used to implement support.\u003c/p\u003e\n\u003ch2 id="widget-program"\u003eWidget Program\u003c/h2\u003e\n\u003cp\u003eThis part is served by the mCaptcha backend. It fetches PoW config from\nthe backend, generates proof and submits it for verification. If\nverification is successful, it sends a message containing the\nverification proof token to the parent window, assuming it\u0026rsquo;s loaded as\nan \u003ccode\u003eiframe\u003c/code\u003e.\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eSource code:\n\u003ca href="https://github.com/mCaptcha/mCaptcha/tree/master/templates/widget"\u003e\u003ccode\u003emCaptcha/mCaptcha/templates/widget\u003c/code\u003e\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eWebAssembly library which generates Proofs of Work for mCaptcha systems.\u003c/p\u003e\n\u003ch2 id="proof-of-workpow-library"\u003eProof-of-Work(PoW) library\u003c/h2\u003e\n\u003cp\u003eWebAssembly bindings(\u003ca href="https://github.com/mCaptcha/pow_wasm"\u003e\u003ccode\u003emCaptcha/pow_wasm\u003c/code\u003e\u003c/a\u003e) are available for the main rust library(\u003ca href="https://github.com/mCaptcha/pow_sha256"\u003e\u003ccode\u003emCaptcha/pow_sha256\u003c/code\u003e\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eFor browsers without support WebAssembly, a\npolyfill(\u003ca href="https://github.com/mCaptcha/pow_sha256-polyfill"\u003e\u003ccode\u003epow_sha256-polyfill\u003c/code\u003e\u003c/a\u003e)\nis available.\u003c/p\u003e\n'},{id:8,href:"/docs/api/mcaptcha-system/",title:"mCaptcha System Library",description:"API documenttion for the core Library used in mCaptcha",content:'\u003cp\u003eDocumentation for the library used in mCaptcha core.\u003c/p\u003e\n\u003ch2 id="versions"\u003eVersions\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href="https://mcaptcha.github.io/mCaptcha/m_captcha/index.html"\u003emaster-branch\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href="/api-docs/m_captcha/0.1.3/m_captcha/index.html"\u003e0.1.3\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href="/api-docs/m_captcha/0.1.2/m_captcha/index.html"\u003e0.1.2\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href="/api-docs/m_captcha/0.1.1/m_captcha/index.html"\u003e0.1.1\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href="/api-docs/m_captcha/0.1.0/m_captcha/index.html"\u003e0.1.0\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n'},{id:9,href:"/docs/api/pow-sha256/",title:"pow_sha256",description:"API documenttion for PoW Library used in mCaptcha",content:'\u003cp\u003eRust crate which generates SHA256 Proofs of Work on serializable datatypes.\u003c/p\u003e\n\u003cp\u003eThis is a fork of the \u003ca href="https://github.com/bddap/pow"\u003e\u003ccode\u003epow\u003c/code\u003e library\u003c/a\u003e by\n\u003ca href="https://github.com/robkorn/pow_sha256"\u003e@robkorn\u003c/a\u003e) with some new\nadditions. Primary of these being:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003ePoW datatype now offers a constructor\u003c/li\u003e\n\u003cli\u003eSalt is no longer hard coded into the library, users can provide\nunique salts.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eOther small changes have also been included of various importance but\nmostly just stylistic/ease of use improvements.\u003c/p\u003e\n\u003ch2 id="versions"\u003eVersions\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href="https://mcaptcha.github.io/pow_sha256/pow_sha256/index.html"\u003emaster-branch\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href="/api-docs/pow_sha256/0.2.1/pow_sha256/index.html"\u003e0.2.1\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href="/api-docs/pow_sha256/0.2.0/pow_sha256/index.html"\u003e0.2.0\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href="/api-docs/pow_sha256/0.1.0/pow_sha256/index.html"\u003e0.1.0\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id="changelog"\u003eChangelog\u003c/h2\u003e\n\u003cp\u003eChangelog is available at the project\u0026rsquo;s\n\u003ca href="https://github.com/mCaptcha/pow_sha256/blob/master/CHANGELOG.md"\u003erepository\u003c/a\u003e\u003c/p\u003e\n'},{id:10,href:"/docs/help/faq/",title:"FAQ",description:"Answers to frequently asked questions.",content:"\u003cp\u003eComing soon\u003c/p\u003e\n"},{id:11,href:"/docs/user-manual/cli/",title:"CLI tool",description:"Instructions to install mCaptcha CLI",content:'\u003cp\u003eA CLI tool exists to compute mCaptcha challenges. It can be installed\nfrom multiple sources:\u003c/p\u003e\n\u003ch2 id="install"\u003eInstall\u003c/h2\u003e\n\u003ch3 id="cratesio"\u003ecrates.io\u003c/h3\u003e\n\u003cp\u003eThe CLI tool is available on, \u003ca href="https://crates.io"\u003ecrates.io\u003c/a\u003e, the Rust\nlanguage\u0026rsquo;s package registry. Rust language toolchain is required to\ninstall from crates.io, please see \u003ca href="https://rustup.rs"\u003erustup.rs\u003c/a\u003e for\nInstructions to install it.\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003ecargo install mcaptcha-cli\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id="pre-compiled-binaries"\u003ePre-compiled binaries\u003c/h3\u003e\n\u003cp\u003eNightly builds and stable releases are regularly published to\n\u003ca href="https://dl.mcaptcha.org/mcaptcha/cli"\u003edl.mcaptcha.org\u003c/a\u003e for a variety of\nCPU architectures and operating systems.\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eDownload binary, checksum and GPG signature files\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003ewget https://dl.mcaptcha.org/mcaptcha/cli/\u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eVERSION\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e/\u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eFILENAME\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e.tar.gz\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003ewget https://dl.mcaptcha.org/mcaptcha/cli/\u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eVERSION\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e/\u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eFILENAME\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e.tar.gz.asc\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e3\u003c/span\u003ewget https://dl.mcaptcha.org/mcaptcha/cli/\u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eVERSION\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e/\u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eFILENAME\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e.tar.gz.sha256\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003col start="2"\u003e\n\u003cli\u003eVerify checksum\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003esha256sum -c \u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eFILENAME\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e.tar.gz.sha256\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003col start="3"\u003e\n\u003cli\u003eDownload mCaptcha\u0026rsquo;s GPG release keys and verify GPG signature\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003egpg --keyserver keyserver.ubuntu.com --recv 73DAC973A9ADBB9ADCB5CDC4595A08135BA9FF73\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003egpg --verify \u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eFILENAME\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e.tar.gz.asc\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003col start="4"\u003e\n\u003cli\u003eInstall Binary\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003etar -xvzf \u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eFILENAME\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e.tar.gz \u003cspan style="color:#ff79c6"\u003e\u0026amp;\u0026amp;\u003c/span\u003e sudo cp \u003cspan style="color:#ff79c6"\u003e{\u003c/span\u003eFILENAME\u003cspan style="color:#ff79c6"\u003e}\u003c/span\u003e/mcaptcha-cli /usr/local/bin\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id="build-from-source"\u003eBuild from source\u003c/h3\u003e\n\u003col\u003e\n\u003cli\u003eInstall Rust tool chain\nPlease see \u003ca href="https://rustup.rs"\u003ehere\u003c/a\u003e for instructions.\u003c/li\u003e\n\u003cli\u003eDownload source code\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003egit clone https://git.batsense.net/mCaptcha/cli\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003col start="3"\u003e\n\u003cli\u003eCompile and install\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003ecargo build --release \u003cspan style="color:#ff79c6"\u003e\u0026amp;\u0026amp;\u003c/span\u003e sudp cp ./target/release/mcaptcha-cli\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003e/usr/local/bin\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch2 id="pass-mcaptcha-challenge"\u003ePass mCaptcha challenge\u003c/h2\u003e\n\u003cp\u003eThe CLI tool requires details about the challenge to work on it. The\ntool can be used in three different modes compute challenge:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eProtected Page: Compute mCaptcha challenge for the CAPTCHA at a\nprotected page\u003c/li\u003e\n\u003cli\u003eWidget URL: Compute PoW for captcha at widget URL\u003c/li\u003e\n\u003cli\u003e(Developer mode) Offline: Computes PoW over given CAPTCHA parameters\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch3 id="from-protected-page-url"\u003eFrom protected page URL\u003c/h3\u003e\n\u003cp\u003eThe most convenient mode: copy the URL of the webpage which has the\nmCaptcha widget (example: showcase.mcaptcha.org) and run the CLI tool\nwith it to get an authorization code:\nCompute challenge using the URL\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003e03:39 atm@lab cli ±|feat-parse-webpage ✗|→ mcaptcha-cli protected-page https://showcase.mcaptcha.org/\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003eAuthorization token: eRAZJiMrW58uDYA1s64Tmwq1u30HutuF\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id="widget-url"\u003eWidget URL\u003c/h3\u003e\n\u003cp\u003eIf you have the widget URL (will be in format https://mcaptcha.example.org/widget?sitekey=randomstring), it can be used to solve challenge as well:\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003eCompute PoW by fetching parameters from CAPTCHA URL\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e3\u003c/span\u003eUsage: mcaptcha-cli online --url \u0026lt;URL\u0026gt;\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e4\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e5\u003c/span\u003eOptions:\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e6\u003c/span\u003e -u, --url \u0026lt;URL\u0026gt; URL of the CAPTCHA. Example: https://example.org/widget?sitekey\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003efoo\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e7\u003c/span\u003e -h, --help Print \u003cspan style="color:#8be9fd;font-style:italic"\u003ehelp\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eExample usage:\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003e13:32 atm@lab cli ±|online ✗|→ mcaptcha-cli online -u https://demo.mcaptcha.org/widget?sitekey\u003cspan style="color:#ff79c6"\u003e=\u003c/span\u003epHy0AktWyOKuxZDzFfoaewncWecCHo23\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003eAuthorization token: 3xleN26OctBuVu3X4t6CYyUjErhaxQvz\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003ch3 id="developer-mode-offline"\u003e[Developer mode] Offline\u003c/h3\u003e\n\u003cp\u003eUseful while debugging mCaptcha configurations, works on raw challenge\nparameters.\u003c/p\u003e\n\u003cp\u003eHelp menu:\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003eCompute PoW with offline parameters\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e3\u003c/span\u003eUsage: mcaptcha-cli offline --salt \u0026lt;SALT\u0026gt; --phrase \u0026lt;PHRASE\u0026gt; --difficulty-factor \u0026lt;DIFFICULTY_FACTOR\u0026gt;\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e4\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e5\u003c/span\u003eOptions:\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e6\u003c/span\u003e -s, --salt \u0026lt;SALT\u0026gt; Salt with which PoW should be computed\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e7\u003c/span\u003e -p, --phrase \u0026lt;PHRASE\u0026gt; Phrase over which PoW should be computed\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e8\u003c/span\u003e -d, --difficulty-factor \u0026lt;DIFFICULTY_FACTOR\u0026gt; Difficulty Factor\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e9\u003c/span\u003e -h, --help Print \u003cspan style="color:#8be9fd;font-style:italic"\u003ehelp\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eExample usage:\u003c/p\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003e13:28 atm@lab cli ±|online|→ mcaptcha-cli offline -s \u003cspan style="color:#ff79c6"\u003e$(\u003c/span\u003erand 32\u003cspan style="color:#ff79c6"\u003e)\u003c/span\u003e -p \u003cspan style="color:#ff79c6"\u003e$(\u003c/span\u003erand 32\u003cspan style="color:#ff79c6"\u003e)\u003c/span\u003e -d \u003cspan style="color:#bd93f9"\u003e50000\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e2\u003c/span\u003edifficulty: \u003cspan style="color:#bd93f9"\u003e50000\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e3\u003c/span\u003enonce: \u003cspan style="color:#bd93f9"\u003e90507\u003c/span\u003e\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e4\u003c/span\u003eoriginal phrase: f351f333d44b2c6b5bf7f033b065bbb8fb5e9dd153bd402e43ed04425f5a3859\n\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e5\u003c/span\u003eresult: \u003cspan style="color:#bd93f9"\u003e340276562956196291522979356090220150471\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eWhere rand is \u003ca href="https://github.com/realaravinth/dotfiles/blob/6fc6c87cc912e17488a35c0d3327ecf393221270/scripts/rand#L20"\u003ethis\u003c/a\u003e script.\u003c/p\u003e\n'},{id:12,href:"/docs/user-manual/how-to-mcaptcha-without-js/",title:"Use mCaptcha without JavaScript",description:"Instructions to solve mCaptcha with JavaScript disabled",content:'\u003cp\u003eTo use mCaptcha without JavaScript:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eInstall mCaptcha CLI too. Please see \u003ca href="./cli"\u003ehere\u003c/a\u003e for instructions.\u003c/li\u003e\n\u003cli\u003eCopy the URL of the protected page\u003c/li\u003e\n\u003cli\u003eRun mCaptcha CLI with that URL:\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class="highlight"\u003e\u003cpre style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4"\u003e\u003ccode class="language-bash" data-lang="bash"\u003e\u003cspan style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"\u003e1\u003c/span\u003emcapthca-cli protected-page \u0026lt;URL\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003col start="4"\u003e\n\u003cli\u003eCopy authorization code and paste it in the form\u003c/li\u003e\n\u003c/ol\u003e\n'},{id:13,href:"/docs/user-manual/",title:"User Manual",description:"Introduction to mCaptcha for users",content:""},{id:14,href:"/docs/webmasters/terminology/",title:"Terminology",description:"Information about terminology used in mCaptcha, some of which unique to the project",content:'\u003ch2 id="authorization-token"\u003eAuthorization token\u003c/h2\u003e\n\u003cp\u003eWhen a visitor solves the CAPTCHA and sends their solution to an\nmCaptcha instance, the solution will be verified for correctness. If the\nsolution is correct, mCaptcha will return a single use authorization token.\u003c/p\u003e\n\u003cp\u003eThis authorization token should be attached to the visitor\u0026rsquo;s requited to the\nprotected service and the protected service should validity of the\nauthorization token with the mCaptcha instance and only allow authorization to\nprotected resource if the authorization token is valid.\u003c/p\u003e\n\u003ch2 id="cooldown-period"\u003eCooldown Period\u003c/h2\u003e\n\u003cp\u003emCaptcha implements leaky bucket algorithm to measure\ncurrent traffic levels. Cooldown period specifies the leak or the time\nafter which a visitor addition is decremented.\u003c/p\u003e\n\u003cp\u003eFor instance, if initial traffic level is 0 and a user visits one\nsecond later, the traffic level will be incremented to 1. Now, if the\ncooldown period is set to 30 seconds, the traffic level will be\ndecremented after 30 seconds. So after 30 seconds, the traffic level will\ngo from 1 to 0.\u003c/p\u003e\n\u003ch2 id="difficulty-factor"\u003eDifficulty Factor\u003c/h2\u003e\n\u003cp\u003eDifficulty factor determines the time it takes to solve a CAPTCHA. The\nhigher the difficulty factor, the longer it will take to generate a\nproof of work for it to solve the CAPTCHA.\u003c/p\u003e\n\u003cp\u003emCaptcha\u0026rsquo;s proof of work based mechanism makes it highly accessible to\npeople with special needs but it is important to choose the difficulty factor\nwith care as very high difficulty factors will make the CAPTCHA\ninaccessible to users on slow devices.\u003c/p\u003e\n\u003ch2 id="sitekey"\u003eSitekey\u003c/h2\u003e\n\u003cp\u003eSite key is a unique identifier associated with CAPTCHA configurations\ncreated on mCaptcha. It is required to integrate a CAPTCHA with your\nwebsite.\u003c/p\u003e\n\u003ch2 id="visitor-threshold"\u003eVisitor Threshold\u003c/h2\u003e\n\u003cp\u003emCaptcha\u0026rsquo;s variable difficulty factor mechanism requires a website\u0026rsquo;s traffic\nstatistics be split into levels, so that it can deploy the right\ndifficulty factor for each level.\u003c/p\u003e\n\u003cp\u003eVisitor threshold is used to traffic into levels and mCaptcha accepts a\ndifficulty configuration for each of these levels. When current traffic\nexceeds a difficulty factor, mCaptcha will increase the difficulty\nfactor to the next configured level.\u003c/p\u003e\n\u003cp\u003eFor instance, consider the configuration given below:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eCool down period: 30 seconds\u003c/li\u003e\n\u003c/ul\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eLevel\u003c/th\u003e\n\u003cth\u003eDifficulty Factor\u003c/th\u003e\n\u003cth\u003eVisitor Threshold\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e1\u003c/td\u003e\n\u003ctd\u003e5,000\u003c/td\u003e\n\u003ctd\u003e2,000\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e2\u003c/td\u003e\n\u003ctd\u003e50,000\u003c/td\u003e\n\u003ctd\u003e5,000\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e3\u003c/td\u003e\n\u003ctd\u003e500,000\u003c/td\u003e\n\u003ctd\u003e10,000\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e4\u003c/td\u003e\n\u003ctd\u003e5,000,000\u003c/td\u003e\n\u003ctd\u003e15,000\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eIf the website sees 2,000 requests in a 30 second window, level 1\ndifficulty factor(5,000) will be deployed. If the traffic increases to\n5,000 requests in a 30 second window, then difficulty factor will be\nupgraded to level 2(50,000). Likewise 10,000 and 15,000 requests over 30\nseconds will result in difficulty factor being upgraded to 500,000 and\n5,000,000 respectively.\u003c/p\u003e\n\u003cp\u003eVisitor threshold is how mCaptcha determines which difficulty factor\nlevel to deploy. mCaptcha uses leaky bucket algorithm to keep the\nvisitor threshold constantly updated within the configured cool down\nperiod. So, at any given moment the, the current visitor level will be\nthe amount of traffic that was served in the cool down period specified.\u003c/p\u003e\n'},{id:15,href:"/docs/webmasters/faq/",title:"Webmasters FAQ",description:"Frequently asked questions related to using mCaptcha as a webmaster",content:'\u003ch3 id="easy-mode-default-cooldown-period"\u003eEasy Mode: Default cooldown period\u003c/h3\u003e\n\u003cp\u003eWhen configuring mCaptcha in \u003ca href="/docs/webmasters/configuring-difficulty-factor/#easy-option"\u003eeasy mode\u003c/a\u003e, the default cooldown period is set to 30 seconds.\u003c/p\u003e\n\u003ch2 id="how-to-get-site-key-from-dashboard"\u003eHow to get site key from dashboard?\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eGo to \u0026ldquo;Site keys\u0026rdquo; on the side panel in the dashboard\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv align=center\u003e\n\u003cfigure\u003e\n \u003cimg class="img-fluid lazyload blur-up" data-sizes="auto" src="/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_20x0_resize_box_2.png" data-srcset="/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_800x0_resize_box_2.png 800w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_700x0_resize_box_2.png 700w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_600x0_resize_box_2.png 600w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_500x0_resize_box_2.png 500w" width="222" height="496" alt="Site key menu option on the dashboard, encircled in red."\u003e\n \u003cnoscript\u003e\u003cimg class="img-fluid" sizes="100vw" srcset="/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_800x0_resize_box_2.png 800w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_700x0_resize_box_2.png 700w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_600x0_resize_box_2.png 600w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_500x0_resize_box_2.png 500w" src="/docs/webmasters/faq/sitekey-in-dashboard-sidepanel.png" width="222" height="496" alt="Site key menu option on the dashboard, encircled in red."\u003e\u003c/noscript\u003e\n\u003c/figure\u003e\n\u003c/div\u003e\n\u003col start="2"\u003e\n\u003cli\u003eclick on the clipboard button to copy the site key to your\nclipboard.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cfigure\u003e\n \u003cimg class="img-fluid lazyload blur-up" data-sizes="auto" src="/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_20x0_resize_box_2.png" data-srcset="/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_900x0_resize_box_2.png 900w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_800x0_resize_box_2.png 800w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_700x0_resize_box_2.png 700w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_600x0_resize_box_2.png 600w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_500x0_resize_box_2.png 500w" width="1825" height="831" alt="Copy site key to clipboard. Clipboard button is highlighted in the photo"\u003e\n \u003cnoscript\u003e\u003cimg class="img-fluid" sizes="100vw" srcset="/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_900x0_resize_box_2.png 900w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_800x0_resize_box_2.png 800w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_700x0_resize_box_2.png 700w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_600x0_resize_box_2.png 600w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_500x0_resize_box_2.png 500w" src="/docs/webmasters/faq/copy-sitekey.png" width="1825" height="831" alt="Copy site key to clipboard. Clipboard button is highlighted in the photo"\u003e\u003c/noscript\u003e\n\u003c/figure\u003e\n'},{id:16,href:"/docs/help/",title:"Help",description:"Help mCaptcha.",content:""},{id:17,href:"/docs/webmasters/",title:"Webmasters",description:"Introduction to mCaptcha for webmasters",content:""},{id:18,href:"/docs/api/",title:"API",description:"Documentation for libraries used in mCaptcha",content:""},{id:19,href:"/docs/",title:"mCaptcha",description:"Docs mCaptcha",content:""},{id:20,href:"/docs/self-hosting/",title:"Self-Hosting",description:"Instructions to self-host mCaptcha",content:""}];b.add(c),userinput.addEventListener('input',e,!0),suggestions.addEventListener('click',f,!0);function e(){var g=this.value,e=b.search(g,5),f=suggestions.childNodes,h=0,i=e.length,c;for(suggestions.classList.remove('d-none'),e.forEach(function(b){c=document.createElement('div'),c.innerHTML='<a href><span></span><span></span></a>',a=c.querySelector('a'),t=c.querySelector('span:first-child'),d=c.querySelector('span:nth-child(2)'),a.href=b.href,t.textContent=b.title,d.textContent=b.description,suggestions.appendChild(c)});f.length>i;)suggestions.removeChild(f[h])}function f(){while(suggestions.lastChild)suggestions.removeChild(suggestions.lastChild);return!1}})()