{% extends "base.html" %} {% block title %}Bootstrapping instructions{% endblock
%} {% block content %}
<h1>Bootstrapping instructions</h1>
<h2>Installing a Linux Terminal</h2>
<h3>Installing Cygwin</h3>
<p>
  If you already have a Cygwin install, rename it so that it doesn't get
  overwritten (something like "[install name]-old").
</p>
<p>
  Download the Cygwin setup executable using this
  <a href="/cygwin/setup-x86_64.exe">mirror</a>, and then run the following from
  a terminal (both Command Prompt and Windows Powershell work)
</p>
<pre style="font-family: monospace">
    $ setup-x86_64.exe -O -R C:\cygwin64 -s {{ request.url.scheme }}://{{ request.url.netloc }}/cygwin -P curl,python3,rsync -q
</pre>
<p>
  The Cygwin install sometimes hangs even when it is finished, hit Enter to
  return to a command prompt.
</p>

<h3>Installing MSYS2</h3>
<p>
  MSYS2 is a lightweight Linux environment which provides compiler support for
  the more modern programming languages used in the backend of Murfey's package
  dependencies.
</p>
<p>
  The Murfey server supports the forwarding of download requests to client PCs
  that cannot access the wider internet. Download the MSYS2 setup executable
  using this <a href="/msys2/setup-x86_64.exe">mirror</a>, and run the
  executable using the default settings.
</p>
<p>
  By default, MSYS2 comes with preset lists of mirrors and servers that it
  installs its packages from. These will need to be disabled, and replaced with
  URLs of the same format that point to the Murfey server the client PC is
  connected to.
</p>
<p>
  These lists can be found in the following folder, if the default installation
  options were chosen:
</p>
<pre style="font-family: monospace">
    C:\msys64\etc\pacman.d\mirrorlist.{environment}
</pre>
<p>This is an example of how the URL to the Murfey server should look like:</p>
<pre style="font-family: monospace">
    Server = https://repo.msys2.org/mingw/x86_64/  # Original URL
    Server = {{ request.url.scheme }}://{{ request.url.netloc }}/msys2/mingw/x86_64  # Murfey URL
</pre>
<p>
  MSYS2 comes with multiple environments, but UCRT64 is the most modern one. In
  order for the Murfey client to be able to install and run its dependencies
  properly, the following packages will need to be installed in the UCRT64
  environment. This can be achieved using the following commands:
</p>
<pre style="font-family: monospace">
    $ pacman -Syu --disable-download-timeout  # Downloads the package database and searches for updates
    $ pacman -S rsync --disable-download-timeout
    $ pacman -S mingw-w64-python-pip --disable-download-timeout
    $ pacman -S mingw-w64-x86_64-rust --disable-download-timeout
</pre>

<h2>Setting Up Python</h2>
<p>
  Once Python and pip are installed in the terminal, you have the option to
  install Murfey in either the base environment or a virtual environment. The
  base environment is simpler, but uninstallation of the Python packages in the
  future could potentially interfere with the base environment's functionality.
</p>
<h3>Setting Up a Virtual Environment</h3>
<p>To set up a virtual environment, run the following commands:</p>
<pre style="font-family: monospace">
    $ pip install virtualenv --index-url {{ request.url.scheme }}://{{ request.url.netloc }}/pypi --trusted-host {{ request.url.hostname }}
    $ virtualenv your-env-name  # Create the virtual environment
    $ source your-env-name/bin/activate  # Activate the virtual environment
</pre>
<h3>Installing Murfey</h3>
<p>
  You can install Murfey in the Python environment (the base one or a virtual
  environment) in either the Cygwin or UCRT64 terminal using the following
  commands:
</p>
<pre style="font-family: monospace">
    $ pip install murfey[client] --index-url {{ request.url.scheme }}://{{ request.url.netloc }}/pypi --trusted-host {{ request.url.hostname }}
</pre>
{% endblock %}
