Skip to content
LibreSignPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

LibreSign

Document management and signature solution with full control over your data.

LibreSign SaaS

Orchestrates LibreSign provisioning with WordPress as client-facing layer for SaaS deployment.

Quick Start

The Nextcloud and WordPress environments are git submodules. Initialize them before the first make up:

git submodule update --init

The site build uses writable, project-local npm and Composer caches under .cache/ instead of relying on potentially root-owned caches from the host. These caches are ignored by Git.

The static site (site/) is a regular cloned repository managed by make up. On the first run, the Makefile clones https://github.com/LibreSign/site.git automatically and checks out main.

Then start the stack:

make up
make up site
make up wordpress nextcloud
make down
make help  # View all available commands

The preferred way to configure the shared header/footer behavior is directly in the WordPress theme via:

  • Appearance > Customize > Header integration
  • Appearance > Customize > Footer integration

There you configure the webhook secret and optional allowlist used by WordPress to receive the header/footer artifacts pushed by the static site build.

On the static-site build side, the webhook publisher is configured with runtime environment variables.

Priority order is:

  1. theme configuration (Appearance > Customize > Header integration / Footer integration)
  2. runtime environment variables for the site build webhook
  3. existing locally stored header/footer artifacts in WordPress

The site build webhooks expect:

  • LIBRESIGN_HEADER_WEBHOOK_URL
  • LIBRESIGN_HEADER_WEBHOOK_SECRET
  • LIBRESIGN_FOOTER_WEBHOOK_URL
  • LIBRESIGN_FOOTER_WEBHOOK_SECRET

For local development on Linux, the repository Makefile loads .env, maps host.docker.internal into the site container, and publishes both fragments directly to the local WordPress REST endpoints by default.

The tracked docker-compose.saas.yml contains the WordPress integration settings required by LibreSign SaaS (plugins, networking, ports and volumes). These belong in the SaaS repository, not in the shared wordpress-docker submodule or in a developer's local configuration.

For optional machine-specific settings, copy the provided example:

cp docker-compose.override.example.yml docker-compose.override.yml

Edit docker-compose.override.yml as needed. It is ignored by Git and is automatically applied last by make up, make down and make test-config when present. No local override is needed for the default make up workflow. The Compose file order is wordpress-docker/docker-compose.yml, then docker-compose.saas.yml, then the optional local override. With explicit -f files, Docker Compose resolves relative bind mount paths from the first Compose file (wordpress-docker/); take this into account when adding local volumes. Do not commit machine-specific values or credentials.

Validate the combined configuration with make test-config before starting the environment.

You can pass component names after make up to start only part of the local stack:

  • make up site
  • make up wordpress
  • make up nextcloud
  • make up wordpress nextcloud

To keep local development simple and avoid /etc/hosts changes, the static site is exposed on its own localhost port instead of using the production subdomain layout:

WordPress reaches Nextcloud through the same HTTPS URL and validates its certificate against the shared proxy's local certificate authority. WordPress uses 127.0.0.1 instead of localhost because the shared proxy sends HSTS for https://localhost, which makes browsers upgrade http://localhost:8080 to HTTPS. Existing installs that still use http://localhost are moved to the new URL by make up.

make up refreshes the remote Docker images used by the WordPress, static site, and Nextcloud services and rebuilds local buildable services before starting the stack. During make up site, the site/ clone is also synced from https://github.com/LibreSign/site.git (main) automatically, so no manual site update step is required.

The site, the Nextcloud apps and the LibreSign WordPress plugins and theme follow the main branch of their repositories. Polylang Pro and WooCommerce Subscriptions come from third-party mirrors, so docker-compose.saas.yml pins them to a release tag with the ref field of the wordpress-docker setup config. Renovate (.github/renovate.json5) checks the mirrors on Mondays and opens a pull request when a new release is tagged. It only recognizes ref written right after source (ending in .git), with the tag as a comment:

- slug: polylang-pro
  source: https://gitlab.com/wordpress-premium/polylang-pro.git
  ref: 851df56e647a4c19450d69ddff9c77aa67963a0d # v3.7.6

On a fresh WordPress database, make up also performs the initial WordPress installation via WP-CLI and restarts the WordPress container once so the wordpress-docker entrypoint can install the configured plugins and themes.

make test validates the Compose configuration and checks the running integration: required services, the WordPress -> Nextcloud HTTPS connection, an authenticated Nextcloud API request, the required apps and plugins, and that running make up again keeps the existing configuration.

Every service is published on 127.0.0.1 only, so the stack is not reachable from other machines on the network.

Each time the WordPress container starts, the password of every WordPress user is reset to WORDPRESS_LOCAL_USERS_PASSWORD (default: admin). When the local database is loaded from a production dump, this applies to every customer and administrator account in it. Set WORDPRESS_LOCAL_RESET_ALL_USERS_PASSWORDS=0 in .env to keep the passwords from the dump.

End-to-end tests

End-to-end tests cover the customer workflows across WordPress and Nextcloud: signing up for a plan, logging into Nextcloud with the store account, renewing, cancelling and changing plan.

They run on a separate stack built from scratch, with the plugins and theme declared in docker-compose.saas.yml, so they never touch the local database or require a developer-specific override. They need Docker and Node.js:

npm ci
npx playwright install chromium
npm run env:start    # WordPress on :8891, Nextcloud on :8892, Mailpit on :8893
npm run test:e2e
npm run env:stop

Integration Flow

WordPress is the customer-facing commerce and account portal (plans, subscriptions, invoices, payments, and account reports).

Component Roles

  • Makefile: orchestrates local development environment (refresh images, start services, perform first WordPress install when needed, connect networks, setup and enable required Nextcloud apps).
  • site: Jigsaw-based marketing site served locally on a dedicated port.
  • wordpress-docker: storefront and customer account portal (checkout, subscriptions, invoices, billing).
  • woocommerce-nextcloud-admin-group-manager (WordPress plugin): converts subscription/account events into integration calls.
  • nextcloud-development: local Nextcloud runtime where integration apps are installed/enabled.
  • admin_group_manager (Nextcloud app/API): receives integration calls and applies provisioning/access updates.
  • wordpress_login_backend (Nextcloud app): allows authentication in Nextcloud using WordPress credentials.
  • wordpress-theme (Wordpress theme): wordpress theme
  • woocommerce-subscription (Woocommerce Subscriptions): Manage subscriptions in Woocommerce

Developer Flow

sequenceDiagram
    actor Dev as Developer
    participant Make as make up
    participant Site as site
    participant WP as wordpress-docker
    participant NC as nextcloud-development

    Dev->>Make: make up
    Make->>Site: refresh remote images
    Make->>Site: start services
    Make->>WP: refresh remote images
    Make->>NC: refresh remote images
    Make->>WP: start services
    Make->>WP: install WordPress core on first boot
    Make->>NC: start services
    Make->>NC: clone and enable admin_group_manager
    Make->>NC: clone and enable wordpress_login_backend
    Make->>NC: connect networks
    Make->>NC: provision admin user
Loading

Customer Flow

sequenceDiagram
    actor User as Customer
    participant WP as WordPress (Store + Account)
    participant Plugin as woocommerce-nextcloud-admin-group-manager
    participant AGM as admin_group_manager (Nextcloud app/API)
    participant NC as Nextcloud portal
    participant WLB as wordpress_login_backend

    User->>WP: choose plan and checkout
    User->>WP: manage billing and invoices
    WP->>Plugin: subscription event
    Plugin->>AGM: provision/update access
    User->>NC: login with WordPress credentials
    NC->>WLB: validate credentials
Loading

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages