Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "x7-dental"
}
}
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ COPY --parents ./addOns/package.json ./addOns/*/*/package.json ./extensions/*/pa

RUN bun pm cache rm
RUN bun install
RUN bun add ajv@8.12.0
RUN npm install --no-save --legacy-peer-deps ajv@8.12.0
# Copy the local directory
COPY --link --exclude=yarn.lock --exclude=package.json --exclude=Dockerfile . .

Expand All @@ -72,6 +72,20 @@ ARG APP_CONFIG=config/default.js
ARG PUBLIC_URL=/
ENV PUBLIC_URL=${PUBLIC_URL}

# Firebase env vars β€” passed as --build-arg at docker build time
ARG REACT_APP_FIREBASE_API_KEY
ARG REACT_APP_FIREBASE_AUTH_DOMAIN
ARG REACT_APP_FIREBASE_PROJECT_ID
ARG REACT_APP_FIREBASE_STORAGE_BUCKET
ARG REACT_APP_FIREBASE_MESSAGING_SENDER_ID
ARG REACT_APP_FIREBASE_APP_ID
ENV REACT_APP_FIREBASE_API_KEY=${REACT_APP_FIREBASE_API_KEY}
ENV REACT_APP_FIREBASE_AUTH_DOMAIN=${REACT_APP_FIREBASE_AUTH_DOMAIN}
ENV REACT_APP_FIREBASE_PROJECT_ID=${REACT_APP_FIREBASE_PROJECT_ID}
ENV REACT_APP_FIREBASE_STORAGE_BUCKET=${REACT_APP_FIREBASE_STORAGE_BUCKET}
Comment on lines 74 to +85
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 security Firebase credentials recorded in Docker image build history

Values passed via --build-arg are permanently stored in each build layer and visible to anyone with access to the image via docker history <image>. While Firebase web API keys are not highly sensitive secrets (they're embedded in client JS), this pattern sets a precedent that could leak more sensitive values if the approach is reused. Consider writing a .env-style file at build time instead of using build args for credentials, or accept the trade-off explicitly in team policy.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Dockerfile
Line: 74-85

Comment:
**Firebase credentials recorded in Docker image build history**

Values passed via `--build-arg` are permanently stored in each build layer and visible to anyone with access to the image via `docker history <image>`. While Firebase web API keys are not highly sensitive secrets (they're embedded in client JS), this pattern sets a precedent that could leak more sensitive values if the approach is reused. Consider writing a `.env`-style file at build time instead of using build args for credentials, or accept the trade-off explicitly in team policy.

How can I resolve this? If you propose a fix, please make it concise.

ENV REACT_APP_FIREBASE_MESSAGING_SENDER_ID=${REACT_APP_FIREBASE_MESSAGING_SENDER_ID}
ENV REACT_APP_FIREBASE_APP_ID=${REACT_APP_FIREBASE_APP_ID}

RUN bun run show:config
RUN bun run build

Expand Down
571 changes: 225 additions & 346 deletions README.md

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env bash
# =============================================================================
# deploy.sh β€” Build β†’ Push β†’ Deploy to Cloud Run + Firebase Hosting
#
# Usage:
# ./deploy.sh # full deploy (build + push + cloud run + hosting)
# ./deploy.sh --skip-build # redeploy existing image without rebuilding
# =============================================================================

set -euo pipefail

# ---------- Windows: point gcloud at its bundled Python ----------
# On Windows, the system `python` is a Store alias stub; gcloud needs a real interpreter.
if [[ -n "${LOCALAPPDATA:-}" ]]; then
_BUNDLED_PY="${LOCALAPPDATA}/Google/Cloud SDK/google-cloud-sdk/platform/bundledpython/python.exe"
if [[ -f "$_BUNDLED_PY" ]]; then
export CLOUDSDK_PYTHON="$_BUNDLED_PY"
fi
fi

# ---------- config (edit if needed) ----------
GCP_PROJECT="x7-dental"
GCP_REGION="us-central1"
SERVICE_NAME="ohif-dental-viewer"
IMAGE="gcr.io/${GCP_PROJECT}/${SERVICE_NAME}"

# Load Firebase env vars from platform/app/.env
ENV_FILE="platform/app/.env"
if [[ ! -f "$ENV_FILE" ]]; then
echo "ERROR: $ENV_FILE not found"
exit 1
fi
source <(grep "^REACT_APP_FIREBASE" "$ENV_FILE" | sed 's/ *= */=/')

