{"id":587,"date":"2020-11-11T07:56:17","date_gmt":"2020-11-11T07:56:17","guid":{"rendered":"http:\/\/www.ishygddt.xyz.\/~blog\/?p=587"},"modified":"2022-03-08T19:04:35","modified_gmt":"2022-03-08T19:04:35","slug":"gab-social-on-centos-via-docker-compose","status":"publish","type":"post","link":"http:\/\/www.ishygddt.xyz\/~blog\/2020\/11\/gab-social-on-centos-via-docker-compose","title":{"rendered":"[obsolete] Gab Social on CentOS 8 via Docker Compose"},"content":{"rendered":"<p>This post is not relevant anymore. Gab <a href=\"https:\/\/gab.com\/shadowknight412\/posts\/105218058977837980\">has permanently removed (and will not be re-enabling)<\/a> Federation in any capacity, so there's no point to even considering running your own Gab Social-based site.<\/p>\n<hr \/>\n<p>These instructions cover the complete process, \u201call batteries included\u201d, as I executed this on a VPS.<\/p>\n<p>First, <a href=\"http:\/\/www.ishygddt.xyz\/~blog\/2020\/11\/installing-dockercompose-on-centos-8\">install Docker+Compose<\/a>.<\/p>\n<p>Then, grab <a href=\"https:\/\/code.gab.com\/gab\/social\/gab-social\">the Gab source code<\/a> and <a href=\"https:\/\/code.gab.com\/gab\/social\/gab-social\/-\/blob\/develop\/docs\/server.md\">build it<\/a>:<\/p>\n<ul>\n<li><code class=\"\" data-line=\"\">git clone -b develop https:\/\/code.gab.com\/gab\/social\/gab-social.git<\/code><br \/>\n(No; they do not have a stable branch\u2026or versioned tags\u2026)<\/li>\n<li><code class=\"\" data-line=\"\">pushd gab-social<\/code><\/li>\n<li><code class=\"\" data-line=\"\">cp -v .env.production.sample .env.production<\/code><\/li>\n<li>Edit <code class=\"\" data-line=\"\">docker-compose.yml<\/code>\n<ul>\n<li>add the following to the end of the <code class=\"\" data-line=\"\">db<\/code> section:\n<pre>    environment:\n      - POSTGRES_HOST_AUTH_METHOD=trust<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><code class=\"\" data-line=\"\">time docker-compose build<\/code><\/li>\n<\/ul>\n<p>This last step took a little under an hour on the 2-core VPS I'm renting, so (unless you're not cheaping out) you'll want to take a break.<\/p>\n<p>Also, mine died in Step 10\/37; I ended up having to reboot the system before it'd work again and complete. (I'm not sure whether this was a problem with Docker, the Dockerfile, or just my hosting provider's images.)<\/p>\n<p>You can punch the holes in your firewall while you're waiting:<\/p>\n<ul>\n<li><code class=\"\" data-line=\"\">systemctl start firewalld &amp;&amp; systemctl enable firewalld<\/code><\/li>\n<li><code class=\"\" data-line=\"\">firewall-cmd --permanent --add-service=http --add-service=https<\/code><\/li>\n<\/ul>\n<p>Then, <a href=\"https:\/\/github.com\/tootsuite\/documentation\/blob\/archive\/Running-Mastodon\/Docker-Guide.md\">set it up<\/a>:<\/p>\n<p><a href=\"https:\/\/nginx.org\/en\/linux_packages.html#RHEL-CentOS\">Install nginx<\/a>:<\/p>\n<ul>\n<li><code class=\"\" data-line=\"\">dnf config-manager --add-repo http:\/\/nginx.org\/packages\/centos\/8\/$(arch)<\/code><\/li>\n<li><code class=\"\" data-line=\"\">echo &#039;gpgkey=https:\/\/nginx.org\/keys\/nginx_signing.key&#039; &gt;&gt; \/etc\/yum.repos.d\/nginx*.repo<\/code><\/li>\n<li><code class=\"\" data-line=\"\">dnf install nginx &amp;&amp; systemctl enable nginx<\/code><\/li>\n<\/ul>\n<p>Configure a proxying site:<\/p>\n<ul>\n<li><code class=\"\" data-line=\"\">mkdir -v \/etc\/nginx\/sites-{enabled,available}<\/code><\/li>\n<li><code class=\"\" data-line=\"\">echo &#039;include sites-enabled\/*;&#039; &gt;&gt; \/etc\/nginx\/conf.d\/sites.conf<\/code><\/li>\n<li><code class=\"\" data-line=\"\">pushd \/etc\/nginx\/sites-available<\/code><\/li>\n<li>Edit (create) text file <code class=\"\" data-line=\"\">gabsocial<\/code><\/li>\n<li>Paste <a href=\"https:\/\/github.com\/tootsuite\/documentation\/blob\/archive\/Running-Mastodon\/Production-guide.md#nginx-configuration\">this monster<\/a> into it<\/li>\n<li>Find-and-replace \"example.com\" and put in <em>your<\/em> web domain<br \/>\n(in Nano, that's Ctrl_W, Ctrl_R)<\/li>\n<li>Change the <code class=\"\" data-line=\"\">root<\/code> values to something like <code class=\"\" data-line=\"\">\/var\/www\/null<\/code> (don't remove the semicolon at the end!)<\/li>\n<li>Save-and-quit<\/li>\n<li><code class=\"\" data-line=\"\">ln -vs ..\/sites-available\/gabsocial ..\/sites-enabled\/<\/code><\/li>\n<li><code class=\"\" data-line=\"\">popd<\/code><\/li>\n<\/ul>\n<p>Set up a TLS certificate (if you know what you're doing, obviously you can replace this part with what you're doing):<\/p>\n<ul>\n<li><code class=\"\" data-line=\"\">dnf install epel-release &amp;&amp; dnf install letsencrypt<\/code><\/li>\n<li><code class=\"\" data-line=\"\">letsencrypt certonly -d example.com --standalone<\/code><\/li>\n<\/ul>\n<p>Set the whole mess up:<\/p>\n<ul>\n<li><code class=\"\" data-line=\"\">sed -i s_\/mnt\/md0\/assets_\/var\/gabsocial\/assets_ docker-compose.yml<\/code><\/li>\n<li><code class=\"\" data-line=\"\">mkdir -vp \/var\/gabsocial\/assets &amp;&amp; chmod -Rv 991:991 \/var\/gabsocial\/assets<\/code><\/li>\n<li><code class=\"\" data-line=\"\">sed &#039;s\/^\\(SECRET_KEY_BASE=\\).*$\/\\1&#039;$(docker-compose run --rm web bundle exec rake secret)\/ -i .env.production<\/code><\/li>\n<li><code class=\"\" data-line=\"\">sed &#039;s\/^\\(OTP_SECRET=\\).*$\/\\1&#039;$(docker-compose run --rm web bundle exec rake secret)\/ -i .env.production<\/code><\/li>\n<li><code class=\"\" data-line=\"\">\/var\/gabsocial\/assets<\/code><\/li>\n<li><code class=\"\" data-line=\"\">docker-compose run --rm web bundle exec rails gabsocial:setup<\/code><\/li>\n<li>Accept the defaults for everything except the domain and mail settings\n<ul>\n<li>I don't know what to tell you about the mail settings other than the fact that \"send mail from localhost\" and \"don't send a test e-mail\" are your best bet if you don't have an e-mail server<\/li>\n<\/ul>\n<\/li>\n<li>Replace <code class=\"\" data-line=\"\">${local_domain}<\/code> with your actual local domain, and run:<br \/>\n<code class=\"\" data-line=\"\">sed &#039;s\/^\\(LOCAL_DOMAIN=\\).*$\/\\1&#039;${local_domain}\/ -i .env.production<\/code><\/p>\n<ul>\n<li><strong>If and only if<\/strong> you are running a separate <code class=\"\" data-line=\"\">WEB_DOMAIN<\/code>, likewise run:<br \/>\n<code class=\"\" data-line=\"\">sed &#039;s\/^#? ?\\(WEB_DOMAIN=\\).*$\/\\1&#039;${web_domain}\/ -i .env.production<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>And, finally, <strong>start it<\/strong>:<\/p>\n<ul>\n<li><code class=\"\" data-line=\"\">systemctl start nginx<\/code><\/li>\n<li><code class=\"\" data-line=\"\">docker-compose up -d<\/code><\/li>\n<\/ul>\n<menu id=\"userscript-search-by-image\" type=\"context\">\n<menu><\/menu>\n<\/menu>\n<menu id=\"userscript-search-by-image\" type=\"context\">\n<menu><\/menu>\n<\/menu>\n<menu id=\"userscript-search-by-image\" type=\"context\">\n<menu><\/menu>\n<\/menu>\n<menu id=\"userscript-search-by-image\" type=\"context\">\n<menu><\/menu>\n<\/menu>\n<menu id=\"userscript-search-by-image\" type=\"context\">\n<menu><\/menu>\n<\/menu>\n<menu id=\"userscript-search-by-image\" type=\"context\">\n<menu><\/menu>\n<\/menu>\n<menu id=\"userscript-search-by-image\" type=\"context\">\n<menu><\/menu>\n<\/menu>\n<menu id=\"userscript-search-by-image\" type=\"context\">\n<menu><\/menu>\n<\/menu>\n","protected":false},"excerpt":{"rendered":"<p>This post is not relevant anymore. Gab has permanently removed (and will not be re-enabling) Federation in any capacity, so there's no point to even considering running your own Gab Social-based site. These instructions cover the complete process, \u201call batteries included\u201d, as I executed this on a VPS. First, install Docker+Compose. Then, grab the Gab &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[43,42,46,145,48],"class_list":["post-587","post","type-post","status-publish","format-standard","hentry","category-drafts","tag-docker","tag-gab","tag-installation","tag-obsolete","tag-pleroma"],"_links":{"self":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts\/587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/comments?post=587"}],"version-history":[{"count":1,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts\/587\/revisions"}],"predecessor-version":[{"id":2033,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts\/587\/revisions\/2033"}],"wp:attachment":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/media?parent=587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/categories?post=587"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/tags?post=587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}