Skip to content

Commit

Permalink
feat: auto detect first login (#2722)
Browse files Browse the repository at this point in the history
* 'hide' default email and password env variables

* first login API endpoint

* run code-generators

* frontend indicators for default username and pw

* remove old env variables from docs

* fix env set variable

* remove password from tests
  • Loading branch information
hay-kot authored Nov 15, 2023
1 parent 71f95ca commit bc575ec
Show file tree
Hide file tree
Showing 22 changed files with 234 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@

### General

| Variables | Default | Description |
| ---------------- | :-------------------: | ----------------------------------------------------------------------------------- |
| PUID | 911 | UserID permissions between host OS and container |
| PGID | 911 | GroupID permissions between host OS and container |
| DEFAULT_GROUP | Home | The default group for users |
| DEFAULT_EMAIL | changeme@example.com | The default username for the superuser |
| DEFAULT_PASSWORD | MyPassword | The default password for the superuser |
| BASE_URL | http://localhost:8080 | Used for Notifications |
| TOKEN_TIME | 48 | The time in hours that a login/auth token is valid |
| API_PORT | 9000 | The port exposed by backend API. **Do not change this if you're running in Docker** |
| API_DOCS | True | Turns on/off access to the API documentation locally. |
| TZ | UTC | Must be set to get correct date/time on the server |
| ALLOW_SIGNUP | true | Allow user sign-up without token |
| Variables | Default | Description |
| ------------- | :-------------------: | ----------------------------------------------------------------------------------- |
| PUID | 911 | UserID permissions between host OS and container |
| PGID | 911 | GroupID permissions between host OS and container |
| DEFAULT_GROUP | Home | The default group for users |
| BASE_URL | http://localhost:8080 | Used for Notifications |
| TOKEN_TIME | 48 | The time in hours that a login/auth token is valid |
| API_PORT | 9000 | The port exposed by backend API. **Do not change this if you're running in Docker** |
| API_DOCS | True | Turns on/off access to the API documentation locally. |
| TZ | UTC | Must be set to get correct date/time on the server |
| ALLOW_SIGNUP | true | Allow user sign-up without token |

### Security

Expand Down
74 changes: 37 additions & 37 deletions frontend/composables/use-locales/available-locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,117 +3,117 @@ export const LOCALES = [
{
name: "繁體中文 (Chinese traditional)",
value: "zh-TW",
progress: 26,
progress: 28,
},
{
name: "简体中文 (Chinese simplified)",
value: "zh-CN",
progress: 34,
progress: 65,
},
{
name: "Tiếng Việt (Vietnamese)",
value: "vi-VN",
progress: 0,
progress: 2,
},
{
name: "Українська (Ukrainian)",
value: "uk-UA",
progress: 100,
progress: 99,
},
{
name: "Türkçe (Turkish)",
value: "tr-TR",
progress: 47,
progress: 50,
},
{
name: "Svenska (Swedish)",
value: "sv-SE",
progress: 60,
progress: 71,
},
{
name: "српски (Serbian)",
value: "sr-SP",
progress: 2,
progress: 4,
},
{
name: "Slovenian",
value: "sl-SI",
progress: 47,
progress: 49,
},
{
name: "Slovak",
value: "sk-SK",
progress: 99,
progress: 97,
},
{
name: "Pусский (Russian)",
value: "ru-RU",
progress: 31,
progress: 99,
},
{
name: "Română (Romanian)",
value: "ro-RO",
progress: 12,
progress: 32,
},
{
name: "Português (Portuguese)",
value: "pt-PT",
progress: 69,
progress: 99,
},
{
name: "Português do Brasil (Brazilian Portuguese)",
value: "pt-BR",
progress: 97,
progress: 98,
},
{
name: "Polski (Polish)",
value: "pl-PL",
progress: 99,
progress: 97,
},
{
name: "Norsk (Norwegian)",
value: "no-NO",
progress: 73,
progress: 85,
},
{
name: "Nederlands (Dutch)",
value: "nl-NL",
progress: 100,
progress: 98,
},
{
name: "Latvian",
value: "lv-LV",
progress: 0,
progress: 1,
},
{
name: "Lithuanian",
value: "lt-LT",
progress: 99,
progress: 97,
},
{
name: "한국어 (Korean)",
value: "ko-KR",
progress: 3,
progress: 5,
},
{
name: "日本語 (Japanese)",
value: "ja-JP",
progress: 9,
progress: 11,
},
{
name: "Italiano (Italian)",
value: "it-IT",
progress: 98,
progress: 96,
},
{
name: "Magyar (Hungarian)",
value: "hu-HU",
progress: 43,
progress: 99,
},
{
name: "Croatian",
value: "hr-HR",
progress: 100,
progress: 97,
},
{
name: "עברית (Hebrew)",
Expand All @@ -123,27 +123,27 @@ export const LOCALES = [
{
name: "Galician",
value: "gl-ES",
progress: 0,
progress: 1,
},
{
name: "Français (French)",
value: "fr-FR",
progress: 100,
progress: 99,
},
{
name: "French, Canada",
value: "fr-CA",
progress: 54,
progress: 97,
},
{
name: "Suomi (Finnish)",
value: "fi-FI",
progress: 31,
progress: 95,
},
{
name: "Español (Spanish)",
value: "es-ES",
progress: 59,
progress: 76,
},
{
name: "American English",
Expand All @@ -153,46 +153,46 @@ export const LOCALES = [
{
name: "British English",
value: "en-GB",
progress: 2,
progress: 4,
},
{
name: "Ελληνικά (Greek)",
value: "el-GR",
progress: 33,
progress: 35,
},
{
name: "Deutsch (German)",
value: "de-DE",
progress: 100,
progress: 99,
},
{
name: "Dansk (Danish)",
value: "da-DK",
progress: 90,
progress: 100,
},
{
name: "Čeština (Czech)",
value: "cs-CZ",
progress: 60,
progress: 66,
},
{
name: "Català (Catalan)",
value: "ca-ES",
progress: 54,
progress: 61,
},
{
name: "Bulgarian",
value: "bg-BG",
progress: 13,
progress: 99,
},
{
name: "العربية (Arabic)",
value: "ar-SA",
progress: 7,
progress: 16,
},
{
name: "Afrikaans (Afrikaans)",
value: "af-ZA",
progress: 0,
progress: 96,
},
]
4 changes: 3 additions & 1 deletion frontend/lang/messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,9 @@
"user-can-invite-other-to-group": "User can invite other to group",
"user-can-manage-group": "User can manage group",
"user-can-organize-group-data": "User can organize group data",
"enable-advanced-features": "Enable advanced features"
"enable-advanced-features": "Enable advanced features",
"it-looks-like-this-is-your-first-time-logging-in": "It looks like this is your first time logging in.",
"dont-want-to-see-this-anymore-be-sure-to-change-your-email": "Don't want to see this anymore? Be sure to change your email in your user settings!"
},
"language-dialog": {
"translated": "translated",
Expand Down
19 changes: 19 additions & 0 deletions frontend/lib/api/types/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,32 @@ export interface AppInfo {
demoStatus: boolean;
allowSignup: boolean;
}
export interface AppStartupInfo {
isFirstLogin: boolean;
}
export interface AppStatistics {
totalRecipes: number;
totalUsers: number;
totalGroups: number;
uncategorizedRecipes: number;
untaggedRecipes: number;
}
export interface AppTheme {
lightPrimary?: string;
lightAccent?: string;
lightSecondary?: string;
lightSuccess?: string;
lightInfo?: string;
lightWarning?: string;
lightError?: string;
darkPrimary?: string;
darkAccent?: string;
darkSecondary?: string;
darkSuccess?: string;
darkInfo?: string;
darkWarning?: string;
darkError?: string;
}
export interface BackupOptions {
recipes?: boolean;
settings?: boolean;
Expand Down
31 changes: 30 additions & 1 deletion frontend/lib/api/types/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
*/

export type WebhookType = "mealplan";
export type SupportedMigrations = "nextcloud" | "chowdown" | "copymethat" | "paprika" | "mealie_alpha" | "tandoor" | "plantoeat";
export type SupportedMigrations =
| "nextcloud"
| "chowdown"
| "copymethat"
| "paprika"
| "mealie_alpha"
| "tandoor"
| "plantoeat";

export interface CreateGroupPreferences {
privateGroup?: boolean;
Expand Down Expand Up @@ -263,39 +270,56 @@ export interface RecipeIngredient {
}
export interface IngredientUnit {
name: string;
pluralName?: string;
description?: string;
extras?: {
[k: string]: unknown;
};
fraction?: boolean;
abbreviation?: string;
pluralAbbreviation?: string;
useAbbreviation?: boolean;
aliases?: IngredientUnitAlias[];
id: string;
createdAt?: string;
updateAt?: string;
}
export interface IngredientUnitAlias {
name: string;
}
export interface CreateIngredientUnit {
name: string;
pluralName?: string;
description?: string;
extras?: {
[k: string]: unknown;
};
fraction?: boolean;
abbreviation?: string;
pluralAbbreviation?: string;
useAbbreviation?: boolean;
aliases?: CreateIngredientUnitAlias[];
}
export interface CreateIngredientUnitAlias {
name: string;
}
export interface IngredientFood {
name: string;
pluralName?: string;
description?: string;
extras?: {
[k: string]: unknown;
};
labelId?: string;
aliases?: IngredientFoodAlias[];
id: string;
label?: MultiPurposeLabelSummary;
createdAt?: string;
updateAt?: string;
}
export interface IngredientFoodAlias {
name: string;
}
export interface MultiPurposeLabelSummary {
name: string;
color?: string;
Expand All @@ -304,11 +328,16 @@ export interface MultiPurposeLabelSummary {
}
export interface CreateIngredientFood {
name: string;
pluralName?: string;
description?: string;
extras?: {
[k: string]: unknown;
};
labelId?: string;
aliases?: CreateIngredientFoodAlias[];
}
export interface CreateIngredientFoodAlias {
name: string;
}
export interface ShoppingListCreate {
name?: string;
Expand Down
Loading

0 comments on commit bc575ec

Please sign in to comment.