Skip to content

Commit

Permalink
Merge pull request #8 from faroedev/cli-data-dir
Browse files Browse the repository at this point in the history
CLI: Add `--dir` option to serve command
  • Loading branch information
pilcrowonpaper authored Oct 28, 2024
2 parents b6a28f6 + 0e6118a commit 88da67e
Show file tree
Hide file tree
Showing 87 changed files with 307 additions and 298 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.2.1

- Added `--dir` option `serve` command.˝

## 0.2.0

- Removed `email` field from user model.
Expand Down
5 changes: 3 additions & 2 deletions docs/malta.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
{
"title": "API reference",
"pages": [
["Rest API", "/api-reference/rest"],
["JavaScript SDK", "/api-reference/sdk-js"]
["CLI", "/reference/cli"],
["Rest API", "/reference/rest"],
["JavaScript SDK", "/reference/sdk-js"]
]
},
{
Expand Down
94 changes: 0 additions & 94 deletions docs/pages/api-reference/rest/index.md

This file was deleted.

76 changes: 0 additions & 76 deletions docs/pages/api-reference/sdk-js/main/Faroe/index.md

This file was deleted.

30 changes: 0 additions & 30 deletions docs/pages/api-reference/sdk-js/main/index.md

This file was deleted.

33 changes: 33 additions & 0 deletions docs/pages/reference/cli/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: "CLI reference"
---

# CLI reference

## generate-secret

Generates a random secret with 200 bits of entropy using a cryptographically secure source.

```
faroe generate-secret
```

## serve

Creates a `faroe_data` directory with an SQLite database file if it doesn't already exist and starts the server on port 4000.

```
faroe serve [...options]
```

### Options

- `--port`: The port number (default: 4000).
- `--dir`: The path of the directory to store data (default: `faroe_data`).
- `--secret`: A random secret. If provided, requires requests to the server to include the secret in the `Authorization` header.

### Example

```
faroe serve --port=3000 --dir="/data/faroe" --secret=SECURE_SECRET
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GET https://your-domain.com/email-update-requests/[request_id]

## Successful response

Returns the [email update request model](/api-reference/rest/models/email-update-request) if the request exists and is valid.
Returns the [email update request model](/reference/rest/models/email-update-request) if the request exists and is valid.

## Error codes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GET https://your-domain.com/password-reset-requests/REQUEST_ID

## Successful response

Returns the [password reset request model](/api-reference/rest/models/password-reset-request) if the request exists and is valid.
Returns the [password reset request model](/reference/rest/models/password-reset-request) if the request exists and is valid.

## Error codes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ All parameters are optional.

## Successful response

Returns a JSON array of [user models](/api-reference/rest/models/user). If there are no users in the page, it will return an empty array.
Returns a JSON array of [user models](/reference/rest/models/user). If there are no users in the page, it will return an empty array.

You can get the number of total pages from the `X-Pagination-Total-Pages` header and the total number of users with the `X-Pagination-Total` header..

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GET https://your-domain.com/users/USER_ID

## Successful response

Returns the [user model](/api-reference/rest/models/user) of the user if they exist.
Returns the [user model](/reference/rest/models/user) of the user if they exist.

## Error codes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GET https://your-domain.com/users/USER_ID/email-update-requests

## Successful response

Returns a JSON array of [email update request models](/api-reference/rest/models/email-update-request). If the user does not have any update requests, it will return an empty array.
Returns a JSON array of [email update request models](/reference/rest/models/email-update-request). If the user does not have any update requests, it will return an empty array.

### Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GET https://your-domain.com/users/USER_ID/email-verification-reqes

## Successful response

Returns the [user email verification request model](/api-reference/rest/models/user-email-verification-request) if the request exists and is valid.
Returns the [user email verification request model](/reference/rest/models/user-email-verification-request) if the request exists and is valid.

## Error codes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GET https://your-domain.com/users/USER_ID/password-reset-requests

## Successful response

Returns a JSON array of [password reset request models](/api-reference/rest/models/password-reset-request). If the user does not have any update requests, it will return an empty array.
Returns a JSON array of [password reset request models](/reference/rest/models/password-reset-request). If the user does not have any update requests, it will return an empty array.

### Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GET https://your-domain.com/users/USER_ID/totp-credential

## Response body

Returns the [user TOTP credential model](/api-reference/rest/models/user-totp-credential) of the credential if it exists.
Returns the [user TOTP credential model](/reference/rest/models/user-totp-credential) of the credential if it exists.

## Error codes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ POST https://your-domain.com/users

## Successful response

Returns the [user model](/api-reference/rest/models/user) of the created user.
Returns the [user model](/reference/rest/models/user) of the created user.

## Error codes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ POST https://your-domain.com/users/USER_ID/email-update-requests

## Successful response

Returns the [email update request model](/api-reference/rest/models/email-verification-request) of the created request.
Returns the [email update request model](/reference/rest/models/email-verification-request) of the created request.

## Error codes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ POST https://your-domain.com/users/USER_ID/email-verification-request

## Successful response

Returns the [user email verification request model](/api-reference/rest/models/user-email-verification-request) of the created request.
Returns the [user email verification request model](/reference/rest/models/user-email-verification-request) of the created request.

## Error codes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ POST https://your-domain.com/users/USER_ID/password-reset-requests

## Successful response

Returns the [password reset request model](/api-reference/rest/models/password-reset-requests-request) of the created request and a verification code. The code is only available here.
Returns the [password reset request model](/reference/rest/models/password-reset-requests-request) of the created request and a verification code. The code is only available here.

```ts
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ All fields are required.

## Response body

Returns the [user TOTP credential model](/api-reference/rest/models/user-totp-credential) of the registered credential.
Returns the [user TOTP credential model](/reference/rest/models/user-totp-credential) of the registered credential.

## Error codes

Expand Down
Loading

0 comments on commit 88da67e

Please sign in to comment.