You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update datastore implementation to use 'mysql' struct tag to map between struct attrs and mysql db columns
* Use microsecond precision timestamp when updating records in mysql
* Add postgres datastore config support
* Add datastore migrations for postgres
* Remove support for basic page/limit pagination in favor of cursor-based pagination
* Add postgres datastore support for all resources
* Move the self-hosting instructions into separate READMEs for each database
* Update link to SQLite issue in README
* Fix typo in command
Copy file name to clipboardExpand all lines: README.md
+4-97Lines changed: 4 additions & 97 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,106 +60,13 @@ Once you've created an account, refer to our [docs](https://docs.warrant.dev/) t
60
60
61
61
### Self-hosting
62
62
63
-
#### Configuring the database
63
+
To self-host or run Warrant locally, follow one of the guides below (select the guide for your database of choice).
64
64
65
-
Warrant requires a database to persist access control data, authorization models, and access rules, so if you choose to self-host Warrant, you'll first need to setup a database, then configure Warrant to connect to the database on startup. The open source version of Warrant currently supports the following databases:
- To request support for another database, please [open an issue](https://github.com/warrant-dev/warrant/issues/new/choose)!
71
69
72
-
#### Configuring the database schema
73
-
74
-
Once you've setup your database, you can create the database schema using [golang-migrate](https://github.com/golang-migrate/migrate).
75
-
76
-
Update to the latest schema:
77
-
78
-
```bash
79
-
migrate -source github://warrant-dev/warrant/migrations/datastore/mysql -database mysql://root@/warrant up
80
-
```
81
-
82
-
#### Run the Warrant Docker image
83
-
84
-
Pull the latest Warrant Docker image
85
-
86
-
```bash
87
-
docker pull warrantdev/warrant
88
-
```
89
-
90
-
Create a configuration file `warrant.env` with the following
91
-
92
-
```bash
93
-
WARRANT_PORT=8000
94
-
WARRANT_LOGLEVEL=0
95
-
WARRANT_ENABLEACCESSLOG=true
96
-
WARRANT_DATASTORE=mysql
97
-
WARRANT_DATASTORE_MYSQL_USERNAME=root
98
-
WARRANT_DATASTORE_MYSQL_PASSWORD=
99
-
WARRANT_DATASTORE_MYSQL_HOSTNAME=127.0.0.1
100
-
WARRANT_DATASTORE_MYSQL_DATABASE=warrant
101
-
```
102
-
103
-
Start the container, passing in the configuration file as environment variables to the container
104
-
105
-
```bash
106
-
docker run --name warrant --env-file warrant.env warrantdev/warrant
107
-
```
108
-
109
-
#### Docker Compose
110
-
111
-
To make it easier to run a database alongside Warrant, you can use [Docker Compose](https://docs.docker.com/compose/) to automatically setup and manage the database alongside Warrant. You can also accomplish this by running Warrant with [Kubernetes](https://kubernetes.io/).
112
-
113
-
Here's an example `docker-compose.yaml` that sets up a MySQL database, creates the database schema required by Warrant, and finally starts Warrant.
This guide will cover how to self-host Warrant with MySQL as the datastore. Note that Warrant only supports versions of MySQL >= 8.0.32.
4
+
5
+
## Docker Compose (Recommended)
6
+
7
+
The following [Docker Compose](https://docs.docker.com/compose/) manifest will create a MySQL database, setup the database schema required by Warrant, and start Warrant. You can also accomplish this by running Warrant with [Kubernetes](https://kubernetes.io/).
Follow the [MySQL Installation Guide](https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/) for your OS to install and start MySQL. For MacOS users, we recommend [installing MySQL using homebrew](https://formulae.brew.sh/formula/mysql).
62
+
63
+
### Migrate the Database Schema
64
+
65
+
Once you've setup and started your database, you can setup the database schema using [golang-migrate](https://github.com/golang-migrate/migrate).
66
+
67
+
Migrate to the latest schema:
68
+
69
+
```bash
70
+
migrate -source github://warrant-dev/warrant/migrations/datastore/mysql -database mysql://replace_with_username@/warrant up
71
+
```
72
+
73
+
### Download and Run the Binary
74
+
75
+
Download the latest warrant binary for your architecture from [here](https://github.com/warrant-dev/warrant/releases/latest). Then unzip the tarball and run the `warrant` executable.
0 commit comments