-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add small sized toolbar toggle for embedded applications (#163)
* Add customization to switch to the small toolbar * Create a small toolbar style * Fix duplicate icons names * Remove faulty border radius * Brign back the background light for the small toolbar * Update documentation with more clear sturcuture * Add documentation on the compact modes * Switch NodePort to ClusterIP * Fix Raspberry Pi naming
- Loading branch information
Showing
22 changed files
with
455 additions
and
91 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
File renamed without changes.
File renamed without changes.
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,19 @@ | ||
# Compact mode | ||
|
||
The compact modus is very interesting if you want to run CIMonitor in an iframe for a dashboard or | ||
any other webpage. | ||
|
||
## Preview | ||
|
||
![](../img/compact-mode.gif) | ||
|
||
## Embedding | ||
|
||
```html | ||
<iframe src="YOUR CI MONITOR URL"> | ||
<p>Your browser does not support iframes.</p> | ||
</iframe> | ||
``` | ||
|
||
**Note:** If your CIMonitor is running on an insecure http page, a page with your iframe with https will not | ||
be able to display your CIMonitor. Make sure both are running on a secure https URL. |
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,7 +1,7 @@ | ||
# Module client | ||
# Linking CIMonitors together | ||
|
||
@todo: Explain that you can run a `back-end/module-client.js` application that connects to the `back-end/server.js` application socket | ||
|
||
![](img/master-slave-setup.png) | ||
![](../img/master-slave-setup.png) | ||
|
||
@todo: Explain that the slave can have its own configuration, with its own modules and triggers. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,77 @@ | ||
# Requirements | ||
|
||
Setting up CIMonitor is quick and easy. You need to have the following packages before we can get started: | ||
|
||
- [make](https://www.gnu.org/software/make/) (should already be present on linux and osx in developers mode) | ||
- [yarn](https://yarnpkg.com/): alternative to NPM | ||
- [node](https://nodejs.org/en/download/): version 10 or higher (recommended | ||
to install via [NVM](https://github.com/creationix/nvm#installation)) | ||
|
||
# Download and prepare | ||
|
||
Clone or download the latest CIMonitor via [github.com/cimonitor/cimonitor](https://github.com/cimonitor/cimonitor) | ||
(press the green button). | ||
|
||
## Configuration | ||
|
||
In the folder you just downloaded, you need to create the primary config file. Create the file | ||
`config/config.json` in the project directory. You could also copy the `config.example.json` file | ||
you find there. | ||
|
||
Make sure at least the following configuration is in your config file: | ||
|
||
```json | ||
{ | ||
"server": { | ||
"port": 9999 | ||
}, | ||
"triggers": [], | ||
"events": [], | ||
"modules": [] | ||
} | ||
``` | ||
|
||
For advanced configuration options, check out [the configuration page](configuration.md). | ||
To store the config in Google Firebase instead of a local JSON file, see [the Firebase page](../advanced/firebase.md). | ||
|
||
Open your terminal in the folder you just downloaded, and run the following command: | ||
|
||
```sh | ||
$ make build-production | ||
``` | ||
|
||
This will download the required dependencies, and build the project files. | ||
|
||
# Run the server application | ||
|
||
Now that you have everything prepared, you can start the server application with the following command: | ||
|
||
```sh | ||
$ node server/server.js | ||
``` | ||
|
||
You can now visit the dashboard via the browser at the given URL, or push statuses directly to the configured port. | ||
|
||
If you want to run the application as a service, check out the [run as a service page](../run/run-as-service.md). This way the | ||
monitor will keep running without having to keep a terminal open. | ||
|
||
# Updating server application | ||
|
||
Easiest update would be using git, where you can just pull the latest version from master. If you downloaded a zip | ||
file, make sure you copy the following files to the new files: | ||
|
||
- `config/config.json` | ||
- `config/saved-statuses.json` | ||
|
||
**Note:** After you pulled the updates, always run the production build again: | ||
|
||
```sh | ||
$ make build-production | ||
``` | ||
|
||
Restart your server application and that's it! | ||
|
||
|
||
# Keep it running | ||
|
||
@todo: Explain [pm2](http://pm2.keymetrics.io/). |
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,156 @@ | ||
# Run on Kubernetes | ||
|
||
## Run directly | ||
|
||
Note: If you want to customize the configuration, you are required to link Firebase. See the | ||
[firebase documentation](../advanced/firebase.md) on how to do that. | ||
|
||
Note that you shouldn't be running more than 1 replica. | ||
|
||
```yml | ||
kind: Namespace | ||
apiVersion: v1 | ||
metadata: | ||
name: cimonitor | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cimonitor-server | ||
namespace: cimonitor | ||
labels: | ||
app: cimonitor-server | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: cimonitor-server | ||
template: | ||
metadata: | ||
labels: | ||
app: cimonitor-server | ||
spec: | ||
containers: | ||
- image: cimonitor/server:latest | ||
name: cimonitor-server-container | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "16Mi" | ||
cpu: "10m" | ||
limits: | ||
memory: "256Mi" | ||
cpu: "500m" | ||
ports: | ||
- containerPort: 9999 | ||
env: | ||
- name: APP_ENV | ||
value: production | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: cimonitor-server-service | ||
namespace: cimonitor | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 80 | ||
targetPort: 9999 | ||
selector: | ||
app: cimonitor-server | ||
|
||
--- | ||
|
||
apiVersion: networking.k8s.io/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: cimonitor-server-ingress | ||
namespace: cimonitor | ||
annotations: | ||
kubernetes.io/tls-acme: "true" | ||
kubernetes.io/ingress.class: "nginx" | ||
cert-manager.io/cluster-issuer: "letsencrypt-prod" | ||
cert-manager.io/acme-challenge-type: http01 | ||
spec: | ||
tls: | ||
- secretName: cimonitor-server-tls | ||
hosts: | ||
- YOUR_HOST_ADDRESS | ||
rules: | ||
- host: YOUR_HOST_ADDRESS | ||
http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: cimonitor-server-service | ||
servicePort: 80 | ||
``` | ||
## With firebase config | ||
Create a firebase secret, containing your firebase service account private key json: | ||
``` | ||
export FIREBASE_PRIVATE_KEY=$(cat/YOUR-FIREBASE-ACCOUNT-PRIVATE-KEY-FILE.json) | ||
|
||
kubectl create secret generic firebase-private-key \ | ||
--namespace cimonitor \ | ||
--from-file=firebase-private-key.json=$FIREBASE_PRIVATE_KEY | ||
``` | ||
|
||
Use the top example, except replace the deployment: | ||
|
||
```yml | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cimonitor-server | ||
namespace: cimonitor | ||
labels: | ||
app: cimonitor-server | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: cimonitor-server | ||
template: | ||
metadata: | ||
labels: | ||
app: cimonitor-server | ||
spec: | ||
volumes: | ||
- name: firebase-private-key | ||
secret: | ||
secretName: firebase-private-key | ||
containers: | ||
- image: cimonitor/server:latest | ||
name: cimonitor-server-container | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "16Mi" | ||
cpu: "10m" | ||
limits: | ||
memory: "256Mi" | ||
cpu: "500m" | ||
ports: | ||
- containerPort: 9999 | ||
env: | ||
- name: FIREBASE_PRIVATE_KEY_FILE | ||
value: "/etc/firebase-secrets/firebase-private-key.json" | ||
- name: FIREBASE_URL | ||
value: "https://YOUR_UNIQUE_FIREBASE_SLUG.firebaseio.com/" | ||
- name: STORAGE | ||
value: "firebase" | ||
- name: APP_ENV | ||
value: production | ||
volumeMounts: | ||
- name: firebase-private-key | ||
readOnly: true | ||
mountPath: "/etc/firebase-secrets" | ||
``` |
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 |
---|---|---|
@@ -1,72 +1,23 @@ | ||
# Requirements | ||
# Setup CIMonitor | ||
|
||
Setting up CIMonitor is quick and easy. You need to have the following packages before we can get started: | ||
There are multiple ways you can run CIMonitor. The quickest and easiest is running it via docker. | ||
|
||
- [make](https://www.gnu.org/software/make/) (should already be present on linux and osx in developers mode) | ||
- [yarn](https://yarnpkg.com/): alternative to npm | ||
- [node](https://nodejs.org/en/download/): version 8 or higher (recommended | ||
to install via [NVM](https://github.com/creationix/nvm#installation)) | ||
## Run on Docker (quickest) | ||
|
||
# Download and prepare | ||
You can very easily run CIMonitor if you have docker installed. See how to do that at | ||
[running CIMonitor on docker](../run/on-docker.md). | ||
|
||
Clone or download the latest CIMonitor via [github.com/cimonitor/cimonitor](https://github.com/cimonitor/cimonitor) | ||
(press the green button). | ||
## Run on a Raspberry Pi (recommended when using modules) | ||
|
||
## Configuration | ||
If you want to use some of the awesome modules that are build for CIMonitor, then | ||
[running CIMonitor on a Raspberry Pi](../run/on-raspberry.md) is most suited for you. | ||
|
||
In the folder you just downloaded, you need to create the primary config file. Create the file | ||
`config/config.json` in the project directory. You could also copy the `config.example.json` file | ||
you find there. | ||
## Run as a service (build it yourself) | ||
|
||
Make sure at least the following configuration is in your config file: | ||
If you want to run the projects from its source code, take a look at | ||
[running CIMonitor as a service](../run/as-service.md). | ||
|
||
```json | ||
{ | ||
"server": { | ||
"port": 9999 | ||
}, | ||
"triggers": [], | ||
"events": [], | ||
"modules": [] | ||
} | ||
``` | ||
## Run on Kubernetes | ||
|
||
For advanced configuration options, check out [the configuration page](configuration.md). | ||
To store the config in Google Firebase instead of a local JSON file, see [the Firebase page](Firebase.md). | ||
|
||
Open your terminal in the folder you just downloaded, and run the following command: | ||
|
||
```sh | ||
$ make build-production | ||
``` | ||
|
||
This will download the required dependencies, and build the project files. | ||
|
||
# Run the server application | ||
|
||
Now that you have everything prepared, you can start the server application with the following command: | ||
|
||
```sh | ||
$ node server/server.js | ||
``` | ||
|
||
You can now visit the dashboard via the browser at the given URL, or push statuses directly to the configured port. | ||
|
||
If you want to run the application as a service, check out the [run as a service page](run-as-service.md). This way the | ||
monitor will keep running without having to keep a terminal open. | ||
|
||
# Updating server application | ||
|
||
Easiest update would be using git, where you can just pull the latest version from master. If you downloaded a zip | ||
file, make sure you copy the following files to the new files: | ||
|
||
- `config/config.json` | ||
- `config/saved-statuses.json` | ||
|
||
**Note:** After you pulled the updates, always run the production build again: | ||
|
||
```sh | ||
$ make build-production | ||
``` | ||
|
||
Restart your server application and that's it! | ||
If you want to run CIMonitor in your Kubernetes cluster, see how to do that at | ||
[running CIMonitor on Kubernetes](../run/on-kubernetes.md). |
Oops, something went wrong.