diff --git a/CHANGELOG.md b/CHANGELOG.md index 9986290..31f8945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## v0.05 ( Nov 17th 2023 ) +* Environment Variables and Labels are now unchecked by default. +* Support for Docker volumes. +* Fixed app uninstall. +* Fixed Proxy Manager. +* Updated functions to ignore the three DweebUI containers: DweebUI, DweebCache(redis), and DweebProxy(caddy). +* Visual updates: Tabs for networks, images, and volumes. Added 'update' option in container drop-down. +* Updated main.js to prevent javascript errors. +* Fix for templates using 'set' instead of 'default' in environment variables. +* Fixes for templates with no volumes or no labels. +* New README.md. +* New screenshots. +* Automatically persists data in docker volumes if there is no bind mount. + ## v0.04 (Nov 11th 2023) * Docker Image and Compose file available. * The containers DweebUI and DweebCache are hidden from the dashboard. diff --git a/README.md b/README.md index 7d3b0cb..0d6f258 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,82 @@ # DweebUI +DweebUI is a simple Docker web interface created with javascript and node.js +Pre-Pre-Pre-Pre-Pre Alpha v0.05 ( :fire: Experimental. Don't install on any servers you care about :fire: ) -DweebUI is a simple Docker web interface created with javascript and node.js +[![GitHub License](https://img.shields.io/github/license/lllllllillllllillll/DweebUI)](https://github.com/lllllllillllllillll/DweebUI/blob/main/LICENSE) +[![GitHub activity](https://img.shields.io/github/commit-activity/y/lllllllillllllillll/DweebUI)](https://github.com/lllllllillllllillll) -Pre-Pre-Pre-Pre-Pre Alpha v 0.04 ( :fire: Experimental. Don't install on any servers you care about :fire: ) * I haven't used Github very much and I'm still new to javascript. * This is the first project I've ever released and I'm sure it's full of plenty of bugs and mistakes. * I probably should have waited a lot longer to share this :| -Requirements: Docker + + + -![DweebUI](https://raw.githubusercontent.com/lllllllillllllillll/DweebUI/main/DweebUI.png) ## Features +* [x] Dashboard provides server metrics (cpu, ram, network, disk) and container controls on a single page. +* [x] Light/Dark Mode. +* [x] Easy to install app templates. +* [x] Automatically persists data in docker volumes if bind mount isn't used. +* [x] Proxy manager for Caddy. +* [x] Partial Portainer Template Support (Network Mode, Ports, Volumes, Enviroment Variables, Labels, Commands, Restart Policy, Nvidia Hardware Acceleration). +* [x] Multi-User built-in. +* [ ] User pages: Shortcuts, Requests, Support. (planned) +* [x] Support for Windows, Linux, and MacOS. +* [ ] Import compose files. (planned) +* [x] Pure javascript. No frameworks or typescript. +* [x] Templates.json maintains compatability with Portainer, allowing you to use the template without needing to use DweebUI. +* [ ] Manage your Docker networks, images, and volumes. (planned) +* [ ] Preset variables. (planned) -* Dashboard provides server metrics (cpu, ram, network, disk) and container controls on a single page. -* Partial Portainer Template Support (Network Mode, Ports, Volumes, Enviroment Variables, Labels, Commands, Restart Policy, Nvidia Hardware Acceleration). -* Light/Dark Mode. -* Support for multiple users is built in (but unused). -* ~~Caddy Proxy Manager (very simple. proof of concept)~~ Broken since moving to docker container. -* Pure javascript. No frameworks or typescript. -* User data is stored in a sqlite database and uses browser sessions and a redis store for authentication. -* Templates.json maintains compatability with Portainer, so you can use the template without needing to use DweebUI. ## Setup * Docker compose.yaml: ``` services: -  dweebui: -    container_name: DweebUI -    image: lllllllillllllillll/dweebui:v0.04 -    ports: -      - 8000:8000 -    depends_on: -      - cache -    links: -      - cache -    volumes: -      - dweebui:/app -      - /var/run/docker.sock:/var/run/docker.sock -  cache: -    container_name: DweebCache -    image: redis:6.2-alpine -    restart: always -    command: redis-server --save 20 1 --loglevel warning --requirepass eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81 -    volumes: -      - cache:/data -  + dweebui: + container_name: DweebUI + image: lllllllillllllillll/dweebui:v0.05 + restart: unless-stopped + ports: + - 8000:8000 + depends_on: + - cache + links: + - cache + volumes: + - dweebui:/app + - ./caddyfiles/Caddyfile:/app/caddyfiles/Caddyfile + - ./caddyfiles/sites:/app/caddyfiles/sites + - /var/run/docker.sock:/var/run/docker.sock + cache: + container_name: DweebCache + image: redis:6.2-alpine + restart: always + command: redis-server --save 20 1 --loglevel warning --requirepass eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81 + volumes: + - cache:/data + proxy: + container_name: DweebProxy + image: caddy:2.4.5-alpine + depends_on: + - dweebui + restart: unless-stopped + network_mode: host + volumes: + - caddy:/data + - caddy:/config + - ./caddyfiles/Caddyfile:/etc/caddy/Caddyfile + - ./caddyfiles/sites:/etc/caddy/sites + volumes: -  dweebui: -  cache: + dweebui: + cache: + caddy: ``` * Using setup.sh: @@ -61,8 +86,7 @@ cd DweebUI chmod +x setup.sh sudo ./setup.sh ``` -Once setup is complete, I recommend installing Caddy first, then something like code-server. -The template is very rough. + ## Credit diff --git a/app.js b/app.js index 4cbf66a..68523e6 100644 --- a/app.js +++ b/app.js @@ -5,8 +5,10 @@ const app = express(); const routes = require("./routes"); const { serverStats, containerList, containerStats, containerAction } = require('./functions/system_information'); +const { RefreshSites } = require('./controllers/site_actions'); let sent_list, clicked; +app.locals.site_list = ''; const redisClient = require('redis').createClient({ url: 'redis://DweebCache:6379', diff --git a/caddyfiles/Caddyfile b/caddyfiles/Caddyfile new file mode 100644 index 0000000..7f8f696 --- /dev/null +++ b/caddyfiles/Caddyfile @@ -0,0 +1 @@ +import ./sites/* \ No newline at end of file diff --git a/components/appCard.js b/components/appCard.js index df6cd8e..c8b2e3b 100644 --- a/components/appCard.js +++ b/components/appCard.js @@ -139,11 +139,11 @@ function appCard(data) { try { let volumes = data.volumes[i]; let volume_check = volumes ? "checked" : ""; - let volume_bind = volumes.bind.split(":")[0] ? volumes.bind.split(":")[0] : ""; - let volume_container = volumes.container.split(":")[0] ? volumes.container.split(":")[0] : ""; - let volume_readwrite = "rw" + let volume_bind = volumes.bind ? volumes.bind : ""; + let volume_container = volumes.container ? volumes.container.split(":")[0] : ""; + let volume_readwrite = "rw"; - if ((volumes.readonly == true) || (volumes.container.endsWith(":ro"))) { + if (volumes.readonly == true) { volume_readwrite = "ro"; } @@ -166,8 +166,9 @@ function appCard(data) { // Get environment details try { let env = data.env[i]; - let env_check = env ? "checked" : ""; + let env_check = ""; let env_default = env.default ? env.default : ""; + if (env.set) { env_default = env.set;} let env_description = env.description ? env.description : ""; let env_label = env.label ? env.label : ""; let env_name = env.name ? env.name : ""; @@ -193,7 +194,7 @@ function appCard(data) { try { let label = data.labels[i]; - let label_check = label ? "checked" : ""; + let label_check = ""; let label_name = label.name ? label.name : ""; let label_value = label.value ? label.value : ""; diff --git a/components/dashCard.js b/components/dashCard.js index 716a6cc..fe4ea19 100644 --- a/components/dashCard.js +++ b/components/dashCard.js @@ -117,12 +117,10 @@ module.exports.dashCard = function dashCard(data) {
-
${external_port}:${internal_port}
-
-
@@ -170,84 +168,168 @@ module.exports.dashCard = function dashCard(data) { -