Skip to content

Commit

Permalink
Merge pull request #25 from lllllllillllllillll/dev
Browse files Browse the repository at this point in the history
v0.06
  • Loading branch information
lllllllillllllillll authored Nov 24, 2023
2 parents 1ffdf15 + 1893be7 commit 086fd96
Show file tree
Hide file tree
Showing 11 changed files with 181 additions and 190 deletions.
78 changes: 43 additions & 35 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
## 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.
* Default icon for containers.
* Fixed missing information in container details/edit modals (Ports, Env, Volumes, Labels).

## v0.03 (Nov 5th 2023)
* Container graphs now load instantly on refresh
* Working net data for server dashboard
* Redis is now installed as a docker container.


## v0.02 (Nov 1st 2023)
* Significant code clean-up and improvements
* CPU and RAM graphs for each container
* Updated Templates.json
* Fixed text color of VPN and VNC buttons


## v0.01 (Oct 15th 2023)
* First release. Not much working.
## v0.06 ( Nov 24th 2023 )
* Multi-platform image (amd64/arm64).
* Removed Caddy from compose file.
* Proxy Manager UI can be enabled from environment variable.
* Removed hardcoded redis passwords.
* Repo change: Implemented image build-and-publish and dependabot (Thank you, gaby).
* Updated dependencies.

## 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.
* Default icon for containers.
* Fixed missing information in container details/edit modals (Ports, Env, Volumes, Labels).

## v0.03 (Nov 5th 2023)
* Container graphs now load instantly on refresh
* Working net data for server dashboard
* Redis is now installed as a docker container.


## v0.02 (Nov 1st 2023)
* Significant code clean-up and improvements
* CPU and RAM graphs for each container
* Updated Templates.json
* Fixed text color of VPN and VNC buttons


## v0.01 (Oct 15th 2023)
* First release. Not much working.
12 changes: 2 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,20 @@

FROM node:21-alpine

# Use production node environment by default.
ENV NODE_ENV production

WORKDIR /app

# Download dependencies as a separate step to take advantage of Docker's caching.
# Leverage a cache mount to /root/.npm to speed up subsequent builds.
# Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into
# into this layer.

RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci --omit=dev

# Run the application as a non-root user.
USER root

# Copy the rest of the source files into the image.
COPY . .

# Expose the port that the application listens on.
EXPOSE 8000

# Run the application.
CMD node app.js
CMD node app.js
180 changes: 87 additions & 93 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,87 @@
# 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: )

