Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
4 changes: 2 additions & 2 deletions apps/dokploy/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DATABASE_URL="postgres://dokploy:amukds4wi9001583845717ad2@localhost:5432/dokploy"
DATABASE_URL="postgres://dokploy:amukds4wi9001583845717ad2@localhost:5432/dokploy2"
PORT=3000
NODE_ENV=development
NODE_ENV=development
2 changes: 1 addition & 1 deletion apps/dokploy/.env.production.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DATABASE_URL="postgres://dokploy:amukds4wi9001583845717ad2@dokploy-postgres:5432/dokploy"
DATABASE_URL="postgres://dokploy:amukds4wi9001583845717ad2@dokploy-postgres:5432/dokploy2"
PORT=3000
NODE_ENV=production
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AlertBlock } from "@/components/shared/alert-block";
import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input";
import { Button } from "@/components/ui/button";
import {
Dialog,
Expand Down Expand Up @@ -144,20 +145,20 @@ export const HandleSecurity = ({
</FormItem>
)}
/>
<FormField
control={form.control}
name="password"
render={({ field }) => (
<FormItem>
<FormLabel>Password</FormLabel>
<FormControl>
<Input placeholder="test" {...field} />
</FormControl>
<FormField
control={form.control}
name="password"
render={({ field }) => (
<FormItem>
<FormLabel>Password</FormLabel>
<FormControl>
<ToggleVisibilityInput placeholder="test" {...field} />
</FormControl>

<FormMessage />
</FormItem>
)}
/>
<FormMessage />
</FormItem>
)}
/>
</div>
</form>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { DialogAction } from "@/components/shared/dialog-action";
import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input";

import { Button } from "@/components/ui/button";
import {
Card,
Expand Down Expand Up @@ -69,7 +71,7 @@ export const ShowSecurity = ({ applicationId }: Props) => {
<div className="flex flex-col gap-1">
<span className="font-medium">Password</span>
<span className="text-sm text-muted-foreground">
{security.password}
<ToggleVisibilityInput value={security.password} disabled />
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { Disable2FA } from "./disable-2fa";
import { Enable2FA } from "./enable-2fa";

const profileSchema = z.object({
name: z.string().optional(),
email: z.string(),
password: z.string().nullable(),
currentPassword: z.string().nullable(),
Expand Down Expand Up @@ -79,6 +80,7 @@ export const ProfileForm = () => {

const form = useForm<Profile>({
defaultValues: {
name: data?.user?.name || "",
email: data?.user?.email || "",
password: "",
image: data?.user?.image || "",
Expand All @@ -92,6 +94,7 @@ export const ProfileForm = () => {
if (data) {
form.reset(
{
name: data?.user?.name || "",
email: data?.user?.email || "",
password: form.getValues("password") || "",
image: data?.user?.image || "",
Expand All @@ -104,16 +107,23 @@ export const ProfileForm = () => {
);
form.setValue("allowImpersonation", data?.user?.allowImpersonation);

if (data.user.email) {
generateSHA256Hash(data.user.email).then((hash) => {
setGravatarHash(hash);
if (data.user.email) {
generateSHA256Hash(data.user.email)
.then((hash) => {
if (hash) {
setGravatarHash(hash);
}
})
.catch((error) => {
console.error("Failed to generate gravatar hash:", error);
});
}
}
}
}, [form, data]);

const onSubmit = async (values: Profile) => {
await mutateAsync({
name: values.name,
email: values.email.toLowerCase(),
password: values.password || undefined,
image: values.image,
Expand All @@ -124,6 +134,7 @@ export const ProfileForm = () => {
await refetch();
toast.success("Profile Updated");
form.reset({
name: values.name,
email: values.email,
password: "",
image: values.image,
Expand Down Expand Up @@ -167,6 +178,22 @@ export const ProfileForm = () => {
className="grid gap-4"
>
<div className="space-y-4">
<FormField
control={form.control}
name="name"
render={({ field }) => (
<FormItem>
<FormLabel>{t("settings.profile.name")}</FormLabel>
<FormControl>
<Input
placeholder={t("settings.profile.name")}
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="email"
Expand Down
4 changes: 3 additions & 1 deletion apps/dokploy/components/layouts/user-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export const UserNav = () => {
<AvatarFallback className="rounded-lg">CN</AvatarFallback>
</Avatar>
<div className="grid flex-1 text-left text-sm leading-tight">
<span className="truncate font-semibold">Account</span>
<span className="truncate font-semibold">
{data?.user?.name || "Account"}
</span>
<span className="truncate text-xs">{data?.user?.email}</span>
</div>
<ChevronsUpDown className="ml-auto size-4" />
Expand Down
7 changes: 6 additions & 1 deletion apps/dokploy/components/shared/toggle-visibility-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const ToggleVisibilityInput = ({ ...props }: InputProps) => {
<div className="flex w-full items-center space-x-2">
<Input ref={inputRef} type={inputType} {...props} />
<Button
type="button"
variant={"secondary"}
onClick={() => {
copy(inputRef.current?.value || "");
Expand All @@ -26,7 +27,11 @@ export const ToggleVisibilityInput = ({ ...props }: InputProps) => {
>
<Clipboard className="size-4 text-muted-foreground" />
</Button>
<Button onClick={togglePasswordVisibility} variant={"secondary"}>
<Button
type="button"
onClick={togglePasswordVisibility}
variant={"secondary"}
>
{inputType === "password" ? (
<EyeIcon className="size-4 text-muted-foreground" />
) : (
Expand Down
6 changes: 6 additions & 0 deletions apps/dokploy/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ export function cn(...inputs: ClassValue[]) {
}

export async function generateSHA256Hash(text: string) {
// Check if crypto.subtle is available (browser context)
if (typeof crypto === "undefined" || !crypto.subtle) {
console.warn("crypto.subtle is not available");
return "";
}

const encoder = new TextEncoder();
const data = encoder.encode(text);
const hashBuffer = await crypto.subtle.digest("SHA-256", data);
Expand Down
6 changes: 3 additions & 3 deletions apps/dokploy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "node -r dotenv/config dist/server.mjs",
"build-server": "tsx esbuild.config.ts",
"build-next": "next build",
"setup": "tsx -r dotenv/config setup.ts && sleep 5 && pnpm run migration:run",
"setup": "tsx -r dotenv/config setup.ts && pnpm run migration:run",
"reset-password": "node -r dotenv/config dist/reset-password.mjs",
"dev": "tsx -r dotenv/config ./server/server.ts --project tsconfig.server.json ",
"dev-turbopack": "TURBOPACK=1 tsx -r dotenv/config ./server/server.ts --project tsconfig.server.json",
Expand Down Expand Up @@ -91,7 +91,7 @@
"@xterm/xterm": "^5.4.0",
"adm-zip": "^0.5.14",
"ai": "^4.0.23",
"bcrypt": "5.1.1",
"bcryptjs": "^2.4.3",
"better-auth": "v1.2.8-beta.7",
"bl": "6.0.11",
"boxen": "^7.1.1",
Expand Down Expand Up @@ -157,7 +157,7 @@
},
"devDependencies": {
"@types/adm-zip": "^0.5.5",
"@types/bcrypt": "5.0.2",
"@types/bcryptjs": "^2.4.6",
"@types/js-cookie": "^3.0.6",
"@types/js-yaml": "4.0.9",
"@types/lodash": "4.17.4",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/az/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

"settings.profile.title": "Hesab",
"settings.profile.description": "Profilinizin məlumatlarını buradan dəyişin.",
"settings.profile.name": "Ad",
"settings.profile.email": "E-poçt",
"settings.profile.password": "Şifrə",
"settings.profile.avatar": "Avatar",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/de/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

"settings.profile.title": "Konto",
"settings.profile.description": "Ändere die Details deines Profiles hier.",
"settings.profile.name": "Name",
"settings.profile.email": "E-Mail",
"settings.profile.password": "Passwort",
"settings.profile.avatar": "Avatar",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

"settings.profile.title": "Account",
"settings.profile.description": "Change the details of your profile here.",
"settings.profile.name": "Name",
"settings.profile.email": "Email",
"settings.profile.password": "Password",
"settings.profile.avatar": "Avatar",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/es/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

"settings.profile.title": "Cuenta",
"settings.profile.description": "Cambia los detalles de tu perfil aquí.",
"settings.profile.name": "Nombre",
"settings.profile.email": "Correo electrónico",
"settings.profile.password": "Contraseña",
"settings.profile.avatar": "Avatar",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/fa/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

"settings.profile.title": "حساب کاربری",
"settings.profile.description": "جزئیات پروفایل خود را در اینجا تغییر دهید.",
"settings.profile.name": "نام",
"settings.profile.email": "ایمیل",
"settings.profile.password": "رمز عبور",
"settings.profile.avatar": "تصویر پروفایل",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/fr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

"settings.profile.title": "Compte",
"settings.profile.description": "Modifier les informations de votre compte ici.",
"settings.profile.name": "Nom",
"settings.profile.email": "Adresse Email",
"settings.profile.password": "Mot de passe",
"settings.profile.avatar": "Photo de profil",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/id/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

"settings.profile.title": "Akun",
"settings.profile.description": "Ubah detail profil Anda di sini.",
"settings.profile.name": "Nama",
"settings.profile.email": "Email",
"settings.profile.password": "Kata Sandi",
"settings.profile.avatar": "Avatar",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/it/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

"settings.profile.title": "Account",
"settings.profile.description": "Modifica i dettagli del tuo profilo qui.",
"settings.profile.name": "Nome",
"settings.profile.email": "Email",
"settings.profile.password": "Password",
"settings.profile.avatar": "Avatar",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/ja/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

"settings.profile.title": "アカウント",
"settings.profile.description": "ここでプロフィールの詳細を変更できます",
"settings.profile.name": "名前",
"settings.profile.email": "メールアドレス",
"settings.profile.password": "パスワード",
"settings.profile.avatar": "アバター",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/ko/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

"settings.profile.title": "계정",
"settings.profile.description": "여기에서 프로필 세부 정보를 변경하세요.",
"settings.profile.name": "이름",
"settings.profile.email": "이메일",
"settings.profile.password": "비밀번호",
"settings.profile.avatar": "아바타",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/kz/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"settings.server.webServer.storage.cleanAll": "Барлығын тазалау",
"settings.profile.title": "Аккаунт",
"settings.profile.description": "Профиль мәліметтерін осы жерден өзгертіңіз.",
"settings.profile.name": "Аты",
"settings.profile.email": "Эл. пошта",
"settings.profile.password": "Құпия сөз",
"settings.profile.avatar": "Аватар",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/ml/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

"settings.profile.title": "അക്കൗണ്ട്",
"settings.profile.description": "നിങ്ങളുടെ പ്രൊഫൈൽ വിശദാംശങ്ങൾ ഇവിടെ മാറ്റുക.",
"settings.profile.name": "പേര്",
"settings.profile.email": "ഇമെയിൽ",
"settings.profile.password": "പാസ്വേഡ്",
"settings.profile.avatar": "അവതാർ",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/nl/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

"settings.profile.title": "Account",
"settings.profile.description": "Veramder details van account.",
"settings.profile.name": "Naam",
"settings.profile.email": "Email",
"settings.profile.password": "Wachtwoord",
"settings.profile.avatar": "Profiel Icoon",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/no/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

"settings.profile.title": "Konto",
"settings.profile.description": "Endre detaljene for profilen din her.",
"settings.profile.name": "Navn",
"settings.profile.email": "Epost",
"settings.profile.password": "Passord",
"settings.profile.avatar": "Avatar",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/pl/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

"settings.profile.title": "Konto",
"settings.profile.description": "Zmień szczegóły swojego profilu",
"settings.profile.name": "Imię",
"settings.profile.email": "Email",
"settings.profile.password": "Hasło",
"settings.profile.avatar": "Avatar",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/pt-br/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

"settings.profile.title": "Conta",
"settings.profile.description": "Altere os detalhes do seu perfil aqui.",
"settings.profile.name": "Nome",
"settings.profile.email": "Email",
"settings.profile.password": "Senha",
"settings.profile.avatar": "Avatar",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/ru/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

"settings.profile.title": "Аккаунт",
"settings.profile.description": "Измените данные вашего профиля.",
"settings.profile.name": "Имя",
"settings.profile.email": "Email",
"settings.profile.password": "Пароль",
"settings.profile.avatar": "Аватар",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/tr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

"settings.profile.title": "Hesap",
"settings.profile.description": "Profil detaylarınızı buradan değiştirebilirsiniz.",
"settings.profile.name": "İsim",
"settings.profile.email": "E-posta",
"settings.profile.password": "Şifre",
"settings.profile.avatar": "Profil Resmi",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/uk/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

"settings.profile.title": "Обліковий запис",
"settings.profile.description": "Змініть дані вашого профілю.",
"settings.profile.name": "Ім'я",
"settings.profile.email": "Електронна пошта",
"settings.profile.password": "Пароль",
"settings.profile.avatar": "Аватар",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/zh-Hans/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"settings.server.webServer.storage.cleanAll": "清理所有内容",
"settings.profile.title": "账户",
"settings.profile.description": "在此更改您的个人资料详情。",
"settings.profile.name": "姓名",
"settings.profile.email": "邮箱",
"settings.profile.password": "密码",
"settings.profile.avatar": "头像",
Expand Down
1 change: 1 addition & 0 deletions apps/dokploy/public/locales/zh-Hant/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

"settings.profile.title": "帳戶",
"settings.profile.description": "更改您的個人資料",
"settings.profile.name": "姓名",
"settings.profile.email": "信箱",
"settings.profile.password": "密碼",
"settings.profile.avatar": "頭像",
Expand Down
Loading