Skip to content

Commit 064199d

Browse files
committed
Add private workspace generator
1 parent 95812ae commit 064199d

8 files changed

Lines changed: 596 additions & 26 deletions

.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ APP_PORT=8000
44
OPENAI_API_KEY=
55
OPENAI_MODEL=gpt-5.4
66
OPENAI_EMBEDDING_MODEL=text-embedding-3-large
7+
PATHOLOGY_PROJECT_NAME=Pathology RAG Workbench
8+
PATHOLOGY_PROJECT_SLUG=pathology-rag-workbench
9+
COMPOSE_PROJECT_NAME=pathology-rag-workbench
10+
PATHOLOGY_CLIENT_COMMAND=pathology-client
11+
PATHOLOGY_INGEST_COMMAND=pathology-ingest-local
12+
PATHOLOGY_OPENCLAW_SKILL_NAME=pathology-rag
13+
PATHOLOGY_INSTALL_GLOBAL_ALIAS=1
714
PATHOLOGY_PDF_ROOT=pathologybook
815
PATHOLOGY_DATA_DIR=data
916
PATHOLOGY_LIBRARY_CONFIG=config/library.local.yaml
@@ -12,5 +19,9 @@ PATHOLOGY_CHUNK_OVERLAP=120
1219
PATHOLOGY_TOP_K=6
1320
PATHOLOGY_EMBEDDING_DIMENSIONS=3072
1421
PATHOLOGY_EMBEDDING_BATCH_SIZE=16
22+
POSTGRES_DB=pathology_ai
23+
POSTGRES_USER=pathology
24+
POSTGRES_PASSWORD=pathology
25+
POSTGRES_PORT=5432
1526
POSTGRES_URL=postgresql+psycopg://pathology:pathology@localhost:5432/pathology_ai
1627
OPENCLAW_PATHOLOGY_API=http://127.0.0.1:8000

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PYTHON := .venv/bin/python
22
PIP := .venv/bin/pip
33

4-
.PHONY: bootstrap doctor ingest api test docker-up docker-down portable-up portable-bundle ui
4+
.PHONY: bootstrap doctor ingest api test docker-up docker-down portable-up portable-bundle ui init-private
55

66
bootstrap:
77
bash scripts/bootstrap.sh
@@ -32,3 +32,7 @@ portable-up:
3232

3333
portable-bundle:
3434
bash scripts/package_portable.sh
35+
36+
init-private:
37+
@test -n "$(TARGET)" || (echo "Usage: make init-private TARGET=/absolute/path/to/private-workspace [NAME='My Private Workspace']"; exit 1)
38+
python3 scripts/init_private_workspace.py "$(TARGET)" $(if $(NAME),--name "$(NAME)",)

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,34 @@ This path is designed to work even when:
4040
- you do not have an OpenAI API key yet
4141
- you are cloning the repo onto a new machine for the first time
4242

43+
## Generate a Private Workspace
44+
45+
If you do not want to work directly in this public repository, you can use it as a generator for a new private local project.
46+
47+
Example:
48+
49+
```bash
50+
bash scripts/init_private_workspace.sh ~/Projects/my-private-pathology --name "My Private Pathology"
51+
```
52+
53+
That command creates a new workspace folder with:
54+
55+
- its own `.env`
56+
- its own `config/library.local.yaml`
57+
- a namespaced Docker Compose project name
58+
- isolated API and PostgreSQL host ports
59+
- namespaced CLI wrapper names such as `pathology-client-my-private-pathology`
60+
- an optional fresh git repository
61+
62+
Then you switch into the generated folder and deploy it there:
63+
64+
```bash
65+
cd ~/Projects/my-private-pathology
66+
bash scripts/deploy_portable.sh --allow-no-openai
67+
```
68+
69+
This is the closest path to generating a new local project that behaves like the original private `pathology-ai` setup, but without carrying over public git history or shared runtime settings.
70+
4371
## Five-Minute Onboarding
4472

4573
### 1. Prerequisites
@@ -206,6 +234,7 @@ Direct script entrypoints:
206234
```bash
207235
bash scripts/doctor.sh
208236
bash scripts/bootstrap.sh
237+
bash scripts/init_private_workspace.sh ~/Projects/my-private-pathology --name "My Private Pathology"
209238
bash scripts/deploy_portable.sh --allow-no-openai
210239
bash scripts/package_portable.sh
211240
```

docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ services:
22
postgres:
33
image: pgvector/pgvector:pg17
44
environment:
5-
POSTGRES_DB: pathology_ai
6-
POSTGRES_USER: pathology
7-
POSTGRES_PASSWORD: pathology
5+
POSTGRES_DB: ${POSTGRES_DB:-pathology_ai}
6+
POSTGRES_USER: ${POSTGRES_USER:-pathology}
7+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pathology}
88
ports:
9-
- "5432:5432"
9+
- "${POSTGRES_PORT:-5432}:5432"
1010
volumes:
1111
- postgres_data:/var/lib/postgresql/data
1212
- ./infra/docker/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
@@ -21,9 +21,9 @@ services:
2121
OPENAI_API_KEY: ${OPENAI_API_KEY}
2222
PATHOLOGY_PDF_ROOT: /app/pathologybook
2323
PATHOLOGY_DATA_DIR: /app/data
24-
POSTGRES_URL: postgresql+psycopg://pathology:pathology@postgres:5432/pathology_ai
24+
POSTGRES_URL: postgresql+psycopg://${POSTGRES_USER:-pathology}:${POSTGRES_PASSWORD:-pathology}@postgres:5432/${POSTGRES_DB:-pathology_ai}
2525
ports:
26-
- "8000:8000"
26+
- "${APP_PORT:-8000}:8000"
2727
volumes:
2828
- .:/app
2929
depends_on:
@@ -40,7 +40,7 @@ services:
4040
OPENAI_API_KEY: ${OPENAI_API_KEY}
4141
PATHOLOGY_PDF_ROOT: /app/pathologybook
4242
PATHOLOGY_DATA_DIR: /app/data
43-
POSTGRES_URL: postgresql+psycopg://pathology:pathology@postgres:5432/pathology_ai
43+
POSTGRES_URL: postgresql+psycopg://${POSTGRES_USER:-pathology}:${POSTGRES_PASSWORD:-pathology}@postgres:5432/${POSTGRES_DB:-pathology_ai}
4444
volumes:
4545
- .:/app
4646
depends_on:

0 commit comments

Comments
 (0)