Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2eae756
Update dependencies in pnpm-lock.yaml and package.json for @codemirro…
Siumauricio Mar 7, 2026
49f43ab
Merge pull request #3912 from Dokploy/3820-compose-file-editor-cmdf-s…
Siumauricio Mar 7, 2026
38b2045
fix: update Docker network creation command to specify driver for sta…
Siumauricio Mar 7, 2026
2f4cbbd
Merge pull request #3913 from Dokploy/3905-isolated-deployment-swarm-…
Siumauricio Mar 7, 2026
cedec52
refactor: update Gitea and GitLab URL handling to prioritize internal…
Siumauricio Mar 7, 2026
28cc361
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 7, 2026
675c1d7
Merge pull request #3914 from Dokploy/3900-local-domains-fetch-failur…
Siumauricio Mar 7, 2026
4be25da
fix: add error handling for volume backup notification sending
Siumauricio Mar 7, 2026
f961dc6
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 7, 2026
f650200
Merge pull request #3915 from Dokploy/3775-volume-backup-marked-as-fa…
Siumauricio Mar 7, 2026
b87f8cc
refactor: streamline deployment cleanup by consolidating removeLastTe…
Siumauricio Mar 7, 2026
ce24ead
Merge pull request #3917 from Dokploy/3752-an-error-have-occured-depl…
Siumauricio Mar 7, 2026
808001d
refactor: enhance volume backup path handling to ensure proper prefix…
Siumauricio Mar 7, 2026
c106d13
Merge pull request #3918 from Dokploy/2686-volume-backups-delete-othe…
Siumauricio Mar 7, 2026
a5a4a1a
refactor: update backup file paths to include app name for better org…
Siumauricio Mar 7, 2026
35d3502
Merge pull request #3919 from Dokploy/3855-instead-of-keeping-x-lates…
Siumauricio Mar 7, 2026
50182a8
fix: prevent doubled /v1/ suffix in Azure OpenAI-compatible URLs
Siumauricio Mar 7, 2026
7a8f2e5
Merge pull request #3920 from Dokploy/3286-azure-openai-endpoint-not-…
Siumauricio Mar 7, 2026
4882bd2
feat: include backup file in restoreComposeBackup function for improv…
Siumauricio Mar 7, 2026
c4f4db3
Merge pull request #3921 from Dokploy/3789-mongodb-restore-failed-wit…
Siumauricio Mar 7, 2026
076262e
feat: add maxAliasCount option to parse function for improved Docker …
Siumauricio Mar 7, 2026
95e14b4
Merge pull request #3930 from Dokploy/3924-docker-composeyml-excessiv…
Siumauricio Mar 7, 2026
a8467e8
refactor: replace authClient with api.user.session.useQuery in multip…
Siumauricio Mar 8, 2026
2182129
chore: remove console.log for session in AddGithubProvider component …
Siumauricio Mar 8, 2026
735c995
chore: import authClient in show-users component for enhanced authent…
Siumauricio Mar 8, 2026
dc8ff78
Merge pull request #3931 from Dokploy/3928-foreign-key-constraint-vio…
Siumauricio Mar 8, 2026
922b4d5
refactor: enhance backup functionality by incorporating appName and s…
Siumauricio Mar 8, 2026
b419294
fix: add --drop option to mongorestore command for improved data rest…
Siumauricio Mar 8, 2026
e9787b7
Merge pull request #3934 from Dokploy/feat/use-appname-on-backups-folder
Siumauricio Mar 8, 2026
b4319c7
Bump version from v0.28.4 to v0.28.5
Siumauricio Mar 8, 2026
75a4e8e
fix: update success message for service deployment to reflect queued …
Siumauricio Mar 8, 2026
ec7df05
Merge pull request #3939 from Dokploy/3827-bulk-deploy-fails-silently…
Siumauricio Mar 8, 2026
ce82e23
fix: improve port conflict detection by enhancing error messages and …
Siumauricio Mar 8, 2026
8e9ab98
Merge pull request #3940 from Dokploy/3806-bug-traefik-and-dokploy-fa…
Siumauricio Mar 8, 2026
c00aa6a
fix: enhance container metrics query to support wildcard matching for…
Siumauricio Mar 8, 2026
30f061e
Merge pull request #3947 from Dokploy/3896-application-monitor-problem
Siumauricio Mar 8, 2026
2102840
fix: add error handling to trusted origins retrieval in admin service
Siumauricio Mar 9, 2026
6e67864
Merge pull request #3951 from Dokploy/3948-unhandled-rejection-in-get…
Siumauricio Mar 9, 2026
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
3 changes: 1 addition & 2 deletions apps/dokploy/components/dashboard/search-command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
CommandList,
CommandSeparator,
} from "@/components/ui/command";
import { authClient } from "@/lib/auth-client";
import { api } from "@/utils/api";
import { StatusTooltip } from "../shared/status-tooltip";

