Commit cc6a8d19 authored by Andreas Düren's avatar Andreas Düren
Browse files

Update CloudronManifest.json and documentation files

parent 3743e382
Loading
Loading
Loading
Loading
+1 −1
Changes for CloudronManifest.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
  ],
  "minBoxVersion": "7.0.0",
  "memoryLimit": 4294967296,
  "postInstallMessage": "Elasticsearch is now installed and available for internal use only. You can access it using http://localhost:9200 from within other Cloudron apps.\n\nUsername: elastic\nPassword: A secure random password has been generated and stored in /app/data/credentials.txt. You can check it in the app logs or by accessing the app container.",
  "postInstallMessage": "Elasticsearch is now installed and available for internal use only.\n\nConnection Information:\n- REST API: ```http://localhost:9200``` (from within other Cloudron apps)\n- Transport Protocol: port ```9300``` (for Elasticsearch clients)\n\nAuthentication:\n- Username: ```elastic```\n- Password: A secure random password has been generated and stored in ``/app/data/credentials.txt```.\n\nThe password can be retrieved from:\n1. The app logs\n2. By accessing the app container\n3. The file at /app/data/credentials.txt\n\nNote: SSL is disabled for HTTP connections for compatibility with most client applications.",
  "multiDomain": false,
  "tcpPorts": {
    "9300": {
+135 −2
Changes for INSTALL.md: 135 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -30,8 +30,8 @@ This guide explains how to install the Elasticsearch package on your Cloudron in
After installation:

1. Check the app logs to ensure Elasticsearch has started correctly
2. Update the default password in the app's environment settings
3. Configure your other Cloudron apps to connect to Elasticsearch using `localhost:9200`
2. Note the generated password from the logs or from `/app/data/credentials.txt`
3. Configure your other Cloudron apps to connect to Elasticsearch using the format: `http://elastic:<password>@localhost:9200`

## Troubleshooting

@@ -42,3 +42,136 @@ After installation:
## Support

For support, please create an issue on the package's GitHub repository or contact the package maintainer. 

## Integration with Nextcloud

If you want to use this Elasticsearch package with Nextcloud's Full-Text Search functionality, follow these steps:

### Prerequisites

1. Ensure you have the following Nextcloud apps installed:
   - Full-Text Search
   - Full-Text Search - Elasticsearch Platform
   - Any content provider app (e.g., Full-Text Search - Files)

### Configuration Steps

#### 1. Find Your Elasticsearch Password

Check the Elasticsearch app logs to find the generated password:

```bash
# From the Cloudron dashboard, view the Elasticsearch app logs
# Look for lines containing "Password: " after Elasticsearch has started
# Or check the file at /app/data/credentials.txt within the container
```

#### 2. Create Elasticsearch Index (Optional)

You can manually create an Elasticsearch index using curl:

```bash
# Connect using localhost (from within another Cloudron app)
curl -X PUT "http://elastic:<your-password>@localhost:9200/nextcloud"
```

This creates an index named "nextcloud" that will be used for Nextcloud integration.

For general purposes, you can create other indices as needed:

```bash
# Create a general-purpose index named "cloud"
curl -X PUT "http://elastic:<your-password>@localhost:9200/cloud"
```

You can verify the indices were created successfully with:

```bash
curl "http://elastic:<your-password>@localhost:9200/_cat/indices"
```

Alternatively, you can let Nextcloud create and configure the index automatically using the OCC command:

```bash
cd /app/code
php occ fulltextsearch_elasticsearch:configure '{"elastic_host":"http://elastic:<your-password>@localhost:9200","elastic_index":"nextcloud"}'
```

#### 3. Configure Nextcloud

Access the Nextcloud CLI:

```bash
# From the Cloudron dashboard, click on your Nextcloud app
# Navigate to "Settings" → "Terminal" to access the CLI
# Or use the Cloudron CLI command: cloudron exec --app your-nextcloud-app
```

Run the following commands in the Nextcloud CLI:

```bash
# Using the OCC command (preferred method)
cd /app/code
php occ config:app:set fulltextsearch_elasticsearch allow_self_signed_cert --value=false
php occ config:app:set fulltextsearch_elasticsearch elastic_ssl --value=false
```

#### 4. Configure the Elasticsearch Connection

Still in the Nextcloud CLI, configure the Elasticsearch connection:

```bash
php occ fulltextsearch_elasticsearch:configure '{"elastic_host":"http://elastic:<your-password>@localhost:9200","elastic_index":"nextcloud"}'
```

Replace `<your-password>` with the password you found in step 1.

#### 5. Initialize the Index

Create and initialize the Elasticsearch index:

```bash
php occ fulltextsearch:index
```

For a full reindex of all content, use:

```bash
php occ fulltextsearch:index -f
```

#### 6. Test the Configuration

Verify that the connection works:

```bash
php occ fulltextsearch:test
```

### Authentication Details

Use the following credentials for Elasticsearch:
- Username: `elastic`
- Password: The generated password from `/app/data/credentials.txt`

### Troubleshooting

If you encounter connection errors:
- Ensure you're using port 9200 (not 9300)
- Use HTTP instead of HTTPS in the connection URL
- In Cloudron, use `localhost` instead of IP addresses for app-to-app communication
- Check that the Elasticsearch app is running

#### Testing Connectivity

You can test connectivity to Elasticsearch from another Cloudron app with:

```bash
curl -v http://elastic:<your-password>@localhost:9200
```

If successful, you should see a JSON response with Elasticsearch information.

#### Advanced Configuration

In some cases, you might need to modify additional Elasticsearch settings. You can do this via the elasticsearch.yml file, which is stored in `/app/data/config/elasticsearch.yml` within the Elasticsearch app container.
 No newline at end of file
+29 −14
Changes for README.md: 29 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -4,10 +4,11 @@ This package provides Elasticsearch for Cloudron, configured for internal use on

## Features

- Elasticsearch 8.17.3 (configurable)
- Elasticsearch 8.17.3
- Single-node configuration optimized for Cloudron
- Security enabled with basic authentication
- Internal access only
- Automatic optimization based on container resources

## Usage

@@ -18,39 +19,53 @@ After installation, Elasticsearch will be available at the following URLs:

### Authentication

Default credentials:
Authentication credentials:
- Username: `elastic`
- Password: `cloudron`
- Password: A secure random password is generated during installation

It's recommended to change the default password after installation by updating the `.env` file and restarting the app.
You can find the password in:
1. The app logs after installation
2. By accessing the app container
3. The file at `/app/data/credentials.txt`

### Connection from other Cloudron apps

To connect to Elasticsearch from another Cloudron app, you can use the following connection details:
To connect to Elasticsearch from another Cloudron app, use the following connection details:

```
Host: localhost
Port: 9200
Protocol: http
Username: elastic
Password: <your password from .env>
Password: <password from credentials.txt>
```

## Configuration
Example connection using cURL:

You can modify the configuration by editing the `.env` file in the app's data directory and restarting the app.
```bash
curl -u elastic:<password> http://localhost:9200
```

## Security Notes

- HTTP SSL is disabled for compatibility with most client applications
- Transport protocol is secured with internal certificates
- Authentication is required for all operations
- All data is stored in the app's data directory

## Performance Configuration

Available configuration options:
The package automatically configures Elasticsearch based on the container's available resources:

- `ELASTIC_PASSWORD`: Password for the 'elastic' user
- `STACK_VERSION`: Version of Elasticsearch to use
- `CLUSTER_NAME`: Name of the Elasticsearch cluster
- `LICENSE`: License type ('basic' or 'trial')
- Java heap size is set to 50% of available memory
- GC optimization for container environments
- Index settings tuned for single-node operation

## Limitations

- This package is for internal use only and is not exposed to the web
- It's configured as a single-node cluster for simplicity
- Memory is limited to 1GB (configurable in CloudronManifest.json)
- Memory usage scales with container limits set in Cloudron

## Support

−303

File deleted.

+1 −1
Changes for package.sh: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ mkdir -p build
rm -rf build/*

# Copy all files to the build directory
cp -r CloudronManifest.json Dockerfile .env start.sh stop.sh README.md logo.svg build/
cp -r CloudronManifest.json Dockerfile .env start.sh stop.sh README.md logo.png build/

# Create the package
cd build