[![GitHub Stars](https://img.shields.io/github/stars/lllllllillllllillll/DweebUI)](https://github.com/lllllllillllllillll)
[![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)

* 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 :|

<a href="https://raw.githubusercontent.com//lllllllillllllillll/DweebUI/main/screenshots/dashboard.png"><img src="https://raw.githubusercontent.com/lllllllillllllillll/DweebUI/main/screenshots/dashboard.png" width="50%"/></a>

<a href="https://raw.githubusercontent.com/lllllllillllllillll/DweebUI/main/screenshots/apps.png"><img src="https://raw.githubusercontent.com/lllllllillllllillll/DweebUI/main/screenshots/apps.png" width="50%"/></a>


## 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)
* [ ] VPN, VPS, and Firewall Toggles. (planned)
* [ ] Offline Mode. (planned)

## Setup

* Docker compose.yaml:
```
services:
  dweebui:
    container_name: DweebUI
    image: lllllllillllllillll/dweebui:v0.05
    restart: unless-stopped
    ports:
      - 8000:8000
    depends_on:
      - cache
    links:
      - cache
    volumes:
      - dweebui:/app
      - caddy:/app/caddyfiles
      - /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
      - caddy:/etc/caddy
volumes:
  dweebui:
  cache:
  caddy:
```

* Using setup.sh:
```
Extract DweebUI.zip and navigate to /DweebUI
cd DweebUI
chmod +x setup.sh
sudo ./setup.sh
```


## Credit

* UI was built using HTML and CSS elements from https://tabler.io/
* Apps template based on Portainer template provided by Lissy93 here: https://github.com/Lissy93/portainer-templates
* Most of the app icons were sourced from Walkxcode's dashboard icons here: https://github.com/walkxcode/dashboard-icons
# DweebUI
DweebUI is a simple Docker web interface created with javascript and node.js

Pre-Pre-Pre-Pre-Pre Alpha v0.06 ( :fire: Experimental. Don't install on any servers you care about :fire: )

[![GitHub Stars](https://img.shields.io/github/stars/lllllllillllllillll/DweebUI)](https://github.com/lllllllillllllillll)
[![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)

* 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 :|

<a href="https://raw.githubusercontent.com//lllllllillllllillll/DweebUI/main/screenshots/dashboard.png"><img src="https://raw.githubusercontent.com/lllllllillllllillll/DweebUI/main/screenshots/dashboard.png" width="50%"/></a>

<a href="https://raw.githubusercontent.com/lllllllillllllillll/DweebUI/main/screenshots/apps.png"><img src="https://raw.githubusercontent.com/lllllllillllllillll/DweebUI/main/screenshots/apps.png" width="50%"/></a>


## 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. (Optional)
* [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)
* [ ] VPN, VPS, and Firewall Toggles. (planned)
* [ ] Offline Mode. (planned)

## Setup

* Docker compose.yaml:
```
services:
dweebui:
container_name: DweebUI
image: lllllllillllllillll/dweebui:v0.06
environment:
NODE_ENV: production
REDIS_PASS: replace_with_password_for_redis
# Proxy_Manager: enabled
restart: unless-stopped
ports:
- 8000:8000
depends_on:
- cache
links:
- cache
volumes:
- dweebui:/app
- caddyfiles:/app/caddyfiles
- /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 replace_with_password_for_redis
volumes:
- cache:/data
volumes:
dweebui:
cache:
caddyfiles:
```

* Using setup.sh:
```
Extract DweebUI.zip and navigate to /DweebUI
cd DweebUI
chmod +x setup.sh
sudo ./setup.sh
```


## Credit

* UI was built using HTML and CSS elements from https://tabler.io/
* Apps template based on Portainer template provided by Lissy93 here: https://github.com/Lissy93/portainer-templates
* Most of the app icons were sourced from Walkxcode's dashboard icons here: https://github.com/walkxcode/dashboard-icons
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ app.locals.site_list = '';

const redisClient = require('redis').createClient({
url: 'redis://DweebCache:6379',
password:'eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81',
password: process.env.REDIS_PASS,
legacyMode:true
});
redisClient.connect().catch(console.log);
Expand Down
24 changes: 9 additions & 15 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
services:
dweebui:
container_name: DweebUI
image: lllllllillllllillll/dweebui:v0.05
image: lllllllillllllillll/dweebui:v0.06
environment:
NODE_ENV: production
REDIS_PASS: replace_with_password_for_redis
# Proxy_Manager: enabled
restart: unless-stopped
ports:
- 8000:8000
Expand All @@ -11,27 +15,17 @@ services:
- cache
volumes:
- dweebui:/app
- caddy:/app/caddyfiles
- caddyfiles:/app/caddyfiles
- /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
command: redis-server --save 20 1 --loglevel warning --requirepass replace_with_password_for_redis
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
- caddy:/etc/caddy

volumes:
dweebui:
cache:
caddy:
caddyfiles:
8 changes: 7 additions & 1 deletion controllers/dashboard.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
const User = require('../database/UserModel');


exports.Dashboard = async function (req, res) {

if (req.session.role == "admin") {

// get user data with matching UUID from sqlite database
let user = await User.findOne({ where: { UUID: req.session.UUID } });

let caddy = 'd-none';

if (process.env.Proxy_Manager == 'enabled') {
caddy = '';
}

// Render the home page
res.render("pages/dashboard", {
name: user.first_name + ' ' + user.last_name,
role: user.role,
avatar: user.avatar,
isLoggedIn: true,
site_list: req.app.locals.site_list,
caddy: caddy
});
} else {
// Redirect to the login page
Expand Down
Loading

0 comments on commit 086fd96

Please sign in to comment.