Skip to content

fix: Serve external resources like icons and fonts locally #818

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

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
720b569
chore: pull images from custom registry (default compose file) (#524)
wrn14897 Dec 10, 2024
8d72534
feat: add more count aggregation functions (count_per_x) (#539)
wrn14897 Dec 23, 2024
cc2a3d4
fix: no need to show field dropdown for all 'count' agg functions (#541)
wrn14897 Dec 24, 2024
e6d8501
chore: bump vector version to v0.43.1 (#540)
wrn14897 Jan 3, 2025
9daccff
fix: should check team + service + name instead (adding webhook) (#550)
wrn14897 Jan 10, 2025
e1d8409
fix: `expandToNestedObject` method bug (inconsistent top-level keys) …
wrn14897 Jan 11, 2025
dacc630
chore: release v1.10.1
wrn14897 Jan 12, 2025
636b085
fix: build-local command (#630)
wrn14897 Feb 25, 2025
7925642
feat: Allow to update team name (#688)
ernestii Mar 18, 2025
8f19139
feat: Allow to set table headers and chart line names (#689)
ernestii Mar 21, 2025
bedee44
fix: UI-metrics search overflow (#745)
harshrajeevsingh Apr 14, 2025
30f18ce
chore: Replace deprecated ubuntu runner (#792)
teeohhem May 6, 2025
76a96c3
feat: Allow to sort logs by timestamp in ASC direction (#787)
ernestii May 6, 2025
e282ef3
Add bootstrap-icons to public directory
MiguelRipoll23 May 14, 2025
607ae80
Add IBM Plex Mono font files
MiguelRipoll23 May 14, 2025
77bce25
Replace font files with updated versions
MiguelRipoll23 May 14, 2025
fba143f
Fix font path in bootstrap-icons.css
MiguelRipoll23 May 14, 2025
d1b9e3e
Update Storybook preview to use local assets
MiguelRipoll23 May 14, 2025
1f9ed8f
Refactor font loading: move IBM Plex Mono styles to separate CSS file…
MiguelRipoll23 May 14, 2025
bfb2295
Update font imports in app.scss to use local assets for bootstrap-ico…
MiguelRipoll23 May 14, 2025
53ed629
Add Roboto font files to public directory
MiguelRipoll23 May 15, 2025
55be3c6
Add Inter font files to public directory
MiguelRipoll23 May 15, 2025
237446b
Add Roboto Mono font files
MiguelRipoll23 May 15, 2025
0128161
Add additional Roboto font weights to google-fonts.css
MiguelRipoll23 May 15, 2025
a1078b5
Replace Inter font weight 500 with 900
MiguelRipoll23 May 15, 2025
668f3c6
Add Inter font weights 100 and 900 to google-fonts.css
MiguelRipoll23 May 15, 2025
8fdf0ef
Add Roboto Mono font weights 100 and 700 to google-fonts.css
MiguelRipoll23 May 15, 2025
8a67509
Remove external font imports for Roboto, Inter, and Roboto Mono from …
MiguelRipoll23 May 15, 2025
0c9b9a9
Update font URLs in bootstrap-icons.css
MiguelRipoll23 May 15, 2025
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
6 changes: 6 additions & 0 deletions .changeset/gentle-lamps-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hyperdx/api': patch
'@hyperdx/app': patch
---

feat: Allow to update team name
6 changes: 6 additions & 0 deletions .changeset/wise-wombats-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hyperdx/app': patch
'@hyperdx/api': patch
---

feat: Allow to set table headers and chart line names
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Used by docker-compose.yml
IMAGE_NAME=ghcr.io/hyperdxio/hyperdx
IMAGE_NAME_HDX=ghcr.hyperdx.io/hyperdxio/hyperdx
LOCAL_IMAGE_NAME=ghcr.io/hyperdxio/hyperdx-local
LOCAL_IMAGE_NAME_DOCKERHUB=hyperdx/hyperdx-local
IMAGE_VERSION=1.10.0
IMAGE_VERSION=1.10.1

# Set up domain URLs
HYPERDX_API_PORT=8000
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
jobs:
lint:
timeout-minutes: 8
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -25,14 +25,14 @@ jobs:
- name: Install vector
run: |
mkdir -p vector
curl -sSfL --proto '=https' --tlsv1.2 https://packages.timber.io/vector/0.41.1/vector-0.41.1-x86_64-unknown-linux-musl.tar.gz | tar xzf - -C vector --strip-components=2
curl -sSfL --proto '=https' --tlsv1.2 https://packages.timber.io/vector/0.43.1/vector-0.43.1-x86_64-unknown-linux-musl.tar.gz | tar xzf - -C vector --strip-components=2
cp ./vector/bin/vector /usr/local/bin/vector
vector --version
- name: Run lint + type check
run: make ci-lint
unit:
timeout-minutes: 8
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -46,7 +46,7 @@ jobs:
run: make ci-unit
integration:
timeout-minutes: 8
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ dev-migrate-db:

.PHONY: build-local
build-local:
docker build ./docker/hostmetrics -t ${IMAGE_NAME}:${LATEST_VERSION}-hostmetrics --target prod &
docker build ./docker/ingestor -t ${IMAGE_NAME}:${LATEST_VERSION}-ingestor --target prod &
docker build ./docker/otel-collector -t ${IMAGE_NAME}:${LATEST_VERSION}-otel-collector --target prod &
docker build --build-arg CODE_VERSION=${LATEST_VERSION} . -f ./packages/miner/Dockerfile -t ${IMAGE_NAME}:${LATEST_VERSION}-miner --target prod &
docker build --build-arg CODE_VERSION=${LATEST_VERSION} . -f ./packages/go-parser/Dockerfile -t ${IMAGE_NAME}:${LATEST_VERSION}-go-parser &
docker build ./docker/hostmetrics -t ${IMAGE_NAME_HDX}:${LATEST_VERSION}-hostmetrics --target prod &
docker build ./docker/ingestor -t ${IMAGE_NAME_HDX}:${LATEST_VERSION}-ingestor --target prod &
docker build ./docker/otel-collector -t ${IMAGE_NAME_HDX}:${LATEST_VERSION}-otel-collector --target prod &
docker build --build-arg CODE_VERSION=${LATEST_VERSION} . -f ./packages/miner/Dockerfile -t ${IMAGE_NAME_HDX}:${LATEST_VERSION}-miner --target prod &
docker build --build-arg CODE_VERSION=${LATEST_VERSION} . -f ./packages/go-parser/Dockerfile -t ${IMAGE_NAME_HDX}:${LATEST_VERSION}-go-parser &
docker build \
--build-arg CODE_VERSION=${LATEST_VERSION} \
--build-arg PORT=${HYPERDX_API_PORT} \
. -f ./packages/api/Dockerfile -t ${IMAGE_NAME}:${LATEST_VERSION}-api --target prod &
. -f ./packages/api/Dockerfile -t ${IMAGE_NAME_HDX}:${LATEST_VERSION}-api --target prod &
docker build \
--build-arg CODE_VERSION=${LATEST_VERSION} \
--build-arg OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} \
--build-arg OTEL_SERVICE_NAME=${OTEL_SERVICE_NAME} \
--build-arg PORT=${HYPERDX_APP_PORT} \
--build-arg SERVER_URL=${HYPERDX_API_URL}:${HYPERDX_API_PORT} \
. -f ./packages/app/Dockerfile -t ${IMAGE_NAME}:${LATEST_VERSION}-app --target prod
. -f ./packages/app/Dockerfile -t ${IMAGE_NAME_HDX}:${LATEST_VERSION}-app --target prod

.PHONY: version
version:
Expand Down
18 changes: 9 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
go-parser:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-go-parser
image: ${IMAGE_NAME_HDX}:${IMAGE_VERSION}-go-parser
container_name: hdx-oss-go-parser
environment:
AGGREGATOR_API_URL: 'http://aggregator:8001'
Expand All @@ -16,7 +16,7 @@ services:
networks:
- internal
miner:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-miner
image: ${IMAGE_NAME_HDX}:${IMAGE_VERSION}-miner
container_name: hdx-oss-miner
environment:
HYPERDX_API_KEY: ${HYPERDX_API_KEY}
Expand All @@ -30,7 +30,7 @@ services:
networks:
- internal
hostmetrics:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-hostmetrics
image: ${IMAGE_NAME_HDX}:${IMAGE_VERSION}-hostmetrics
container_name: hdx-oss-hostmetrics
environment:
HYPERDX_API_KEY: ${HYPERDX_API_KEY}
Expand All @@ -40,7 +40,7 @@ services:
networks:
- internal
ingestor:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-ingestor
image: ${IMAGE_NAME_HDX}:${IMAGE_VERSION}-ingestor
container_name: hdx-oss-ingestor
volumes:
- .volumes/ingestor_data:/var/lib/vector
Expand Down Expand Up @@ -76,7 +76,7 @@ services:
networks:
- internal
otel-collector:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-otel-collector
image: ${IMAGE_NAME_HDX}:${IMAGE_VERSION}-otel-collector
container_name: hdx-oss-otel-collector
environment:
HYPERDX_LOG_LEVEL: ${HYPERDX_LOG_LEVEL}
Expand All @@ -94,7 +94,7 @@ services:
networks:
- internal
aggregator:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-api
image: ${IMAGE_NAME_HDX}:${IMAGE_VERSION}-api
container_name: hdx-oss-aggregator
ports:
- 8001:8001
Expand All @@ -118,7 +118,7 @@ services:
- redis
- ch-server
task-check-alerts:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-api
image: ${IMAGE_NAME_HDX}:${IMAGE_VERSION}-api
container_name: hdx-oss-task-check-alerts
entrypoint: 'node'
command: './build/tasks/index.js check-alerts'
Expand Down Expand Up @@ -150,7 +150,7 @@ services:
- db
- redis
api:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-api
image: ${IMAGE_NAME_HDX}:${IMAGE_VERSION}-api
container_name: hdx-oss-api
ports:
- ${HYPERDX_API_PORT}:${HYPERDX_API_PORT}
Expand Down Expand Up @@ -185,7 +185,7 @@ services:
- db
- redis
app:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-app
image: ${IMAGE_NAME_HDX}:${IMAGE_VERSION}-app
container_name: hdx-oss-app
ports:
- ${HYPERDX_APP_PORT}:${HYPERDX_APP_PORT}
Expand Down
2 changes: 1 addition & 1 deletion docker/ingestor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## base #############################################################################################
FROM timberio/vector:0.41.1-alpine AS base
FROM timberio/vector:0.43.1-alpine AS base

RUN mkdir -p /var/lib/vector
VOLUME ["/var/lib/vector"]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hyperdx",
"private": true,
"version": "1.10.0",
"version": "1.10.1",
"license": "MIT",
"workspaces": [
"packages/*"
Expand Down
7 changes: 7 additions & 0 deletions packages/api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @hyperdx/api

## 1.10.1

### Patch Changes

- e1d8409: fix: expandToNestedObject method bug (inconsistent top-level keys)
- 9daccff: fix: should check team + service + name uniq constraint instead (adding webhook)

## 1.10.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperdx/api",
"version": "1.10.0",
"version": "1.10.1",
"license": "MIT",
"private": true,
"engines": {
Expand Down
4 changes: 4 additions & 0 deletions packages/api/src/controllers/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export function rotateTeamApiKey(teamId: ObjectId) {
return Team.findByIdAndUpdate(teamId, { apiKey: uuidv4() }, { new: true });
}

export function setTeamName(teamId: ObjectId, name: string) {
return Team.findByIdAndUpdate(teamId, { name }, { new: true });
}

export async function getTags(teamId: ObjectId) {
const [dashboardTags, logViewTags] = await Promise.all([
Dashboard.aggregate([
Expand Down
29 changes: 28 additions & 1 deletion packages/api/src/routers/api/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { z } from 'zod';
import { validateRequest } from 'zod-express-middleware';

import * as config from '@/config';
import { getTags, getTeam, rotateTeamApiKey } from '@/controllers/team';
import {
getTags,
getTeam,
rotateTeamApiKey,
setTeamName,
} from '@/controllers/team';
import {
deleteTeamMember,
findUserByEmail,
Expand Down Expand Up @@ -78,6 +83,28 @@ router.patch('/apiKey', async (req, res, next) => {
}
});

router.patch(
'/name',
validateRequest({
body: z.object({
name: z.string().min(1).max(100),
}),
}),
async (req, res, next) => {
try {
const teamId = req.user?.team;
if (teamId == null) {
throw new Error(`User ${req.user?._id} not associated with a team`);
}
const { name } = req.body;
const team = await setTeamName(teamId, name);
res.json({ name: team?.name });
} catch (e) {
next(e);
}
},
);

router.post(
'/invitation',
validateRequest({
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/routers/api/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ router.post(
}
const { name, service, url, description, queryParams, headers, body } =
req.body;
if (await Webhook.findOne({ team: teamId, service, url })) {
if (await Webhook.findOne({ team: teamId, service, name })) {
return res.status(400).json({
message: 'Webhook already exists',
});
Expand Down
17 changes: 17 additions & 0 deletions packages/api/src/tasks/__tests__/checkAlerts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@ describe('checkAlerts', () => {
expect(expandToNestedObject({ 'foo.bar.baz': 'qux' })).toEqual({
foo: { bar: { baz: 'qux' } },
});
// inconsistent top level keys
expect(
expandToNestedObject({
foo: 'bar',
'foo.bar': 'baz',
}),
).toEqual({
foo: 'bar',
});
expect(
expandToNestedObject({
'foo.bar': 'baz',
foo: 'bar',
}),
).toEqual({
foo: 'bar',
});
// mix
expect(
expandToNestedObject({
Expand Down
15 changes: 10 additions & 5 deletions packages/api/src/tasks/checkAlerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,16 @@ export const expandToNestedObject = (
break;
}
const nestedKey = keys[i];
if (i === keys.length - 1) {
nestedObj[nestedKey] = obj[key];
} else {
nestedObj[nestedKey] = nestedObj[nestedKey] || {};
nestedObj = nestedObj[nestedKey];
try {
if (i === keys.length - 1) {
nestedObj[nestedKey] = obj[key];
} else {
nestedObj[nestedKey] = nestedObj[nestedKey] || {};
nestedObj = nestedObj[nestedKey];
}
} catch (e) {
// skip the duplicate inconsistent top level keys case. ex: 'foo' and 'foo.bar'
logger.warn('expandToNestedObject', e);
}
}
}
Expand Down
15 changes: 2 additions & 13 deletions packages/app/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="./styles/bootstrap-icons.css" />
<link rel="stylesheet" href="./styles/google-fonts.css" />
2 changes: 2 additions & 0 deletions packages/app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @hyperdx/app

## 1.10.1

## 1.10.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperdx/app",
"version": "1.10.0",
"version": "1.10.1",
"private": true,
"license": "MIT",
"engines": {
Expand Down
16 changes: 2 additions & 14 deletions packages/app/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,9 @@ export default function MyApp({ Component, pageProps }: AppPropsWithLayout) {
return (
<React.Fragment>
<Head>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"
/>
<link rel="stylesheet" href="./styles/bootstrap-icons.css" />
<link rel="icon" type="image/png" sizes="32x32" href="/Icon32.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossOrigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
></link>
<link rel="stylesheet" href="./styles/google-fonts.css" />
<meta
name="viewport"
content="width=device-width, initial-scale=0.75"
Expand Down
Binary file added packages/app/public/fonts/bootstrap-icons.woff
Binary file not shown.
Binary file added packages/app/public/fonts/bootstrap-icons.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading