Skip to content
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
14 changes: 10 additions & 4 deletions dockerfiles/Hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ ARG NPM_REGISTRY

WORKDIR /app

RUN corepack enable && corepack prepare pnpm@10.27.0 --activate
RUN if [ -n "${NPM_REGISTRY}" ]; then npm config set registry "${NPM_REGISTRY}"; fi
RUN npm install -g pnpm@10.27.0
RUN if [ -n "${NPM_REGISTRY}" ]; then pnpm config set registry "${NPM_REGISTRY}"; fi

# Copy monorepo configuration and lockfile
Expand All @@ -39,6 +40,7 @@ COPY runtime/hub/frontend/pnpm-workspace.yaml runtime/hub/frontend/pnpm-lock.yam
COPY runtime/hub/frontend/packages/shared/package.json ./packages/shared/
COPY runtime/hub/frontend/apps/admin/package.json ./apps/admin/
COPY runtime/hub/frontend/apps/spawn/package.json ./apps/spawn/
COPY runtime/hub/frontend/apps/home/package.json ./apps/home/

# Install dependencies with frozen lockfile
RUN pnpm install --frozen-lockfile
Expand All @@ -59,13 +61,16 @@ USER root
# Frontend: templates and static files
RUN mkdir -p /tmp/custom_templates/static/css /tmp/custom_templates/static/js \
/usr/local/share/jupyterhub/static/admin-ui \
/usr/local/share/jupyterhub/static/spawn-ui
/usr/local/share/jupyterhub/static/spawn-ui \
/usr/local/share/jupyterhub/static/home-ui

COPY --chmod=644 runtime/hub/frontend/templates/ /tmp/custom_templates/
COPY --from=frontend-builder /app/apps/admin/dist/ /usr/local/share/jupyterhub/static/admin-ui/
COPY --from=frontend-builder /app/apps/spawn/dist/ /usr/local/share/jupyterhub/static/spawn-ui/
COPY --from=frontend-builder /app/apps/home/dist/ /usr/local/share/jupyterhub/static/home-ui/
RUN chown -R 1000:1000 /usr/local/share/jupyterhub/static/admin-ui/ \
/usr/local/share/jupyterhub/static/spawn-ui/
/usr/local/share/jupyterhub/static/spawn-ui/ \
/usr/local/share/jupyterhub/static/home-ui/

# Backend: Python dependencies and core logic
RUN pip install --no-cache-dir uv
Expand All @@ -90,4 +95,5 @@ ENV JUPYTERHUB_TEMPLATE_PATH=/tmp/custom_templates

RUN ls -la /tmp/custom_templates && \
ls -la /usr/local/share/jupyterhub/static/admin-ui/ && \
ls -la /usr/local/share/jupyterhub/static/spawn-ui/
ls -la /usr/local/share/jupyterhub/static/spawn-ui/ && \
ls -la /usr/local/share/jupyterhub/static/home-ui/
4 changes: 2 additions & 2 deletions runtime/hub/core/authenticators/auto_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_handlers(self, app):
"""Override to bypass login page and auto-authenticate."""

class AutoLoginHandler(BaseHandler):
"""Handler that automatically authenticates and redirects to spawn."""
"""Handler that automatically authenticates and redirects to home."""

async def get(self):
"""Auto-authenticate user on GET request."""
Expand All @@ -59,7 +59,7 @@ async def get(self):

next_url = self.get_argument("next", "")
if not next_url:
next_url = getattr(user, "url", None) or url_path_join(self.hub.base_url, "spawn")
next_url = url_path_join(self.hub.base_url, "home")

self.log.info(f"Auto-login: user '{username}' authenticated, redirecting to {next_url}")
self.redirect(next_url)
Expand Down
35 changes: 35 additions & 0 deletions runtime/hub/frontend/apps/home/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { dirname } from 'path'
import { fileURLToPath } from 'url'
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

const __dirname = dirname(fileURLToPath(import.meta.url))

export default tseslint.config(
{ ignores: ['dist'] },
{
files: ['**/*.{ts,tsx}'],
extends: [js.configs.recommended, ...tseslint.configs.recommended],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
tsconfigRootDir: __dirname,
},
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
12 changes: 12 additions & 0 deletions runtime/hub/frontend/apps/home/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AUP Learning Cloud - Home</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
31 changes: 31 additions & 0 deletions runtime/hub/frontend/apps/home/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@auplc/home",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@auplc/shared": "workspace:*",
"react": "catalog:",
"react-dom": "catalog:"
},
"devDependencies": {
"@eslint/js": "catalog:",
"@types/node": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@vitejs/plugin-react": "catalog:",
"eslint": "catalog:",
"eslint-plugin-react-hooks": "catalog:",
"eslint-plugin-react-refresh": "catalog:",
"globals": "catalog:",
"typescript": "catalog:",
"typescript-eslint": "catalog:",
"vite": "catalog:"
}
}
Loading
Loading