<buttonid="sidebar-toggle"class="icon-button"type="button"title="Toggle Table of Contents"aria-label="Toggle Table of Contents"aria-controls="sidebar">
<ahref="print.html"title="Print this book"aria-label="Print this book">
<iid="print-button"class="fa fa-print"></i>
</a>
</div>
</div>
<divid="search-wrapper"class="hidden">
<formid="searchbar-outer"class="searchbar-outer">
<inputtype="search"id="searchbar"name="searchbar"placeholder="Search this book ..."aria-controls="searchresults-outer"aria-describedby="searchresults-header">
<p>If you are asked to rebase your change, follow these steps:</p>
<pre><code>git checkout master
git pull
git checkout <feature-branch-name>
git rebase master
</code></pre>
<p>Then be sure to fix any merge issues or other comments as they arise. If you have issues, you can always stop and reset with:</p>
<pre><code>git rebase --abort
</code></pre>
<h3id="development-server-quickstart-for-interactive-testing"><aclass="header"href="#development-server-quickstart-for-interactive-testing">Development Server Quickstart for Interactive Testing</a></h3>
<p>After getting the code, you will need a rust environment. Please investigate <ahref="https://rustup.rs">rustup</a> for your platform to establish this.</p>
<p>Once you have the source code, you need certificates to use with the server, because without certificates, authentication will fail. </p>
<p>We recommend using <ahref="https://letsencrypt.org">Let's Encrypt</a>, but if this is not possible, please use our insecure cert tool (<code>insecure_generate_tls.sh</code>). The insecure cert tool creates <code>/tmp/kanidm</code> and puts some self-signed certificates there.</p>
<p>You can now build and run the server with the commands below. It will use a database in <code>/tmp/kanidm.db</code>.</p>
<p>Create the initial database and generate an <code>admin</code> username:</p>
<pre><code>cargo run --bin kanidmd recover_account -c ./examples/insecure_server.toml -n admin
<snip>
Success - password reset to -> Et8QRJgQkMJu3v1AQxcbxRWW44qRUZPpr6BJ9fCGapAB9cT4
</code></pre>
<p>Record the password above, then run the server start command:</p>
<pre><code>cd kanidmd/daemon
cargo run --bin kanidmd server -c ../../examples/insecure_server.toml
</code></pre>
<p>(The server start command is also a script in <code>kanidmd/daemon/run_insecure_dev_server.sh</code>)</p>
<p>In a new terminal, you can now build and run the client tools with:</p>
<h3id="building-the-web-ui"><aclass="header"href="#building-the-web-ui">Building the Web UI</a></h3>
<p><strong>NOTE:</strong> There is a pre-packaged version of the Web UI at <code>/kanidmd_web_ui/pkg/</code>, which can be used directly. This means you don't need to build the Web UI yourself</p>
<p>The web UI uses rust wasm rather than javascript. To build this you need to set up the environment.</p>
<pre><code>cargo install wasm-pack
npm install --global rollup
</code></pre>
<p>Then you are able to build the UI.</p>
<pre><code>cd kanidmd_web_ui/
./build_wasm.sh
</code></pre>
<p>The "developer" profile for kanidmd will automatically use the pkg output in this folder.</p>
<p>Setting different developer profiles while building is done by setting the environment variable KANIDM_BUILD_PROFILE to one of the bare filename of the TOML files in <code>/profiles</code>. </p>
<tr><td><code>IMAGE_BASE</code></td><td>Base location of the container image.</td><td><code>kanidm</code></td></tr>
<tr><td><code>IMAGE_VERSION</code></td><td>Determines the container's tag.</td><td>None</td></tr>
<tr><td><code>CONTAINER_TOOL_ARGS</code></td><td>Specify extra options for the container build tool.</td><td>None</td></tr>
<tr><td><code>IMAGE_ARCH</code></td><td>Passed to <code>--platforms</code> when the container is built.</td><td><code>linux/amd64,linux/arm64</code></td></tr>
<tr><td><code>CONTAINER_BUILD_ARGS</code></td><td>Override default ARG settings during the container build.</td><td>None</td></tr>
<tr><td><code>CONTAINER_TOOL</code></td><td>Use an alternative container build tool.</td><td><code>docker</code></td></tr>
<tr><td><code>BOOK_VERSION</code></td><td>Sets version used when building the documentation book.</td><td><code>master</code></td></tr>
<h4id="automatically-built-containers"><aclass="header"href="#automatically-built-containers">Automatically built containers</a></h4>
<p>To speed up testing across platforms, we're leveraging GitHub actions to build containers for test use.</p>
<p>Whenever code is merged with the <code>master</code> branch of Kanidm, containers are automatically built for <code>kanidmd</code> and <code>radius</code>. Sometimes they fail to build, but we'll try and keep them avilable.</p>
<p>To find information on the packages, <ahref="https://github.com/orgs/kanidm/packages?repo_name=kanidm">visit the Kanidm packages page here</a>.</p>
<p>An example command for pulling and running the radius container is below. You'll need to <ahref="https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry">authenticate with the GitHub container registry first</a>.</p>