Compare commits
5 Commits
0c76986ee2
...
cursor/fix
| Author | SHA1 | Date | |
|---|---|---|---|
| b5c440a900 | |||
| 1285a1048e | |||
|
|
76e0f803a3 | ||
|
|
19db9c58dd | ||
|
|
7776b7f10d |
25
.env.example
25
.env.example
@@ -9,23 +9,26 @@ INSECURE=true
|
|||||||
|
|
||||||
## Features ##
|
## Features ##
|
||||||
# The following variable is a convenience variable to enable or disable features of this compose project.
|
# The following variable is a convenience variable to enable or disable features of this compose project.
|
||||||
# Example: if you want to use traefik and letsencrypt, you can set the variable to
|
# Root docker-compose.yml starts Traefik only; always include opencloud/opencloud.yml for OpenCloud.
|
||||||
#COMPOSE_FILE=docker-compose.yml:traefik/opencloud.yml
|
# Example: baseline OpenCloud with Traefik
|
||||||
|
#COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml
|
||||||
# This enables you to just run `docker compose up -d` and the compose files will be added to the stack.
|
# This enables you to just run `docker compose up -d` and the compose files will be added to the stack.
|
||||||
# As alternative approach you can run `docker compose -f docker-compose.yml -f docker-compose.traefik.yml up -d`
|
# As alternative approach you can run `docker compose -f docker-compose.yml -f opencloud/opencloud.yml up -d`
|
||||||
# Default: OpenCloud and Collabora with traefik and letsencypt
|
# OpenCloud and Collabora with Traefik and Let's Encrypt
|
||||||
# This needs DNS entries for the domain names used in the .env file.
|
# This needs DNS entries for the domain names used in the .env file.
|
||||||
#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
#COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
||||||
# If you want to use the external proxy, you can use the following combination.
|
# If you want to use the external proxy, you can use the following combination.
|
||||||
# DNS entries and certificates need to be managed by the external environment.
|
# DNS entries and certificates need to be managed by the external environment.
|
||||||
# The domain names need to be entered into the .env file.
|
# The domain names need to be entered into the .env file.
|
||||||
#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:external-proxy/opencloud.yml:external-proxy/collabora.yml
|
#COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:external-proxy/opencloud.yml:external-proxy/collabora.yml
|
||||||
# Keycloak Shared User Directory
|
# Keycloak Shared User Directory
|
||||||
#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml:idm/ldap-keycloak.yml:traefik/ldap-keycloak.yml
|
#COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml:idm/ldap-keycloak.yml:traefik/ldap-keycloak.yml
|
||||||
# OpenCloud, Planka and Gitea
|
# OpenCloud and Gitea (shared Postgres)
|
||||||
#COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:project/planka.yml:version-control/gitea.yml:traefik/opencloud.yml:traefik/planka.yml:database/postgres.yml:traefik/gitea.yml
|
#COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:version-control/gitea.yml:database/postgres.yml
|
||||||
# Odoo, Gitea, opencloud
|
# Odoo, Gitea, and OpenCloud (shared Postgres; include odoo-init on first start)
|
||||||
#Compose_File=docker-compose.yml:odoo/odoo.yml:opencloud/opencloud.yml:version-control/gitea.yml:traefik/opencloud.yml:traefik/planka.yml:database/postgres.yml:traefik/gitea.yml:traefik/odoo.yml
|
#COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:odoo/odoo.yml:odoo/odoo-init.yml:version-control/gitea.yml:database/postgres.yml
|
||||||
|
# Odoo, Gitea, OpenCloud, Postgres, with backup and restore helpers
|
||||||
|
#COMPOSE_FILE=docker-compose.yml:odoo/odoo.yml:opencloud/opencloud.yml:version-control/gitea.yml:database/postgres.yml:backup/backup.yml:odoo/odoo-init.yml:backup/restore.yml
|
||||||
|
|
||||||
## Traefik Settings ##
|
## Traefik Settings ##
|
||||||
# Note: Traefik is always enabled and can't be disabled.
|
# Note: Traefik is always enabled and can't be disabled.
|
||||||
|
|||||||
179
README.md
179
README.md
@@ -1,10 +1,12 @@
|
|||||||
# OpenCloud Compose
|
# Selfhost Cloud Compose Stack
|
||||||
|
|
||||||
This repository provides Docker Compose configurations for deploying OpenCloud in various environments.
|
This repository provides modular Docker Compose configurations for a self-hosted stack built around OpenCloud, with Traefik at the root and optional Odoo, Gitea, Postgres, and backup services.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
OpenCloud Compose offers a modular approach to deploying OpenCloud with several configuration options:
|
The stack uses a modular compose layout. The root `docker-compose.yml` starts **Traefik only**. OpenCloud and other apps are added as overlay files.
|
||||||
|
|
||||||
|
OpenCloud options:
|
||||||
|
|
||||||
- **Standard deployment** with Traefik reverse proxy and Let's Encrypt certificates or certificates from files
|
- **Standard deployment** with Traefik reverse proxy and Let's Encrypt certificates or certificates from files
|
||||||
- **External proxy** support for environments with existing reverse proxies (like Nginx, Caddy, etc.)
|
- **External proxy** support for environments with existing reverse proxies (like Nginx, Caddy, etc.)
|
||||||
@@ -14,6 +16,15 @@ OpenCloud Compose offers a modular approach to deploying OpenCloud with several
|
|||||||
- **Monitoring** with metrics endpoints for observability and performance monitoring
|
- **Monitoring** with metrics endpoints for observability and performance monitoring
|
||||||
- **Radicale** integration for Calendar and Contacts
|
- **Radicale** integration for Calendar and Contacts
|
||||||
|
|
||||||
|
Additional services in this repo:
|
||||||
|
|
||||||
|
- **Odoo 19** (`odoo/odoo.yml` + `odoo/odoo-init.yml`)
|
||||||
|
- **Gitea** (`version-control/gitea.yml`, SSH on port 2222) — see [version-control/README.md](version-control/README.md)
|
||||||
|
- **Shared Postgres** (`database/postgres.yml`) for Gitea and Odoo
|
||||||
|
- **Backups** (`backup/backup.yml`, `backup/restore.yml`, optional Borgmatic) — see [backup/README.md](backup/README.md) and [backup/borgmatic-README.md](backup/borgmatic-README.md)
|
||||||
|
|
||||||
|
> **Note**: Traefik is always present via `docker-compose.yml`. OpenCloud lives in `opencloud/opencloud.yml` (with Traefik labels). Overlays that attach services to `opencloud-net` (Collabora, Keycloak, Tika, Radicale, monitoring) typically also include `traefik/opencloud.yml` so Traefik joins that network.
|
||||||
|
|
||||||
## Quick Start Guide
|
## Quick Start Guide
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
@@ -29,8 +40,8 @@ OpenCloud Compose offers a modular approach to deploying OpenCloud with several
|
|||||||
|
|
||||||
1. **Clone the repository**:
|
1. **Clone the repository**:
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/opencloud-eu/opencloud-compose.git
|
git clone ssh://git@git.faryad.top:2222/rhino/selfhost-cloud-compose-stack.git
|
||||||
cd opencloud-compose
|
cd selfhost-cloud-compose-stack
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Create environment file**:
|
2. **Create environment file**:
|
||||||
@@ -48,12 +59,12 @@ OpenCloud Compose offers a modular approach to deploying OpenCloud with several
|
|||||||
|
|
||||||
You can deploy using explicit `-f` flags:
|
You can deploy using explicit `-f` flags:
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker-compose.yml -f traefik/opencloud.yml up -d
|
docker compose -f docker-compose.yml -f opencloud/opencloud.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Or by adding the `COMPOSE_FILE` variable in `.env`:
|
Or by adding the `COMPOSE_FILE` variable in `.env`:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:traefik/opencloud.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Then simply run:
|
Then simply run:
|
||||||
@@ -66,6 +77,8 @@ OpenCloud Compose offers a modular approach to deploying OpenCloud with several
|
|||||||
127.0.0.1 cloud.opencloud.test
|
127.0.0.1 cloud.opencloud.test
|
||||||
127.0.0.1 traefik.opencloud.test
|
127.0.0.1 traefik.opencloud.test
|
||||||
127.0.0.1 keycloak.opencloud.test
|
127.0.0.1 keycloak.opencloud.test
|
||||||
|
127.0.0.1 git.opencloud.test
|
||||||
|
127.0.0.1 odoo.opencloud.test
|
||||||
```
|
```
|
||||||
|
|
||||||
7. **Access OpenCloud**:
|
7. **Access OpenCloud**:
|
||||||
@@ -85,10 +98,10 @@ OpenCloud Compose offers a modular approach to deploying OpenCloud with several
|
|||||||
|
|
||||||
2. **Configure deployment options** in `.env`:
|
2. **Configure deployment options** in `.env`:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Start OpenCloud**:
|
3. **Start the stack**:
|
||||||
```bash
|
```bash
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
@@ -103,12 +116,12 @@ OpenCloud can be deployed with Keycloak for identity management and LDAP for the
|
|||||||
|
|
||||||
Using `-f` flags:
|
Using `-f` flags:
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker-compose.yml -f idm/ldap-keycloak.yml -f traefik/opencloud.yml -f traefik/ldap-keycloak.yml up -d
|
docker compose -f docker-compose.yml -f opencloud/opencloud.yml -f idm/ldap-keycloak.yml -f traefik/opencloud.yml -f traefik/ldap-keycloak.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Or by setting in `.env`:
|
Or by setting in `.env`:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/ldap-keycloak.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/ldap-keycloak.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
> **For local development only**: Add to `/etc/hosts`:
|
> **For local development only**: Add to `/etc/hosts`:
|
||||||
@@ -129,12 +142,12 @@ Include Collabora for document editing using either method:
|
|||||||
|
|
||||||
Using `-f` flags:
|
Using `-f` flags:
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker-compose.yml -f weboffice/collabora.yml -f traefik/opencloud.yml -f traefik/collabora.yml up -d
|
docker compose -f docker-compose.yml -f opencloud/opencloud.yml -f weboffice/collabora.yml -f traefik/opencloud.yml -f traefik/collabora.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Or by setting in `.env`:
|
Or by setting in `.env`:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
> **For local development only**: Add to `/etc/hosts`:
|
> **For local development only**: Add to `/etc/hosts`:
|
||||||
@@ -151,12 +164,12 @@ Enable full text search capabilities with Apache Tika using either method:
|
|||||||
|
|
||||||
Using `-f` flags:
|
Using `-f` flags:
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker-compose.yml -f search/tika.yml -f traefik/opencloud.yml up -d
|
docker compose -f docker-compose.yml -f opencloud/opencloud.yml -f search/tika.yml -f traefik/opencloud.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Or by setting in `.env`:
|
Or by setting in `.env`:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:search/tika.yml:traefik/opencloud.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:search/tika.yml:traefik/opencloud.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
This setup includes:
|
This setup includes:
|
||||||
@@ -172,12 +185,12 @@ Enable CalDAV (calendars, to-do lists) and CardDAV (contacts) server.
|
|||||||
|
|
||||||
Using `-f` flags:
|
Using `-f` flags:
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker-compose.yml -f radicale/radicale.yml -f traefik/opencloud.yml up -d
|
docker compose -f docker-compose.yml -f opencloud/opencloud.yml -f radicale/radicale.yml -f traefik/opencloud.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Or by setting in `.env`:
|
Or by setting in `.env`:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:radicale/radicale.yml:traefik/opencloud.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:radicale/radicale.yml:traefik/opencloud.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
This setup includes:
|
This setup includes:
|
||||||
@@ -190,25 +203,27 @@ Enable monitoring capabilities with metrics endpoints using either method:
|
|||||||
|
|
||||||
> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain. Configure a DNS A/AAAA record for your domain (e.g., `cloud.example.com`) or use a wildcard DNS entry (`*.example.com`).
|
> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain. Configure a DNS A/AAAA record for your domain (e.g., `cloud.example.com`) or use a wildcard DNS entry (`*.example.com`).
|
||||||
|
|
||||||
Using `-f` flags:
|
OpenCloud proxy metrics (`monitoring/monitoring.yml`):
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker-compose.yml -f monitoring/monitoring.yml -f traefik/opencloud.yml up -d
|
docker compose -f docker-compose.yml -f opencloud/opencloud.yml -f monitoring/monitoring.yml -f traefik/opencloud.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Or by setting in `.env`:
|
Or by setting in `.env`:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:monitoring/monitoring.yml:traefik/opencloud.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:monitoring/monitoring.yml:traefik/opencloud.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
For Collabora collaboration-service metrics, also include `monitoring/monitoring-collaboration.yml` (requires the Collabora overlay):
|
||||||
|
```
|
||||||
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:monitoring/monitoring.yml:monitoring/monitoring-collaboration.yml:traefik/opencloud.yml:traefik/collabora.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
This setup includes:
|
This setup includes:
|
||||||
- Metrics endpoints for OpenCloud proxy service (port 9205)
|
- Metrics endpoint for the OpenCloud proxy service (listens on port 9205 inside the container)
|
||||||
- Metrics endpoints for collaboration service (port 9304)
|
- Metrics endpoint for the collaboration service (listens on port 9304 inside the container; needs `monitoring/monitoring-collaboration.yml`)
|
||||||
- Performance monitoring and observability data
|
|
||||||
- Prometheus-compatible metrics format
|
- Prometheus-compatible metrics format
|
||||||
|
|
||||||
Access metrics endpoints:
|
> **Note**: These overlays set listen addresses only; they do **not** publish host ports. Scrape metrics from the Docker network (for example `http://opencloud:9205/metrics` or `http://collaboration:9304/metrics`), or add your own port mappings if you need host access.
|
||||||
- OpenCloud metrics: `http://localhost:9205/metrics`
|
|
||||||
- Collaboration metrics: `http://localhost:9304/metrics`
|
|
||||||
|
|
||||||
> **Note**: The monitoring configuration uses an external network `opencloud-net`. You need to create this network manually before starting the services:
|
> **Note**: The monitoring configuration uses an external network `opencloud-net`. You need to create this network manually before starting the services:
|
||||||
> ```bash
|
> ```bash
|
||||||
@@ -223,12 +238,12 @@ If you already have a reverse proxy (Nginx, Caddy, etc.), use either method:
|
|||||||
|
|
||||||
Using `-f` flags:
|
Using `-f` flags:
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker-compose.yml -f weboffice/collabora.yml -f external-proxy/opencloud.yml -f external-proxy/collabora.yml up -d
|
docker compose -f docker-compose.yml -f opencloud/opencloud.yml -f weboffice/collabora.yml -f external-proxy/opencloud.yml -f external-proxy/collabora.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Or by setting in `.env`:
|
Or by setting in `.env`:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:external-proxy/opencloud.yml:external-proxy/collabora.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:external-proxy/opencloud.yml:external-proxy/collabora.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
This exposes the necessary ports:
|
This exposes the necessary ports:
|
||||||
@@ -240,10 +255,38 @@ This exposes the necessary ports:
|
|||||||
If you're using **Nginx Proxy Manager (NPM)**, you **should NOT** activate **"Block Common Exploits"** for the Proxy Host.
|
If you're using **Nginx Proxy Manager (NPM)**, you **should NOT** activate **"Block Common Exploits"** for the Proxy Host.
|
||||||
Otherwise, the desktop app authentication will return **error 403 Forbidden**.
|
Otherwise, the desktop app authentication will return **error 403 Forbidden**.
|
||||||
|
|
||||||
|
### With Odoo, Gitea, and Shared Postgres
|
||||||
|
|
||||||
|
Odoo and Gitea share Postgres from `database/postgres.yml`. Traefik labels for Odoo are already in `odoo/odoo.yml` (there is no `traefik/odoo.yml`).
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:odoo/odoo.yml:odoo/odoo-init.yml:database/postgres.yml:version-control/gitea.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
Using `-f` flags:
|
||||||
|
```bash
|
||||||
|
docker compose -f docker-compose.yml -f opencloud/opencloud.yml -f odoo/odoo.yml -f odoo/odoo-init.yml -f database/postgres.yml -f version-control/gitea.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
> **For local development only**: Add to `/etc/hosts`:
|
||||||
|
> ```
|
||||||
|
> 127.0.0.1 odoo.opencloud.test
|
||||||
|
> 127.0.0.1 git.opencloud.test
|
||||||
|
> ```
|
||||||
|
|
||||||
|
- **Odoo**: include `odoo/odoo-init.yml` on first start so volume ownership is fixed automatically — see [scripts/odoo/README.md](scripts/odoo/README.md)
|
||||||
|
- **Gitea**: web UI via Traefik; SSH on host port **2222** — see [version-control/README.md](version-control/README.md)
|
||||||
|
|
||||||
|
### Backups
|
||||||
|
|
||||||
|
Scheduled Postgres dumps and volume archives are defined in `backup/backup.yml`; restores use `backup/restore.yml`. Optional Borgmatic is in `backup/borgmatic.yml`.
|
||||||
|
|
||||||
|
See [backup/README.md](backup/README.md) and [backup/borgmatic-README.md](backup/borgmatic-README.md) for configuration and restore workflows. Do not copy outdated volume names from older docs; Odoo uses `odoo-db-data` and `odoo-config` (see below).
|
||||||
|
|
||||||
## SSL Certificate Support
|
## SSL Certificate Support
|
||||||
|
|
||||||
OpenCloud Compose supports adding SSL certificates for public domains and development environments. This feature enables you to use the "Let's Encrypt ACME challenge" to generate certificates for your public domains as well as using your own certificates.
|
This stack supports adding SSL certificates for public domains and development environments. This feature enables you to use the "Let's Encrypt ACME challenge" to generate certificates for your public domains as well as using your own certificates.
|
||||||
|
|
||||||
### Use Let's Encrypt with ACME Challenge
|
### Use Let's Encrypt with ACME Challenge
|
||||||
|
|
||||||
@@ -408,34 +451,54 @@ mkdir -p /path/to/opencloud/{config,data}
|
|||||||
chown -R 1000:1000 /path/to/opencloud
|
chown -R 1000:1000 /path/to/opencloud
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Odoo Volume Permissions (First-Time Setup)
|
#### Odoo volumes and first-time init
|
||||||
|
|
||||||
When deploying Odoo for the first time, the named volumes are created with root ownership by default. To allow Odoo to write to its filestore and other directories, fix the ownership before starting the services:
|
Odoo uses:
|
||||||
|
|
||||||
|
- named volume `odoo-db-data` → `/var/lib/odoo` (filestore, sessions, attachments)
|
||||||
|
- named volume `odoo-config` → `/etc/odoo`
|
||||||
|
- bind mount `./odoo/addons` → `/mnt/extra-addons`
|
||||||
|
|
||||||
|
On first deploy, include `odoo/odoo-init.yml`. The one-shot `odoo-init` service chowns the named volumes and initializes the database. Details: [scripts/odoo/README.md](scripts/odoo/README.md).
|
||||||
|
|
||||||
|
#### Odoo startup page (Projects instead of Discuss)
|
||||||
|
|
||||||
|
By default, Odoo 19 opens **Discuss** after login. The custom addon [`odoo/addons/project_home_action`](odoo/addons/project_home_action) restores the **Home Action** field on user Preferences and sets it to **Projects** for internal users.
|
||||||
|
|
||||||
|
`./odoo/addons` is already mounted into the container at `/mnt/extra-addons` via [`odoo/odoo.yml`](odoo/odoo.yml). After deploying a revision that includes this addon:
|
||||||
|
|
||||||
|
1. Restart Odoo if the container was already running, so it picks up the new module files:
|
||||||
```bash
|
```bash
|
||||||
# Detect Odoo UID:GID and fix volume ownership
|
docker compose restart odoo
|
||||||
OG=$(docker run --rm odoo:19 sh -c "printf \"%s:%s\" \"\$(id -u odoo)\" \"\$(id -g odoo)\"")
|
|
||||||
for v in odoo-filestore odoo-db-data odoo-config odoo-logs odoo-web-data odoo-addons; do
|
|
||||||
docker run --rm -v "${v}:/data" alpine chown -R "$OG" /data
|
|
||||||
done
|
|
||||||
```
|
```
|
||||||
|
2. In Odoo, open **Settings → Apps**.
|
||||||
|
3. Remove the **Apps** filter (and enable **developer mode** if the Apps menu is limited), then **Update Apps List**.
|
||||||
|
4. Search for **Project as Home Action** (`project_home_action`) and **Install** it.
|
||||||
|
5. Log out and log back in. You should land on Projects (`/odoo/project`) instead of Discuss.
|
||||||
|
|
||||||
This ensures Odoo can create attachments, logs, and configuration files without permission errors.
|
On install, existing internal users with an empty Home Action are updated automatically. New internal users get the same default. You can still change Home Action per user under **Settings → Users → Preferences** (or **My Preferences**).
|
||||||
|
|
||||||
|
Requires the **Project** app to be installed (`depends: project`).
|
||||||
|
|
||||||
### Compose File Structure
|
### Compose File Structure
|
||||||
|
|
||||||
This repository uses a modular approach with multiple compose files:
|
This repository uses a modular approach with multiple compose files:
|
||||||
|
|
||||||
- `docker-compose.yml` - Core OpenCloud service
|
- `docker-compose.yml` — Traefik reverse proxy (always included)
|
||||||
- `weboffice/` - Web office integrations (Collabora Online)
|
- `opencloud/` — OpenCloud service
|
||||||
- `storage/` - Storage backend configurations (decomposeds3)
|
- `odoo/` — Odoo 19 and first-boot init
|
||||||
- `search/` - Search and content analysis services (Apache Tika)
|
- `version-control/` — Gitea
|
||||||
- `monitoring/` - Monitoring and metrics configurations
|
- `database/` — Shared Postgres for Gitea and Odoo
|
||||||
- `idm/` - Identity management configurations (Keycloak & LDAP)
|
- `backup/` — Backup, restore, and optional Borgmatic helpers
|
||||||
- `traefik/` - Traefik reverse proxy configurations
|
- `weboffice/` — Web office integrations (Collabora Online)
|
||||||
- `external-proxy/` - Configuration for external reverse proxies
|
- `storage/` — Storage backend configurations (decomposeds3)
|
||||||
- `radicale/` - Radicale configuration
|
- `search/` — Search and content analysis services (Apache Tika)
|
||||||
- `config/` - Configuration files for OpenCloud, Keycloak, and LDAP
|
- `monitoring/` — Monitoring and metrics configurations
|
||||||
|
- `idm/` — Identity management configurations (Keycloak & LDAP)
|
||||||
|
- `traefik/` — Extra Traefik network aliases and labels for overlays
|
||||||
|
- `external-proxy/` — Configuration for external reverse proxies
|
||||||
|
- `radicale/` — Radicale configuration
|
||||||
|
- `config/` — Configuration files for OpenCloud, Keycloak, LDAP, Traefik, etc.
|
||||||
|
|
||||||
## Advanced Usage
|
## Advanced Usage
|
||||||
|
|
||||||
@@ -450,24 +513,34 @@ The `COMPOSE_FILE` environment variable is a powerful way to manage complex Dock
|
|||||||
|
|
||||||
Example configurations:
|
Example configurations:
|
||||||
|
|
||||||
|
Baseline OpenCloud:
|
||||||
|
```
|
||||||
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml
|
||||||
|
```
|
||||||
|
|
||||||
Production with Collabora:
|
Production with Collabora:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Production with Keycloak and LDAP:
|
Production with Keycloak and LDAP:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/ldap-keycloak.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/ldap-keycloak.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Production with both Collabora and Keycloak/LDAP:
|
Production with both Collabora and Keycloak/LDAP:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/collabora.yml:traefik/ldap-keycloak.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/collabora.yml:traefik/ldap-keycloak.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
Production with monitoring:
|
Production with monitoring:
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:monitoring/monitoring.yml:traefik/opencloud.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:monitoring/monitoring.yml:traefik/opencloud.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
OpenCloud with Odoo, Gitea, and Postgres:
|
||||||
|
```
|
||||||
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:odoo/odoo.yml:odoo/odoo-init.yml:database/postgres.yml:version-control/gitea.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
### Automation and GitOps
|
### Automation and GitOps
|
||||||
@@ -475,7 +548,7 @@ COMPOSE_FILE=docker-compose.yml:monitoring/monitoring.yml:traefik/opencloud.yml
|
|||||||
For automated deployments, using the `COMPOSE_FILE` variable in `.env` is recommended:
|
For automated deployments, using the `COMPOSE_FILE` variable in `.env` is recommended:
|
||||||
|
|
||||||
```
|
```
|
||||||
COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
This allows tools like Ansible or CI/CD pipelines to deploy the stack without modifying the compose files.
|
This allows tools like Ansible or CI/CD pipelines to deploy the stack without modifying the compose files.
|
||||||
@@ -509,7 +582,7 @@ services:
|
|||||||
|
|
||||||
- **SSL Certificate Errors**: For local development, accept self-signed certificates by visiting each domain directly in your browser.
|
- **SSL Certificate Errors**: For local development, accept self-signed certificates by visiting each domain directly in your browser.
|
||||||
- **Port Conflicts**: If you have services already using ports 80/443, use the external proxy configuration.
|
- **Port Conflicts**: If you have services already using ports 80/443, use the external proxy configuration.
|
||||||
- **Permission Issues**: Ensure data and config directories have proper permissions (owned by user/group 1000).
|
- **Permission Issues**: Ensure data and config directories have proper permissions (owned by user/group 1000). For Odoo named volumes, use `odoo/odoo-init.yml` on first start.
|
||||||
|
|
||||||
### Logs
|
### Logs
|
||||||
|
|
||||||
|
|||||||
2
odoo/addons/project_home_action/__init__.py
Normal file
2
odoo/addons/project_home_action/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
from . import models
|
||||||
|
from .hooks import post_init_hook
|
||||||
19
odoo/addons/project_home_action/__manifest__.py
Normal file
19
odoo/addons/project_home_action/__manifest__.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"name": "Project as Home Action",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"summary": "Open Projects after login instead of Discuss",
|
||||||
|
"description": (
|
||||||
|
"Restores the Home Action field on user Preferences (removed in Odoo 19) "
|
||||||
|
"and sets it to Projects for internal users on install and for new users."
|
||||||
|
),
|
||||||
|
"category": "Project",
|
||||||
|
"author": "Automated",
|
||||||
|
"license": "LGPL-3",
|
||||||
|
"depends": ["base", "project", "web"],
|
||||||
|
"data": [
|
||||||
|
"views/res_users_views.xml",
|
||||||
|
],
|
||||||
|
"post_init_hook": "post_init_hook",
|
||||||
|
"installable": True,
|
||||||
|
"application": False,
|
||||||
|
}
|
||||||
13
odoo/addons/project_home_action/hooks.py
Normal file
13
odoo/addons/project_home_action/hooks.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
def post_init_hook(env):
|
||||||
|
"""Set Home Action to Projects for internal users that have none."""
|
||||||
|
action = env.ref("project.open_view_project_all", raise_if_not_found=False)
|
||||||
|
if not action:
|
||||||
|
return
|
||||||
|
users = env["res.users"].search(
|
||||||
|
[
|
||||||
|
("share", "=", False),
|
||||||
|
("action_id", "=", False),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
if users:
|
||||||
|
users.write({"action_id": action.id})
|
||||||
1
odoo/addons/project_home_action/models/__init__.py
Normal file
1
odoo/addons/project_home_action/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import res_users
|
||||||
20
odoo/addons/project_home_action/models/res_users.py
Normal file
20
odoo/addons/project_home_action/models/res_users.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
from odoo import api, models
|
||||||
|
|
||||||
|
|
||||||
|
class ResUsers(models.Model):
|
||||||
|
_inherit = "res.users"
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _project_home_action(self):
|
||||||
|
return self.env.ref("project.open_view_project_all", raise_if_not_found=False)
|
||||||
|
|
||||||
|
@api.model_create_multi
|
||||||
|
def create(self, vals_list):
|
||||||
|
users = super().create(vals_list)
|
||||||
|
action = self._project_home_action()
|
||||||
|
if not action:
|
||||||
|
return users
|
||||||
|
to_update = users.filtered(lambda user: not user.share and not user.action_id)
|
||||||
|
if to_update:
|
||||||
|
to_update.write({"action_id": action.id})
|
||||||
|
return users
|
||||||
30
odoo/addons/project_home_action/views/res_users_views.xml
Normal file
30
odoo/addons/project_home_action/views/res_users_views.xml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<!-- Admin user form: Preferences → Home Action -->
|
||||||
|
<record id="view_users_form_home_action" model="ir.ui.view">
|
||||||
|
<field name="name">res.users.form.home.action</field>
|
||||||
|
<field name="model">res.users</field>
|
||||||
|
<field name="inherit_id" ref="base.view_users_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//page[@name='preferences']//group[@name='other_preferences']" position="inside">
|
||||||
|
<group string="Menus Customization" invisible="share">
|
||||||
|
<field name="action_id" options="{'no_create': True}"/>
|
||||||
|
</group>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- My Preferences dialog -->
|
||||||
|
<record id="view_users_form_simple_modif_home_action" model="ir.ui.view">
|
||||||
|
<field name="name">res.users.preferences.form.home.action</field>
|
||||||
|
<field name="model">res.users</field>
|
||||||
|
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//page[@name='preferences_page']//group[@name='other_preferences']" position="inside">
|
||||||
|
<group string="Menus Customization">
|
||||||
|
<field name="action_id" options="{'no_create': True}" readonly="0"/>
|
||||||
|
</group>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user