### Local Development Setup Commands
Source: https://context7.com/opencloud-eu/docs/llms.txt
Commands for setting up the local development environment for the documentation site, including installing dependencies, starting the development server, building, serving, and formatting/linting.
```bash
# Install dependencies
pnpm install
```
```bash
# Start development server (English)
pnpm start
```
```bash
# Start development server (German)
pnpm run start --locale de
```
```bash
# Build production site
pnpm build
```
```bash
# Serve production build locally (with redirects)
pnpm run serve
```
```bash
# Format and lint before committing
pnpm format:write
pnpm lint:md:fix
```
--------------------------------
### Quick Start Installation
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/index.md
Use this command to quickly install OpenCloud by downloading and executing the installation script.
```bash
curl -L https://opencloud.eu/install | /bin/bash
```
--------------------------------
### Enable and Start Docker Service
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/container/docker-compose/docker-compose-base.md
Enable the Docker service to start on boot and then start the service immediately. This ensures Docker is running and available.
```bash
systemctl enable docker && systemctl start docker
```
--------------------------------
### Start OpenCloud Server
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/other/bare-metal.md
Starts the OpenCloud server process. This command should be run after initialization.
```bash
./bin/opencloud server
```
--------------------------------
### Create Environment File from Example
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/container/docker-compose/docker-compose-base.md
Copy the example environment file to create your active .env configuration file. This file will store your specific deployment settings.
```bash
cp .env.example .env
```
--------------------------------
### PROPFIND Request Example with Namespaces
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/apis/http/webdav/index.md
An example of a PROPFIND request body demonstrating how to declare namespaces for DAV and custom properties.
```xml
```
--------------------------------
### Install Docker on Raspberry Pi
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/other/raspberry-pi.md
Download and execute the official Docker installation script. This command fetches the script and runs it to install Docker.
```bash
curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh
```
--------------------------------
### Install Project Dependencies
Source: https://github.com/opencloud-eu/docs/blob/main/README.md
Installs all necessary project dependencies using pnpm. Run this command after cloning the repository.
```bash
pnpm install
```
--------------------------------
### Install Dependencies and Build LikeC4 Diagrams
Source: https://github.com/opencloud-eu/docs/blob/main/assets/likec4/README.md
Use these commands to install project dependencies and build the C4 diagrams. The generated diagrams are placed in the \/static\/likec4\/ directory.
```bash
pnpm install
pnpm build-likec4
```
--------------------------------
### Install Git
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/other/bare-metal.md
Installs the Git version control system on your system. Git is required for cloning repositories.
```bash
sudo apt install git
```
--------------------------------
### Example YAML Configuration
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/services/idp/example-config.mdx
This snippet displays the content of an example YAML configuration file for environment variables. Ensure the file path is correct when importing.
```yaml
apiVersion: v1
kind: Pod
metadata:
name: my-app
spec:
containers:
- name: my-app-container
image: my-app-image
env:
- name: DB_HOST
value: "localhost"
- name: DB_PORT
value: "5432"
- name: DB_USER
value: "admin"
- name: DB_PASSWORD
value: "password"
- name: API_KEY
value: "abcdef12345"
```
--------------------------------
### rclone Configuration Examples
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/maintenance/migrate.md
Example configurations for connecting to OpenCloud, oCIS, and Nextcloud instances using rclone's webdav type.
```ini
[opencloud-admin]
type = webdav
url = https://opencloud_url/remote.php/webdav
vendor = opencloud
owncloud_exclude_shares = true
user = admin
pass = sQOM4mn2DdR9ihRGkyAMcd50W6mniaSqSfx2qVOdBJs
description = opencloud-admin
[opencloud-alan]
type = webdav
url = https://opencloud_url/remote.php/webdav
vendor = opencloud
owncloud_exclude_shares = true
user = alan
pass = sQOM4mn2DdR9ihRGkyAMcd50W6mniaSqSfx2qVOdBJs
description = opencloud-alan
[ocis-admin]
type = webdav
url = https://ocis_url/remote.php/webdav
vendor = ocis
owncloud_exclude_shares = true
user = admin
pass = Sav5354nRTgBHyItQeCZp9tCBidX2BxbuMx_dDLwxqs
description = ocis-admin
[ocis-einstein]
type = webdav
url = https://ocis_url/remote.php/webdav
vendor = ocis-einstein
owncloud_exclude_shares = true
user = einstein
pass = dcYsf3PNvBxaIi7MMq-bqg74KMWWWS8p3uFT-WD17SA
description = ocis-einstein
[nc-admin]
type = webdav
url = http://nc_url/remote.php/webdav
vendor = nc
owncloud_exclude_shares = true
user = admin
pass = IBSkhC1wCDdS2Gt9iBV-C9IqlGek
description = nc-admin
[nc-bob]
type = webdav
url = http://localhost:8080/remote.php/webdav
vendor = nc-bob
owncloud_exclude_shares = true
user = bob
pass = ufOK3zPDjR4meEwwy3cWUVA18Lf8TpubBRyPL5m9KC508PkMiEVAXTxg6olu
description = nc-bob
```
--------------------------------
### Start OpenCloud with Docker
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/maintenance/upgrade/upgrade-4.0.0.md
This command starts an OpenCloud instance using Docker, mapping host directories for configuration and data, and setting necessary environment variables. Ensure the host paths `$HOME/opencloud/opencloud-config` and `$HOME/opencloud/opencloud-data` exist.
```bash
docker run \
--name opencloud \
--rm \
-d \
-p 9200:9200 \
-v $HOME/opencloud/opencloud-config:/etc/opencloud \
-v $HOME/opencloud/opencloud-data:/var/lib/opencloud \
-e OC_INSECURE=true \
-e PROXY_HTTP_ADDR=0.0.0.0:9200 \
-e OC_URL=https://localhost:9200 \
opencloudeu/opencloud:4.0.x
```
--------------------------------
### Example Diff Output and Configuration Update
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/maintenance/upgrade/upgrade-4.0.0.md
This is an example output from `opencloud init --diff`, showing a configuration difference. It highlights the addition of `url_signing_secret` and indicates that a patch file has been generated.
```bash
opencloud init --diff
Do you want to configure OpenCloud with certificate checking disabled?
This is not recommended for public instances! [yes | no = default] yes
running in diff mode
diff -u /etc/opencloud/opencloud.yaml /etc/opencloud/opencloud.yaml.tmp
--- /etc/opencloud/opencloud.yaml
+++ /etc/opencloud/opencloud.yaml.tmp
@@ -3,6 +3,7 @@
machine_auth_api_key: k55Y7i3Djeeu4aPPNzM67Q39rf3ZHz^9
system_user_api_key: GeTXN@Mj7-4n8Yhuwboq8Gb1hF7Q%^
transfer_secret: ANy#T5.IvknED9-Ud39+YmlXzN^TdaKi
+url_signing_secret: zB#FtAYid24Z^DkuBoTllnId=igo!tCO
system_user_id: 8cc36d34-cd87-4434-b9e2-726e5553609c
admin_user_id: 34a73600-a02c-4064-8aec-341cd1865a71
graph:
diff written to /etc/opencloud/opencloud.config.patch
```
--------------------------------
### Example Unified Roles CLI Output
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/_static/env-vars/graph_readme.md
This is a shortened example of the output from the 'opencloud graph list-unified-roles' command, illustrating the structure of role information.
```bash
+--------------------------------------+----------+--------------------------------+--------------------------------+------------------------------------------+
| UID | ENABLED | DESCRIPTION | CONDITION | ALLOWED RESOURCE ACTIONS |
+--------------------------------------+----------+--------------------------------+--------------------------------+------------------------------------------+
| a8d5fe5e-96e3-418d-825b-534dbdf22b99 | enabled | View and download. | exists @Resource.Root | libre.graph/driveItem/path/read |
| | | | | libre.graph/driveItem/quota/read |
| | | | | libre.graph/driveItem/content/read |
| | | | | libre.graph/driveItem/permissions/read |
| | | | | libre.graph/driveItem/children/read |
| | | | | libre.graph/driveItem/deleted/read |
| | | | | libre.graph/driveItem/basic/read |
+--------------------------------------+----------+--------------------------------+--------------------------------+------------------------------------------+
```
--------------------------------
### Start OpenCloud with Docker Compose
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/other/raspberry-pi.md
Launch the OpenCloud services defined in the Docker Compose configuration. This command starts all necessary containers.
```bash
docker compose up
```
--------------------------------
### Local Development Setup
Source: https://context7.com/opencloud-eu/docs/llms.txt
Commands for setting up and running the local development environment for the documentation site.
```APIDOC
## Local Development Setup
### Description
Provides commands to install dependencies, start the development server, build, and serve the production site locally.
### Commands
- **Install Dependencies**
```bash
pnpm install
```
- **Start Development Server (English)**
```bash
pnpm start
```
- **Start Development Server (German)**
```bash
pnpm run start --locale de
```
- **Build Production Site**
```bash
pnpm build
```
- **Serve Production Build Locally (with redirects)**
```bash
pnpm run serve
```
- **Format and Lint Before Committing**
```bash
pnpm format:write
pnpm lint:md:fix
```
```
--------------------------------
### Example Output for Creating App Token
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/_static/env-vars/auth-app_readme.md
Example JSON response when creating an app token, showing the token, expiration date, creation date, and label.
```json
{
"token": "3s2K7816M4vuSpd5",
"expiration_date": "2024-08-08T13:42:42.796888022+02:00",
"created_date": "2024-08-07T13:42:42+02:00",
"label": "Generated via API"
}
```
--------------------------------
### Example Output for Listing App Tokens
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/_static/env-vars/auth-app_readme.md
Example JSON response when listing app tokens, showing the token UUID, expiration date, creation date, and label for each token.
```json
[
{
"token": "155f402e-1c5c-411c-92d4-92f3b612cd99"
"expiration_date": "2024-08-08T13:44:31.025199075+02:00",
"created_date": "2024-08-07T13:44:31+02:00",
"label": "Generated via Impersonation API"
},
{
"token": "8c606bdb-e22e-4094-9304-732fd4702bc9"
"expiration_date": "2024-08-08T13:46:41.936052281+02:00",
"created_date": "2024-08-07T13:46:42+02:00",
"label": "Generated via Impersonation API"
}
]
```
--------------------------------
### Quick Install OpenCloud
Source: https://context7.com/opencloud-eu/docs/llms.txt
Use this command to quickly deploy OpenCloud on a Linux server.
```bash
# Quick install OpenCloud
curl -L https://opencloud.eu/install | /bin/bash
```
--------------------------------
### Start OpenCloud with Decomposeds3
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/configuration/storage/decomposeds3.md
Start the OpenCloud containers using Docker Compose, including the Decomposeds3 storage configuration. This command ensures both the main OpenCloud services and the storage configuration are active.
```bash
docker compose -f docker-compose.yml -f storage/decomposeds3.yml up
```
--------------------------------
### Start OpenCloud Server with Docker Compose
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/web/development/tooling.md
Run this command to start the OpenCloud server in detached mode. For the full stack including wopi and Collabora, use `docker-compose up -d`.
```bash
docker-compose up opencloud -d
```
--------------------------------
### Start OpenCloud Service with Docker
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/container/docker.md
Start the OpenCloud service in detached mode. This command maps ports, mounts volumes for persistence, and sets necessary environment variables for an insecure local setup.
```bash
docker run \
--name opencloud \
--rm \
-d \
-p 9200:9200 \
-v $HOME/opencloud/opencloud-config:/etc/opencloud \
-v $HOME/opencloud/opencloud-data:/var/lib/opencloud \
-e OC_INSECURE=true \
-e PROXY_HTTP_ADDR=0.0.0.0:9200 \
-e OC_URL=https://localhost:9200 \
opencloudeu/opencloud-rolling:latest
```
--------------------------------
### Restart Collabora Docker Compose
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/configuration/collabora.md
Restart your Collabora docker-compose setup to apply the newly installed fonts.
```bash
docker compose restart
```
--------------------------------
### Start Documentation Site Preview
Source: https://github.com/opencloud-eu/docs/blob/main/assets/likec4/README.md
Run this command to preview the documentation site locally after making changes to the C4 models. This command also helps in previewing the generated diagrams.
```bash
pnpm start
```
--------------------------------
### Build and Serve Documentation Locally
Source: https://github.com/opencloud-eu/docs/blob/main/README.md
Builds the documentation first to enable redirects, then serves it locally. This is necessary for local development when redirects are present.
```bash
pnpm build
pnpm run serve
```
--------------------------------
### Registering Search Extension
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/web/extension-system/extension-types/search-extensions.md
Example of how to register a search extension within a Vue application. This involves using the defineWebApplication setup function and providing the extension.
```typescript
export default defineWebApplication({
setup() {
const { extension } = useSolrSearchExtension();
return {
appInfo: {
name: $gettext('Solr search app'),
id: 'solrs-search-app'
},
extensions: computed(() => [unref(extension)])
};
}
});
```
--------------------------------
### Example YAML Configuration
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/services/groups/example-config.mdx
This snippet displays a sample YAML file used for environment variables. Ensure the file path and content match your project's needs.
```yaml
groups:
- name: "developers"
members:
- "alice"
- "bob"
- name: "testers"
members:
- "charlie"
- "david"
```
--------------------------------
### Register Custom Page Extension in Web Application
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/web/extension-system/extension-types/left-sidebar-menu-item-extensions.md
Example of registering a custom page extension within a Vue web application setup. It defines application info, routes, and includes the computed extension.
```typescript
export default defineWebApplication({
setup() {
const { extension } = useCustomPageExtension();
return {
appInfo: {
name: $gettext('Custom page app'),
id: 'custom-page-app'
},
routes: {
path: '/files/custom-page',
name: 'files-custom-page',
component: CustomPageComponent,
meta: {
title: $gettext('Custom Page')
}
},
extensions: computed(() => [unref(extension)])
};
}
});
```
--------------------------------
### Registering Action Extension in Web Application
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/web/extension-system/extension-types/action-extensions.md
Example of how to register the custom download files action extension within a web application setup. It utilizes Vue's `defineWebApplication` and `computed` for dynamic extension management.
```typescript
export default defineWebApplication({
setup() {
const { extension } = useFileActionDownloadFiles();
return {
appInfo: {
name: $gettext('Download app'),
id: 'download-app'
},
extensions: computed(() => [unref(extension)])
};
}
});
```
--------------------------------
### Instance Configuration Example
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/_static/env-vars/webfinger_readme.md
Illustrates a complex configuration for determining different OpenCloud instances based on OpenID Connect UserInfo claims, using regular expressions and break flags.
```APIDOC
### Configuration Example (YAML)
```yaml
webfinger:
instances:
- claim: email
regex: alan@example\.org
href: "https://{{.preferred_username}}.cloud.opencloud.test"
title:
"en": "OpenCloud Instance for Alan"
"de": "OpenCloud Instanz für Alan"
break: true
- claim: "email"
regex: mary@example\.org
href: "https://{{.preferred_username}}.cloud.opencloud.test"
title:
"en": "OpenCloud Instance for Mary"
"de": "OpenCloud Instanz für Mary"
break: false
- claim: "email"
regex: .+@example\.org
href: "https://example-org.cloud.opencloud.test"
title:
"en": "OpenCloud Instance for example.org"
"de": "OpenCloud Instanz für example.org"
break: true
- claim: "email"
regex: .+@example\.com
href: "https://example-com.cloud.opencloud.test"
title:
"en": "OpenCloud Instance for example.com"
"de": "OpenCloud Instanz für example.com"
break: true
- claim: "email"
regex: .+@.+\..+
href: "https://cloud.opencloud.test"
title:
"en": "OpenCloud Instance"
"de": "OpenCloud Instanz"
break: true
```
### Response Example (for `acct:mary@example.org` logged in as Mary)
```json
{
"subject": "acct:mary@example.org",
"links": [
{
"rel": "http://openid.net/specs/connect/1.0/issuer",
"href": "https://sso.example.org/cas/oidc/"
},
{
"rel": "http://webfinger.opencloud/rel/server-instance",
"href": "https://mary.cloud.opencloud.test",
"titles": {
"en": "OpenCloud Instance for Mary",
"de": "OpenCloud Instanz für Mary"
}
},
{
"rel": "http://webfinger.opencloud/rel/server-instance",
"href": "https://xyz.drive.example.org",
"titles": {
"en": "OpenCloud Instance for example.org",
"de": "OpenCloud Instanz für example.org"
}
}
]
}
```
```
--------------------------------
### Register Custom Folder View Extension in Application
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/web/extension-system/extension-types/folder-view-extensions.md
Example demonstrating how to register the custom folder view extension within a web application. This involves defining the application's setup function and returning the extension in the extensions array.
```typescript
export default defineWebApplication({
setup() {
const { extension } = useCustomFolderViewExtension();
return {
appInfo: {
name: $gettext('Custom folder view app'),
id: 'custom-folder-view-app'
},
extensions: computed(() => [unref(extension)])
};
}
});
```
--------------------------------
### Install Microsoft Core Fonts
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/configuration/collabora.md
Installs common Microsoft fonts such as Arial. You will need to accept the EULA during installation.
```bash
apt install ttf-mscorefonts-installer
```
--------------------------------
### Install npm
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/other/bare-metal.md
Installs Node Package Manager (npm), which is used for managing JavaScript packages and dependencies.
```bash
sudo apt install npm -y
```
--------------------------------
### Get All Users
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/apis/http/graph/users.md
Use the GET /users endpoint to retrieve a list of all users in the system. Requires authentication.
```bash
curl -k 'https://localhost:9200/graph/v1.0/users' -u user:password
```
--------------------------------
### Install Corepack Globally
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/other/bare-metal.md
Installs Corepack, a tool for managing Node.js package manager versions, globally on your system.
```bash
sudo npm install -g corepack
```
--------------------------------
### Example YAML Policy Configuration
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/services/policies/example-config.mdx
This snippet displays a sample YAML configuration for policies. Ensure the file path and content match your requirements.
```yaml
apiVersion: "v1"
kind: "Policy"
metadata:
name: "example-policy"
spec:
description: "An example policy"
rules:
- name: "allow-all"
match:
any:
- "request.method == 'GET'"
action:
allow: true
```
--------------------------------
### Gherkin Feature Example
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/web/testing/e2e-testing-standards.md
Example of a well-written Gherkin feature with a descriptive title, user role, and clear intent.
```gherkin
Feature: Password Management for Registered Users
As a registered user
I want to set a new password
So that I can secure my account
```
--------------------------------
### Configured Instance Discovery Response
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/_static/env-vars/webfinger_readme.md
Example JSON response after applying complex configuration rules, showing multiple server instances based on user claims and regex matches.
```json
{
"subject": "acct:mary@example.org",
"links": [
{
"rel": "http://openid.net/specs/connect/1.0/issuer",
"href": "https://sso.example.org/cas/oidc/"
},
{
"rel": "http://webfinger.opencloud/rel/server-instance",
"href": "https://mary.cloud.opencloud.test",
"titles": {
"en": "OpenCloud Instance for Mary",
"de": "OpenCloud Instanz für Mary"
}
},
{
"rel": "http://webfinger.opencloud/rel/server-instance",
"href": "https://xyz.drive.example.org",
"titles": {
"en": "OpenCloud Instance for example.org",
"de": "OpenCloud Instanz für example.org"
}
}
]
}
```
--------------------------------
### Markdown Ordered List Example
Source: https://github.com/opencloud-eu/docs/blob/main/README.md
Example of a simple markdown ordered list. Avoid deep nesting of list items.
```markdown
1. First step
2. Second step
3. Third step
```
--------------------------------
### Frontend YAML Configuration
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/services/frontend/example-config.mdx
Example of a frontend YAML configuration file. Ensure the file path is correct and the content is valid YAML.
```yaml
API_URL=http://localhost:3000
NODE_ENV=development
FEATURE_FLAG_A=true
```
--------------------------------
### Set Up Local OpenCloud Directories
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/container/docker-compose/volume-permissions.md
Create necessary directories for OpenCloud configuration and data on the host system. Ensure ownership and permissions are set correctly for the container user (UID/GID 1000).
```bash
sudo mkdir -p /your/local/path/opencloud/{config,data}
sudo chown -R 1000:1000 /your/local/path/opencloud
sudo chmod -R 0700 /your/local/path/opencloud
```
--------------------------------
### Get Currently Signed-in User
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/apis/http/graph/users.md
Use the GET /me endpoint to retrieve the user object of the currently authenticated user. Requires authentication.
```bash
curl -k 'https://localhost:9200/graph/v1.0/me' -u user:password
```
--------------------------------
### Get All Users with MemberOf Expansion
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/apis/http/graph/users.md
Use the GET /users?$expand=memberOf endpoint to retrieve a list of all users along with their group memberships. Requires authentication.
```bash
curl -k 'https://localhost:9200/graph/v1.0/users?$expand=memberOf' -u user:password
```
--------------------------------
### Merged Application Configuration Example
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/_static/env-vars/web_readme.md
Illustrates the final merged configuration after applying manifest, global, and local configurations. Note that 'maxSize' is only present in the global config.
```json
{
"external_apps": [
{
"id": "image-viewer-obj",
"path": "index.js",
"config": {
"maxWidth": 320,
"maxHeight": 640,
"maxSize": 512
}
}
]
}
```
--------------------------------
### Initialize OpenCloud with Docker
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/container/docker.md
Run the OpenCloud Docker image for the first-time setup. This command initializes the configuration and data directories. You can set a custom admin password using the IDM_ADMIN_PASSWORD environment variable; otherwise, one will be auto-generated.
```bash
docker run --rm -it \
-v $HOME/opencloud/opencloud-config:/etc/opencloud \
-v $HOME/opencloud/opencloud-data:/var/lib/opencloud \
-e IDM_ADMIN_PASSWORD=admin \
opencloudeu/opencloud-rolling:latest init
```
--------------------------------
### Start OpenCloud with Updated Image (Docker Compose)
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/maintenance/upgrade/upgrade.md
Start OpenCloud in detached mode using Docker Compose, specifying the OpenCloud Docker image and tag.
```Shell
OC_DOCKER_IMAGE=opencloudeu/opencloud OC_DOCKER_TAG=tag docker compose up -d
```
--------------------------------
### Filtering Drives by Drive Type
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/apis/http/graph/index.md
Example of using an OData filter query parameter to restrict results. This specific example filters drives to only those with a 'project' driveType.
```shell
GET https://cloud.opencloud.test/graph/v1.0/drives?$filter=driveType eq 'project'
```
--------------------------------
### List directory contents with properties (WebDAV)
Source: https://context7.com/opencloud-eu/docs/llms.txt
Uses PROPFIND to list files and folders within a directory, including their metadata like permissions, size, and modification time. Requires authentication.
```bash
curl -k -X PROPFIND 'https://cloud.example.com/dav/spaces/storage-users-1%24user-id-here/' \
-H 'Depth: 1' \
-H 'Content-Type: application/xml' \
-u user:password \
-d '
'
```
--------------------------------
### Start Docs in German Locale
Source: https://github.com/opencloud-eu/docs/blob/main/README.md
Launches the local development server with the German language locale. Note that switching languages via the UI is not currently supported.
```bash
pnpm run start --locale de
```
--------------------------------
### Create Directories for Bind Mounts
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/getting-started/container/docker.md
Before running OpenCloud, create the necessary directories for configuration and data persistence using bind mounts.
```bash
mkdir -p $HOME/opencloud/opencloud-config
mkdir -p $HOME/opencloud/opencloud-data
```
--------------------------------
### Get Specific User by ID or Account Name
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/apis/http/graph/users.md
Use the GET /users/{userid or accountname} endpoint to retrieve a specific user's details. Requires authentication.
```bash
curl -k 'https://localhost:9200/graph/v1.0/users/058bff95-6708-4fe5-91e4-9ea3d377588b' -u user:password
```
--------------------------------
### List Resource Properties with HTTP
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/apis/http/webdav/index.md
This HTTP request demonstrates how to list resource properties using the PROPFIND method. It includes necessary headers like Host, Depth, and Content-Type.
```http
PROPFIND /dav/spaces/storage-users-1%24some-admin-user-id-0000-000000000000/ HTTP/1.1
Host: localhost:9200
Origin: https://localhost
Access-Control-Request-Method: PROPFIND
Depth: 1
Content-Type: application/xml
Authorization: Basic YWRtaW46YWRtaW4=
Content-Length: 436
```
--------------------------------
### Define Web Application Structure
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/web/extension-system/viewer-editor-apps.md
Sets up a web application with routes, menu items, and file extension handling. Ensure the `appId` is unique and `defaultExtension` matches your primary file type.
```typescript
import { AppWrapperRoute, defineWebApplication, AppMenuItemExtension } from '@opencloud-eu/web-pkg';
import translations from '../l10n/translations.json';
import { useGettext } from 'vue3-gettext';
import { computed } from 'vue';
// This is the base component of your app.
import App from './App.vue';
export default defineWebApplication({
setup() {
// The ID of your app.
const appId = 'advanced-pdf-viewer';
const { $gettext } = useGettext();
// This creates a route under which your app can be opened.
// Later, this route will be bound to one or more file extensions.
const routes = [
{
name: 'advanced-pdf-viewer',
path: '/:driveAliasAndItem(.*)?',
component: AppWrapperRoute(App, {
applicationId: appId
}),
meta: {
authContext: 'hybrid',
title: $gettext('Advanced PDF Viewer'),
patchCleanPath: true
}
}
];
// if you want your app to be present in the app menu on the top left.
const menuItems = computed(() => [
{
label: () => $gettext('Advanced PDF Viewer'),
type: 'appMenuItem',
handler: () => {
// do stuff...
}
}
]);
return {
appInfo: {
name: 'Advanced PDF Viewer',
id: appId,
defaultExtension: 'pdf',
extensions: [
// This makes sure all files with the "pdf" extension will be routed to your app when being opened.
// See the `ApplicationFileExtension` interface down below for a list of all possible properties.
{
extension: 'pdf',
routeName: 'advanced-pdf-viewer',
// Add this if you want your app to be present in the "New" file menu.
newFileMenu: {
menuTitle() {
return $gettext('PDF document');
}
}
}
]
},
routes,
translations,
extensions: menuItems
};
}
});
```
--------------------------------
### List All Spaces API Request
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/apis/http/graph/spaces.md
This GET request retrieves a list of all available spaces. Elevated permissions are required for this operation. If permissions are insufficient, the response mirrors that of `GET /me/drives`.
```shell
GET https://cloud.opencloud.test/graph/{version}/{me/}drives/?{query-parameters}
```
--------------------------------
### Example Custom Component Extension
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/web/extension-system/extension-types/custom-component-extensions.md
An example of a custom component extension that renders a NyanCat progress bar. It targets the 'app.runtime.global-progress-bar' extension point and includes user preference options.
```typescript
const extension = {
id: 'com.github.opencloud-eu.web.app.progress-bars.nyan-cat',
type: 'customComponent',
extensionPointIds: ['app.runtime.global-progress-bar'],
content: (slots) => [h(NyanCat, slots)],
userPreference: {
optionLabel: $gettext('Nyan Cat progress bar')
}
};
```
--------------------------------
### Create Directory with HTTP
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/dev/server/apis/http/webdav/index.md
This HTTP request demonstrates how to create a new directory using the MKCOL method. The Host and Authorization headers are required.
```http
MKCOL /dav/spaces/storage-users-1%24some-admin-user-id-0000-000000000000/NewFolder/ HTTP/1.1
Host: localhost:9200
Authorization: Basic YWRtaW46YWRtaW4=
```
--------------------------------
### Example LDAP Structure
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/admin/configuration/authentication-and-user-management/keycloak.md
Illustrates a typical LDAP directory structure for user and group management, including an optional writable subtree for custom groups.
```bash
dc=example,dc=org # Base DN
├── ou=users # User organizational unit
│ ├── uid=user1 # User entries
│ └── uid=user2
└── ou=groups # Group organizational unit
├── cn=admins # Group entries
├── cn=users
└── ou=custom (optional) # Optional custom groups tree, writable by OpenCloud
├── cn=teamA # Custom Group entries
└── cn=teamB
```
--------------------------------
### Build OpenCloud with libvips using go build
Source: https://github.com/opencloud-eu/docs/blob/main/versioned_docs/version-4.0/_static/env-vars/thumbnails_readme.md
Alternatively, enable libvips support by including the 'enable_vips' build tag in the go build command. This method also prepares the binary to use the libvips library.
```shell
go build -tags enable_vips -o opencloud -o bin/opencloud ./cmd/opencloud
```