Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.16.0
20.19.5
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM node:20.9-slim AS base
FROM node:20.19.5-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.cloud
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM node:20.9-slim AS base
FROM node:20.19.5-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.schedule
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM node:20.9-slim AS base
FROM node:20.19.5-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM node:20.9-slim AS base
FROM node:20.19.5-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
Expand Down
2 changes: 1 addition & 1 deletion apps/dokploy/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.16.0
20.19.5
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { ToggleVisibilityInput } from "../../../../shared/toggle-visibility-input";

const AddSecuritychema = z.object({
username: z.string().min(1, "Username is required"),
Expand Down Expand Up @@ -151,7 +152,7 @@ export const HandleSecurity = ({
<FormItem>
<FormLabel>Password</FormLabel>
<FormControl>
<Input placeholder="test" {...field} />
<ToggleVisibilityInput placeholder="password" {...field} />
</FormControl>

<FormMessage />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import { api } from "@/utils/api";
import { LockKeyhole, Trash2 } from "lucide-react";
import { toast } from "sonner";
import { HandleSecurity } from "./handle-security";

import { MIN_PASSWORD_LENGTH } from "@/pages/register";
interface Props {
applicationId: string;
}


export const ShowSecurity = ({ applicationId }: Props) => {
const { data, refetch } = api.application.one.useQuery(
{
Expand Down Expand Up @@ -69,7 +70,9 @@ 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}
{security.password
? "*".repeat(MIN_PASSWORD_LENGTH)
: ""}
</span>
</div>
</div>
Expand Down
5 changes: 4 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,9 @@ 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
2 changes: 1 addition & 1 deletion apps/dokploy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
},
"packageManager": "pnpm@9.5.0",
"engines": {
"node": "^20.16.0",
"node": "^20.19.5",
"pnpm": ">=9.5.0"
},
"lint-staged": {
Expand Down
17 changes: 10 additions & 7 deletions apps/dokploy/pages/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,39 @@ import { type ReactElement, useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
export const MIN_PASSWORD_LENGTH = 8;
const MINIMUM_REQUIRED_LENGTH = 1;
const TIMEOUT_DURATION = 2000;

const registerSchema = z
.object({
name: z.string().min(1, {
name: z.string().min(MINIMUM_REQUIRED_LENGTH , {
message: "Name is required",
}),
email: z
.string()
.min(1, {
.min(MINIMUM_REQUIRED_LENGTH, {
message: "Email is required",
})
.email({
message: "Email must be a valid email",
}),
password: z
.string()
.min(1, {
.min(MINIMUM_REQUIRED_LENGTH, {
message: "Password is required",
})
.refine((password) => password === "" || password.length >= 8, {
.refine((password) => password === "" || password.length >= MIN_PASSWORD_LENGTH, {
message: "Password must be at least 8 characters",
}),
confirmPassword: z
.string()
.min(1, {
.min(MINIMUM_REQUIRED_LENGTH, {
message: "Password is required",
})
.refine(
(confirmPassword) =>
confirmPassword === "" || confirmPassword.length >= 8,
confirmPassword === "" || confirmPassword.length >= MIN_PASSWORD_LENGTH,
{
message: "Password must be at least 8 characters",
},
Expand Down Expand Up @@ -102,7 +105,7 @@ const Register = ({ isCloud }: Props) => {
setError(error.message || "An error occurred");
} else {
toast.success("User registered successfuly", {
duration: 2000,
duration: TIMEOUT_DURATION,
});
if (!isCloud) {
router.push("/");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"packageManager": "pnpm@9.5.0",
"engines": {
"node": "^20.16.0",
"node": "^20.19.5",
"pnpm": ">=9.5.0"
},
"lint-staged": {
Expand Down