<!DOCTYPE html>
<html lang="en">
<head>
    <link href="//fonts.googleapis.com/css?family=Muli:400,400italic" rel="stylesheet" type="text/css">
    <meta charset="utf-8"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Butterknife server</title>
    <style type="text/css">
        img {
            max-width: 100%;
            max-height: 100%;
        }

        footer {
            display: block;
            text-align: center;
        }

        a {
            text-decoration: none;
            color: #44c;
        }


        html,body {
            margin: 0;
            padding: 0 0 1em 0;
        }

        .comment {
            color: #aaf;
        }

        table th, table td {
            border: 1px solid #ccc;
            padding: 2px;
        }

        h1, h2, th {
            font-family: 'Muli';
            font-weight: bold;
        }

        h1 {
            text-align: center;
            font-size: 22pt;
        }

        h2 {
            font-size: 18pt;
        }

        h2 svg {
            position: relative;
            top: 16px;
        }

        p, td, footer {
            font-family: 'Muli';
            font-size: 14pt;
        }

        pre {
            overflow: auto;
            border: 1px solid #000;
            background: #444;
            color: #fff;
            font-size: 12pt;
            padding: 4px;
            border-radius: 6px;
            margin: 0 0;
        }

        header {
            background: #222;
            color: #ff8;
            margin: 0 auto;
        }

        #container, header h1 {
            margin: 0 auto;
            max-width: 960px;
        }


        #container {
            margin: 1em auto;
            padding: 1em;
        }

        ul {
            list-style: none;
            padding: 0;
        }

        li {
            font-family: monospace;
            font-size: 12pt;
        }

        li span.version {
            font-size: 8pt;
            border-radius: 3px;
            padding: 2px;
            margin: 2px 0;
        }

        li {
            padding-bottom: 1px;
            border-bottom: 1px solid #eee;
            clear: right;
        }

        .package.new.version {
            background-color: #A6F3A6;
        }

        .package.old.version {
            background-color: #F8CBCB;
        }

        .package.version.container {
            float: right;
        }
    </style>
</head>
<body>



<div id="container">

    <img src="http://butterknife.rocks/img/butterknife-logo-cropped.svg" style="margin: 0 auto; display:block; "/>
    {% block container %}

    <h2>What is this?</h2>
    <p>You've stumbled upon <a href="http://butterknife.rocks/">Butterknife</a>
    server instance, some cool kids are hosting Linux-based operating system
    templates here as Btrfs snapshots and you can deploy those
    templates on your computer.
    See <a href="http://butterknife.rocks/">Butterknife project website</a>
    what this fuss is all about.
    </p>

    <h2>How to use it?</h2>
    <p>
    You are reccommended to boot Butterknife provisioning image either
    from PXE or from memory stick.
    </p>

    <h2>
    <svg height="48" width="48">
        <circle fill="none" stroke-width="3" stroke="black" r="20" cy="24" cx="24"></circle>
        <text dominant-baseline="middle" text-anchor="middle" y="26" x="24">1</text>
    </svg>
    Provision using memory stick</h2>

    <p>Download <a href="http://butterknife.rocks/provision/butterknife-amd64.iso">ISO file</a> and write it on a memory stick

    <pre>wget -c http://butterknife.rocks/provision/butterknife-amd64.iso
sudo dd if=butterknife-amd64.iso of=/dev/sdx</pre>

    <p>Windows users may want to give <a href="https://sourceforge.net/projects/win32diskimager/">Win32 Disk Imager</a> a try.
    You can also set up TFTP server for booting via PXE, see GitHub page for more information.
    If something doesn't work as expected make sure you're using up to date provisioning image.
    </p>


    <h2>
    <svg height="48" width="48">
        <circle fill="none" stroke-width="3" stroke="black" r="20" cy="24" cx="24"></circle>
        <text dominant-baseline="middle" text-anchor="middle" y="26" x="24">2</text>
    </svg>
    Boot the machine</h2>

    <p>Boot the machine either from memory stick.
    Refer to your motherboard manual for temporary boot device.
    Note that currently Butterknife supports legacy boot methods only,
    hence make sure you have turned (U)EFI and secure boot off.

    <h2>
    <svg height="48" width="48">
        <circle fill="none" stroke-width="3" stroke="black" r="20" cy="24" cx="24"></circle>
        <text dominant-baseline="middle" text-anchor="middle" y="26" x="24">3</text>
    </svg>
    Follow instructions on the screen
    </h2>

    <p>
    Make sure you're connected to a DHCP-enabled router via ethernet cable and wait
    for Butterknife provisioning image to boot up.
    Once you've landed at following screen, you're almost done, just
    <a href="https://github.com/laurivosandi/butterknife#deployment-workflow">follow instructions of the screen</a>:</p>

    <img src="https://github.com/laurivosandi/butterknife/raw/master/doc/img/butterknife-main-screen.png" style="margin: 0 auto; display: block;"/>

    <p>Butterknife wipes the harddisk, creates a Btrfs filesystem and downloads the
    snapshot to newly created filesystem by default.
    There are options to use unpartitioned disk space, reformat a partition,
    resize NTFS filesystem and even receive into existing Btrfs filesystem.
    Once the snapshot is downloaded you can join the machine to an
    Active Directory compatible domain or create a local user account.
    Finally post installation scripts reconfigure bootloader
    and if you're lucky enough you're greeted with a shiny Linux OS deployment.</p>

    <h2>Run downstream server</h2>

    <p>In case you want to run downstream Butterknife server with
    snapshots on this machine you can use <i>butterknife pull</i> feature,
    but first install Butterknife:</p>

    <pre>pip3 install butterknife</pre>

    <p>Pull the snapshots from this server:</p>

    <pre>butterknife pull {{request.uri}}</pre>

    <p>Run downstream server:</pre>

    <pre>butterknife serve</pre>

    <p>This of course assumes you're running on top of Btrfs filesystem and
    your Btrfs utilities are up-to-date.</p>

    <h2>Available snapshots</h2>

    <p>Following snapshots are available on this server, use
    <i>butterknife pull</i> to download the snapshots to your local server
    as described above or use Butterknife provisioning image to deploy the templates.</p>

    <table style="border-collapse:collapse; width:100%;">
        <tr>
            <th>Owner</th>
            <th>Name</th>
            <th>Architecture</th>
            <th>Version</th>
            <th>Stream</th>
            <th>Actions</th>
        </tr>
        {% for subvolume in subvolumes %}
            <tr>
                <td>{{subvolume.domain}}</td>
                <td>{{subvolume.identifier}}</td>
                <td>{{subvolume.architecture}}</td>
                <td>{{subvolume.created}}</td>
                <td>
                    <a href="/{{subvolume}}" title="Download in .far format, suitable for piping to: btrfs receive">far</a>
                    <a href="/{{subvolume}}/?format=tar" title="Download in .tar format, suitable for piping to: tar xvf -">tar</a>
                    <a href="/{{subvolume}}/manifest/" title="Download manifest">mft</a>
                    {% if subvolume.signed %}| <a href="/{{subvolume}}/signature/" title="Download signature">signature</a>{% endif %}
                </td>
                <td>
                    <a href="/{{subvolume}}/packages/">dpkg</a>
                    {% if newer_subvolume %}
                    <a href="/{{newer_subvolume}}/packages/?parent={{subvolume}}">diff</a>{% endif %}
                </td>
            </tr>
            {% set newer_subvolume = subvolume %}
        {% endfor %}
    </table>
{% endblock %}
</div>

</body>
<footer><a href="http://butterknife.rocks/">Butterknife</a> by Lauri Võsandi</footer>

</html>
