123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>utils/morty.sh — Searx Documentation (Searx-1.1.0.tex)</title>
- <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
- <link rel="stylesheet" type="text/css" href="../_static/searx.css" />
- <link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
- <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
- <script src="../_static/jquery.js"></script>
- <script src="../_static/underscore.js"></script>
- <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
- <script src="../_static/doctools.js"></script>
- <script src="../_static/sphinx_highlight.js"></script>
- <script src="../_static/tabs.js"></script>
- <link rel="index" title="Index" href="../genindex.html" />
- <link rel="search" title="Search" href="../search.html" />
- <link rel="next" title="utils/lxc.sh" href="lxc.sh.html" />
- <link rel="prev" title="utils/filtron.sh" href="filtron.sh.html" />
- </head><body>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="lxc.sh.html" title="utils/lxc.sh"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="filtron.sh.html" title="utils/filtron.sh"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> »</li>
- <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Admin’s tooling box</a> »</li>
- <li class="nav-item nav-item-this"><a href=""><code class="docutils literal notranslate"><span class="pre">utils/morty.sh</span></code></a></li>
- </ul>
- </div>
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <section id="utils-morty-sh">
- <span id="morty-sh"></span><h1><code class="docutils literal notranslate"><span class="pre">utils/morty.sh</span></code><a class="headerlink" href="#utils-morty-sh" title="Permalink to this heading">¶</a></h1>
- <aside class="sidebar">
- <p class="sidebar-title">further reading</p>
- <ul class="simple">
- <li><p><a class="reference internal" href="../admin/architecture.html#architecture"><span class="std std-ref">Architecture</span></a></p></li>
- <li><p><a class="reference internal" href="../admin/installation.html#installation"><span class="std std-ref">Installation</span></a> (<a class="reference internal" href="../admin/installation-nginx.html#installation-nginx"><span class="std std-ref">nginx</span></a> & <a class="reference internal" href="../admin/installation-apache.html#installation-apache"><span class="std std-ref">apache</span></a>)</p></li>
- <li><p><a class="reference internal" href="../admin/morty.html#searx-morty"><span class="std std-ref">How to setup result proxy</span></a></p></li>
- </ul>
- </aside>
- <p>To simplify installation and maintenance of a <a class="reference external" href="https://github.com/asciimoo/morty">morty</a> instance you can use the
- script <a class="reference external" href="https://github.com/searx/searx/blob/master/utils/morty.sh">Origin: utils/morty.sh</a>. In most cases you will install <a class="reference external" href="https://github.com/asciimoo/morty">morty</a> simply by
- running the command:</p>
- <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo -H ./utils/morty.sh install all
- </pre></div>
- </div>
- <p>The script adds a <code class="docutils literal notranslate"><span class="pre">${SERVICE_USER}</span></code> (default:<code class="docutils literal notranslate"><span class="pre">morty</span></code>) and installs <a class="reference external" href="https://github.com/asciimoo/morty">morty</a>
- into this user account:</p>
- <ol class="arabic simple">
- <li><p>Create a separated user account (<code class="docutils literal notranslate"><span class="pre">morty</span></code>).</p></li>
- <li><p>Download and install <a class="reference external" href="https://golang.org/">Go</a> binary in user’s $HOME (<code class="docutils literal notranslate"><span class="pre">~morty</span></code>).</p></li>
- <li><p>Install <a class="reference external" href="https://github.com/asciimoo/morty">morty</a> with the package management from <a class="reference external" href="https://golang.org/">Go</a> (<code class="docutils literal notranslate"><span class="pre">go</span> <span class="pre">get</span> <span class="pre">-v</span> <span class="pre">-u</span>
- <span class="pre">github.com/asciimoo/morty</span></code>)</p></li>
- <li><p>Setup a systemd service unit <a class="reference external" href="https://github.com/searx/searx/blob/master/utils/templates/lib/systemd/system/morty.service">[ref]</a>
- (<code class="docutils literal notranslate"><span class="pre">/lib/systemd/system/morty.service</span></code>).</p></li>
- </ol>
- <div class="admonition hint">
- <p class="admonition-title">Hint</p>
- <p>To add morty to your searx instance read chapter <a class="reference internal" href="../admin/morty.html#searx-morty"><span class="std std-ref">How to setup result proxy</span></a>.</p>
- </div>
- <section id="create-user">
- <h2>Create user<a class="headerlink" href="#create-user" title="Permalink to this heading">¶</a></h2>
- <div class="sphinx-tabs docutils container">
- <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-YmFzaA==" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-0-YmFzaA==" name="YmFzaA==" role="tab" tabindex="0">bash</button></div><div aria-labelledby="tab-0-YmFzaA==" class="sphinx-tabs-panel group-tab" id="panel-0-YmFzaA==" name="YmFzaA==" role="tabpanel" tabindex="0"><div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ sudo -H useradd --shell /bin/bash --system <span class="se">\</span>
- --home-dir <span class="s2">"/usr/local/morty"</span> <span class="se">\</span>
- --comment <span class="s2">"Privacy-respecting metasearch engine"</span> morty
- $ sudo -H mkdir <span class="s2">"/usr/local/morty"</span>
- $ sudo -H chown -R <span class="s2">"morty:morty"</span> <span class="s2">"/usr/local/morty"</span>
- </pre></div>
- </div>
- </div></div>
- </section>
- <section id="install-go">
- <h2>Install go<a class="headerlink" href="#install-go" title="Permalink to this heading">¶</a></h2>
- <div class="sphinx-tabs docutils container">
- <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-1-YmFzaA==" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-1-YmFzaA==" name="YmFzaA==" role="tab" tabindex="0">bash</button></div><div aria-labelledby="tab-1-YmFzaA==" class="sphinx-tabs-panel group-tab" id="panel-1-YmFzaA==" name="YmFzaA==" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ cat > <span class="s2">"/usr/local/morty/.go_env"</span> <span class="s"><<EOF</span>
- <span class="s">export GOPATH=/usr/local/morty/go-apps</span>
- <span class="s">export PATH=$PATH:/usr/local/morty/local/go/bin:$GOPATH/bin</span>
- <span class="s">EOF</span>
- $ sudo -i -u <span class="s2">"morty"</span>
- <span class="o">(</span>morty<span class="o">)</span> $ <span class="nb">echo</span> <span class="s1">'source /usr/local/morty/.go_env'</span> >> ~/.profile
- <span class="o">(</span>morty<span class="o">)</span> $ mkdir /usr/local/morty/local
- <span class="o">(</span>morty<span class="o">)</span> $ wget --progress<span class="o">=</span>bar -O <span class="s2">"go1.13.5.linux-amd64.tar.gz"</span> <span class="se">\</span>
- <span class="s2">"https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz"</span>
- <span class="o">(</span>morty<span class="o">)</span> $ tar -C /usr/local/morty/local -xzf <span class="s2">"go1.13.5.linux-amd64.tar.gz"</span>
- <span class="o">(</span>morty<span class="o">)</span> $ which go
- /usr/local/morty/local/go/bin/go
- </pre></div>
- </div>
- </div></div>
- </section>
- <section id="install-morty">
- <h2>Install morty<a class="headerlink" href="#install-morty" title="Permalink to this heading">¶</a></h2>
- <p>Install morty software and systemd unit:</p>
- <div class="sphinx-tabs docutils container">
- <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-2-YmFzaA==" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-2-YmFzaA==" name="YmFzaA==" role="tab" tabindex="0">bash</button></div><div aria-labelledby="tab-2-YmFzaA==" class="sphinx-tabs-panel group-tab" id="panel-2-YmFzaA==" name="YmFzaA==" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ sudo -i -u <span class="s2">"morty"</span>
- <span class="o">(</span>morty<span class="o">)</span> $ go get -v -u github.com/asciimoo/morty
- </pre></div>
- </div>
- </div></div>
- <div class="sphinx-tabs docutils container">
- <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-3-c3lzdGVtZA==" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-3-c3lzdGVtZA==" name="c3lzdGVtZA==" role="tab" tabindex="0">systemd</button></div><div aria-labelledby="tab-3-c3lzdGVtZA==" class="sphinx-tabs-panel group-tab" id="panel-3-c3lzdGVtZA==" name="c3lzdGVtZA==" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="o">[</span>Unit<span class="o">]</span>
- <span class="nv">Description</span><span class="o">=</span>morty
- <span class="nv">After</span><span class="o">=</span>syslog.target
- <span class="nv">After</span><span class="o">=</span>network.target
- <span class="o">[</span>Service<span class="o">]</span>
- <span class="nv">Type</span><span class="o">=</span>simple
- <span class="nv">User</span><span class="o">=</span>morty
- <span class="nv">Group</span><span class="o">=</span>morty
- <span class="nv">WorkingDirectory</span><span class="o">=</span>/usr/local/morty
- <span class="nv">ExecStart</span><span class="o">=</span>/usr/local/morty/go-apps/bin/morty -key <span class="s1">''</span> -listen <span class="s1">'127.0.0.1:3000'</span> -timeout <span class="m">5</span>
- <span class="nv">Restart</span><span class="o">=</span>always
- <span class="nv">Environment</span><span class="o">=</span><span class="nv">USER</span><span class="o">=</span>morty <span class="nv">HOME</span><span class="o">=</span>/usr/local/morty <span class="nv">DEBUG</span><span class="o">=</span><span class="nb">false</span>
- <span class="c1"># Some distributions may not support these hardening directives. If you cannot</span>
- <span class="c1"># start the service due to an unknown option, comment out the ones not supported</span>
- <span class="c1"># by your version of systemd.</span>
- <span class="nv">ProtectSystem</span><span class="o">=</span>full
- <span class="nv">PrivateDevices</span><span class="o">=</span>yes
- <span class="nv">PrivateTmp</span><span class="o">=</span>yes
- <span class="nv">NoNewPrivileges</span><span class="o">=</span><span class="nb">true</span>
- <span class="o">[</span>Install<span class="o">]</span>
- <span class="nv">WantedBy</span><span class="o">=</span>multi-user.target
- </pre></div>
- </div>
- </div></div>
- </section>
- <section id="overview">
- <span id="morty-sh-overview"></span><h2>Overview<a class="headerlink" href="#overview" title="Permalink to this heading">¶</a></h2>
- <p>The <code class="docutils literal notranslate"><span class="pre">--help</span></code> output of the script is largely self-explanatory
- (<a class="reference internal" href="index.html#toolboxing-common"><span class="std std-ref">Common commands & environment</span></a>):</p>
- <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>usage::
- morty.sh shell
- morty.sh install [all|user]
- morty.sh update [morty]
- morty.sh remove [all]
- morty.sh activate [service]
- morty.sh deactivate [service]
- morty.sh inspect [service]
- morty.sh option [debug-on|debug-off|new-key]
- morty.sh apache [install|remove]
- morty.sh nginx [install|remove]
- morty.sh info [searx]
- shell
- start interactive shell from user morty
- install / remove
- all: complete setup of morty service
- user: add/remove service user 'morty' (/usr/local/morty)
- update morty
- Update morty installation (/usr/local/morty)
- activate service
- activate and start service daemon (systemd unit)
- deactivate service
- stop and deactivate service daemon (systemd unit)
- inspect service
- show service status and log
- option
- set one of the available options
- :new-key: set new morty key
- apache : http://fv-az163-121/morty/
- :install: apache site with a reverse proxy (ProxyPass)
- :remove: apache site morty.conf
- nginx (http://fv-az163-121/morty/)
- :install: nginx site with a reverse proxy (ProxyPass)
- :remove: nginx site morty.conf
- If needed, set the environment variables in the '.config.sh' file::
- PUBLIC_URL_MORTY: http://fv-az163-121/morty/
- MORTY_LISTEN: 127.0.0.1:3000
- SERVICE_USER: morty
- To activate result and image proxy in searx, edit settings.yml (read:
- https://searx.github.io/searx/admin/morty.html)::
- result_proxy:
- url : http://fv-az163-121/morty/
- server:
- image_proxy : True
- </pre></div>
- </div>
- </section>
- </section>
- <div class="clearer"></div>
- </div>
- </div>
- </div>
- <span id="sidebar-top"></span>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
-
-
- <p class="logo"><a href="../index.html">
- <img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
- </a></p>
-
- <h3>Project Links</h3>
- <ul>
- <li><a href="https://searx.github.io/searx/blog/index.html">Blog</a>
-
- <li><a href="https://github.com/searx/searx">Source</a>
-
- <li><a href="https://github.com/searx/searx/wiki">Wiki</a>
-
- <li><a href="https://twitter.com/Searx_engine">Twitter</a>
-
- <li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
- </ul><h3>Navigation</h3>
- <ul>
- <li><a href="../index.html">Overview</a>
- <ul>
- <li><a href="index.html">Admin’s tooling box</a>
- <ul>
- <li>Previous: <a href="filtron.sh.html" title="previous chapter"><code class="docutils literal notranslate"><span class="pre">utils/filtron.sh</span></code></a>
- <li>Next: <a href="lxc.sh.html" title="next chapter"><code class="docutils literal notranslate"><span class="pre">utils/lxc.sh</span></code></a></ul>
- </li>
- </ul>
- </li>
- </ul>
- <div id="searchbox" style="display: none" role="search">
- <h3 id="searchlabel">Quick search</h3>
- <div class="searchformwrapper">
- <form class="search" action="../search.html" method="get">
- <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
- <input type="submit" value="Go" />
- </form>
- </div>
- </div>
- <script>document.getElementById('searchbox').style.display = "block"</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
-
- <div class="footer" role="contentinfo">
- © Copyright 2015-2022, Adam Tauber, Noémi Ványi.
- Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
- </div>
- <script src="../_static/version_warning_offset.js"></script>
- </body>
- </html>
|