Skip to content

Commit 0e4d8a0

Browse files
authored
Add README explaining how to run Warrant with SQLite (#92)
* Rearrange/update main README * Add setup tutorial for running Warrant with SQLite * Rearrange links in main README
1 parent 342c090 commit 0e4d8a0

File tree

2 files changed

+59
-3
lines changed

2 files changed

+59
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
</p>
44
<p align="center">
55
<a href="https://warrant.dev/">Website</a> |
6+
<a href="https://app.warrant.dev/signup">Warrant Cloud</a> |
67
<a href="https://docs.warrant.dev/">Docs</a> |
78
<a href="https://docs.warrant.dev/objecttypes/get-all-object-types/">API Reference</a>
89
</p>
@@ -25,7 +26,6 @@ Warrant allows you to define, store, and manage your product's authorization mod
2526
## Features
2627

2728
- A real-time, low latency `check` API to perform access checks in your application at runtime (e.g. _is `user:A editor of tenant:X`?_)
28-
- A real-time `query` API to query and audit access rules for a given subject or object (e.g. _`which users in tenant:1 have access to object:A?`_)
2929
- Built-in support for roles & permissions (RBAC) + API endpoints to create and manage custom roles & permissions from your application
3030
- Built-in support for multi-tenant access control
3131
- Define roles, permissions, access rules, etc. _per tenant_
@@ -60,6 +60,7 @@ The quickest and easiest way to get started with Warrant is by using the managed
6060
Warrant Cloud is compatible with the same APIs as this open source version and provides additional functionality like:
6161

6262
- An admin dashboard for quickly managing your authorization model and access rules via an intuitive, easy-to-use UI
63+
- A real-time `query` API to query and audit access rules for a given subject or object (e.g. _`which users in tenant:1 have access to object:A?`_)
6364
- Multi-region availability
6465
- Improved access check latency & throughput for large scale use cases.
6566

@@ -71,7 +72,7 @@ To self-host or run Warrant locally, follow one of the guides below (select the
7172

7273
- [MySQL](/migrations/datastore/mysql/README.md)
7374
- [Postgres](/migrations/datastore/postgres/README.md)
74-
- SQLite (coming soon) - Upvote [the issue](https://github.com/warrant-dev/warrant/issues/14)
75+
- [SQLite](/migrations/datastore/sqlite/README.md)
7576
- To request support for another database, please [open an issue](https://github.com/warrant-dev/warrant/issues/new/choose)!
7677

7778
## SDKs
@@ -102,7 +103,7 @@ To report a bug you found or request a feature that you'd like, open an issue. I
102103

103104
Contributions from the community are welcome! Just be sure to follow some ground rules:
104105

105-
- Never submit a PR without an issue.
106+
- Never submit a PR without an associated issue.
106107
- Issues should mention whether the issue is a bug or a feature.
107108
- Issues reporting a bug should describe (1) steps to reproduce the bug, (2) what the current behavior is, and (3) what the expected behavior should be.
108109
- Issues requesting a feature should (1) provide a description of the feature and (2) explain the intended use case for the feature.

migrations/datastore/sqlite/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Running Warrant with SQLite
2+
3+
This guide will cover how to run Warrant with SQLite as the datastore/eventstore. Note that running Warrant with SQLite requires that you build Warrant from source.
4+
5+
## Running the Binary
6+
7+
### Install SQLite
8+
9+
Many operating systems (like MacOS) come with SQLite pre-installed. If you already have SQLite installed, you can skip to the next step. If you don't already have SQLite installed, [install it](https://www.tutorialspoint.com/sqlite/sqlite_installation.htm). Once installed, you should be able to run the following command to print the currently installed version of SQLite:
10+
11+
```bash
12+
sqlite3 --version
13+
```
14+
15+
### Install Go
16+
17+
[Install Go](https://go.dev/doc/install).
18+
19+
### Build Warrant From Source
20+
21+
Clone the Warrant repository from GitHub or download and unzip the tarball containing the source code for the [latest Warrant release](https://github.com/warrant-dev/warrant/releases/latest).
22+
23+
```bash
24+
tar -xvf <name_of_tarball>
25+
```
26+
27+
Navigate to the `cmd/warrant` directory and run `make dev` to build Warrant. This will create a file called `warrant` that contains the executable.
28+
29+
### Create `warrant.yaml` Configuration
30+
31+
Create a file called `warrant.yaml` in the directory containing the Warrant binary. Add properties to configure SQLite as both the datastore and evenstore for Warrant.
32+
33+
```yaml
34+
# warrant.yaml
35+
port: 8000
36+
logLevel: 0
37+
enableAccessLog: true
38+
apiKey: replace_with_api_key
39+
datastore:
40+
sqlite:
41+
database: warrant
42+
inMemory: true
43+
eventstore:
44+
sqlite:
45+
database: warrantEvents
46+
inMemory: true
47+
```
48+
49+
NOTE: By default, SQLite will create a database file for both the database and eventstore. The filenames are configurable using the `database` property under `datastore` and `eventstore`. Specifying the `inMemory` option under `datastore` or `eventstore` will bypass creation of a database file and run the SQLite database completely in memory. When running Warrant with the `inMemory` configuration, **any data in Warrant will be lost once the Warrant process is shutdown/killed**.
50+
51+
### Run the Executable
52+
53+
```bash
54+
./warrant
55+
```

0 commit comments

Comments
 (0)