2023-10-27 21:41:33 +05:30
var suggestions = document . getElementById ( "suggestions" ) , userinput = document . getElementById ( "userinput" ) ; document . addEventListener ( "keydown" , inputFocus ) ; function inputFocus ( e ) { e . keyCode === 191 && ( e . preventDefault ( ) , userinput . focus ( ) ) , e . keyCode === 27 && ( userinput . blur ( ) , suggestions . classList . add ( "d-none" ) ) } document . addEventListener ( "click" , function ( e ) { var t = suggestions . contains ( e . target ) ; t || suggestions . classList . add ( "d-none" ) } ) , document . addEventListener ( "keydown" , suggestionFocus ) ; function suggestionFocus ( e ) { const s = suggestions . querySelectorAll ( "a" ) , o = [ ... s ] , t = o . indexOf ( document . activeElement ) ; let n = 0 ; e . keyCode === 38 ? ( e . preventDefault ( ) , n = t > 0 ? t - 1 : 0 , s [ n ] . focus ( ) ) : e . keyCode === 40 && ( e . preventDefault ( ) , n = t + 1 < o . length ? t + 1 : t , s [ n ] . focus ( ) ) } ( function ( ) { var e = new FlexSearch ( { preset : "score" , cache : ! 0 , doc : { id : "id" , field : [ "title" , "description" , "content" ] , store : [ "href" , "title" , "description" ] } } ) , n = [ { 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 : ` <p>mCaptcha can protect your website from DDoS attacks. In this guide we’ll
explore how to install mCaptcha on your website . The end result will be
something like this , on your website : < / p >
< figure >
< img class = "img-fluid lazyload blur-up" data - sizes = "auto" src = "/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_20x0_resize_box_3.png" data - srcset = "/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_800x0_resize_box_3.png 800w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_700x0_resize_box_3.png 700w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_600x0_resize_box_3.png 600w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_500x0_resize_box_3.png 500w" width = "618" height = "669" alt = "A registration form with mCaptcha widget installed" >
< noscript > < img class = "img-fluid" sizes = "100vw" srcset = "/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_800x0_resize_box_3.png 800w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_700x0_resize_box_3.png 700w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_600x0_resize_box_3.png 600w,/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result_hub39801b2a229b4882fd00c2c83dd77fb_28299_500x0_resize_box_3.png 500w" src = "/docs/webmasters/installing-captcha/mcaptcha-widget-installation-result.png" width = "618" height = "669" alt = "A registration form with mCaptcha widget installed" > < / n o s c r i p t >
< / f i g u r e >
< p > For the purpose of this demo , we will be using
< a href = "https://demo.mcaptcha.org" > demo . mcaptcha . org < / a > , a d e m o i n s t a n c e r u n n i n g
in @ realaravinth & rsquo ; s bedroom ( for this same reason , it shouldn & rsquo ; t be used
for anything serious ) < / p >
< h2 id = "1-create-an-account-and-sign-into-the-mcaptcha-dashboard" > 1. Create an account and sign into the mCaptcha dashboard < / h 2 >
< p > Head over to < a href = "https://demo.mcaptcha.org/join" > demo . mcaptcha . org < / a > a n d
create an account . When ready , sign in . < / p >
< h2 id = "2-create-new-site-key" > 2. Create new site key < / h 2 >
< p > A < a href = "/docs/terminology/sitekey/" > site key < / a > i s h o w a n e w C A P T C H A i s c o n f i g u r e d w i t h i n m C a p t c h a . T o c r e a t e
a new site key , click on & ldquo ; New Site & rdquo ; button in the dashboard . < / p >
< figure >
< img class = "img-fluid lazyload blur-up" data - sizes = "auto" src = "/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_20x0_resize_box_3.png" data - srcset = "/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_900x0_resize_box_3.png 900w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_800x0_resize_box_3.png 800w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_700x0_resize_box_3.png 700w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_600x0_resize_box_3.png 600w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_500x0_resize_box_3.png 500w" width = "1825" height = "857" alt = "mCaptcha dashboard with the 'new site key' button highlighted" >
< noscript > < img class = "img-fluid" sizes = "100vw" srcset = "/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_900x0_resize_box_3.png 900w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_800x0_resize_box_3.png 800w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_700x0_resize_box_3.png 700w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_600x0_resize_box_3.png 600w,/docs/webmasters/installing-captcha/new-sitekey-btn_hu4dc550a2e568d01f004e26fb8eb1b427_65746_500x0_resize_box_3.png 500w" src = "/docs/webmasters/installing-captcha/new-sitekey-btn.png" width = "1825" height = "857" alt = "mCaptcha dashboard with the 'new site key' button highlighted" > < / n o s c r i p t >
< / f i g u r e >
< p > There are two options to create a new site key , easy and advanced . < strong > We
are going to use the easy mode in this tutorial . < / s t r o n g > I f y o u a r e i n t e r e s t e d
in learning more about the advance mode , please see < a href = "/docs/introduction/configuring-difficulty-factor/#advance-option" > here < / a > . < / p >
< blockquote >
< h3 id = "easy-modedocsintroductionconfiguring-difficulty-factoreasy-option" > < a href = "/docs/introduction/configuring-difficulty-factor/#easy-option" > Easy Mode < / a > < / h 3 >
< p > Easy mode asks a few basic statistics about your website and generates a
configuration that should work for your website . Currently , easy mode is
guided by assumptions on suitable difficulty factors to protect a
website but it will be fine - tuned as mCaptcha sees more deployment . < / p >
< p > Configuration generated by easy mode can be tweaked later using the
advance mode , as you become more familiar with how mCaptcha works . < / p >
< / b l o c k q u o t e >
< p > Fill the form and submit it . < / p >
< figure >
< img class = "img-fluid lazyload blur-up" data - sizes = "auto" src = "/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_20x0_resize_box_3.png" data - srcset = "/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_900x0_resize_box_3.png 900w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_800x0_resize_box_3.png 800w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_700x0_resize_box_3.png 700w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_600x0_resize_box_3.png 600w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_500x0_resize_box_3.png 500w" width = "720" height = "452" alt = "mCaptcha dashboard with the 'new site key' form in easy mode, with details filled in" >
< noscript > < img class = "img-fluid" sizes = "100vw" srcset = "/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_900x0_resize_box_3.png 900w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_800x0_resize_box_3.png 800w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_700x0_resize_box_3.png 700w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_600x0_resize_box_3.png 600w,/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled_hu0c237370199481610ab31adaa9c5a5e6_30108_500x0_resize_box_3.png 500w" src = "/docs/webmasters/installing-captcha/new-sitekey-easy-mode-filled.png" width = "720" height = "452" alt = "mCaptcha dashboard with the 'new site key' form in easy mode, with details filled in" > < / n o s c r i p t >
< / f i g u r e >
< h2 id = "3-copy-widget-link" > 3. Copy widget link < / h 2 >
< p > Submitting the form will take you to a page where site key configuration
can be viewed . & ldquo ; View deployment & rdquo ; link will display CAPTCHA widget with
the supplied configuration . Click on it and grab the widget link . < / p >
< h2 id = "4-install-mcaptcha-on-your-website" > 4. Install mCaptcha on your website < / h 2 >
< p > Integration support is available for some frontend JavaScript
frameworks . To see full list of supported frameworks , please see
< a href = "https://github.com/mCaptcha/glue#framework-support" > here < / a > . < / p >
< p > There are two options to use the integration library to integrate
mCaptcha on your website : < / p >
< ol >
< li > Serve the integration library yourself < / l i >
< li > Use a CDN like unpkg . com < / l i >
< / o l >
< p > In this tutorial , we & rsquo ; ll be using the CDN . < / p >
< p > < strong > Pasting the following snippet on the page , within the form < / s t r o n g > t h a t r e q u i r e s t o b e p r o t e c t e d
will load the mCaptcha widget with the configuration supplied . Be sure
to replace < code > Your { { paste your widget link } } < / c o d e > w i t h t h e l i n k o b t a i n e d f r o m
the previous step . < / p >
2023-10-28 03:18:10 +05:30
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-html" data - lang = "html" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > & l t ; < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > l a b e l < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > d a t a - m c a p t c h a _ u r l < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; { { p a s t e y o u r w i d g e t l i n k h e r e } } & # 3 4 ; < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > f o r < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; m c a p t c h a _ _ t o k e n & # 3 4 ; < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > i d < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; m c a p t c h a _ _ t o k e n - l a b e l & # 3 4 ; < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 5 < / s p a n > < s p a n > & g t ;
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 6 < / s p a n > < s p a n > m C a p t c h a a u t h o r i z a t i o n t o k e n .
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 7 < / s p a n > < s p a n > & l t ; < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > a < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 8 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > h r e f < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; h t t p s : / / m c a p t c h a . o r g / d o c s / u s e r - m a n u a l / h o w - t o - m c a p t c h a - w i t h o u t - j s / & # 3 4 ; < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 9 < / s p a n > < s p a n > & g t ; I n s t r u c t i o n s & l t ; / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > a < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 0 < / s p a n > < s p a n > & g t ; .
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 1 < / s p a n > < s p a n > & l t ; < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > i n p u t < / s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > t y p e < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; t e x t & # 3 4 ; < / s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > n a m e < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; m c a p t c h a _ _ t o k e n & # 3 4 ; < / s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > i d < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; m c a p t c h a _ _ t o k e n & # 3 4 ; < / s p a n > / & g t ;
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 2 < / s p a n > < s p a n > & l t ; / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > l a b e l < / s p a n > & g t ;
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 3 < / s p a n > < s p a n > & l t ; < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > d i v < / s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > i d < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; m c a p t c h a _ _ w i d g e t - c o n t a i n e r & # 3 4 ; < / s p a n > & g t ; & l t ; / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > d i v < / s p a n > & g t ;
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 4 < / s p a n > < s p a n > & l t ; < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > s c r i p t < / s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > s r c < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; h t t p s : / / u n p k g . c o m / @ m c a p t c h a / v a n i l l a - g l u e @ 0 . 1 . 0 - r c 2 / d i s t / i n d e x . j s & # 3 4 ; < / s p a n > & g t ; & l t ; / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > s c r i p t < / s p a n > & g t ;
2023-10-27 21:41:33 +05:30
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > A f u l l e x a m p l e i s a v a i l a b l e
< a href = "https://github.com/mCaptcha/glue/blob/ea576d875457de54d82bed3edfc4ee68302fa4d8/packages/vanilla/static/embeded.html" > here < / a > . < / p >
< h2 id = "5-configure-backend-to-authenticate-captcha-tokens" > 5. Configure backend to authenticate CAPTCHA tokens < / h 2 >
< ol >
< li >
< p > Get < a href = "/docs/terminology/access-token" > access token < / a > f r o m t h e u s e r & r s q u o ; s
form submission payload . The access token will be associated with a
parameter called < code > mcaptcha _ _token < / c o d e > . < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-python" data - lang = "python" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > m c a p t c h a _ t o k e n < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > r e q u e s t < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > . < / s p a n > f o r m [ < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; m c a p t c h a _ _ t o k e n & # 3 4 ; < / s p a n > ]
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < / l i >
< li >
< p > Validate access token with mCaptcha instance < / p >
< / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-python" data - lang = "python" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > p a y l o a d < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > {
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; t o k e n & # 3 4 ; < / s p a n > : m c a p t c h a _ t o k e n ,
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; k e y & # 3 4 ; < / s p a n > : m c a p t c h a _ s i t e k e y , < s p a n s t y l e = " c o l o r : # 6 2 7 2 a 4 " > # c a p t c h a s i t e k e y < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 6 2 7 2 a 4 " > # m C a p t c h a a c c o u n t s e c r e t ; a v a i l a b l e i n s e t t i n g s < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 5 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; s e c r e t & # 3 4 ; < / s p a n > : m c a p t c h a _ a c c o u n t _ s e c r e t ,
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 6 < / s p a n > < s p a n > }
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 7 < / s p a n > < s p a n > r e s p < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > r e q u e s t s < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > . < / s p a n > p o s t (
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 8 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; h t t p s : / / d e m o . m c a p t h a . o r g / a p i / v 1 / p o w / s i t e v e r i f y & # 3 4 ; < / s p a n > , j s o n < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > p a y l o a d
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 9 < / s p a n > < s p a n > )
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 0 < / s p a n > < s p a n > r e s p < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > r e s p < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > . < / s p a n > j s o n ( )
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < o l s t a r t = " 3 " >
< li > If access token is valid , allow access to protected resource or deny
access . < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-python" data - lang = "python" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > i f < / s p a n > r e s p [ < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; v a l i d & # 3 4 ; < / s p a n > ] < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = = < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > F a l s e < / s p a n > :
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > r e t u r n < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; i n v a l i d c a p t c h a & # 3 4 ; < / s p a n > , < s p a n s t y l e = " c o l o r : # b d 9 3 f 9 " > 4 0 0 < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > e l s e < / s p a n > :
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > r e t u r n < / s p a n > a l l o w _ a c c e s s _ t o _ p r o t e c t e d _ r e s o u r c e ( r e q u e s t < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > . < / s p a n > f o r m )
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > P l e a s e s e e h e r e f o r a c o m p l e t e < a h r e f = " h t t p s : / / g i t h u b . c o m / m C a p t c h a / d o s / t r e e / 8 f 2 b 5 3 a b 4 6 d 6 4 f a 7 8 a 8 3 0 0 d c 8 c e 9 d 7 8 5 7 8 f f c e 1 2 / s e r v e r " > F l a s k e x a m p l e < / a > a n d h e r e f o r a n < a h r e f = " h t t p s : / / g i t h u b . c o m / m C a p t c h a / d o s / t r e e / 8 f 2 b 5 3 a b 4 6 d 6 4 f a 7 8 a 8 3 0 0 d c 8 c e 9 d 7 8 5 7 8 f f c e 1 2 / r u s t - s e r v e r / d e m o - s e r v e r " > A c t i x
Web example < / a > . < / p >
< p > Congratulations , mCaptcha is now integrated with your website ! < / p >
` },{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: ` < p > mCaptcha is highly responsive to detecting DDoS attacks . Admins are
advised to take advantage of it by setting low < a href = "/docs/terminology/difficulty-factor/" > difficulty
factors < / a > f o r n o r m a l t r a f f i c l e v e l s
for their website . < / p >
< p > < strong > Lowest advisable difficulty factor is 5000. < / s t r o n g > < / p >
< p > For instance , if it is normal for my website to get 2000 requests for
every 30 seconds , I will set a < a href = "/docs/terminology/cooldown-period" > cool
down < / a > p e r i o d o f 3 0 s e c o n d s a n d t h e
first level of difficulty configuration will have a < a href = "/docs/terminology/visitor-threshold" > visitor threshold < / a > o f 2 0 0 0 w i t h a
difficulty factor of 5000. < / p >
< p > There are two modes to setting difficulty factor for your website on
mCaptcha : < / p >
< h3 id = "easy-option" > Easy option < / h 3 >
< p > Easy mode asks a few basic statistics about your website and generates a
configuration that should work for your website . Currently , easy mode is
guided by assumptions on suitable difficulty factors to protect a
website but it will be fine - tuned as mCaptcha sees more deployment . < / p >
< p > Configuration generated by easy mode can be tweaked later using the
advance mode , as you become more familiar with how mCaptcha works . < / p >
< figure >
< img class = "img-fluid lazyload blur-up" data - sizes = "auto" src = "/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_20x0_resize_box_3.png" data - srcset = "/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_900x0_resize_box_3.png 900w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_800x0_resize_box_3.png 800w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_700x0_resize_box_3.png 700w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_600x0_resize_box_3.png 600w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_500x0_resize_box_3.png 500w" width = "720" height = "452" alt = "new sitekey form in easy mode" >
< noscript > < img class = "img-fluid" sizes = "100vw" srcset = "/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_900x0_resize_box_3.png 900w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_800x0_resize_box_3.png 800w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_700x0_resize_box_3.png 700w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_600x0_resize_box_3.png 600w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode_hu3f66189ea53484ac6603a2d78fa015c8_26636_500x0_resize_box_3.png 500w" src = "/docs/webmasters/configuring-difficulty-factor/new-sitekey-easy-mode.png" width = "720" height = "452" alt = "new sitekey form in easy mode" > < / n o s c r i p t >
< / f i g u r e >
< h3 id = "advance-option" > Advance option < / h 3 >
< p > Advance mode gives the admin granular control over how mCaptcha behaves
on their website . It has options to set the difficulty factor for each
level of traffic ( or visitor threshold , in mCaptcha speak ) , fully taking
advantage of mCaptcha & rsquo ; s variable difficulty factor feature . < / p >
< p > For instance , if it is normal for a website to get 200 requests over 30
seconds , then setting a very low difficulty factor for a visitor
threshold of 200 and a cool down period of 30 seconds will allow the
users to pass through without waiting on the CAPTCHA . But if 1000
requests over 30 seconds will bring down the service , then the admin can
configure increasing levels of difficulty factor of increasing traffic
levels , effectively rate limiting its users and protecting the
underlying website . < / p >
< figure >
< img class = "img-fluid lazyload blur-up" data - sizes = "auto" src = "/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_20x0_resize_box_3.png" data - srcset = "/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_900x0_resize_box_3.png 900w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_800x0_resize_box_3.png 800w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_700x0_resize_box_3.png 700w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_600x0_resize_box_3.png 600w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_500x0_resize_box_3.png 500w" width = "720" height = "407" alt = "new sitekey form in advance mode" >
< noscript > < img class = "img-fluid" sizes = "100vw" srcset = "/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_900x0_resize_box_3.png 900w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_800x0_resize_box_3.png 800w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_700x0_resize_box_3.png 700w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_600x0_resize_box_3.png 600w,/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode_huc4867c6295dc4be195d832a52b37239b_23312_500x0_resize_box_3.png 500w" src = "/docs/webmasters/configuring-difficulty-factor/new-sitekey-adv-mode.png" width = "720" height = "407" alt = "new sitekey form in advance mode" > < / n o s c r i p t >
< / f i g u r e >
` },{id:2,href:"/docs/self-hosting/getting-started/",title:"Getting started",description:"Get started with self-hosting mCaptcha",content: ` < h2 id = "get-started" > Get started < / h 2 >
< p > There are two main ways to self - host mCaptcha : < / p >
< ol >
< li > < a href = "./bare-metal" > Bare metal < / a > < / l i >
< li > < a href = "./docker" > With Docker < / a > < / l i >
< / o l >
` },{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: ` < h3 id = "2-configure" > 2. Configure < / h 3 >
< p > mcaptcha is highly configurable . < / p >
< p > Configuration is applied / merged in the following order : < / p >
< ol >
< li > path to configuration file passed in via < code > MCAPTCHA _CONFIG < / c o d e > < / l i >
< li > < code > . / config / default . toml < / c o d e > < / l i >
< li > < code > / e t c / m c a p t c h a / c o n f i g . t o m l < / c o d e > < / l i >
< li > environment variables . < / l i >
< / o l >
< h3 id = "1-install-postgres-if-you-dont-have-it-already" > 1. Install postgres if you don & rsquo ; t have it already . < / h 3 >
< p > For Debian based distributions : < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > s u d o a p t i n s t a l l p o s t g r e s
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " 2 - c r e a t e - n e w - u s e r - f o r - r u n n i n g - m c a p t c h a " > 2 . C r e a t e n e w u s e r f o r r u n n i n g < c o d e > m c a p t c h a < / c o d e > < / h 3 >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > $ s u d o u s e r a d d - b / s r v - m - s / u s r / b i n / z s h m c a p t c h a
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " 3 - c r e a t e - n e w - u s e r - i n - p o s t g r e s " > 3 . C r e a t e n e w u s e r i n P o s t g r e s < / h 3 >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > $ s u d o - i u p o s t g r e s < s p a n s t y l e = " c o l o r : # 6 2 7 2 a 4 " > # s w i t c h t o \ ` p o s t g r e s \ ` u s e r < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > $ p s q l
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 8 b e 9 f d ; f o n t - s t y l e : i t a l i c " > p o s t g r e s < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # 6 2 7 2 a 4 " > # C R E A T E U S E R m c a p t c h a W I T H P A S S W O R D & # 3 9 ; m y s u p e r l o n g p a s s w o r d a n d y e s y o u n e e d s i n g l e q u o t e \ ` ; < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > $ c r e a t e d b - O m c a p t c h a m c a p t c h a < s p a n s t y l e = " c o l o r : # 6 2 7 2 a 4 " > # c r e a t e d b & # 3 9 ; m c a p t c h a & # 3 9 ; w i t h & # 3 9 ; m c a p t c h a & # 3 9 ; a s o w n e r < / s p a n >
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " 4 - i n s t a l l - a n d - l o a d - m c a p t c h a c a c h e h t t p s g i t h u b c o m m c a p t c h a c a c h e - m o d u l e " > 4 . I n s t a l l a n d l o a d < a h r e f = " h t t p s : / / g i t h u b . c o m / m C a p t c h a / c a c h e " > < c o d e > m C a p t c h a / c a c h e < / c o d e > < / a > m o d u l e : < / h 3 >
< p > See < a href = "https://github.com/mCaptcha/cache" > < code > mCaptcha / cache < / c o d e > < / a > f o r m o r e
details . < / p >
< h3 id = "4-build-mcaptcha" > 4. Build < code > mcaptcha < / c o d e > < / h 3 >
< p > To build < code > mcaptcha < / c o d e > , y o u n e e d t h e f o l l o w i n g d e p e n d e n c i e s : < / p >
< ol >
< li > rust < / l i >
< li > node ( < code > v14 . 16.0 < / c o d e > ) < / l i >
< li > yarn ( JavaScript package manager ) < / l i >
< li > make < / l i >
< / o l >
< h2 id = "how-to-build" > How to build < / h 2 >
< ol >
< li > Install Cargo using < a href = "https://rustup.rs/" > rustup < / a > w i t h : < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > $ c u r l - - p r o t o < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 9 ; = h t t p s & # 3 9 ; < / s p a n > - - t l s v 1 . 2 - s S f h t t p s : / / s h . r u s t u p . r s | s h
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < o l s t a r t = " 2 " >
< li >
< p > Install node ( < code > v14 . 16.0 < / c o d e > ) < / p >
< / l i >
< li >
< p > Install yarn ( JavaScript package manager ) < / p >
< / l i >
< li >
< p > Build with make : < / p >
< / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > $ m a k e d e v - e n v < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > & a m p ; & a m p ; < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > m a k e r e l e a s e
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " 5 - i n s t a l l - p a c k a g e " > 5 . I n s t a l l p a c k a g e : < / h 3 >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > $ s u d o c p . / t a r g e t / r e l e a s e / m c a p t c h a / u s r / b i n / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > & a m p ; & a m p ; < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > m k d i r s u d o / e t c / m c a p t c h a < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > & a m p ; & a m p ; < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > s u d o c p c o n f i g / d e f a u l t . t o m l / e t c / m c a p t c h a / c o n f i g . t o m l
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " 6 - s y s t e m d - s e r v i c e - c o n f i g u r a t i o n " > 6 . S y s t e m d s e r v i c e c o n f i g u r a t i o n : < / h 3 >
< ol >
< li > Copy the following to < code > / e t c / s y s t e m d / s y s t e m / m c a p t c h a . s e r v i c e < / c o d e > : < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-systemd" data - lang = "systemd" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > [ U n i t ] < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > D e s c r i p t i o n < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > m C a p t c h a : a C A P T C H A s y s t e m t h a t g i v e s a t t a c k e r s a r u n f o r t h e i r m o n e y < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > [ S e r v i c e ] < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 5 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > T y p e < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > s i m p l e < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 6 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > U s e r < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > m c a p t c h a < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 7 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > E x e c S t a r t < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > / u s r / b i n / m c a p t c h a < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 8 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > R e s t a r t < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > o n - f a i l u r e < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 9 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > R e s t a r t S e c < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > 1 < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 0 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > S u c c e s s E x i t S t a t u s < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > 3 4 < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 1 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > R e s t a r t F o r c e E x i t S t a t u s < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > 3 4 < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > S y s t e m C a l l A r c h i t e c t u r e s < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > n a t i v e < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > M e m o r y D e n y W r i t e E x e c u t e < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > t r u e < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 4 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > N o N e w P r i v i l e g e s < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > t r u e < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 5 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > E n v i r o n m e n t < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; R U S T _ L O G = i n f o & # 3 4 ; < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 6 < / s p a n > < s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 7 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > [ U n i t ] < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 8 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > A f t e r < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > s o u n d . t a r g e t < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 1 9 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > W a n t s < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > n e t w o r k - o n l i n e . t a r g e t < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 0 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > W a n t s < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > n e t w o r k - o n l i n e . t a r g e t < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 1 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > R e q u i r e s < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > p o s t g r e s q l . s e r v i c e < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > A f t e r < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > s y s l o g . t a r g e t < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 3 < / s p a n > < s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 4 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > [ I n s t a l l ] < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 5 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 5 0 f a 7 b " > W a n t e d B y < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > m u l t i - u s e r . t a r g e t < / s p a n >
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < o l s t a r t = " 2 " >
< li > Enable service : < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > $ s u d o s y s t e m c t l d a e m o n - r e l o a d < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > & a m p ; & a m p ; < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > s u d o s y s t e m c t l < s p a n s t y l e = " c o l o r : # 8 b e 9 f d ; f o n t - s t y l e : i t a l i c " > e n a b l e < / s p a n > m c a p t c h a < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > & a m p ; & a m p ; < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \ < / s p a n > < s p a n s t y l e = " c o l o r : # 6 2 7 2 a 4 " > # A u t o s t a r t u p d u r i n g b o o t < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > s u d o s y s t e m c t l s t a r t m c a p t c h a
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ ` \ ` < / s p a n >
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > ` } , { i d : 4 , h r e f : " / d o c s / s e l f - h o s t i n g / d o c k e r / " , t i t l e : " U s i n g D o c k e r " , d e s c r i p t i o n : " D e p l o y m C a p t c h a u s i n g d o c k e r " , c o n t e n t : ` < h 2 i d = " w i t h - d o c k e r " > W i t h D o c k e r < / h 2 >
< h3 id = "1-configure" > 1. Configure < / h 3 >
< p > mcaptcha is highly configurable . < / p >
< p > Configuration is applied / merged in the following order : < / p >
< ol >
< li > path to configuration file passed in via < code > MCAPTCHA _CONFIG < / c o d e > < / l i >
< li > < code > . / config / default . toml < / c o d e > < / l i >
< li > < code > / e t c / m c a p t c h a / c o n f i g . t o m l < / c o d e > < / l i >
< li > environment variables . < / l i >
< / o l >
< p > See
< a href = "https://github.com/mCaptcha/mCaptcha/tree/master/docs/CONFIGURATION.md" > CONFIGURATION . md < / a >
for configurable options . < / p >
< h3 id = "2-run-image" > 2. Run image < / h 3 >
< p > If you have already have a Postgres instance running , then : < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > d o c k e r r u n - p & l t ; h o s t - m a c h i n e - p o r t & g t ; : & l t ; p o r t - i n - c o n f i g u r a t i o n - f i l e & g t ; < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > - - a d d - h o s t < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > d a t a b a s e : & l t ; d a t a b a s e - i p - a d d r s s & g t ; < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > - e < s p a n s t y l e = " c o l o r : # 8 b e 9 f d ; f o n t - s t y l e : i t a l i c " > R U S T _ L O G < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > d e b u g < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > - e < s p a n s t y l e = " c o l o r : # 8 b e 9 f d ; f o n t - s t y l e : i t a l i c " > D A T A B A S E _ U R L < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > & # 3 4 ; p o s t g r e s : / / & l t ; d b - u s e r & g t ; : & l t ; d b - p a s s w o r d & g t ; @ d a t a b a s e : & l t ; d b - p o r t & g t ; / & l t ; d b - n a m e & g t ; & # 3 4 ; < / s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 5 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > m c a p t c h a / m c a p t c h a : l a t e s t
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > I f y o u d o n & r s q u o ; t h a v e a P o s t g r e s i n s t a n c e r u n n i n g , y o u c a n e i t h e r i n s t a l l
one using a package manager or launch one with docker . A < a href = "'../docker-compose.yml" > docker - compose
configuration < / a > i s a v a i l a b l e t h a t w i l l l a u n c h b o t h
a database instance mcaptcha instance . < / p >
< h2 id = "with-docker-compose" > With docker - compose < / h 2 >
< ol >
< li >
< p > Follow steps above to build docker image . < / p >
< / l i >
< li >
< p > Set database password < a href = "'../docker-compose.yml" > docker - compose configuration < / a > . < / p >
< / l i >
< li >
< p > Launch network < / p >
< / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > d o c k e r - c o m p o s e u p - d
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > ` } , { i d : 5 , h r e f : " / d o c s / s e l f - h o s t i n g / d e p e n d e n c i e s / " , t i t l e : " D a t a b a s e a n d c a c h e " , d e s c r i p t i o n : " m C a p t c h a s e r v e r r e q u i r e s d e p e n d e n c i e s l i k e a P o s t g r e s d a t a b a s e a n d a R e d i s c a c h e " , c o n t e n t : ` < h 2 i d = " n o t e s " > N o t e s < / h 2 >
< h3 id = "database" > Database < / h 3 >
< ul >
< li >
< p > Database migrations are baked into the server binary so don & rsquo ; t worry
about them . < / p >
< / l i >
< li >
< p > When compiling from source , unset database configuration ( comment out
database configuration / < code > unset < / c o d e > r e l e v a n t e n v i r o n m e n t v a r i a b l e s ) .
< code > mCaptcha < /code> uses <a href="https:/ / crates . io / crates / sqlx " > < code > sqlx < / c o d e > < / a > d a t a b a s e c l i e n t
library which checks SQL queries at compile time . So if you are starting
with a fresh database without migrations applied , compilation will fail . < / p >
< / l i >
< / u l >
< h3 id = "redis" > Redis < / h 3 >
< ul >
< li >
< p > Redis is an optional dependency . Currently , the non - Redis configuration
doesn & rsquo ; t persist CAPTCHA heat . So if there & rsquo ; s a systems failure , CAPTCHA
heat will be reset and visitor count will start from 0. For small
installations , this should post a problem as heat is short lived and is
reset anyways at cool down period . < / p >
< / l i >
< li >
< p > mCaptcha uses a custom Redis module called
< a href = "https://github.com/mCaptcha/cache" > cache < / a > t o o v e r c o m e s o m e o f R e d i s '
limitations . < / p >
< / l i >
< / u l >
< h2 id = "instructions" > Instructions < / h 2 >
< p > Once again , there are two ways to go about this : < / p >
< ol >
< li > Docker < / l i >
< li > Bare metal < / l i >
< / o l >
< h3 id = "docker" > Docker < / h 3 >
< h3 id = "database-1" > Database < / h 3 >
< p > Download and run Postgres < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > d o c k e r c r e a t e - - n a m e m c a p t c h a - p o s t g r e s < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > - e < s p a n s t y l e = " c o l o r : # 8 b e 9 f d ; f o n t - s t y l e : i t a l i c " > P O S T G R E S _ P A S S W O R D < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > & l t ; d a t a b a s e - p a s s w o r d & g t ; < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > - p 5 4 3 2 : 5 4 3 2 < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > p o s t g r e s < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > & a m p ; & a m p ; < / s p a n > d o c k e r s t a r t m c a p t c h a - p o s t g r e s
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " r e d i s - 1 " > R e d i s < / h 3 >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > d o c k e r c r e a t e - - n a m e m c a p t c h a - c a c h e < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > - p 6 3 7 9 : 6 3 7 9 < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > \ \
< / s p a n > < / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # f 1 f a 8 c " > < / s p a n > m c a p t c h a / c a c h e < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > & a m p ; & a m p ; < / s p a n > d o c k e r s t a r t m c a p t c h a - c a c h e
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > S e e < a h r e f = " h t t p s : / / g i t h u b . c o m / m C a p t c h a / c a c h e " > m C a p t c h a / c a c h e < / a > f o r m o r e
details . < / p >
< h3 id = "1-install-postgres-if-you-dont-have-it-already" > 1. Install Postgres if you don & rsquo ; t have it already . < / h 3 >
< p > For Debian based distributions : < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > s u d o a p t i n s t a l l p o s t g r e s
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " 2 - c r e a t e - n e w - u s e r - f o r - r u n n i n g - m c a p t c h a " > 2 . C r e a t e n e w u s e r f o r r u n n i n g < c o d e > m C a p t c h a < / c o d e > < / h 3 >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > $ s u d o u s e r a d d - b / s r v - m - s / u s r / b i n / b a s h m c a p t c h a
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " 3 - c r e a t e - n e w - u s e r - i n - p o s t g r e s " > 3 . C r e a t e n e w u s e r i n P o s t g r e s < / h 3 >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > $ s u d o - i u p o s t g r e s < s p a n s t y l e = " c o l o r : # 6 2 7 2 a 4 " > # s w i t c h t o \ ` p o s t g r e s \ ` u s e r < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > $ p s q l
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > < s p a n s t y l e = " c o l o r : # 8 b e 9 f d ; f o n t - s t y l e : i t a l i c " > p o s t g r e s < / s p a n > < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > < s p a n s t y l e = " c o l o r : # 6 2 7 2 a 4 " > # C R E A T E U S E R m c a p t c h a W I T H P A S S W O R D & # 3 9 ; m y s u p e r l o n g p a s s w o r d a n d y e s y o u n e e d s i n g l e q u o t e & # 3 9 ; ; < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > $ c r e a t e d b - O m c a p t c h a m c a p t c h a < s p a n s t y l e = " c o l o r : # 6 2 7 2 a 4 " > # c r e a t e d b & # 3 9 ; m c a p t c h a & # 3 9 ; w i t h & # 3 9 ; m c a p t c h a & # 3 9 ; a s o w n e r < / s p a n >
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " 4 - i n s t a l l - m c a p t c h a c a c h e h t t p s g i t h u b c o m m c a p t c h a c a c h e " > 4 . I n s t a l l < a h r e f = " h t t p s : / / g i t h u b . c o m / m C a p t c h a / c a c h e " > < c o d e > m C a p t c h a / c a c h e < / c o d e > < / a > < / h 3 >
< p > See < a href = "https://github.com/mCaptcha/cache" > < code > mCaptcha / cache < / c o d e > < / a > f o r m o r e
details . < / p >
` },{id:6,href:"/docs/help/troubleshooting/",title:"Troubleshooting",description:"Solutions to common problems.",content: ` < h2 id = "q-i-just-setup-an-instance-but-i-am-unable-to-login" > Q : I just setup an instance but I am unable to login < / h 2 >
< p > mCaptcha by default is configured to server at < code > localhost < / c o d e > h o s t n a m e . I f
the instance is deployed at another hostname , please try setting
< code > MCAPTCHA _SERVER _DOMAIN < / c o d e > e n v i r o n m e n t v a r i a b l e t o t h e h o s t n a m e a t w h i c h
your instance is deployed or setting the equivalent in config . toml : < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-toml" data - lang = "toml" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > [ s e r v e r ]
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > d o m a i n = m y d o m a i n
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > ` } , { i d : 7 , h r e f : " / d o c s / a p i / b r o w s e r / " , t i t l e : " B r o w s e r l i b r a r i e s " , d e s c r i p t i o n : " A P I d o c u m e n t t i o n f o r m C a p t c h a W A S M l i b r a r y " , c o n t e n t : ` < p > T h e b r o w s e r p a r t o f m C a p t c h a i s d i v i d e d i n t o t h r e e c o m p o n e n t s . < / p >
< ul >
< li > Glue code < / l i >
< li > Widget program < / l i >
< li > Proof - of - Work libraries ( WebAssembly and JavaScript polyfill ) < / l i >
< / u l >
< h2 id = "glue-code" > Glue code < / h 2 >
< p > This is the code that links mCaptcha with your website & rsquo ; s frontend code .
It creates an < code > iframe < / c o d e > c o n t a i n i n g t h e m C a p t c h a w i d g e t a n d i n j e c t s t h e
received verification proof token into a hidden input field . < / p >
< p > Support is available for various frameworks , see
< a href = "https://github.com/mCaptcha/glue" > < code > mCaptcha / glue < / c o d e > < / a > f o r t h e f u l l l i s t . < / p >
< p > For frameworks without official support , a low - level library ,
< a href = "https://www.npmjs.com/package/@mcaptcha/core-glue" > < code > @ mcaptcha / core - glue < / c o d e > < / a > ,
can be used to implement support . < / p >
< h2 id = "widget-program" > Widget Program < / h 2 >
< p > This part is served by the mCaptcha backend . It fetches PoW config from
the backend , generates proof and submits it for verification . If
verification is successful , it sends a message containing the
verification proof token to the parent window , assuming it & rsquo ; s loaded as
an < code > iframe < / c o d e > . < / p >
< ul >
< li > Source code :
< a href = "https://github.com/mCaptcha/mCaptcha/tree/master/templates/widget" > < code > mCaptcha / mCaptcha / templates / widget < / c o d e > < / a > < / l i >
< / u l >
< p > WebAssembly library which generates Proofs of Work for mCaptcha systems . < / p >
< h2 id = "proof-of-workpow-library" > Proof - of - Work ( PoW ) library < / h 2 >
< p > WebAssembly bindings ( < a href = "https://github.com/mCaptcha/pow_wasm" > < code > mCaptcha / pow _wasm < / c o d e > < / a > ) a r e a v a i l a b l e f o r t h e m a i n r u s t l i b r a r y ( < a h r e f = " h t t p s : / / g i t h u b . c o m / m C a p t c h a / p o w _ s h a 2 5 6 " > < c o d e > m C a p t c h a / p o w _ s h a 2 5 6 < / c o d e > < / a > ) . < / p >
< p > For browsers without support WebAssembly , a
polyfill ( < a href = "https://github.com/mCaptcha/pow_sha256-polyfill" > < code > pow _sha256 - polyfill < / c o d e > < / a > )
is available . < / p >
` },{id:8,href:"/docs/api/mcaptcha-system/",title:"mCaptcha System Library",description:"API documenttion for the core Library used in mCaptcha",content: ` < p > Documentation for the library used in mCaptcha core . < / p >
< h2 id = "versions" > Versions < / h 2 >
< ul >
< li > < a href = "https://mcaptcha.github.io/mCaptcha/m_captcha/index.html" > master - branch < / a > < / l i >
< li > < a href = "/api-docs/m_captcha/0.1.3/m_captcha/index.html" > 0.1 . 3 < / a > < / l i >
< li > < a href = "/api-docs/m_captcha/0.1.2/m_captcha/index.html" > 0.1 . 2 < / a > < / l i >
< li > < a href = "/api-docs/m_captcha/0.1.1/m_captcha/index.html" > 0.1 . 1 < / a > < / l i >
< li > < a href = "/api-docs/m_captcha/0.1.0/m_captcha/index.html" > 0.1 . 0 < / a > < / l i >
< / u l >
` },{id:9,href:"/docs/api/pow-sha256/",title:"pow_sha256",description:"API documenttion for PoW Library used in mCaptcha",content: ` < p > Rust crate which generates SHA256 Proofs of Work on serializable datatypes . < / p >
< p > This is a fork of the < a href = "https://github.com/bddap/pow" > < code > pow < / c o d e > l i b r a r y < / a > b y
< a href = "https://github.com/robkorn/pow_sha256" > @ robkorn < / a > ) w i t h s o m e n e w
additions . Primary of these being : < / p >
< ul >
< li > PoW datatype now offers a constructor < / l i >
< li > Salt is no longer hard coded into the library , users can provide
unique salts . < / l i >
< / u l >
< p > Other small changes have also been included of various importance but
mostly just stylistic / ease of use improvements . < / p >
< h2 id = "versions" > Versions < / h 2 >
< ul >
< li > < a href = "https://mcaptcha.github.io/pow_sha256/pow_sha256/index.html" > master - branch < / a > < / l i >
< li > < a href = "/api-docs/pow_sha256/0.2.1/pow_sha256/index.html" > 0.2 . 1 < / a > < / l i >
< li > < a href = "/api-docs/pow_sha256/0.2.0/pow_sha256/index.html" > 0.2 . 0 < / a > < / l i >
< li > < a href = "/api-docs/pow_sha256/0.1.0/pow_sha256/index.html" > 0.1 . 0 < / a > < / l i >
< / u l >
< h2 id = "changelog" > Changelog < / h 2 >
< p > Changelog is available at the project & rsquo ; s
< a href = "https://github.com/mCaptcha/pow_sha256/blob/master/CHANGELOG.md" > repository < / a > < / p >
` },{id:10,href:"/docs/help/faq/",title:"FAQ",description:"Answers to frequently asked questions.",content: ` < p > Coming soon < / p >
2023-10-28 03:18:10 +05:30
` },{id:11,href:"/docs/user-manual/cli/",title:"CLI tool",description:"Instructions to install mCaptcha CLI",content: ` < p > A CLI tool exists to compute mCaptcha challenges . It can be installed
from multiple sources : < / p >
< h2 id = "install" > Install < / h 2 >
< h3 id = "cratesio" > crates . io < / h 3 >
< p > The CLI tool is available on , < a href = "https://crates.io" > crates . io < / a > , t h e R u s t
language & rsquo ; s package registry . Rust language toolchain is required to
install from crates . io , please see < a href = "https://rustup.rs" > rustup . rs < / a > f o r
Instructions to install it . < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > c a r g o i n s t a l l m c a p t c h a - c l i
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " p r e - c o m p i l e d - b i n a r i e s " > P r e - c o m p i l e d b i n a r i e s < / h 3 >
< p > Nightly builds and stable releases are regularly published to
< a href = "https://dl.mcaptcha.org/mcaptcha/cli" > dl . mcaptcha . org < / a > f o r a v a r i e t y o f
CPU architectures and operating systems . < / p >
< ol >
< li > Download binary , checksum and GPG signature files < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < /span><span>wget https:/ / dl . mcaptcha . org / mcaptcha / cli / < span style = "color:#ff79c6" > { < / s p a n > V E R S I O N < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > { < / s p a n > F I L E N A M E < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > . t a r . g z
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > w g e t h t t p s : / / d l . m c a p t c h a . o r g / m c a p t c h a / c l i / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > { < / s p a n > V E R S I O N < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > { < / s p a n > F I L E N A M E < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > . t a r . g z . a s c
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > w g e t h t t p s : / / d l . m c a p t c h a . o r g / m c a p t c h a / c l i / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > { < / s p a n > V E R S I O N < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > / < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > { < / s p a n > F I L E N A M E < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > . t a r . g z . s h a 2 5 6
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < o l s t a r t = " 2 " >
< li > Verify checksum < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > s h a 2 5 6 s u m - c < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > { < / s p a n > F I L E N A M E < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > . t a r . g z . s h a 2 5 6
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < o l s t a r t = " 3 " >
< li > Download mCaptcha & rsquo ; s GPG release keys and verify GPG signature < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > g p g - - k e y s e r v e r k e y s e r v e r . u b u n t u . c o m - - r e c v 7 3 D A C 9 7 3 A 9 A D B B 9 A D C B 5 C D C 4 5 9 5 A 0 8 1 3 5 B A 9 F F 7 3
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > g p g - - v e r i f y < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > { < / s p a n > F I L E N A M E < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > . t a r . g z . a s c
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < o l s t a r t = " 4 " >
< li > Install Binary < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > t a r - x v z f < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > { < / s p a n > F I L E N A M E < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > . t a r . g z < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > & a m p ; & a m p ; < / s p a n > s u d o c p < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > { < / s p a n > F I L E N A M E < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > } < / s p a n > / m c a p t c h a - c l i / u s r / l o c a l / b i n
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " b u i l d - f r o m - s o u r c e " > B u i l d f r o m s o u r c e < / h 3 >
< ol >
< li > Install Rust tool chain
Please see < a href = "https://rustup.rs" > here < / a > f o r i n s t r u c t i o n s . < / l i >
< li > Download source code < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < /span><span>git clone https:/ / git . batsense . net / mCaptcha / cli
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < o l s t a r t = " 3 " >
< li > Compile and install < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > c a r g o b u i l d - - r e l e a s e < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > & a m p ; & a m p ; < / s p a n > s u d p c p . / t a r g e t / r e l e a s e / m c a p t c h a - c l i
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > / u s r / l o c a l / b i n
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 2 i d = " p a s s - m c a p t c h a - c h a l l e n g e " > P a s s m C a p t c h a c h a l l e n g e < / h 2 >
< p > The CLI tool requires details about the challenge to work on it . The
tool can be used in three different modes compute challenge : < / p >
< ol >
< li > Protected Page : Compute mCaptcha challenge for the CAPTCHA at a
protected page < / l i >
< li > Widget URL : Compute PoW for captcha at widget URL < / l i >
< li > ( Developer mode ) Offline : Computes PoW over given CAPTCHA parameters < / l i >
< / o l >
< h3 id = "from-protected-page-url" > From protected page URL < / h 3 >
< p > The most convenient mode : copy the URL of the webpage which has the
mCaptcha widget ( example : showcase . mcaptcha . org ) and run the CLI tool
with it to get an authorization code :
Compute challenge using the URL < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < /span><span>03:39 atm@lab cli ±|feat-parse-webpage ✗|→ mcaptcha-cli protected-page https:/ / showcase . mcaptcha . org /
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > A u t h o r i z a t i o n t o k e n : e R A Z J i M r W 5 8 u D Y A 1 s 6 4 T m w q 1 u 3 0 H u t u F
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " w i d g e t - u r l " > W i d g e t U R L < / h 3 >
< p > If 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:</p>
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > C o m p u t e P o W b y f e t c h i n g p a r a m e t e r s f r o m C A P T C H A U R L
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > U s a g e : m c a p t c h a - c l i o n l i n e - - u r l & l t ; U R L & g t ;
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 5 < / s p a n > < s p a n > O p t i o n s :
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 6 < / s p a n > < s p a n > - u , - - u r l & l t ; U R L & g t ; U R L o f t h e C A P T C H A . E x a m p l e : h t t p s : / / e x a m p l e . o r g / w i d g e t ? s i t e k e y < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > = < / s p a n > f o o
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 7 < / s p a n > < s p a n > - h , - - h e l p P r i n t < s p a n s t y l e = " c o l o r : # 8 b e 9 f d ; f o n t - s t y l e : i t a l i c " > h e l p < / s p a n >
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > E x a m p l e u s a g e : < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < /span><span>13:32 atm@lab cli ±|online ✗|→ mcaptcha-cli online -u https:/ / demo . mcaptcha . org / widget ? sitekey < span style = "color:#ff79c6" >= < / s p a n > p H y 0 A k t W y O K u x Z D z F f o a e w n c W e c C H o 2 3
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > A u t h o r i z a t i o n t o k e n : 3 x l e N 2 6 O c t B u V u 3 X 4 t 6 C Y y U j E r h a x Q v z
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < h 3 i d = " d e v e l o p e r - m o d e - o f f l i n e " > [ D e v e l o p e r m o d e ] O f f l i n e < / h 3 >
< p > Useful while debugging mCaptcha configurations , works on raw challenge
parameters . < / p >
< p > Help menu : < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > C o m p u t e P o W w i t h o f f l i n e p a r a m e t e r s
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > U s a g e : m c a p t c h a - c l i o f f l i n e - - s a l t & l t ; S A L T & g t ; - - p h r a s e & l t ; P H R A S E & g t ; - - d i f f i c u l t y - f a c t o r & l t ; D I F F I C U L T Y _ F A C T O R & g t ;
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 5 < / s p a n > < s p a n > O p t i o n s :
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 6 < / s p a n > < s p a n > - s , - - s a l t & l t ; S A L T & g t ; S a l t w i t h w h i c h P o W s h o u l d b e c o m p u t e d
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 7 < / s p a n > < s p a n > - p , - - p h r a s e & l t ; P H R A S E & g t ; P h r a s e o v e r w h i c h P o W s h o u l d b e c o m p u t e d
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 8 < / s p a n > < s p a n > - d , - - d i f f i c u l t y - f a c t o r & l t ; D I F F I C U L T Y _ F A C T O R & g t ; D i f f i c u l t y F a c t o r
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 9 < / s p a n > < s p a n > - h , - - h e l p P r i n t < s p a n s t y l e = " c o l o r : # 8 b e 9 f d ; f o n t - s t y l e : i t a l i c " > h e l p < / s p a n >
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > E x a m p l e u s a g e : < / p >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > 1 3 : 2 8 a t m @ l a b c l i ± | o n l i n e | → m c a p t c h a - c l i o f f l i n e - s < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > $ ( < / s p a n > r a n d 3 2 < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > ) < / s p a n > - p < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > $ ( < / s p a n > r a n d 3 2 < s p a n s t y l e = " c o l o r : # f f 7 9 c 6 " > ) < / s p a n > - d < s p a n s t y l e = " c o l o r : # b d 9 3 f 9 " > 5 0 0 0 0 < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 2 < / s p a n > < s p a n > d i f f i c u l t y : < s p a n s t y l e = " c o l o r : # b d 9 3 f 9 " > 5 0 0 0 0 < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 3 < / s p a n > < s p a n > n o n c e : < s p a n s t y l e = " c o l o r : # b d 9 3 f 9 " > 9 0 5 0 7 < / s p a n >
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 4 < / s p a n > < s p a n > o r i g i n a l p h r a s e : f 3 5 1 f 3 3 3 d 4 4 b 2 c 6 b 5 b f 7 f 0 3 3 b 0 6 5 b b b 8 f b 5 e 9 d d 1 5 3 b d 4 0 2 e 4 3 e d 0 4 4 2 5 f 5 a 3 8 5 9
< / s p a n > < / s p a n > < s p a n s t y l e = " d i s p l a y : f l e x ; " > < s p a n s t y l e = " w h i t e - s p a c e : p r e ; - w e b k i t - u s e r - s e l e c t : n o n e ; u s e r - s e l e c t : n o n e ; m a r g i n - r i g h t : 0 . 4 e m ; p a d d i n g : 0 0 . 4 e m 0 0 . 4 e m ; c o l o r : # 7 f 7 f 7 f " > 5 < / s p a n > < s p a n > r e s u l t : < s p a n s t y l e = " c o l o r : # b d 9 3 f 9 " > 3 4 0 2 7 6 5 6 2 9 5 6 1 9 6 2 9 1 5 2 2 9 7 9 3 5 6 0 9 0 2 2 0 1 5 0 4 7 1 < / s p a n >
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > W h e r e r a n d i s < a h r e f = " h t t p s : / / g i t h u b . c o m / r e a l a r a v i n t h / d o t f i l e s / b l o b / 6 f c 6 c 8 7 c c 9 1 2 e 1 7 4 8 8 a 3 5 c 0 d 3 3 2 7 e c f 3 9 3 2 2 1 2 7 0 / s c r i p t s / r a n d # L 2 0 " > t h i s < / a > s c r i p t . < / p >
` },{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: ` < p > To use mCaptcha without JavaScript : < / p >
< ol >
< li > Install mCaptcha CLI too . Please see < a href = "./cli" > here < / a > f o r i n s t r u c t i o n s . < / l i >
< li > Copy the URL of the protected page < / l i >
< li > Run mCaptcha CLI with that URL : < / l i >
< / o l >
< div class = "highlight" > < pre tabindex = "0" style = "color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class = "language-bash" data - lang = "bash" > < span style = "display:flex;" > < span style = "white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f" > 1 < / s p a n > < s p a n > m c a p t h c a - c l i p r o t e c t e d - p a g e & l t ; U R L & g t ;
< / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < o l s t a r t = " 4 " >
< li > Copy authorization code and paste it in the form < / l i >
< / o l >
` },{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: ` < h2 id = "authorization-token" > Authorization token < / h 2 >
2023-10-27 21:41:33 +05:30
< p > When a visitor solves the CAPTCHA and sends their solution to an
mCaptcha instance , the solution will be verified for correctness . If the
solution is correct , mCaptcha will return a single use authorization token . < / p >
< p > This authorization token should be attached to the visitor & rsquo ; s requited to the
protected service and the protected service should validity of the
authorization token with the mCaptcha instance and only allow authorization to
protected resource if the authorization token is valid . < / p >
< h2 id = "cooldown-period" > Cooldown Period < / h 2 >
< p > mCaptcha implements leaky bucket algorithm to measure
current traffic levels . Cooldown period specifies the leak or the time
after which a visitor addition is decremented . < / p >
< p > For instance , if initial traffic level is 0 and a user visits one
second later , the traffic level will be incremented to 1. Now , if the
cooldown period is set to 30 seconds , the traffic level will be
decremented after 30 seconds . So after 30 seconds , the traffic level will
go from 1 to 0. < / p >
< h2 id = "difficulty-factor" > Difficulty Factor < / h 2 >
< p > Difficulty factor determines the time it takes to solve a CAPTCHA . The
higher the difficulty factor , the longer it will take to generate a
proof of work for it to solve the CAPTCHA . < / p >
< p > mCaptcha & rsquo ; s proof of work based mechanism makes it highly accessible to
people with special needs but it is important to choose the difficulty factor
with care as very high difficulty factors will make the CAPTCHA
inaccessible to users on slow devices . < / p >
< h2 id = "sitekey" > Sitekey < / h 2 >
< p > Site key is a unique identifier associated with CAPTCHA configurations
created on mCaptcha . It is required to integrate a CAPTCHA with your
website . < / p >
< h2 id = "visitor-threshold" > Visitor Threshold < / h 2 >
< p > mCaptcha & rsquo ; s variable difficulty factor mechanism requires a website & rsquo ; s traffic
statistics be split into levels , so that it can deploy the right
difficulty factor for each level . < / p >
< p > Visitor threshold is used to traffic into levels and mCaptcha accepts a
difficulty configuration for each of these levels . When current traffic
exceeds a difficulty factor , mCaptcha will increase the difficulty
factor to the next configured level . < / p >
< p > For instance , consider the configuration given below : < / p >
< ul >
< li > Cool down period : 30 seconds < / l i >
< / u l >
< table >
< thead >
< tr >
< th > Level < / t h >
< th > Difficulty Factor < / t h >
< th > Visitor Threshold < / t h >
< / t r >
< / t h e a d >
< tbody >
< tr >
< td > 1 < / t d >
< td > 5 , 000 < / t d >
< td > 2 , 000 < / t d >
< / t r >
< tr >
< td > 2 < / t d >
< td > 50 , 000 < / t d >
< td > 5 , 000 < / t d >
< / t r >
< tr >
< td > 3 < / t d >
< td > 500 , 000 < / t d >
< td > 10 , 000 < / t d >
< / t r >
< tr >
< td > 4 < / t d >
< td > 5 , 000 , 000 < / t d >
< td > 15 , 000 < / t d >
< / t r >
< / t b o d y >
< / t a b l e >
< p > If the website sees 2 , 000 requests in a 30 second window , level 1
difficulty factor ( 5 , 000 ) will be deployed . If the traffic increases to
5 , 000 requests in a 30 second window , then difficulty factor will be
upgraded to level 2 ( 50 , 000 ) . Likewise 10 , 000 and 15 , 000 requests over 30
seconds will result in difficulty factor being upgraded to 500 , 000 and
5 , 000 , 000 respectively . < / p >
< p > Visitor threshold is how mCaptcha determines which difficulty factor
level to deploy . mCaptcha uses leaky bucket algorithm to keep the
visitor threshold constantly updated within the configured cool down
period . So , at any given moment the , the current visitor level will be
the amount of traffic that was served in the cool down period specified . < / p >
2023-10-28 03:18:10 +05:30
` },{id:15,href:"/docs/webmasters/faq/",title:"Webmasters FAQ",description:"Frequently asked questions related to using mCaptcha as a webmaster",content: ` < h3 id = "easy-mode-default-cooldown-period" > Easy Mode : Default cooldown period < / h 3 >
2023-10-27 21:41:33 +05:30
< p > When configuring mCaptcha in < a href = "/docs/webmasters/configuring-difficulty-factor/#easy-option" > easy mode < / a > , t h e d e f a u l t c o o l d o w n p e r i o d i s s e t t o 3 0 s e c o n d s . < / p >
< h2 id = "how-to-get-site-key-from-dashboard" > How to get site key from dashboard ? < / h 2 >
< ol >
< li > Go to & ldquo ; Site keys & rdquo ; on the side panel in the dashboard < / l i >
< / o l >
< div align = center >
< figure >
< img class = "img-fluid lazyload blur-up" data - sizes = "auto" src = "/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_20x0_resize_box_3.png" data - srcset = "/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_800x0_resize_box_3.png 800w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_700x0_resize_box_3.png 700w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_600x0_resize_box_3.png 600w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_500x0_resize_box_3.png 500w" width = "222" height = "496" alt = "Site key menu option on the dashboard, encircled in red." >
< noscript > < img class = "img-fluid" sizes = "100vw" srcset = "/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_800x0_resize_box_3.png 800w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_700x0_resize_box_3.png 700w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_600x0_resize_box_3.png 600w,/docs/webmasters/faq/sitekey-in-dashboard-sidepanel_hu437e619e92d9fef838a97af482e11285_26958_500x0_resize_box_3.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." > < / n o s c r i p t >
< / f i g u r e >
< / d i v >
< ol start = "2" >
< li > click on the clipboard button to copy the site key to your
clipboard . < / l i >
< / o l >
< figure >
< img class = "img-fluid lazyload blur-up" data - sizes = "auto" src = "/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_20x0_resize_box_3.png" data - srcset = "/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_900x0_resize_box_3.png 900w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_800x0_resize_box_3.png 800w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_700x0_resize_box_3.png 700w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_600x0_resize_box_3.png 600w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_500x0_resize_box_3.png 500w" width = "1825" height = "831" alt = "Copy site key to clipboard. Clipboard button is highlighted in the photo" >
< noscript > < img class = "img-fluid" sizes = "100vw" srcset = "/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_900x0_resize_box_3.png 900w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_800x0_resize_box_3.png 800w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_700x0_resize_box_3.png 700w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_600x0_resize_box_3.png 600w,/docs/webmasters/faq/copy-sitekey_huf38748cca91d238810283a1abb694c9a_63890_500x0_resize_box_3.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" > < / n o s c r i p t >
< / f i g u r e >
2023-10-28 03:18:10 +05:30
` },{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:""}];e.add(n),userinput.addEventListener("input",s,!0),suggestions.addEventListener("click",o,!0);function s(){var n,i=this.value,s=e.search(i,5),o=suggestions.childNodes,r=0,c=s.length;for(suggestions.classList.remove("d-none"),s.forEach(function(e){n=document.createElement("div"),n.innerHTML="<a href><span></span><span></span></a>",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.href,t.textContent=e.title,d.textContent=e.description,suggestions.appendChild(n)});o.length>c;)suggestions.removeChild(o[r])}function o(){for(;suggestions.lastChild;)suggestions.removeChild(suggestions.lastChild);return!1}})()