-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auth with email and password (#13)
* feat: allow authentication with email/password * docs: add config example directus-sync.config.js
- Loading branch information
1 parent
04b1b83
commit be605e9
Showing
21 changed files
with
178 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,11 @@ Moreover, `directus-sync` organizes backups into multiple files, significantly i | |
easier to track and review changes. This thoughtful separation facilitates a smoother version control process, allowing | ||
for targeted updates and clearer oversight of your Directus configurations. | ||
|
||
# Requirements | ||
|
||
- Node.js 18 or higher | ||
- `directus-extension-sync` installed on your Directus instance. See the [installation instructions](#dependency-directus-extension-sync). | ||
|
||
# Usage | ||
|
||
The CLI is available using the `npx` command. | ||
|
@@ -86,6 +91,13 @@ These options can be used with any command to configure the operation of `direct | |
|
||
- `-t, --directus-token <directusToken>` | ||
Provide the Directus access token. Alternatively, set the `DIRECTUS_TOKEN` environment variable. | ||
If provided, the `directus-email` and `directus-password` options are ignored. | ||
|
||
- `-e, --directus-email <directusEmail> ` | ||
Provide the Directus email. Alternatively, set the `DIRECTUS_ADMIN_EMAIL` environment variable. | ||
|
||
- `-p, --directus-password <directusPassword>` | ||
Provide the Directus password. Alternatively, set the `DIRECTUS_ADMIN_PASSWORD` environment variable. | ||
|
||
- `--no-split` | ||
Indicates whether the schema snapshot should be split into multiple files. By default, snapshots are split. | ||
|
@@ -125,6 +137,8 @@ module.exports = { | |
debug: true, | ||
directusUrl: 'https://directus.example.com', | ||
directusToken: 'my-directus-token', | ||
directusEmail: '[email protected]', // ignored if directusToken is provided | ||
directusPassword: 'my-directus-password', // ignored if directusToken is provided | ||
split: true, | ||
dumpPath: './directus-config', | ||
collectionsPath: 'collections', | ||
|
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
directus-config/ | ||
README.md | ||
directus-sync.config.js |
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
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
6 changes: 3 additions & 3 deletions
6
packages/cli/src/lib/services/collections/dashboards/id-mapper-client.ts
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { IdMapperClient } from '../base'; | ||
import { Service } from 'typedi'; | ||
import { DASHBOARDS_COLLECTION } from './constants'; | ||
import { ConfigService } from '../../config'; | ||
import { MigrationClient } from '../../migration-client'; | ||
|
||
@Service() | ||
export class DashboardsIdMapperClient extends IdMapperClient { | ||
constructor(config: ConfigService) { | ||
super(config, DASHBOARDS_COLLECTION); | ||
constructor(migrationClient: MigrationClient) { | ||
super(migrationClient, DASHBOARDS_COLLECTION); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
packages/cli/src/lib/services/collections/flows/id-mapper-client.ts
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { IdMapperClient } from '../base'; | ||
import { Service } from 'typedi'; | ||
import { FLOWS_COLLECTION } from './constants'; | ||
import { ConfigService } from '../../config'; | ||
import { MigrationClient } from '../../migration-client'; | ||
|
||
@Service() | ||
export class FlowsIdMapperClient extends IdMapperClient { | ||
constructor(config: ConfigService) { | ||
super(config, FLOWS_COLLECTION); | ||
constructor(migrationClient: MigrationClient) { | ||
super(migrationClient, FLOWS_COLLECTION); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
packages/cli/src/lib/services/collections/operations/id-mapper-client.ts
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { IdMapperClient } from '../base'; | ||
import { Service } from 'typedi'; | ||
import { OPERATIONS_COLLECTION } from './constants'; | ||
import { ConfigService } from '../../config'; | ||
import { MigrationClient } from '../../migration-client'; | ||
|
||
@Service() | ||
export class OperationsIdMapperClient extends IdMapperClient { | ||
constructor(config: ConfigService) { | ||
super(config, OPERATIONS_COLLECTION); | ||
constructor(migrationClient: MigrationClient) { | ||
super(migrationClient, OPERATIONS_COLLECTION); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
packages/cli/src/lib/services/collections/panels/id-mapper-client.ts
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { IdMapperClient } from '../base'; | ||
import { Service } from 'typedi'; | ||
import { PANELS_COLLECTION } from './constants'; | ||
import { ConfigService } from '../../config'; | ||
import { MigrationClient } from '../../migration-client'; | ||
|
||
@Service() | ||
export class PanelsIdMapperClient extends IdMapperClient { | ||
constructor(config: ConfigService) { | ||
super(config, PANELS_COLLECTION); | ||
constructor(migrationClient: MigrationClient) { | ||
super(migrationClient, PANELS_COLLECTION); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
packages/cli/src/lib/services/collections/permissions/id-mapper-client.ts
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { IdMapperClient } from '../base'; | ||
import { Service } from 'typedi'; | ||
import { PERMISSIONS_COLLECTION } from './constants'; | ||
import { ConfigService } from '../../config'; | ||
import { MigrationClient } from '../../migration-client'; | ||
|
||
@Service() | ||
export class PermissionsIdMapperClient extends IdMapperClient { | ||
constructor(config: ConfigService) { | ||
super(config, PERMISSIONS_COLLECTION); | ||
constructor(migrationClient: MigrationClient) { | ||
super(migrationClient, PERMISSIONS_COLLECTION); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
packages/cli/src/lib/services/collections/roles/id-mapper-client.ts
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { IdMapperClient } from '../base'; | ||
import { Service } from 'typedi'; | ||
import { ROLES_COLLECTION } from './constants'; | ||
import { ConfigService } from '../../config'; | ||
import { MigrationClient } from '../../migration-client'; | ||
|
||
@Service() | ||
export class RolesIdMapperClient extends IdMapperClient { | ||
constructor(config: ConfigService) { | ||
super(config, ROLES_COLLECTION); | ||
constructor(migrationClient: MigrationClient) { | ||
super(migrationClient, ROLES_COLLECTION); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
packages/cli/src/lib/services/collections/settings/id-mapper-client.ts
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { IdMapperClient } from '../base'; | ||
import { Service } from 'typedi'; | ||
import { SETTINGS_COLLECTION } from './constants'; | ||
import { ConfigService } from '../../config'; | ||
import { MigrationClient } from '../../migration-client'; | ||
|
||
@Service() | ||
export class SettingsIdMapperClient extends IdMapperClient { | ||
constructor(config: ConfigService) { | ||
super(config, SETTINGS_COLLECTION); | ||
constructor(migrationClient: MigrationClient) { | ||
super(migrationClient, SETTINGS_COLLECTION); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
packages/cli/src/lib/services/collections/webhooks/id-mapper-client.ts
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { IdMapperClient } from '../base'; | ||
import { Service } from 'typedi'; | ||
import { WEBHOOKS_COLLECTION } from './constants'; | ||
import { ConfigService } from '../../config'; | ||
import { MigrationClient } from '../../migration-client'; | ||
|
||
@Service() | ||
export class WebhooksIdMapperClient extends IdMapperClient { | ||
constructor(config: ConfigService) { | ||
super(config, WEBHOOKS_COLLECTION); | ||
constructor(migrationClient: MigrationClient) { | ||
super(migrationClient, WEBHOOKS_COLLECTION); | ||
} | ||
} |
Oops, something went wrong.