Skip to content

Commit 3ea117d

Browse files
authored
Reskin auto-drive (#456)
* Update components structure to use atomic pattern * feat: create new landing page * feat: create landing layout * feat: create anonymous role in hasura * feat: add public file explorer * feat: create a new sidebar for mobile compatibility * refactor: update AccountInformation and LandingHeader components for improved structure and mobile compatibility * feat: add new color variants for light accent and danger in Tailwind config and globals CSS; update Button component styles * fix: update Button component variant from lightAccent to outline in FileTableRow * feat: add details view to public explorer * improve login & logout redirects * refactor: update router dependencies in AppLayout and LandingLayout for improved navigation handling * move explorer to dashboard and remove the need for logging in * refactor: remove session dependency from ObjectDownloadModal to simplify metadata fetching logic * fix: downloads stalled on anon user * refactor: rearrange component structure in AppLayout for better organization and clarity * refactor: remove authentication check from object reporting handler to streamline error handling * refactor: simplify reportFile function by removing authentication checks and headers * refactor: clean up middleware and layout components by removing unused code and logging * refactor: update login callback URL to include default network ID for improved routing * refactor: update images and remove console log from App component for cleaner code * feat: ensure that the user + subcription is updated * refactor: remove object ownership fields from global files query * refactor: eliminate owners field from object summary in global files query * test: increase timeout for S3 SDK integration test to prevent timeouts * feat: enable dark mode support in Tailwind configuration * feat: add explore button to landing hero section * feat: add metric reporting for object reporting in controller * refactor: remove unused NavItem import from HeroSection component
1 parent af04d30 commit 3ea117d

File tree

184 files changed

+5188
-2244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+5188
-2244
lines changed

backend/__tests__/integration/s3-sdk/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('AWS S3 - SDK', () => {
9191

9292
expect(result.Body).toBeDefined()
9393
expect(Buffer.from(await result.Body!.transformToByteArray())).toEqual(Body)
94-
})
94+
}, 15_000)
9595

9696
it('should be able download first 10 bytes of the object', async () => {
9797
const command = new GetObjectCommand({

backend/src/app/controllers/object.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
handleInternalErrorResult,
1111
} from '../../shared/utils/neverthrow.js'
1212
import { handleError } from '../../errors/index.js'
13+
import { sendMetricToVictoria } from '../../infrastructure/drivers/vmetrics.js'
1314

1415
const logger = createLogger('http:controllers:object')
1516

@@ -452,10 +453,15 @@ objectController.post(
452453
asyncSafeHandler(async (req, res) => {
453454
const { cid } = req.params
454455

455-
const executor = await handleAuth(req, res)
456-
if (!executor) {
457-
return
458-
}
456+
logger.info('Reporting object', { cid })
457+
sendMetricToVictoria({
458+
measurement: 'object_report',
459+
tag: req.ip?.toString() ?? 'unknown',
460+
fields: {
461+
cid,
462+
ip: req.ip?.toString() ?? 'unknown',
463+
},
464+
})
459465

460466
const reportResult = await handleInternalError(
461467
ObjectUseCases.reportObject(cid),

docker-compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ services:
7070
HASURA_GRAPHQL_DEV_MODE: "true" # Disable development mode features
7171

7272
# Role and CORS Settings
73-
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: user # Default role for unauthenticated users
73+
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: anonymous # Default role for unauthenticated users
7474
HASURA_GRAPHQL_CORS_DOMAIN: ${HASURA_GRAPHQL_CORS_DOMAIN} # Allowed domains for CORS
7575
HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES: "true"
7676

docker-compose.devProdAuth.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ services:
7171
HASURA_GRAPHQL_DEV_MODE: "true" # Disable development mode features
7272

7373
# Role and CORS Settings
74-
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: user # Default role for unauthenticated users
74+
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: anonymous # Default role for unauthenticated users
7575
HASURA_GRAPHQL_CORS_DOMAIN: ${HASURA_GRAPHQL_CORS_DOMAIN} # Allowed domains for CORS
7676
HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES: "true"
7777

@@ -92,6 +92,9 @@ services:
9292
# Hasura Migrations and Metadata
9393
HASURA_GRAPHQL_METADATA_DIR: /app/metadata
9494
HASURA_GRAPHQL_MIGRATIONS_DIR: /app/migrations
95+
command:
96+
- graphql-engine
97+
- serve
9598
profiles:
9699
- infrastructure
97100
ports:

docker-compose.prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
HASURA_GRAPHQL_DEV_MODE: "false" # Disable development mode features
2323

2424
# Role and CORS Settings
25-
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: user # Default role for unauthenticated users
25+
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: anonymous # Default role for unauthenticated users
2626
HASURA_GRAPHQL_CORS_DOMAIN: ${HASURA_GRAPHQL_CORS_DOMAIN} # Allowed domains for CORS
2727
HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES: "true"
2828

frontend/codegen.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
import type { CodegenConfig } from '@graphql-codegen/cli';
22
import * as dotenv from 'dotenv';
33

4-
dotenv.config();
4+
dotenv.config({ path: '../.env' });
55

66
const config: CodegenConfig = {
77
generates: {
88
'./gql/graphql.ts': {
9-
schema: process.env.HASURA_URL ?? 'http://localhost:6565/v1/graphql',
9+
schema: [
10+
{
11+
'http://localhost:6565/v1/graphql': {
12+
headers: {
13+
'x-hasura-admin-secret': process.env.HASURA_GRAPHQL_ADMIN_SECRET!,
14+
'x-hasura-role': 'admin',
15+
},
16+
},
17+
},
18+
],
1019
documents: ['./src/**/query.graphql'],
1120
plugins: [
1221
'typescript',

0 commit comments

Comments
 (0)