-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pryazhentsev/aircraft-data-cleanup
- Loading branch information
Showing
107 changed files
with
14,496 additions
and
646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# Export | ||
|
||
The export feature allows you to export your flight data from AirTrail. | ||
|
||
## Export flights | ||
|
||
To export your flights, follow these steps: | ||
|
||
1. Go to the AirTrail application. | ||
2. Go to the settings page. | ||
3. Click on the "Export" tab. | ||
4. Choose your desired export format (CSV or JSON). | ||
|
||
## Export formats | ||
|
||
### CSV | ||
|
||
The CSV export option allows you to export your flights as a CSV file, which can be opened in any spreadsheet | ||
application like Microsoft Excel or Google Sheets. It is a simple and easy-to-use format that can be used to | ||
analyze your flight data. | ||
|
||
#### Format | ||
|
||
The CSV file contains the following columns: | ||
|
||
- `date`: The date of the flight (YYYY-MM-DD format). | ||
- `from`: The IATA code of the departure airport. | ||
- `to`: The IATA code of the arrival airport. | ||
- `departure`: The departure time in ISO 8601 format (if available). | ||
- `arrival`: The arrival time in ISO 8601 format (if available). | ||
- `duration`: The duration of the flight in seconds. | ||
- `flightNumber`: The flight number (if available). | ||
- `flightReason`: The reason for the flight (if provided). | ||
- `airline`: The airline operating the flight (if available). | ||
- `aircraft`: The type of aircraft used (if available). | ||
- `aircraftReg`: The registration number of the aircraft (if available). | ||
- `note`: Any additional notes about the flight. | ||
- `seat`: The type of seat (e.g., window, aisle, etc.). | ||
- `seatNumber`: The seat number (if available). | ||
- `seatClass`: The class of the seat (e.g., economy, business). | ||
|
||
### JSON | ||
|
||
:::tip | ||
The JSON format can be reimported into AirTrail using the import feature. | ||
::: | ||
|
||
The JSON export option provides a more structured format that is ideal for developers or when integrating the data into | ||
other systems. It contains nested objects for each flight and detailed data for each user and their seat information. | ||
|
||
#### Format | ||
|
||
The JSON file follows this structure: | ||
|
||
```json | ||
{ | ||
"users": [ | ||
{ | ||
"id": "user_id", | ||
"displayName": "User Name", | ||
"username": "username" | ||
} | ||
], | ||
"flights": [ | ||
{ | ||
"date": "YYYY-MM-DD", | ||
"from": "ICAO_CODE", | ||
"to": "ICAO_CODE", | ||
"departure": "ISO_8601_DATETIME", | ||
"arrival": "ISO_8601_DATETIME", | ||
"duration": flight_duration_in_seconds, | ||
"flightNumber": "FLIGHT_NUMBER", | ||
"flightReason": "FLIGHT_REASON", | ||
"airline": "ICAO_AIRLINE_CODE", | ||
"aircraft": "ICAO_AIRCRAFT_TYPE", | ||
"aircraftReg": "AIRCRAFT_REGISTRATION", | ||
"note": "FLIGHT_NOTE", | ||
"seats": [ | ||
{ | ||
"userId": "USER_ID", | ||
"guestName": "GUEST_NAME", | ||
"seat": "SEAT_TYPE", | ||
"seatNumber": "SEAT_NUMBER", | ||
"seatClass": "SEAT_CLASS" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
|
||
# OAuth Authentication | ||
|
||
AirTrail supports authentication via OpenID Connect (OIDC). | ||
This allows you to use your existing identity provider to authenticate users in AirTrail. | ||
|
||
## Prerequisites | ||
|
||
Before you can configure OAuth authentication in AirTrail, you need to set up an OAuth client in your identity provider. | ||
The specific steps to do this depend on the identity provider you are using, but in general you will need to: | ||
|
||
1. Register a new OIDC/OAuth2 client in your identity provider. | ||
2. Configure the client with the following settings: | ||
- Client type: `Confidential` | ||
- Application type: `Web application` | ||
- Grant type: `Authorization Code` | ||
3. Add the following redirect URI to the client configuration: | ||
- `http://DOMAIN:PORT/login` | ||
|
||
## Configuration | ||
|
||
To configure OAuth authentication in AirTrail, go to the `Settings` page and click on the `OAuth` tab (you need to be an | ||
admin to access this page). | ||
Here you can enter the following settings: | ||
|
||
| Setting | Default | Description | | ||
|---------------|----------------|-----------------------------------------------------------------------------------------------------| | ||
| Enabled | `false` | Whether to enable OAuth authentication. | | ||
| Issuer URL | | The URL of the OIDC issuer (e.g. `https://accounts.google.com/.well-known/openid-configuration`). | | ||
| Client ID | | The client ID of the OAuth client you created in your identity provider. | | ||
| Client Secret | | The client secret of the OAuth client you created in your identity provider. | | ||
| Scope | openid profile | The scopes to send with the request. | | ||
| Auto Register | `true` | Whether to automatically register new users if no existing AirTrail user is found for the username. | | ||
| Auto Login | `false` | Whether to automatically launch the OAuth login flow when a user visits the login page. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Statistics | ||
|
||
Get insights into your flying habits with the statistics page. | ||
Statistics are available through the bottom navigation bar. | ||
|
||
## Fields | ||
|
||
:::tip Note | ||
Statistics only take into account flights that have been completed. | ||
::: | ||
|
||
| Field | Description | | ||
|--------------------|----------------------------------------------------------------------| | ||
| Flights | The total number of flights you have completed. | | ||
| Distance | The total distance you have flown. | | ||
| Duration | The total time you have spent flying. | | ||
| Airports | The total number of airports you have visited. | | ||
| Seat Classes | The distribution of flights by seat class (Economy, Business, etc.). | | ||
| Seat Distribution | The distribution of flights by seat (Window, Aisle, etc.). | | ||
| Flight Reason | The distribution of flights by reason (Business, Leisure, etc.). | | ||
| Continents Visited | The amount you have visited each continent. | | ||
| Flights by month | The amount of flights per month. | | ||
| Flights by weekday | The amount of flights per weekday. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- AlterTable | ||
ALTER TABLE "user" | ||
ADD COLUMN "oauth_id" TEXT, | ||
ALTER COLUMN "password" DROP NOT NULL; | ||
|
||
-- CreateTable | ||
CREATE TABLE "app_config" | ||
( | ||
"id" SERIAL NOT NULL, | ||
"enabled" BOOLEAN NOT NULL DEFAULT false, | ||
"issuer_url" TEXT, | ||
"client_id" TEXT, | ||
"client_secret" TEXT, | ||
"scope" TEXT NOT NULL DEFAULT 'openid profile', | ||
"auto_register" BOOLEAN NOT NULL DEFAULT true, | ||
"auto_login" BOOLEAN NOT NULL DEFAULT false, | ||
|
||
CONSTRAINT "app_config_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- Insert | ||
INSERT INTO "app_config" ("enabled", "scope", "auto_register", | ||
"auto_login") | ||
VALUES (false, 'openid profile', true, | ||
false); | ||
|
16 changes: 16 additions & 0 deletions
16
prisma/migrations/20241003080714_visited_countries/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- CreateTable | ||
CREATE TABLE "visited_country" ( | ||
"id" SERIAL NOT NULL, | ||
"code" INTEGER NOT NULL, | ||
"status" TEXT NOT NULL, | ||
"note" TEXT, | ||
"user_id" TEXT NOT NULL, | ||
|
||
CONSTRAINT "visited_country_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "visited_country_code_user_id_key" ON "visited_country"("code", "user_id"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "visited_country" ADD CONSTRAINT "visited_country_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
Oops, something went wrong.