Expand Down Expand Up @@ -56,7 +55,7 @@ export const SearchCommand = () => {
const router = useRouter();
const [open, setOpen] = React.useState(false);
const [search, setSearch] = React.useState("");
const { data: session } = authClient.useSession();
const { data: session } = api.user.session.useQuery();
const { data } = api.project.all.useQuery(undefined, {
enabled: !!session,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ import {
} from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";
import { authClient } from "@/lib/auth-client";
import { api } from "@/utils/api";

export const AddGithubProvider = () => {
const [isOpen, setIsOpen] = useState(false);
const { data: activeOrganization } = api.organization.active.useQuery();

const { data: session } = authClient.useSession();
const { data: session } = api.user.session.useQuery();
const { data } = api.user.get.useQuery();
const [manifest, setManifest] = useState("");
const [isOrganization, setIsOrganization] = useState(false);
Expand Down Expand Up @@ -99,8 +98,8 @@ export const AddGithubProvider = () => {
<form
action={
isOrganization
? `https://github.com/organizations/${organizationName}/settings/apps/new?state=gh_init:${activeOrganization?.id}`
: `https://github.com/settings/apps/new?state=gh_init:${activeOrganization?.id}`
? `https://github.com/organizations/${organizationName}/settings/apps/new?state=gh_init:${activeOrganization?.id}:${session?.user?.id ?? ""}`
: `https://github.com/settings/apps/new?state=gh_init:${activeOrganization?.id}:${session?.user?.id ?? ""}`
}
method="post"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const ShowUsers = () => {
const { mutateAsync } = api.user.remove.useMutation();

const utils = api.useUtils();
const { data: session } = authClient.useSession();
const { data: session } = api.user.session.useQuery();

return (
<div className="w-full">
Expand Down
2 changes: 1 addition & 1 deletion apps/dokploy/components/layouts/side.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ function SidebarLogo() {
const { state } = useSidebar();
const { data: isCloud } = api.settings.isCloud.useQuery();
const { data: user } = api.user.get.useQuery();
const { data: session } = authClient.useSession();
const { data: session } = api.user.session.useQuery();
const {
data: organizations,
refetch,
Expand Down
5 changes: 4 additions & 1 deletion apps/dokploy/components/shared/code-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { yaml } from "@codemirror/lang-yaml";
import { StreamLanguage } from "@codemirror/language";
import { properties } from "@codemirror/legacy-modes/mode/properties";
import { shell } from "@codemirror/legacy-modes/mode/shell";
import { EditorView } from "@codemirror/view";
import { search, searchKeymap } from "@codemirror/search";
import { EditorView, keymap } from "@codemirror/view";
import { githubDark, githubLight } from "@uiw/codemirror-theme-github";
import CodeMirror, { type ReactCodeMirrorProps } from "@uiw/react-codemirror";
import { useTheme } from "next-themes";
Expand Down Expand Up @@ -155,6 +156,8 @@ export const CodeEditor = ({
}}
theme={resolvedTheme === "dark" ? githubDark : githubLight}
extensions={[
search(),
keymap.of(searchKeymap),
language === "yaml"
? yaml()
: language === "json"
Expand Down
5 changes: 3 additions & 2 deletions apps/dokploy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dokploy",
"version": "v0.28.4",
"version": "v0.28.5",
"private": true,
"license": "Apache-2.0",
"type": "module",
Expand Down Expand Up @@ -53,7 +53,8 @@
"@codemirror/lang-yaml": "^6.1.2",
"@codemirror/language": "^6.11.0",
"@codemirror/legacy-modes": "6.4.0",
"@codemirror/view": "6.29.0",
"@codemirror/search": "^6.6.0",
"@codemirror/view": "^6.39.15",
"@dokploy/server": "workspace:*",
"@dokploy/trpc-openapi": "0.0.17",
"@faker-js/faker": "^8.4.1",
Expand Down
19 changes: 13 additions & 6 deletions apps/dokploy/pages/api/providers/github/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,29 @@ type Query = {
state: string;
installation_id: string;
setup_action: string;
userId: string;
};

export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
) {
const { code, state, installation_id, userId }: Query = req.query as Query;
const { code, state, installation_id }: Query = req.query as Query;

if (!code) {
return res.status(400).json({ error: "Missing code parameter" });
}
const [action, value] = state?.split(":");
// Value could be the organizationId or the githubProviderId
const [action, ...rest] = state?.split(":");
// For gh_init: rest[0] = organizationId, rest[1] = userId
// For gh_setup: rest[0] = githubProviderId

if (action === "gh_init") {
const organizationId = rest[0];
const userId = rest[1] || (req.query.userId as string);

if (!userId) {
return res.status(400).json({ error: "Missing userId parameter" });
}

const octokit = new Octokit({});
const { data } = await octokit.request(
"POST /app-manifests/{code}/conversions",
Expand All @@ -44,7 +51,7 @@ export default async function handler(
githubWebhookSecret: data.webhook_secret,
githubPrivateKey: data.pem,
},
value as string,
organizationId as string,
userId,
);
} else if (action === "gh_setup") {
Expand All @@ -53,7 +60,7 @@ export default async function handler(
.set({
githubInstallationId: installation_id,
})
.where(eq(github.githubId, value as string))
.where(eq(github.githubId, rest[0] as string))
.returning();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ const EnvironmentPage = (
}
if (success > 0) {
toast.success(
`${success} service${success !== 1 ? "s" : ""} deployed successfully`,
`${success} service${success !== 1 ? "s" : ""} queued for deployment`,
);
}
if (failed > 0) {
Expand Down
6 changes: 3 additions & 3 deletions apps/dokploy/server/api/routers/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ export const settingsRouter = createTRPCRouter({
// Check if port 8080 is already in use before enabling dashboard
const portCheck = await checkPortInUse(8080, input.serverId);
if (portCheck.isInUse) {
const conflictingContainer = portCheck.conflictingContainer
? ` by container "${portCheck.conflictingContainer}"`
const conflictInfo = portCheck.conflictingContainer
? ` by ${portCheck.conflictingContainer}`
: "";
throw new TRPCError({
code: "CONFLICT",
message: `Port 8080 is already in use${conflictingContainer}. Please stop the conflicting service or use a different port for the Traefik dashboard.`,
message: `Port 8080 is already in use${conflictInfo}. Please stop the conflicting service or use a different port for the Traefik dashboard.`,
});
}
newPorts.push({
Expand Down
10 changes: 10 additions & 0 deletions apps/dokploy/server/api/routers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ export const userRouter = createTRPCRouter({

return memberResult;
}),
session: protectedProcedure.query(async ({ ctx }) => {
return {
user: {
id: ctx.user.id,
},
session: {
activeOrganizationId: ctx.session.activeOrganizationId,
},
};
}),
get: protectedProcedure.query(async ({ ctx }) => {
const memberResult = await db.query.member.findFirst({
where: and(
Expand Down
8 changes: 4 additions & 4 deletions apps/monitoring/database/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ func (db *DB) GetLastNContainerMetrics(containerName string, limit int) ([]Conta
WITH recent_metrics AS (
SELECT metrics_json
FROM container_metrics
WHERE container_name = ?
WHERE container_name = ? OR container_name LIKE ?
ORDER BY timestamp DESC
LIMIT ?
)
SELECT metrics_json FROM recent_metrics ORDER BY json_extract(metrics_json, '$.timestamp') ASC
`
rows, err := db.Query(query, containerName, limit)
rows, err := db.Query(query, containerName, containerName+".%", limit)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -90,12 +90,12 @@ func (db *DB) GetAllMetricsContainer(containerName string) ([]ContainerMetric, e
WITH recent_metrics AS (
SELECT metrics_json
FROM container_metrics
WHERE container_name = ?
WHERE container_name = ? OR container_name LIKE ?
ORDER BY timestamp DESC
)
SELECT metrics_json FROM recent_metrics ORDER BY json_extract(metrics_json, '$.timestamp') ASC
`
rows, err := db.Query(query, containerName)
rows, err := db.Query(query, containerName, containerName+".%")
if err != nil {
return nil, err
}
Expand Down
24 changes: 17 additions & 7 deletions packages/server/src/services/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,25 @@ export const getTrustedOrigins = async () => {
if (trustedOriginsCache && now < trustedOriginsCache.expiresAt) {
return trustedOriginsCache.data;
}
const trustedOrigins = await runQuery();
trustedOriginsCache = {
data: trustedOrigins,
expiresAt: now + TRUSTED_ORIGINS_CACHE_TTL_MS,
};
return trustedOrigins;
try {
const trustedOrigins = await runQuery();
trustedOriginsCache = {
data: trustedOrigins,
expiresAt: now + TRUSTED_ORIGINS_CACHE_TTL_MS,
};
return trustedOrigins;
} catch (error) {
console.error("Failed to fetch trusted origins:", error);
return trustedOriginsCache?.data ?? [];
}
}

return runQuery();
try {
return await runQuery();
} catch (error) {
console.error("Failed to fetch trusted origins:", error);
return [];
}
};

export const getTrustedProviders = async () => {
Expand Down
Loading