8000 GitHub - Partha11/overleaf-toolkit · GitHub
[go: up one dir, main page]

Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

433 Commits

Folders and files

Repository files navigation

Cloverleaf Logo

Cloverleaf

An enhanced, self-hosted collaborative LaTeX editor with custom branding, extended user activation workflows, email notifications, and streamlined deployment.

stars open issues Docker Node.js License: AGPL v3

About

Cloverleaf is an enhanced, self-hosted distribution of Overleaf Community Edition built on top of the containerized toolkit. It preserves full compatibility with the official Overleaf CE ecosystem while introducing refined branding, comprehensive administrative tooling, and quality-of-life enhancements for self-hosters and collaborative teams.

Key Enhancements

  • Refined Branding & UI: Custom Cloverleaf iconography, smooth editor-loading fill animation, redesigned header logo, and dynamic compile-status favicons (normal, compiling, compiled, error).
  • Advanced User Management: Dedicated /admin/user dashboard with batch registration, project counts (owned vs. collaborated breakdown), admin privilege toggles, and account removal.
  • Automated Invitation Emails: Automatic activation/welcome emails dispatched to newly registered users via SMTP (with graceful fallback direct activation links when mail transport is unavailable).
  • Flexible Reverse Proxy & Dual-Access Support: Dynamic protocol and host detection enabling seamless simultaneous access via HTTPS domain names and direct HTTP IP addresses without cookie or session dropouts.
  • Editor Review Comments: Restored review thread and messaging capabilities in the editor side panel.

Quick Start

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/Partha11/overleaf-toolkit.git ./cloverleaf
    cd cloverleaf
  2. Initialize configuration:

    bin/init

    This generates the local configuration files in config/ and applies the custom Docker Compose overrides.

  3. Configure your instance: Review and adjust settings in config/overleaf.rc and config/variables.env:

    nano config/overleaf.rc
    nano config/variables.env
  4. Start the containers:

    bin/up -d
  5. Create the initial admin user: Open http://localhost (or http://your-server-ip:port) in your browser to complete the launchpad wizard, or create an administrator directly from the command line:

    bin/docker-exec sharelatex node services/web/scripts/create-admin-user.js --email admin@example.com

Configuration

Custom UI Styles

Global branding and theme overrides live in overrides/cloverleaf-overrides-v4.css. The stylesheet is mounted read-only into Overleaf's public stylesheets directory and loaded by _metadata.pug; theme initialization remains inline.

Manage Users-specific refinements are scoped to .manage-users-page, using :where() to preserve selector specificity. Shared card, table, form, modal, dropdown, and editor theme defaults remain global. Dark session-table stripes are scoped to .clear-user-sessions; light-mode stripes remain unchanged. The project list heading has a transparent dark-mode background so its #main-content ID does not pick up page-container styling. The v1, v2, and v3 stylesheet mounts are retained for cached pages and rollback.

Stylesheets are cached for one year. When changing these rules, use a new versioned filename and update both _metadata.pug and overrides/docker-compose.override.yml. Run bin/docker-compose up -d --no-deps sharelatex to synchronize the runtime configuration and recreate only the web container with the updated mount. A restart alone does not apply new mounts.

Run node scripts/test-ui-scopes.mjs with the web container running to check selector isolation, unchanged shared CSS declarations, and template rendering. This check does not access the database or modify application data.

For browser color regression checks (requires Chromium and Node 22+), run:

node scripts/test-ui-scopes.mjs /tmp/cloverleaf-ui-fixtures.json
node scripts/test-session-theme.mjs /tmp/cloverleaf-ui-fixtures.json

The browser check covers sample session tables and project headings using the live login page's assets. It does not log in, clear sessions, or modify actual projects.

Manage Users JavaScript

Manage Users loads the single implementation in overrides/user-management.js through the existing admin-only /admin/user-management.js route. The script tag uses the request's CSP nonce and defer; do not remove the nonce, because the application's strict-dynamic policy blocks ordinary same-origin script tags. The route retains Express's default caching and conditional revalidation.

When changing the script, update the ?v= value in manage_users.pug to the first 12 hexadecimal characters of its SHA-256 digest. The UI structural check verifies the value. Restart only sharelatex to reload the cached Pug template.

Run node scripts/test-user-management.mjs /tmp/cloverleaf-ui-fixtures.json after generating fixtures with scripts/test-ui-scopes.mjs. This checks CSP, deferred initialization, filtering, registration, link copying, promotion/demotion, deletion, and error/cancellation paths using sample users and intercepted action responses. It never submits admin mutations to the running application.

Mail / SMTP Setup

To enable automated invitation and password reset emails, configure your SMTP credentials in config/variables.env:

OVERLEAF_EMAIL_FROM_ADDRESS=noreply@yourdomain.com
OVERLEAF_EMAIL_SMTP_HOST=smtp.resend.com
OVERLEAF_EMAIL_SMTP_PORT=587
OVERLEAF_EMAIL_SMTP_SECURE=false
OVERLEAF_EMAIL_SMTP_USER=resend
OVERLEAF_EMAIL_SMTP_PASS=re_your_api_key

Reverse Proxy & SSL

When deploying behind Nginx or Traefik:

OVERLEAF_BEHIND_PROXY=true
OVERLEAF_SECURE_COOKIE=auto
OVERLEAF_SITE_URL=https://cloverleaf.yourdomain.com

Tip

Setting OVERLEAF_SECURE_COOKIE=auto ensures cookies adapt automatically—securing them over HTTPS connections while keeping direct HTTP IP access functional without login errors.

Management Commands

The toolkit provides simple wrapper scripts in the bin/ directory:

Command Description
bin/up -d Start all Cloverleaf containers in detached mode
bin/down Stop and remove active containers
bin/doctor Run diagnostic checks on system requirements and configuration
bin/logs View real-time container log output
bin/docker-exec Execute a command inside the sharelatex web container
bin/build-frontend Recompile frontend bundles with custom overrides and themes

Contributing

Contributions are welcome:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push the branch (git push origin feature/my-feature)
  5. Open a pull request

Bug reports and suggestions can be submitted via GitHub Issues.

Credits & Acknowledgements

  • Special credit to Sabbir Mahmud Afridi for suggesting the name Cloverleaf.
  • Cloverleaf is built upon and extends the official Overleaf Toolkit developed and maintained by Overleaf (Digital Science / WriteLaTeX Ltd).

We express our gratitude to the Overleaf team and the open-source community for creating and supporting the foundational LaTeX collaborative editor ecosystem.

License

Distributed under the GNU Affero General Public License v3.0. See LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0