Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump Npgsql.OpenTelemetry from 8.0.2 to 8.0.3 #3

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
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
22 changes: 0 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ jobs:
- name: Docker setup Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: gztime
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -70,7 +64,6 @@ jobs:
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/gzctf
gztime/gzctf
flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
tags: |
Expand All @@ -87,18 +80,3 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true

- name: Prune old packages
uses: vlaurin/[email protected]
with:
dry-run: false
token: ${{ secrets.PACKAGE_TOKEN }}
container: ${{ github.event.repository.name }}/gzctf
keep-tags-regexes: ^v\d+\.\d+\.\d+$
prune-tags-regexes: ^[0-9a-f]{6,40}
keep-tags: |
latest
main
develop
keep-last: 20
prune-untagged: false
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# GZ::CTF

[Upstream repository (GZTimeWalker/GZCTF)](https://github.com/GZTimeWalker/GZCTF)

[![publish](https://github.com/GZTimeWalker/GZCTF/actions/workflows/ci.yml/badge.svg)](https://github.com/GZTimeWalker/GZCTF/actions/workflows/ci.yml)
![version](https://img.shields.io/github/v/release/GZTimeWalker/GZCTF?include_prereleases&label=version)
![license](https://img.shields.io/github/license/GZTimeWalker/GZCTF?color=FF5531)
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.4" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
<PackageVersion Include="Npgsql.OpenTelemetry" Version="8.0.2" />
<PackageVersion Include="Npgsql.OpenTelemetry" Version="8.0.3" />
<PackageVersion Include="NPOI" Version="2.7.0" />
<PackageVersion Include="NSwag.AspNetCore" Version="14.0.7" />
<PackageVersion Include="NSwag.MSBuild" Version="14.0.7" />
Expand Down
2 changes: 1 addition & 1 deletion src/GZCTF/ClientApp/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_BACKEND_URL="http://localhost:55000/"
VITE_BACKEND_URL="https://ctf.sdc.tf/"
9 changes: 5 additions & 4 deletions src/GZCTF/ClientApp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
<head>
<meta charset="UTF-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta content="GZ::CTF is an open source CTF platform" name="description"/>
<meta content="#0AD7AF" name="theme-color"/>
<link href="/favicon.webp" rel="icon" type="image/webp"/>
<title>GZ::CTF</title>
<meta content="San Diego CTF is an annual Capture the Flag competition hosted by ACM Cyber at UC San Diego." name="description"/>
<meta content="#F19A3E" name="theme-color"/>
<link href="/favicon.png" rel="icon" type="image/png"/>
<meta property="og:image" content="/favicon.png">
<title>SDCTF 2024</title>
</head>
<body>
<div id="root"></div>
Expand Down
Binary file added src/GZCTF/ClientApp/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/GZCTF/ClientApp/src/components/AppFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const AppFooter: FC = () => {
<Center mx="auto" h="100%">
<Stack gap="sm" w={isMobile ? '100%' : '80%'}>
<Stack w="100%" align="center" gap={2}>
<MainIcon style={{ maxWidth: isMobile ? '3rem' : '4rem', height: 'auto' }} />
<MainIcon style={{ maxWidth: isMobile ? '3rem' : '6rem', height: 'auto' }} />
<Text fw="bold" size={isMobile ? '2rem' : '2.5rem'}>
GZ<span className={logoClasses.brand}>::</span>CTF
SDCTF
</Text>
</Stack>

Expand Down
30 changes: 24 additions & 6 deletions src/GZCTF/ClientApp/src/components/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { createStyles } from '@mantine/emotion'
import {
mdiAccountCircleOutline,
mdiAccountGroupOutline,
mdiBullhornOutline,
mdiCached,
mdiFlagOutline,
mdiHomeVariantOutline,
mdiLogout,
mdiTranslate,
mdiWeatherNight,
Expand Down Expand Up @@ -94,6 +97,27 @@ const AppHeader: FC = () => {
<Menu.Dropdown>
{user && !error ? (
<>
<Menu.Item
component={Link}
to="/"
leftSection={<Icon path={mdiHomeVariantOutline} size={1} />}
>
{t('common.tab.home')}
</Menu.Item>
<Menu.Item
component={Link}
to="/posts"
leftSection={<Icon path={mdiBullhornOutline} size={1} />}
>
{t('common.tab.post')}
</Menu.Item>
<Menu.Item
component={Link}
to="/games"
leftSection={<Icon path={mdiFlagOutline} size={1} />}
>
{t('common.tab.game')}
</Menu.Item>
<Menu.Item
component={Link}
to="/teams"
Expand All @@ -108,12 +132,6 @@ const AppHeader: FC = () => {
>
{t('common.tab.account.profile')}
</Menu.Item>
<Menu.Item
onClick={clearLocalCache}
leftSection={<Icon path={mdiCached} size={1} />}
>
{t('common.tab.account.clean_cache')}
</Menu.Item>
<Menu.Item
color="red"
onClick={logout}
Expand Down
5 changes: 3 additions & 2 deletions src/GZCTF/ClientApp/src/components/AppNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createStyles, getStylesRef } from '@mantine/emotion'
import {
mdiAccountCircleOutline,
mdiAccountGroupOutline,
mdiBullhornOutline,
mdiCached,
mdiFlagOutline,
mdiHomeVariantOutline,
Expand Down Expand Up @@ -133,10 +134,10 @@ const AppNavbar: FC = () => {

const items: NavbarItem[] = [
{ icon: mdiHomeVariantOutline, label: 'common.tab.home', link: '/' },
{ icon: mdiNoteTextOutline, label: 'common.tab.post', link: '/posts' },
{ icon: mdiBullhornOutline, label: 'common.tab.post', link: '/posts' },
{ icon: mdiFlagOutline, label: 'common.tab.game', link: '/games' },
{ icon: mdiAccountGroupOutline, label: 'common.tab.team', link: '/teams' },
{ icon: mdiInformationOutline, label: 'common.tab.about', link: '/about' },
// { icon: mdiInformationOutline, label: 'common.tab.about', link: '/about' },
{ icon: mdiWrenchOutline, label: 'common.tab.admin', link: '/admin/games', admin: true },
]

Expand Down
52 changes: 24 additions & 28 deletions src/GZCTF/ClientApp/src/components/ChallengePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import ChallengeDetailModal from '@Components/ChallengeDetailModal'
import Empty from '@Components/Empty'
import WriteupSubmitModal from '@Components/WriteupSubmitModal'
import { useChallengeTagLabelMap, SubmissionTypeIconMap } from '@Utils/Shared'
import { useIsMobile } from '@Utils/ThemeOverride'
import { useGame, useGameTeamInfo } from '@Utils/useGame'
import { ChallengeInfo, ChallengeTag, SubmissionType } from '@Api'

Expand Down Expand Up @@ -63,16 +64,12 @@ const ChallengePanel: FC = () => {
const challengeTagLabelMap = useChallengeTagLabelMap()
const { t } = useTranslation()

const isMobile = useIsMobile(1300)

// skeleton for loading
if (!challenges) {
return (
<Group
gap="sm"
wrap="nowrap"
justify="space-between"
align="flex-start"
maw="calc(100% - 20rem)"
>
<Group gap="sm" wrap="nowrap" justify="space-between" align="flex-start">
<Stack miw="10rem" gap={6}>
{Array(10)
.fill(null)
Expand All @@ -88,7 +85,6 @@ const ChallengePanel: FC = () => {
pt={0}
spacing="sm"
pos="relative"
w="calc(100% - 9rem)"
cols={{ base: 3, w18: 4, w24: 6, w30: 8, w36: 10, w42: 12, w48: 14 }}
>
{Array(8)
Expand Down Expand Up @@ -139,9 +135,9 @@ const ChallengePanel: FC = () => {
wrap="nowrap"
justify="space-between"
align="flex-start"
miw="calc(100% - 20rem)"
style={{ flex: '100% 1' }}
>
<Stack miw="10rem">
<Stack miw="10rem" style={{ position: isMobile ? 'sticky' : undefined, top: '2rem' }}>
{game?.writeupRequired && (
<>
<Button
Expand Down Expand Up @@ -217,19 +213,19 @@ const ChallengePanel: FC = () => {
</Tabs.List>
</Tabs>
</Stack>
<ScrollArea
w="calc(100% - 9rem)"
h="calc(100vh - 7rem)"
pos="relative"
offsetScrollbars
scrollbarSize={4}
>
{currentChallenges && currentChallenges.length ? (
{currentChallenges && currentChallenges.length ? (
<ScrollArea
h={isMobile ? undefined : 'calc(100vh - 7rem)'}
pos="relative"
offsetScrollbars
scrollbarSize={4}
style={{ flex: 'auto' }}
>
<SimpleGrid
p="xs"
pt={0}
spacing="sm"
cols={{ base: 3, w18: 4, w24: 6, w30: 8, w36: 10, w42: 12, w48: 14 }}
style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))' }}
>
{currentChallenges?.map((chal) => (
<ChallengeCard
Expand All @@ -250,15 +246,15 @@ const ChallengePanel: FC = () => {
/>
))}
</SimpleGrid>
) : (
<Center h="calc(100vh - 10rem)">
<Stack gap={0}>
<Title order={2}>{t('game.content.all_solved.title')}</Title>
<Text>{t('game.content.all_solved.comment')}</Text>
</Stack>
</Center>
)}
</ScrollArea>
</ScrollArea>
) : (
<Center style={{ flex: 'auto', alignSelf: 'center' }}>
<Stack gap={0} style={{ padding: '1rem' }}>
<Title order={2}>{t('game.content.all_solved.title')}</Title>
<Text>{t('game.content.all_solved.comment')}</Text>
</Stack>
</Center>
)}
{game?.writeupRequired && (
<WriteupSubmitModal
opened={writeupSubmitOpened}
Expand Down
2 changes: 1 addition & 1 deletion src/GZCTF/ClientApp/src/components/GameCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const GameCard: FC<GameCardProps> = ({ game, ...others }) => {
>
<Card.Section>
<Group wrap="nowrap" align="flex-start">
<BackgroundImage src={poster ?? ''} h="10rem" maw="20rem" miw="20rem">
<BackgroundImage src={poster ?? ''} h="10rem" maw="20rem">
<Center h="100%">
{!poster && <Icon path={mdiFlagOutline} size={4} color={theme.colors.gray[5]} />}
</Center>
Expand Down
4 changes: 2 additions & 2 deletions src/GZCTF/ClientApp/src/components/GameNoticePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const GameNoticePanel: FC = () => {
)

return (
<Card shadow="sm" w="20rem">
<Card shadow="sm">
<Stack gap="xs">
<SegmentedControl
value={filter}
Expand All @@ -193,7 +193,7 @@ const GameNoticePanel: FC = () => {
]}
/>
{filteredNotices.length ? (
<ScrollArea offsetScrollbars scrollbarSize={0} h="calc(100vh - 25rem)">
<ScrollArea offsetScrollbars scrollbarSize={0}>
<List size="sm" spacing={3}>
{filteredNotices.map((notice) => (
<List.Item
Expand Down
2 changes: 1 addition & 1 deletion src/GZCTF/ClientApp/src/components/IconTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const IconTabs: FC<IconTabsProps> = (props) => {
))

return (
<Group gap={0} justify="space-between" w="100%" wrap="nowrap">
<Group gap={0} justify="space-between" w="100%">
{aside}
{withIcon && (
<LogoHeader
Expand Down
5 changes: 1 addition & 4 deletions src/GZCTF/ClientApp/src/components/LogoHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ export const LogoHeader = forwardRef<HTMLDivElement, GroupProps>((props, ref) =>
return (
<Group ref={ref} wrap="nowrap" {...props}>
<MainIcon style={{ maxWidth: 60, height: 'auto' }} />
<Title className={classes.title}>
{config?.title ?? 'GZ'}
<span className={classes.brand}>::</span>CTF
</Title>
<Title className={classes.title}>{config?.title ?? 'GZ'}CTF</Title>
</Group>
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/GZCTF/ClientApp/src/components/TeamCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const TeamCard: FC<TeamCardProps> = (props) => {
<Group align="stretch" style={{ flexWrap: 'nowrap', alignItems: 'center' }}>
<Stack style={{ flexGrow: 1 }}>
<Group align="stretch" justify="space-between">
<Avatar alt="avatar" color="cyan" size="lg" radius="md" src={team.avatar}>
<Avatar alt="avatar" color="orange" size="lg" radius="md" src={team.avatar}>
{team.name?.slice(0, 1) ?? 'T'}
</Avatar>

Expand Down
44 changes: 21 additions & 23 deletions src/GZCTF/ClientApp/src/components/TeamRank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const TeamRank: FC<CardProps> = (props) => {
<Card {...props} shadow="sm" p="md">
<Stack gap={8}>
<Group gap="sm" wrap="nowrap">
<Avatar alt="avatar" color="cyan" size={50} radius="md" src={teamInfo?.rank?.avatar}>
<Avatar alt="avatar" color="orange" size={50} radius="md" src={teamInfo?.rank?.avatar}>
{teamInfo?.rank?.name?.slice(0, 1) ?? 'T'}
</Avatar>
<Skeleton visible={!teamInfo}>
Expand Down Expand Up @@ -105,28 +105,26 @@ const TeamRank: FC<CardProps> = (props) => {
</Stack>
</Group>
<Progress value={solved * 100} />
{!isMobile && (
<PasswordInput
value={teamInfo?.teamToken}
readOnly
leftSection={<Icon path={mdiKey} size={1} />}
variant="unstyled"
onClick={() => {
clipboard.copy(teamInfo?.teamToken)
showNotification({
color: 'teal',
message: t('team.notification.token.copied'),
icon: <Icon path={mdiCheck} size={1} />,
})
}}
styles={{
innerInput: {
cursor: 'copy',
fontFamily: theme.fontFamilyMonospace,
},
}}
/>
)}
<PasswordInput
value={teamInfo?.teamToken}
readOnly
leftSection={<Icon path={mdiKey} size={1} />}
variant="unstyled"
onClick={() => {
clipboard.copy(teamInfo?.teamToken)
showNotification({
color: 'teal',
message: t('team.notification.token.copied'),
icon: <Icon path={mdiCheck} size={1} />,
})
}}
styles={{
innerInput: {
cursor: 'copy',
fontFamily: theme.fontFamilyMonospace,
},
}}
/>
</Stack>
</Card>
)
Expand Down
2 changes: 1 addition & 1 deletion src/GZCTF/ClientApp/src/components/WithNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const WithNavBar: FC<WithNavBarProps> = ({
const isMobile = useIsMobile()

return (
<WithWiderScreen minWidth={minWidth}>
<WithWiderScreen minWidth={0}>
<Watermark
text={user?.userId ?? ''}
textColor={colorScheme === 'dark' ? theme.colors.gray[3] : theme.colors.gray[7]}
Expand Down
Loading