# ---------- build & push ----------
if [[ "${1:-}" != "--skip-build" ]]; then
echo "==> Building Docker image..."
docker build \
--build-arg REACT_APP_FIREBASE_API_KEY="$REACT_APP_FIREBASE_API_KEY" \
--build-arg REACT_APP_FIREBASE_AUTH_DOMAIN="$REACT_APP_FIREBASE_AUTH_DOMAIN" \
--build-arg REACT_APP_FIREBASE_PROJECT_ID="$REACT_APP_FIREBASE_PROJECT_ID" \
--build-arg REACT_APP_FIREBASE_STORAGE_BUCKET="$REACT_APP_FIREBASE_STORAGE_BUCKET" \
--build-arg REACT_APP_FIREBASE_MESSAGING_SENDER_ID="$REACT_APP_FIREBASE_MESSAGING_SENDER_ID" \
--build-arg REACT_APP_FIREBASE_APP_ID="$REACT_APP_FIREBASE_APP_ID" \
-t "$IMAGE" \
.

echo "==> Pushing image to Google Container Registry..."
docker push "$IMAGE"
fi

# ---------- deploy to Cloud Run ----------
echo "==> Deploying to Cloud Run ($GCP_REGION)..."
gcloud run deploy "$SERVICE_NAME" \
--image "$IMAGE" \
--platform managed \
--region "$GCP_REGION" \
--project "$GCP_PROJECT" \
--port 8080 \
--allow-unauthenticated \
--min-instances 0 \
--max-instances 3 \
--memory 512Mi \
--cpu 1

# ---------- deploy Firebase Hosting ----------
echo "==> Deploying Firebase Hosting rules..."
firebase deploy --only hosting --project "$GCP_PROJECT"

echo ""
echo "Done! Your app is live at:"
echo " https://${GCP_PROJECT}.web.app"
104 changes: 104 additions & 0 deletions extensions/24x7-dental-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
11 changes: 11 additions & 0 deletions extensions/24x7-dental-ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["prettier-plugin-tailwindcss"],
"trailingComma": "es5",
"printWidth": 100,
"proseWrap": "always",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"arrowParens": "avoid",
"endOfLine": "auto"
}
96 changes: 96 additions & 0 deletions extensions/24x7-dental-ui/.webpack/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
const path = require('path');
const pkg = require('../package.json');

const outputFile = 'index.umd.js';
const rootDir = path.resolve(__dirname, '../');
const outputFolder = path.join(__dirname, `../dist/umd/${pkg.name}/`);

// Todo: add ESM build for the extension in addition to umd build

const config = {
mode: 'production',
entry: rootDir + '/' + pkg.module,
devtool: 'source-map',
output: {
path: outputFolder,
filename: outputFile,
library: pkg.name,
libraryTarget: 'umd',
chunkFilename: '[name].chunk.js',
umdNamedDefine: true,
globalObject: "typeof self !== 'undefined' ? self : this",
},
externals: [
{
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
'@ohif/core': {
commonjs2: '@ohif/core',
commonjs: '@ohif/core',
amd: '@ohif/core',
root: '@ohif/core',
},
'@ohif/ui': {
commonjs2: '@ohif/ui',
commonjs: '@ohif/ui',
amd: '@ohif/ui',
root: '@ohif/ui',
},
},
],
module: {

rules: [
{
test: /\.svg?$/,
oneOf: [
{
use: [
{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false
},
},
},
]
},
prettier: false,
svgo: true,
titleProp: true,
},
},
],
issuer: {
and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
},
},
],
},
{
test: /(\.jsx|\.js|\.tsx|\.ts)$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/,
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
],
},
resolve: {
modules: [path.resolve('./node_modules'), path.resolve('./src')],
extensions: ['.json', '.js', '.jsx', '.tsx', '.ts'],
},
};

module.exports = config;
18 changes: 18 additions & 0 deletions extensions/24x7-dental-ui/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
MIT License

Copyright (c) 2026 24x7-dental-ui (dennis.jayvee.patricio.03@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
7 changes: 7 additions & 0 deletions extensions/24x7-dental-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 24x7-dental-ui
## Description
24x7 Extension for Dental SaaS UI customization for OHIF Viewer
## Author
Dennis Jayvee Patricio
## License
MIT
Loading