website/docs/self-hosting/index.xml

39 lines
7.4 KiB
XML

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Self-Hosting on </title>
<link>/docs/self-hosting/</link>
<description>Recent content in Self-Hosting on </description>
<generator>Hugo</generator>
<language>en-US</language>
<atom:link href="/docs/self-hosting/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Getting started</title>
<link>/docs/self-hosting/getting-started/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>/docs/self-hosting/getting-started/</guid>
<description>&lt;h2 id=&#34;get-started&#34;&gt;Get started&lt;/h2&gt;&#xA;&lt;p&gt;There are two main ways to self-host mCaptcha:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&#34;/docs/self-hosting/bare-metal&#34;&gt;Bare metal&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;/docs/self-hosting/docker&#34;&gt;With Docker&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;/docs/self-hosting/ansible&#34;&gt;With Ansible&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;</description>
</item>
<item>
<title>Deploy bare metal</title>
<link>/docs/self-hosting/bare-metal/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>/docs/self-hosting/bare-metal/</guid>
<description>&lt;h2 id=&#34;1-install-database&#34;&gt;1. Install Database&lt;/h2&gt;&#xA;&lt;p&gt;The following databases are supported:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Postgres&lt;/li&gt;&#xA;&lt;li&gt;MariaDB&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Please install the database of your choice. Then:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create new database user for mCaptcha&lt;/li&gt;&#xA;&lt;li&gt;Create new database for mCaptcha&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;mCaptcha binary has migrations baked-in and is applied on start up. The&#xA;choice of database is described using the &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#scheme&#34;&gt;scheme&lt;/a&gt; of the database URL. For&#xA;instance:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Postgres: &lt;code&gt;postgres://mcaptcha:password@localhost:5432/mcaptcha&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Mariadb: &lt;code&gt;mysql://mcaptcha:password@localhost:3306/mcaptcha&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;2-optionally-install-mcaptchacache&#34;&gt;2. Optionally, install mCaptcha/cache&lt;/h2&gt;&#xA;&lt;p&gt;We recommend this for larger instances. For single-user instances or for&#xA;instances that protect personal websites, we recommend using the&#xA;internal cache system. To do so, please comment out the&#xA;&lt;a href=&#34;https://github.com/mCaptcha/mCaptcha/blob/d4967626ee59504b32b0f85e409b4e3444ddc4f0/config/default.toml#L54&#34;&gt;&lt;code&gt;redis&lt;/code&gt;&lt;/a&gt; section of the configuration file.&lt;/p&gt;</description>
</item>
<item>
<title>Using Ansible</title>
<link>/docs/self-hosting/ansible/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>/docs/self-hosting/ansible/</guid>
<description>&lt;p&gt;Ansible playbooks to install mCaptcha are available &lt;a href=&#34;https://git.batsense.net/mCaptcha/iac&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;instructions&#34;&gt;Instructions&lt;/h2&gt;&#xA;&lt;h3 id=&#34;installation&#34;&gt;Installation&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Clone the repository:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span style=&#34;white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;1&lt;/span&gt;&lt;span&gt;git clone https://git.batsense.net/mCaptcha/iac &lt;span style=&#34;color:#ff79c6&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#8be9fd;font-style:italic&#34;&gt;cd&lt;/span&gt; iac&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Create inventory file. You should have SSH access to the remote&#xA;machine, and the user must have &lt;code&gt;sudo&lt;/code&gt; privileges. Example inventory&#xA;file:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-ini&#34; data-lang=&#34;ini&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span style=&#34;white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;1&lt;/span&gt;&lt;span&gt;&lt;span style=&#34;color:#ff79c6&#34;&gt;[mcaptcha_hosts]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span style=&#34;white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;2&lt;/span&gt;&lt;span&gt;&lt;span style=&#34;color:#50fa7b&#34;&gt;&amp;#34;mcaptcha_hosts&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span style=&#34;white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f&#34;&gt;3&lt;/span&gt;&lt;span&gt;&lt;span style=&#34;color:#50fa7b&#34;&gt;&amp;lt;node name&amp;gt; ansible_host&lt;/span&gt;&lt;span style=&#34;color:#ff79c6&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#f1fa8c&#34;&gt;&amp;lt;node IP&amp;gt; ansible_user=&amp;lt;remote username&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pr</description>
</item>
<item>
<title>Using Docker</title>
<link>/docs/self-hosting/docker/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>/docs/self-hosting/docker/</guid>
<description>&lt;h2 id=&#34;with-docker&#34;&gt;With Docker&lt;/h2&gt;&#xA;&lt;h3 id=&#34;1-configure&#34;&gt;1. Configure&lt;/h3&gt;&#xA;&lt;p&gt;mcaptcha is highly configurable.&lt;/p&gt;&#xA;&lt;p&gt;Configuration is applied/merged in the following order:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;path to configuration file passed in via &lt;code&gt;MCAPTCHA_CONFIG&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;./config/default.toml&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;/etc/mcaptcha/config.toml&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;environment variables.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;See&#xA;&lt;a href=&#34;https://github.com/mCaptcha/mCaptcha/tree/master/docs/CONFIGURATION.md&#34;&gt;CONFIGURATION.md&lt;/a&gt;&#xA;for configurable options.&lt;/p&gt;&#xA;&lt;h3 id=&#34;2-run-image&#34;&gt;2. Run image&lt;/h3&gt;&#xA;&lt;p&gt;If you have already have a Postgres instance running, then:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker run -p &amp;lt;host-machine-port&amp;gt;:&amp;lt;port-in-configuration-file&amp;gt; \&#xA;&#x9;--add-host=database:&amp;lt;database-ip-addrss&amp;gt; \&#xA;&#x9;-e RUST_LOG=debug \&#xA;&#x9;-e DATABASE_URL=&amp;#34;postgres://&amp;lt;db-user&amp;gt;:&amp;lt;db-password&amp;gt;@database:&amp;lt;db-port&amp;gt;/&amp;lt;db-name&amp;gt;&amp;#34; \&#xA;&#x9;mcaptcha/mcaptcha:latest&#xA;&lt;/code&gt;&lt;/pr</description>
</item>
</channel>
</rss>