Add QA test outputs, build scripts, and Dockerfile validation

- Created `qa-test-output-after-fix.txt` and `qa-test-output.txt` to log results of certificate page authentication tests.
- Added `build.sh` for deterministic backend builds in CI, utilizing `go list` for efficiency.
- Introduced `codeql_scan.sh` for CodeQL database creation and analysis for Go and JavaScript/TypeScript.
- Implemented `dockerfile_check.sh` to validate Dockerfiles for base image and package manager mismatches.
- Added `sourcery_precommit_wrapper.sh` to facilitate Sourcery CLI usage in pre-commit hooks.
This commit is contained in:
GitHub Actions
2025-12-11 18:26:24 +00:00
parent 65d837a13f
commit 8294d6ee49
609 changed files with 111623 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import {
getProxyHosts,
createProxyHost,
updateProxyHost,
deleteProxyHost,
bulkUpdateACL,
ProxyHost
} from '../api/proxyHosts';
export const QUERY_KEY = ['proxy-hosts'];
export function useProxyHosts() {
const queryClient = useQueryClient();
const query = useQuery({
queryKey: QUERY_KEY,
queryFn: getProxyHosts,
});
const createMutation = useMutation({
mutationFn: (host: Partial<ProxyHost>) => createProxyHost(host),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: QUERY_KEY });
},
});
const updateMutation = useMutation({
mutationFn: ({ uuid, data }: { uuid: string; data: Partial<ProxyHost> }) =>
updateProxyHost(uuid, data),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: QUERY_KEY });
},
});
const deleteMutation = useMutation({
mutationFn: (opts: { uuid: string; deleteUptime?: boolean } | string) =>
typeof opts === 'string' ? deleteProxyHost(opts) : (opts.deleteUptime !== undefined ? deleteProxyHost(opts.uuid, opts.deleteUptime) : deleteProxyHost(opts.uuid)),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: QUERY_KEY });
},
});
const bulkUpdateACLMutation = useMutation({
mutationFn: ({ hostUUIDs, accessListID }: { hostUUIDs: string[]; accessListID: number | null }) =>
bulkUpdateACL(hostUUIDs, accessListID),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: QUERY_KEY });
},
});
return {
hosts: query.data || [],
loading: query.isLoading,
isFetching: query.isFetching,
error: query.error ? (query.error as Error).message : null,
createHost: createMutation.mutateAsync,
updateHost: (uuid: string, data: Partial<ProxyHost>) => updateMutation.mutateAsync({ uuid, data }),
deleteHost: (uuid: string, deleteUptime?: boolean) => deleteMutation.mutateAsync(deleteUptime !== undefined ? { uuid, deleteUptime } : uuid),
bulkUpdateACL: (hostUUIDs: string[], accessListID: number | null) =>
bulkUpdateACLMutation.mutateAsync({ hostUUIDs, accessListID }),
isCreating: createMutation.isPending,
isUpdating: updateMutation.isPending,
isDeleting: deleteMutation.isPending,
isBulkUpdating: bulkUpdateACLMutation.isPending,
};
}
export type { ProxyHost };