-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various improvements to the docs (#113)
* Various improvements to the docs -- Improve the docs index -- Fix s3-configuration tutorial -- Add integrations reference -- Minor fixes
- Loading branch information
1 parent
a243cc4
commit 111a6fb
Showing
15 changed files
with
260 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
docs/Tutorial/container-configuration.md → docs/how-to/configure-container.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Container configuration | ||
# How to configure the container | ||
|
||
This charm exposes several configurations to tweak the behaviour of discourse. These can by changes by running `juju config [charm_name] [configuration]=[value]`. Below you can find some of the options that will allow you to modify the charm's behaviour: | ||
|
||
* CORS policies can be modified with the settings [cors_origin](https://charmhub.io/discourse-k8s/configure#cors_origin) and [enable_cors](https://charmhub.io/discourse-k8s/configure#enable_cors) | ||
* The developer mails can be set through [developer_emails](https://charmhub.io/discourse-k8s/configure#developer_emails) | ||
* Throttle level protections provided by discourse can be changed via [throttle_level](https://charmhub.io/discourse-k8s/configure#throttle_level) | ||
|
||
For a comprehensive list of configuration options check the [configuration reference](https://charmhub.io/discourse-k8s/configure). | ||
For a comprehensive list of configuration options check the [configuration reference](https://charmhub.io/discourse-k8s/configure). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# How to configure the hostname | ||
|
||
### Prerequisites | ||
|
||
Deploy and relate [nginx-ingress-integrator](https://charmhub.io/nginx-ingress-integrator) charm. | ||
|
||
``` | ||
juju deploy nginx-ingress-integrator | ||
juju trust nginx-ingress-integrator --scope cluster # if RBAC is enabled | ||
juju relate discourse-k8s nginx-ingress-integrator | ||
``` | ||
|
||
### Configure hostname | ||
|
||
This charm exposes the `external_hostname` configuration option to specify the external hostname of the application. | ||
|
||
To configure a different hostname for Discourse, you can configure the ingress hostname through the | ||
discourse-k8s configuration. | ||
|
||
``` | ||
juju config discourse-k8s external_hostname=<desired-hostname> | ||
``` | ||
|
||
The output of `juju status` should look similar to the following: | ||
|
||
``` | ||
Model Controller Cloud/Region Version SLA Timestamp | ||
tutorial mk8s microk8s/localhost 2.9.44 unsupported 18:19:34-04:00 | ||
App Version Status Scale Charm Channel Rev Address Exposed Message | ||
discourse-k8s 2.8.14 active 1 discourse-k8s 41 <discourse-ip> no | ||
nginx-ingress-integrator 25.3.0 active 1 nginx-ingress-integrator latest/stable 81 <ingress-ip> no Ingress IP(s): 127.0.0.1, Service IP(s): <ingress-svc-ip> | ||
postgresql-k8s 14.9 active 1 postgresql-k8s 14/edge 145 <postgres-ip> no Primary | ||
redis-k8s 7.0.4 active 1 redis-k8s latest/edge 26 <redis-ip> no | ||
Unit Workload Agent Address Ports Message | ||
discourse-k8s/0* active idle <discourse-ip> | ||
nginx-ingress-integrator/0* active idle <ingress-ip> Ingress IP(s): 127.0.0.1, Service IP(s): <ingress-svc-ip> | ||
postgresql-k8s/0* active idle <postgres-ip> Primary | ||
redis-k8s/0* active idle <redis-ip> | ||
``` | ||
|
||
Note the Service IP(s): next to nginx-ingress-integrator charm’s Status output. | ||
|
||
Test the ingress by sending a GET request to the service with `Host` headers. | ||
|
||
``` | ||
curl -H "Host: <desired-hostname>" http://<ingress-svc-ip> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
docs/Tutorial/saml-configuration.md → docs/how-to/configure-saml.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# SAML configuration | ||
# How to configure SAML | ||
|
||
To configure Discourse's SAML integration you'll have to set the following configuration options with the appropriate values for your SAML server by running `juju config [charm_name] [configuration]=[value]`. | ||
|
||
The SAML URL needs to be scpecified in `saml_target_url`. If you wish to force the login to go through SAML, enable `force_saml_login`. | ||
The groups to be synced from the provider can be defined in `saml_sync_groups` as a comma-separated list of values. | ||
|
||
For more details on the configuration options and their default values see the [configuration reference](https://charmhub.io/discourse-k8s/configure). | ||
For more details on the configuration options and their default values see the [configuration reference](https://charmhub.io/discourse-k8s/configure). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# How to contribute | ||
|
||
## Overview | ||
|
||
This document explains the processes and practices recommended for contributing | ||
enhancements to the Discourse operator. | ||
|
||
- Generally, before developing enhancements to this charm, you should consider | ||
[opening an issue](https://github.com/canonical/discourse-k8s-operator/issues) | ||
explaining your use case. | ||
- If you would like to chat with us about your use-cases or proposed | ||
implementation, you can reach us at [Canonical Mattermost public channel](https://chat.charmhub.io/charmhub/channels/charm-dev) | ||
or [Discourse](https://discourse.charmhub.io/). | ||
- Familiarising yourself with the [Charmed Operator Framework](https://juju.is/docs/sdk) | ||
library will help you a lot when working on new features or bug fixes. | ||
- All enhancements require review before being merged. Code review typically | ||
examines | ||
- code quality | ||
- test coverage | ||
- user experience for Juju operators of this charm. | ||
- Please help us out in ensuring easy to review branches by rebasing your pull | ||
request branch onto the `main` branch. This also avoids merge commits and | ||
creates a linear Git commit history. | ||
- Please generate src documentation for every commit. See the section below for | ||
more details. | ||
|
||
## Developing | ||
|
||
The code for this charm can be downloaded as follows: | ||
|
||
``` | ||
git clone https://github.com/canonical/discourse-k8s-operator | ||
``` | ||
|
||
You can use the environments created by `tox` for development: | ||
|
||
```shell | ||
tox --notest -e unit | ||
source .tox/unit/bin/activate | ||
``` | ||
|
||
### Testing | ||
|
||
Note that the [Discourse](discourse_rock/rockcraft.yaml) image need to be built and | ||
pushed to microk8s for the tests to run. It should | ||
be tagged as `localhost:32000/discourse:latest` so that Kubernetes knows how to pull them | ||
from the MicroK8s repository. Note that the MicroK8s registry needs to be | ||
enabled using `microk8s enable registry`. More details regarding the OCI image | ||
below. The following commands can then be used to run the tests: | ||
|
||
* `tox`: Runs all of the basic checks (`lint`, `unit`, `static`, and `coverage-report`). | ||
* `tox -e fmt`: Runs formatting using `black` and `isort`. | ||
* `tox -e lint`: Runs a range of static code analysis to check the code. | ||
* `tox -e static`: Runs other checks such as `bandit` for security issues. | ||
* `tox -e unit`: Runs the unit tests. | ||
* `tox -e integration`: Runs the integration tests. | ||
|
||
### Generating src docs for every commit | ||
|
||
Run the following command: | ||
|
||
```bash | ||
echo -e "tox -e src-docs\ngit add src-docs\n" >> .git/hooks/pre-commit | ||
chmod +x .git/hooks/pre-commit | ||
``` | ||
|
||
## Build charm | ||
|
||
Build the charm in this git repository using: | ||
|
||
```shell | ||
charmcraft pack | ||
``` | ||
For the integration tests (and also to deploy the charm locally), the discourse | ||
image is required in the microk8s registry. To enable it: | ||
|
||
```shell | ||
microk8s enable registry | ||
``` | ||
|
||
The following commands import the images in the Docker daemon and push them into | ||
the registry: | ||
|
||
```shell | ||
cd [project_dir]/discourse_rock && rockcraft pack rockcraft.yaml | ||
skopeo --insecure-policy copy oci-archive:discourse_1.0_amd64.rock docker-daemon:localhost:32000/discourse:latest | ||
docker push localhost:32000/discourse:latest | ||
``` | ||
|
||
### Deploy | ||
|
||
```bash | ||
# Create a model | ||
juju add-model discourse-dev | ||
# Enable DEBUG logging | ||
juju model-config logging-config="<root>=INFO;unit=DEBUG" | ||
# Deploy the charm (assuming you're on amd64) | ||
juju deploy ./discourse-k8s_ubuntu-20.04-amd64.charm \ | ||
--resource discourse-image=localhost:32000/discourse:latest \ | ||
``` | ||
|
||
## Canonical Contributor Agreement | ||
|
||
Canonical welcomes contributions to the Discourse Operator. Please check out our [contributor agreement](https://ubuntu.com/legal/contributors) if you're interested in contributing to the solution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.