Skip to content

Commit

Permalink
chore: rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
knrdl committed Oct 23, 2022
1 parent 6ccbae1 commit 7e96727
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# CASA
# CaaSa

## Container as a Service Admin
## Container as a Service admin

| [Demo](https://knrdl.github.io/casa/) | [Docker Hub](https://hub.docker.com/r/knrdl/casa) [![Docker Hub](https://img.shields.io/docker/pulls/knrdl/casa.svg?logo=docker&style=popout-square)](https://hub.docker.com/r/knrdl/casa) | [![CI](https://github.com/knrdl/casa/actions/workflows/docker-image.yml/badge.svg)](https://github.com/knrdl/casa/actions/workflows/docker-image.yml)
| ----------- | ----------- | ----------- |
| [Demo](https://knrdl.github.io/caasa/) | [Docker Hub](https://hub.docker.com/r/knrdl/caasa) [![Docker Hub](https://img.shields.io/docker/pulls/knrdl/caasa.svg?logo=docker&style=popout-square)](https://hub.docker.com/r/knrdl/caasa) | [![CI](https://github.com/knrdl/caasa/actions/workflows/docker-image.yml/badge.svg)](https://github.com/knrdl/caasa/actions/workflows/docker-image.yml)
|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ----------- |

Outsource the administration of a handful of containers to your co-workers.

CASA provides a simple web-interface to handle basic container admin tasks:
CaaSa provides a simple web-interface to handle basic container admin tasks:

* View resource consumption/runtime behaviour
* Restart, Stop containers
Expand All @@ -19,17 +19,17 @@ Restrict permissions per container and user

## Getting started

### 1. Deploy CASA
### 1. Deploy CaaSa

```yaml
version: '2.4'
services:
casa:
image: knrdl/casa
caasa:
image: knrdl/caasa
restart: always
environment:
ROLES_casa_admin_basic: info, state, logs, procs, files, files-read
ROLES_casa_admin_full: info, info-annotations, state, logs, term, procs, files, files-read, files-write
ROLES_caasa_admin_basic: info, state, logs, procs, files, files-read
ROLES_caasa_admin_full: info, info-annotations, state, logs, term, procs, files, files-read, files-write
AUTH_API_URL: https://identity.mycompany.com/login
AUTH_API_FIELD_USERNAME: username
AUTH_API_FIELD_PASSWORD: password
Expand All @@ -41,7 +41,7 @@ services:
cpu_count: 1
```
> :warning: **For production** is a reverse-proxy with TLS termination in front of CASA highly recommended
> :warning: **For production** is a reverse-proxy with TLS termination in front of CaaSa highly recommended
Roles are defined via environment variables and might contain these permissions:
Expand All @@ -59,7 +59,7 @@ Roles are defined via environment variables and might contain these permissions:
#### 2.1 Restful authentication
To perform logins CASA sends http-post requests to the URL defined in the environment variable `AUTH_API_URL`. The requests contain a json body with username and password. The json field names are defined via environment variables `AUTH_API_FIELD_USERNAME` (default: *username*) and `AUTH_API_FIELD_PASSWORD` (default: *password*). A 2XX response code (e.g. *200 OK*) represents a successful login.
To perform logins CaaSa sends http-post requests to the URL defined in the environment variable `AUTH_API_URL`. The requests contain a json body with username and password. The json field names are defined via environment variables `AUTH_API_FIELD_USERNAME` (default: *username*) and `AUTH_API_FIELD_PASSWORD` (default: *password*). A 2XX response code (e.g. *200 OK*) represents a successful login.

#### 2.2 Dummy authentication

Expand All @@ -69,19 +69,19 @@ Set the environment variable `AUTH_API_URL=https://example.org`. Now you can log

#### 2.3 WebProxy authentication

CASA can read the username from a http request header. This header must be supplied by a reverse proxy in front of CASA. It can be specified via the environment variable `WEBPROXY_AUTH_HEADER`. A typical header name is *Remote-User*.
CaaSa can read the username from a http request header. This header must be supplied by a reverse proxy in front of CaaSa. It can be specified via the environment variable `WEBPROXY_AUTH_HEADER`. A typical header name is *Remote-User*.

> :warning: The header must be supplied by the reverse proxy and must not be set by the client.

### 3. Annotate containers

If a container should be visible in CASA, it must be annotated with a label defined above as `ROLES_<labelname>` and list all permitted usernames (or user IDs). Usernames are treated as case-insensitive.
If a container should be visible in CaaSa, it must be annotated with a label defined above as `ROLES_<labelname>` and list all permitted usernames (or user IDs). Usernames are treated as case-insensitive.

```bash
docker run -it --rm --name casa_demo --label casa.admin.full=user1,user2 nginx:alpine
docker run -it --rm --name caasa_demo --label caasa.admin.full=user1,user2 nginx:alpine
```

In this example the users `user1` and `user2` are granted the rights of the `casa.admin.full` role for the container `casa_demo` via CASA web interface.
In this example the users `user1` and `user2` are granted the rights of the `caasa.admin.full` role for the container `caasa_demo` via CaaSa web interface.

## Screenshot

Expand Down
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "casa",
"name": "caasa",
"version": "1.0.0",
"private": true,
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>

<title>Casa</title>
<title>CaaSa</title>

<link rel='icon' type='image/svg+xml' href='favicon.svg'>
<link rel='stylesheet' href='global.css'>
<link rel='stylesheet' href='build/bundle.css'>

<meta name="description" content="Container as a Service Admin">
<meta name="description" content="Container as a Service admin">
<meta name="theme-color" content="#2A1443" />

<script defer src='build/bundle.js'></script>
Expand All @@ -20,4 +20,4 @@
<body>
</body>

</html>
</html>
6 changes: 3 additions & 3 deletions client/src/api.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ function mockResponse(body) {
return `{"response": "get_system_info", "payload": {"version": "20.10.7", "containers": {"total": 178, "running": 170, "stopped": 0}, "os": "Ubuntu 20.04.3 LTS", "cpus": 24, "mem": 31277850624}}`
case 'get_container_list':
return `{"response": "get_container_list", "payload": [
{"id": "2b7eb6b9d2f7fd2dd26738500a81a16310f78e46eea2f9c2a27ed876d85d8586", "name": "Casa Demo", "namespace": null, "status": "running", "permissions": ["info", "info-annotations", "procs", "files-read", "files-write", "files", "logs", "state", "term"]},
{"id": "2b7eb6b9d2f7fd2dd26738500a81a16310f78e46eea2f9c2a27ed876d85d8586", "name": "CaaSa Demo", "namespace": null, "status": "running", "permissions": ["info", "info-annotations", "procs", "files-read", "files-write", "files", "logs", "state", "term"]},
{"id": "2b7eb6b9d2f7fd2dd26738500a81a16310f78e46eea2f9c2a27ed876d85d8587", "name": "Backend", "namespace": "Cool Web App", "status": "running", "permissions": ["info", "info-annotations", "procs", "files-read", "files-write", "files", "logs", "state", "term"]},
{"id": "2b7eb6b9d2f7fd2dd26738500a81a16310f78e46eea2f9c2a27ed876d85d8588", "name": "Gateway", "namespace": "Cool Web App", "status": "running", "permissions": ["info", "info-annotations", "procs", "files-read", "files-write", "files", "logs", "state", "term"]}
]}`
case 'get_processes':
return `{"response": "get_processes", "payload": [{"pid": "45756", "ppid": "45733", "%cpu": "0.0", "%mem": "0.0", "user": "root", "stime": "16:24", "command": "nginx: master process nginx -g daemon off;", "level": 0}, {"pid": "45822", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45823", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45824", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45825", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45826", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45827", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45828", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45829", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45830", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45831", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45832", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "45833", "ppid": "45756", "%cpu": "0.0", "%mem": "0.0", "user": "systemd+", "stime": "16:24", "command": "nginx: worker process", "level": 1}, {"pid": "46825", "ppid": "45733", "%cpu": "0.0", "%mem": "0.0", "user": "root", "stime": "16:34", "command": "sh", "level": 0}]}`
case 'get_container_info':
const container_name = {
'2b7eb6b9d2f7fd2dd26738500a81a16310f78e46eea2f9c2a27ed876d85d8586': '/casa_demo',
'2b7eb6b9d2f7fd2dd26738500a81a16310f78e46eea2f9c2a27ed876d85d8586': '/caasa_demo',
'2b7eb6b9d2f7fd2dd26738500a81a16310f78e46eea2f9c2a27ed876d85d8587': '/cool_web_app_backend_1',
'2b7eb6b9d2f7fd2dd26738500a81a16310f78e46eea2f9c2a27ed876d85d8588': '/cool_web_app_gateway_1',
}
return `{"response": "get_container_info", "payload": {"id": "${body.payload.container_id}", "name": "${container_name[body.payload.container_id]}", "status": "running", "command": "/docker-entrypoint.sh nginx -g daemon off;", "created_at": "2021-12-02T10:33:16.628618832Z", "started_at": "2021-12-02T10:33:17.015866729Z", "finished_at": "0001-01-01T00:00:00Z", "crashes": 0, "env": {"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "NGINX_VERSION": "1.21.1", "NJS_VERSION": "0.6.1", "PKG_RELEASE": "1"}, "labels": {"casa.admin.full": "user1,user2", "maintainer": "NGINX Docker Maintainers <docker-maint@nginx.com>"}, "image": {"name": "nginx:alpine", "hash": "sha256:b9e2356ea1be9452f3777a587b0b6a30bc16c295fe6190eda6a0776522f27439"}, "mem": {"used": 10452992, "max_used": 19345408, "total": 52428800}, "cpu": {"perc": ${Math.random() * 10}}, "net": {"rx_bytes": 18201, "tx_bytes": 0}, "ports": ["80/tcp"]}}`
return `{"response": "get_container_info", "payload": {"id": "${body.payload.container_id}", "name": "${container_name[body.payload.container_id]}", "status": "running", "command": "/docker-entrypoint.sh nginx -g daemon off;", "created_at": "2021-12-02T10:33:16.628618832Z", "started_at": "2021-12-02T10:33:17.015866729Z", "finished_at": "0001-01-01T00:00:00Z", "crashes": 0, "env": {"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "NGINX_VERSION": "1.21.1", "NJS_VERSION": "0.6.1", "PKG_RELEASE": "1"}, "labels": {"caasa.admin.full": "user1,user2", "maintainer": "NGINX Docker Maintainers <docker-maint@nginx.com>"}, "image": {"name": "nginx:alpine", "hash": "sha256:b9e2356ea1be9452f3777a587b0b6a30bc16c295fe6190eda6a0776522f27439"}, "mem": {"used": 10452992, "max_used": 19345408, "total": 52428800}, "cpu": {"perc": ${Math.random() * 10}}, "net": {"rx_bytes": 18201, "tx_bytes": 0}, "ports": ["80/tcp"]}}`
case 'get_container_logs':
if (body.payload.onlynew)
return `{"response": "get_container_logs", "payload":""}`
Expand Down
4 changes: 2 additions & 2 deletions client/src/containers/SystemInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
{info.containers.running}/{info.containers.total} Containers running
</div>
<div class="mt-3">
<a href="https://github.com/knrdl/casa" target="_blank" rel="noopener noreferrer"
<a href="https://github.com/knrdl/caasa" target="_blank" rel="noopener noreferrer"
class="text-decoration-none">
<Fa icon={faGithub} size="sm"/>
Casa on Github</a>
CaaSa on Github</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion setup-dev/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
COMPOSE_PROJECT_NAME=casadev
COMPOSE_PROJECT_NAME=caasadev
16 changes: 8 additions & 8 deletions setup-dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: '2.4'

services:
casa:
caasa:
build: ..
restart: always
environment:
ROLES_casa_admin_basic: info, state, logs, procs, files, files-read
ROLES_casa_admin_full: info, info-annotations, state, logs, term, procs, files, files-read, files-write
ROLES_caasa_admin_basic: info, state, logs, procs, files, files-read
ROLES_caasa_admin_full: info, info-annotations, state, logs, term, procs, files, files-read, files-write
AUTH_API_URL: https://example.org
AUTH_API_FIELD_USERNAME: username
AUTH_API_FIELD_PASSWORD: password
Expand All @@ -21,9 +21,9 @@ services:
mem_limit: 150m
cpu_count: 1
labels:
traefik.http.routers.casa.rule: Host(`localhost`)
traefik.http.routers.caasa.rule: Host(`localhost`)
traefik.http.middlewares.webproxy-auth.headers.customrequestheaders.Remote-User: user1 # for web proxy auth
traefik.http.routers.casa.middlewares: 'webproxy-auth@docker'
traefik.http.routers.caasa.middlewares: 'webproxy-auth@docker'

proxy:
image: docker.io/traefik:v2.9
Expand All @@ -36,17 +36,17 @@ services:
# - /var/run/docker.sock:/var/run/docker.sock # DOCKER
- /run/user/1000/podman/podman.sock:/var/run/docker.sock # PODMAN
labels:
casa.admin.basic: user1,user2
caasa.admin.basic: user1,user2

demo1:
image: docker.io/nginx:alpine
labels:
casa.admin.full: user1,user2
caasa.admin.full: user1,user2

demo2:
image: docker.io/traefik/whoami
labels:
casa.admin.basic: user1,user2
caasa.admin.basic: user1,user2

networks:
net:

0 comments on commit 7e96727

Please sign in to comment.