diff --git a/CHANGELOG.md b/CHANGELOG.md
index 26e792c..207d4a7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,16 @@
+## v0.08 (Dec 15th 2023)
+* Updates to compose file and instructions from [steveiliop56](https://github.com/steveiliop56)
+* Added SECRET field to compose file as a basic security measure.
+* Visibility button to hide containers or reset view.
+* Container link now uses server IP address.
+* More compact container card, with style options planned.
+* Improved log view.
+* Removed VPN, Firewall, and VNC buttons.
+* Updated dependencies (Sequelize 6.35.2)
+* Fixed web pages not using the "public" static folder.
+* Small tweaks to router.
+* Replaced the default icon shown for missing icons (docker.png).
+
## v0.07 (Dec 8th 2023)
* View container logs.
* Removed Redis.
diff --git a/Dockerfile b/Dockerfile
index ff00254..23c58c9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,6 @@
FROM node:21-alpine
-ENV NODE_ENV production
WORKDIR /app
diff --git a/DweebUI.png b/DweebUI.png
deleted file mode 100644
index 16e814f..0000000
Binary files a/DweebUI.png and /dev/null differ
diff --git a/README.md b/README.md
index 43f04ad..7ba807c 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,16 @@
# DweebUI
-DweebUI is a simple Docker web interface created with javascript and node.js
+DweebUI is a simple Docker web interface created using Javascript, Node.JS, and Express.
-Pre-Pre-Pre-Pre-Pre Alpha v0.07 ( :fire: Experimental. Don't install on any servers you care about :fire: )
+Pre-Pre-Pre-Pre-Pre Alpha v0.08 ( :fire: Experimental. Don't install on any servers you care about :fire: )
[](https://github.com/lllllllillllllillll)
-[](https://github.com/lllllllillllllillll/DweebUI/blob/main/LICENSE)
[](https://github.com/lllllllillllllillll)
+[](https://hub.docker.com/repository/docker/lllllllillllllillll/dweebui)
+[](https://github.com/lllllllillllllillll/DweebUI/blob/main/LICENSE)
+
-* 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.
+* This is a personal project that I decided to share. I'm sure it has plenty of bugs and mistakes.
+* I haven't used Github very much and I'm still new to Javascript.
* I probably should have waited a lot longer to share this :|
@@ -17,49 +19,71 @@ Pre-Pre-Pre-Pre-Pre Alpha v0.07 ( :fire: Experimental. Don't install on any serv
## Features
-* [x] Dashboard provides server metrics (cpu, ram, network, disk) and container controls on a single page.
+* [x] Dashboard provides server metrics, container metrics, and container controls, on a single page.
+* [x] View container logs.
+* [ ] Update containers (planned).
+* [ ] Manage your Docker networks, images, and volumes (planned).
* [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. (Optional)
-* [x] Partial Portainer Template Support (Network Mode, Ports, Volumes, Enviroment Variables, Labels, Commands, Restart Policy, Nvidia Hardware Acceleration).
+* [x] Proxy manager for Caddy (Optional).
* [x] Multi-User built-in.
-* [ ] User pages: Shortcuts, Requests, Support. (planned)
+* [ ] User pages (planned).
* [x] Support for Windows, Linux, and MacOS.
-* [ ] Import compose files. (planned)
-* [x] Javascript, Node.js, and Express.
+* [ ] Docker compose support (planned).
* [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)
-* [ ] VPN, VPS, and Firewall Toggles. (planned)
-* [ ] Offline Mode. (planned)
+* [x] Automatically persists data in docker volumes if bind mount isn't used.
+* [ ] Preset variables (planned).
+* [ ] Offline/Local Icons (planned).
+
## Setup
-* Docker compose.yaml:
+Docker Compose:
```
+version: "3.9"
services:
- dweebui:
- container_name: DweebUI
- image: lllllllillllllillll/dweebui:v0.07
- environment:
- NODE_ENV: production
- PORT: 8000
- # Proxy_Manager: enabled
- restart: unless-stopped
- ports:
- - 8000:8000
- volumes:
- - dweebui:/app
- - caddyfiles:/app/caddyfiles
- - /var/run/docker.sock:/var/run/docker.sock
+
+ dweebui:
+ container_name: dweebui
+ image: lllllllillllllillll/dweebui:v0.08
+ # build:
+ # context: .
+ environment:
+ NODE_ENV: production
+ PORT: 8000
+ SECRET: MrWiskers
+ #Proxy_Manager: enabled
+ restart: unless-stopped
+ ports:
+ - 8000:8000
+ volumes:
+ - dweebui:/app
+ - caddyfiles:/app/caddyfiles
+ - /var/run/docker.sock:/var/run/docker.sock
+ #- ./custom-templates.json:/app/custom-templates.json
+ #- ./composefiles:/app/composefiles
+ networks:
+ - dweeb_network
+
volumes:
- dweebui:
- caddyfiles:
+ dweebui:
+ caddyfiles:
+
+
+networks:
+ dweeb_network:
+ driver: bridge
```
-* Using setup.sh:
+Compose setup:
+
+* Paste the above content into a file named ```docker-compose.yml``` then place it in a folder named ```dweebui```.
+* Open a terminal in the ```dweebui``` folder, then enter ```docker compose up -d```.
+* You may need to use ```docker-compose up -d``` or execute the command as root with either ```sudo docker compose up -d``` or ```sudo docker-compose up -d```.
+
+
+Using setup.sh:
```
Extract DweebUI.zip and navigate to /DweebUI
cd DweebUI
@@ -68,8 +92,9 @@ sudo ./setup.sh
```
-## Credit
+## Credits
+* Dockerode and dockerode-compose by Apocas: https://github.com/apocas/dockerode
* UI was built using HTML and CSS elements from https://tabler.io/
* Apps template based on Portainer template provided by Lissy93: https://github.com/Lissy93/portainer-templates
-* Icons from Walkxcode with some renames and additions: https://github.com/walkxcode/dashboard-icons
+* Icons from Walkxcode with some renames and additions: https://github.com/walkxcode/dashboard-icons
\ No newline at end of file
diff --git a/app.js b/app.js
index 7be165b..6635f59 100644
--- a/app.js
+++ b/app.js
@@ -8,10 +8,13 @@ const PORT = process.env.PORT || 8000;
const routes = require("./routes");
// Functions and variables
-const { serverStats, containerList, containerStats, containerAction, containerLogs } = require('./functions/system');
+const { serverStats, containerList, containerStats, containerAction, containerLogs, hiddenContainers } = require('./functions/system');
let sentList, clicked;
app.locals.site_list = '';
+const Containers = require('./database/ContainerSettings');
+
+
// Configure Session
const sessionMiddleware = session({
secret: "keyboard cat",
@@ -36,7 +39,7 @@ app.use([
// Start Express server
const server = app.listen(PORT, async () => {
- console.log(`App listening on port ${PORT}`);
+ console.log(`App listening on port ${PORT}`);
});
// Start Socket.io
@@ -90,11 +93,39 @@ io.on('connection', (socket) => {
clicked = false;
});
+
+ socket.on('hide', async (data) => {
+ console.log(`Hide ${data.container}`);
+
+ let containerExists = await Containers.findOne({ where: {name:data.container}});
+
+ if(!containerExists){
+ const container = await Containers.create({
+ name: data.container,
+ visibility: false
+ });
+ hiddenContainers();
+ console.log(`[Created] Container ${data.container} hidden`)
+ } else {
+ containerExists.update({ visibility: false });
+ console.log(`[Updated] Container ${data.container} hidden`)
+ hiddenContainers();
+ }
+ });
+
+ socket.on('reset', (data) => {
+ // set visibility to true for all containers
+ Containers.update({ visibility: true }, { where: {} });
+ console.log('All containers visible');
+ hiddenContainers();
+ });
+
// Container logs
socket.on('logs', (data) => {
containerLogs(data.container)
.then(logs => {
+ console.log(`Refreshed logs for ${data.container}`)
socket.emit('logString', logs);
})
.catch(err => {
diff --git a/components/dashCard.js b/components/dashCard.js
index 7974973..2afbc14 100644
--- a/components/dashCard.js
+++ b/components/dashCard.js
@@ -1,11 +1,24 @@
module.exports.dashCard = function dashCard(data) {
- let { name, service, id, state, image, external_port, internal_port, ports, volumes, environment_variables, labels } = data;
-
+ let { name, service, id, state, image, external_port, internal_port, ports, volumes, environment_variables, labels, IPv4, style } = data;
+
+ let margin, iconSize, fontSize = '';
+
+ if (style == "Large") {
+ iconSize = 'width="150px"'
+ } else if ((style == "Compact") || (style == undefined)) {
+ iconSize = 'width="100px"'
+ margin = 'style="margin-bottom: 0;"'
+ } else if (style == "Row") {
+ iconSize = 'width="50px"'
+ margin = 'style="margin-bottom: 0;"'
+ }
+
+
//disable controls for a docker container depending on its name
- let enabled = "";
- if (name.startsWith('Dweeb')) {
- enabled = 'disabled=""';
+ let actions = "";
+ if (name.startsWith('dweebui')) {
+ actions = 'disabled=""';
}
if ( external_port == undefined ) { external_port = 0; }
@@ -115,23 +128,23 @@ module.exports.dashCard = function dashCard(data) {