<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 get advice or make changes, just keep commiting to the branch, and pushing to your branch.
When we are happy with the code, we'll merge in github, meaning you can now clean up your branch.</p>
<pre><code>git checkout master
git pull
git branch -D <feature-branch-name>
</code></pre>
<p>Rebasing:</p>
<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
<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. Defaults to <code>kanidm</code>.</td></tr>
<tr><td><code>IMAGE_VERSION</code></td><td>Determines the container's tag.</td></tr>
<tr><td><code>CONTAINER_TOOL_ARGS</code></td><td>Specify extra options for the container build tool.</td></tr>
<tr><td><code>IMAGE_ARCH</code></td><td>Passed to <code>--platforms</code> when the container is built. Defaults to <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></tr>
<tr><td><code>CONTAINER_TOOL</code></td><td>Use an alternative container build tool. Defaults to <code>docker</code>.</td></tr>
<tr><td><code>BOOK_VERSION</code></td><td>Sets version used when building the documentation book. Defaults to <code>master</code>.</td></tr>
</tbody></table>
<p>Build a development container using <code>podman</code>:</p>
<pre><code>CONTAINER_TOOL=podman make build/kanidmd
</code></pre>
<p>Build a development container and specify a redis build cache:</p>
<pre><code>CONTAINER_BUILD_ARGS="--build-arg "SCCACHE_REDIS=redis://redis.dev.blackhats.net.au:6379"" make build/kanidmd