Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18.2
22.20.0
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "starlight",
"name": "recogito.github.io",
"type": "module",
"version": "0.0.1",
"scripts": {
Expand All @@ -16,4 +16,4 @@
"sharp": "^0.34.3",
"typescript": "^5.4.2"
}
}
}
52 changes: 12 additions & 40 deletions src/content/docs/guides/local-development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,6 @@ docker --version
cd recogito-server
```

:::note[Supabase CLI Compatibility - pgsodium Extension]
If using Supabase CLI version 2.20.4 or later, you need to make a one-time fix to the migration file:

Edit `supabase/migrations/20230524173605_remote_commit.sql` and comment out line 13:
```sql
-- CREATE EXTENSION IF NOT EXISTS "pgsodium" WITH SCHEMA "pgsodium";
```

**Why this is needed:**
- Newer Supabase CLI versions don't pre-create the `pgsodium` schema in local development
- Supabase is [deprecating the pgsodium extension](https://supabase.com/docs/guides/database/extensions/pgsodium) and does not recommend its use for new projects
- Recogito doesn't use pgsodium's encryption features
- Your data remains secure: **Supabase projects are encrypted at rest by default** (SOC2 & HIPAA compliant)

**Production deployments:**
If your production instance was created before this change and already has pgsodium installed, it will continue to work. However, the extension is not actively used by Recogito, so this change is safe for all environments.
:::

2. **Start Supabase locally**

```bash
Expand Down Expand Up @@ -200,36 +182,26 @@ docker --version
The `supabase db reset` command only runs migrations - it doesn't populate roles and groups from config.json.
:::

7. **Create test users**
7. **Create test users and run tests**

Recogito Server has a number of `Jest` tests that are in the `jest/tests/projects.test.ts` file. These tests verify some base functionality.

To simplify the process going forward, modify the `run_tests.sh` file to be executable:

```bash
export SUPABASE_HOST=http://localhost:54321
export SUPABASE_SERVICE_KEY=<service_role_key from step 2>
export PROFESSOR_PW=password123
export STUDENT_PW=password123
export TUTOR_PW=password123
export READER_PW=password123
export INVITE_PW=password123
export PROFESSOR_GROUP_ID='f918b2f8-f587-4ee1-9f2d-35b3aed0b1e6'
node create-test-users.js -f config.json
chmod +x run_tests.sh
```

This creates test accounts for development:
- `professor@example.com` / `password123`
- `student@example.com` / `password123`
- `tutor@example.com` / `password123`
- `reader@example.com` / `password123`
- `invited@example.com` / `password123`

8. **Assign test users to organization groups**
Then execute the tests from the root directory of the repository:

```bash
export SUPABASE_HOST=http://localhost:54321
export SUPABASE_SERVICE_KEY=<service_role_key from step 2>
node assign-test-user-groups.js -f config.json
./run_tests.sh
```

This assigns test users to appropriate groups:
The test script will create a number of test users that you can use locally to access the client and test fuctionality.

This creates test accounts for development:

- `professor@example.com` → Org Professor (can create projects)
- `student@example.com` → Org Readers (read-only)
- `tutor@example.com` → Org Readers (read-only)
Expand Down
65 changes: 41 additions & 24 deletions src/content/docs/guides/self-hosting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ ssh root@your_server_ip
Update the system:
```bash
apt update
apt upgrade
```

Create a new user with sudo privileges:
Expand All @@ -125,6 +126,13 @@ ufw enable
ufw status
```

Best practice is to not utilize the `root` login except in special circumstances. Go ahead and exit the instance and SSH in with the new `recogito` user.

```bash
exit
ssh recogito@your_server_ip
```

### 2. Install Nginx

Install and configure the web server:
Expand Down Expand Up @@ -214,31 +222,31 @@ Use [Supabase JWT Generator](https://supabase.com/docs/guides/self-hosting/docke
- **MINIO_ROOT_USER/PASSWORD**: MinIO dashboard credentials
- **PGADMIN_ADMIN_EMAIL/PASSWORD**: pgAdmin web access

### 6. Run Installation
### 6. Configure Nginx Routes

Execute the installation script:
```bash
sudo bash ./install-self-hosted-docker.sh
```
Copy and customize Nginx configuration files:

Respond "Yes" to database push when prompted.
#### Client Configuration

### 7. Configure Nginx Routes
You will need 5 URLs for this setup

Copy and customize Nginx configuration files:
- A client URL for accessing the Recogito Studio client
- A server URL for API calls
- A MinIO URL for accessing the MinIO dashboard
- A pgAdmin URL for accessing pgAdmin
- A Portainer URL for accessing the Portainer UI

#### Client Configuration
```bash
sudo cp ./nginx.client.example.com /etc/nginx/sites-available/client.example.com
sudo nano /etc/nginx/sites-available/client.example.com
sudo cp ./nginx.client.example.com /etc/nginx/sites-available/<your client url>
sudo nano /etc/nginx/sites-available/<your client url>
```

Replace `client.example.com` with your actual client domain.

#### Server Configuration
```bash
sudo cp ./nginx.server.example.com /etc/nginx/sites-available/server.example.com
sudo nano /etc/nginx/sites-available/server.example.com
sudo cp ./nginx.server.example.com /etc/nginx/sites-available/<your server url>
sudo nano /etc/nginx/sites-available/<your server url>
```

Update:
Expand Down Expand Up @@ -270,11 +278,11 @@ map $http_upgrade $connection_upgrade {
#### Enable Sites
Create symbolic links:
```bash
sudo ln -s /etc/nginx/sites-available/server.example.com /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/client.example.com /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/pgadmin.example.com /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/minio.example.com /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/portainer.example.com /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/<your server url> /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/<your client url> /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/<your pgAdmin url> /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/<your MinIO url> /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/<your Portainer url> /etc/nginx/sites-enabled/
```

Test and restart:
Expand All @@ -283,7 +291,7 @@ sudo nginx -t
sudo systemctl restart nginx
```

### 8. SSL Certificates with Let's Encrypt
### 7. SSL Certificates with Let's Encrypt

Install Certbot:
```bash
Expand All @@ -294,11 +302,11 @@ sudo ln -s /snap/bin/certbot /usr/bin/certbot

Generate certificates for each domain:
```bash
sudo certbot --nginx -d client.example.com
sudo certbot --nginx -d server.example.com
sudo certbot --nginx -d pgadmin.example.com
sudo certbot --nginx -d minio.example.com
sudo certbot --nginx -d portainer.example.com
sudo certbot --nginx -d <your client url>
sudo certbot --nginx -d <your server url>
sudo certbot --nginx -d <your pgAdmin url>
sudo certbot --nginx -d <your MinIO url>
sudo certbot --nginx -d <your portainer url>
```

Verify auto-renewal:
Expand All @@ -307,6 +315,15 @@ sudo systemctl status snap.certbot.renew.service
sudo certbot renew --dry-run
```

### 8. Run Installation

Execute the installation script:
```bash
sudo bash ./install-self-hosted-docker.sh
```

Respond "Yes" to database push when prompted.

## Testing Your Installation

### Test Client Access
Expand Down
1 change: 0 additions & 1 deletion src/content/docs/reference/client-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ Layered annotation system:
- Multiple layers per document
- Context-based organization
- Private/shared annotations
- Version tracking

### Backend Integration

Expand Down