From 62e795cdbcad097cc963fb504924a04c1734633c Mon Sep 17 00:00:00 2001 From: Subby Date: Sat, 17 Dec 2022 06:07:35 -0800 Subject: [PATCH 1/5] Add docker compose file. (#29) Added a compose file to allow for dick to insert into docker. Please be gentle. This resolves #21 --- Dockerfile | 24 ++++++++++++++++++++++++ docker-compose.yml | 14 ++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7852f01 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM archlinux:latest + +# Update the repositories +RUN pacman -Sy + +# Install nodejs +RUN pacman -S --noconfirm git nodejs npm + +# Generate directories and set up project +RUN mkdir /app && mkdir /app/dick && mkdir /app/ass +COPY . /app/dick +RUN cd /app/dick + +#RUN nvm install node +RUN npm install -g npm@latest +RUN npm --version +RUN node --version + +WORKDIR /app/dick + +RUN npm i + +# Expose port +EXPOSE 3000 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..296b9c9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "2.1" +services: + dick: + container_name: dick + build: + context: ./ + dockerfile: Dockerfile + command: npm start + volumes: + - ./src/constants.ts:/app/dick/src/constants.ts # DICK constants file + - ../ass:/app/ass # Path to your ASS install + ports: + - 3000:3000 + restart: unless-stopped From bb4ac53c7b67ed01eb9801ec73107638c6635a4a Mon Sep 17 00:00:00 2001 From: Facinorous <63425706+Facinorous-420@users.noreply.github.com> Date: Sat, 17 Dec 2022 09:56:34 -0500 Subject: [PATCH 2/5] Add docker set up instructions to README --- README.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index eefdf87..0cab0be 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Dick was created to be an easy to use front end for You can learn more here. **Planned Feautres:** -1. There are a lot of good ideas out there, to keep track of what is currently planned see the v1.1 project board +1. There are a lot of good ideas out there, to keep track of what is currently planned see the project board The front end is built using Tailwind CSS, Lucide Icons, as well as hand crafted components all templated using EJS. I plan to eventually rewrite this in React. @@ -83,11 +83,10 @@ Inside this file, is some basic configuration you can change for your set up. Th | Variable | Description | | --------------------------------------------- | :---------------------: | -| `DICK_SUBMODULE = false` | Put this to true if you wish to run DICK as an ASS submoduke, false if seperate | -| `ASS_LOCATION = "../ass"` | If running DICK seperately, DICK will use this to find your ASS install folder | | `ASS_SECURE = false` | Put this to true if you are running ASS behind a domain with HTTPS,. false if HTTP | | `ASSDOMAIN = "127.0.0.1:40115"` | Put this to your ASS domain. Can be an ip, or domain for example `https://cdn.mydomain.com` | -| `PORT = "3000"` | Change this number to the port you wish DICK to run on | +| `ASS_LOCATION = "../ass"` | If running DICK seperately, DICK will use this to find your ASS install folder. Leave this alone if using Docker. | +| `PORT = "3000"` | Change this number to the port you wish DICK to run on. Leave this alone if using Docker. | > **Note** > If you want to set a user as admin, currently you must do it via the database file generated at `/src/database/users.json` and change the users role from `user` to `admin`. By default, the first user to login to your dick instance will be admin. @@ -114,7 +113,21 @@ Inside this file, is some basic configuration you can change for your set up. Th #### Production
- Open to view the production set up steps + Open to view the docker production set up steps +
+ + 1. Create a folder, call it whatever you wish + 2. Install, and run ASS https://github.com/tycrek/ass#installation (This will create an `ass` folder) + 3. Go back into the folder you created and clone this repo `git clone https://github.com/Facinorous-420/dick.git` + 4. Go into the newly created `dick` folder `cd dick` + 5. Go into `/src` and copy `constants.ts.example` to `constants.ts` and edit it as needed + 6. Go back to the root of `dick` and edit the `docker-compose.yml` to match your specific needs by changing the port, and voluime location where your ass files are on your system. + 7. Run the docker compose file `docker-compose up -d` this will create a new container named `dick`. +
+ +
+ + Open to view the source production set up steps
1. Create a folder, call it whatever you wish @@ -124,7 +137,6 @@ Inside this file, is some basic configuration you can change for your set up. Th 5. Go into `/src` and copy `constants.ts.example` to `constants.ts` and edit it as needed 6. Go back to the root of `dick` and install the dependancies for the frontend, `npm i` 7. Run `npm start` to compile the code base and run DICK -
When you approach the login screen, the login information is your ASS username, and the secret key generated by ASS is your password. From 6c8ca24a5bf37aaafe8f4714cbfdb8e0a3d4e47c Mon Sep 17 00:00:00 2001 From: Facinorous <63425706+Facinorous-420@users.noreply.github.com> Date: Sat, 17 Dec 2022 09:56:59 -0500 Subject: [PATCH 3/5] Update version to v1.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ffd11c..8990efd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dick", - "version": "1.1.0", + "version": "1.1.1", "description": "A frontend for ASS", "main": "./dist/dashboard.js", "repository": { From d8f960f6ee3c9f0226d8b1387049c3397432c1d8 Mon Sep 17 00:00:00 2001 From: Facinorous Date: Sat, 17 Dec 2022 10:14:37 -0500 Subject: [PATCH 4/5] Update flash messages to appear in pills, resolving Style the login page system messages #19 --- views/pages/admin/tabs/appsettings.ejs | 24 ++++++++++-------------- views/pages/public/login.ejs | 12 ++++++------ views/pages/public/register.ejs | 18 +++++++++--------- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/views/pages/admin/tabs/appsettings.ejs b/views/pages/admin/tabs/appsettings.ejs index 6e66d80..bc42fb5 100644 --- a/views/pages/admin/tabs/appsettings.ejs +++ b/views/pages/admin/tabs/appsettings.ejs @@ -3,21 +3,17 @@
- <% if(success_alert_message !='' ){ %> -
-

- <%= success_alert_message %> -

-
- <% } %> + <% if(success_alert_message !='' ){ %> + + <% } %> - <% if(error_message !='' ){ %> -
-

- <%= error_message %> -

-
- <% } %> + <% if(error_message !='' ){ %> + + <% } %>
diff --git a/views/pages/public/login.ejs b/views/pages/public/login.ejs index 369512e..5085e65 100644 --- a/views/pages/public/login.ejs +++ b/views/pages/public/login.ejs @@ -10,15 +10,15 @@

<% if(success_alert_message !='' ){ %> -

- <%= success_alert_message %> -

+ <% } %> <% if(error_message !='' ){ %> -

- <%= error_message %> -

+ <% } %> diff --git a/views/pages/public/register.ejs b/views/pages/public/register.ejs index 1e1911d..5f7f4bb 100644 --- a/views/pages/public/register.ejs +++ b/views/pages/public/register.ejs @@ -10,16 +10,16 @@

<% if(success_alert_message !='' ){ %> -

- <%= success_alert_message %> -

- <% } %> + + <% } %> - <% if(error_message !='' ){ %> -

- <%= error_message %> -

- <% } %> + <% if(error_message !='' ){ %> + + <% } %>
@@ -64,11 +59,9 @@
+ class="bg-accentsecondary w-auto hover:bg-accent rounded-md px-5 py-2 text-color-primary">Create User
- + -
\ No newline at end of file +
diff --git a/views/pages/admin/main.ejs b/views/pages/admin/main.ejs index a964aec..81f6998 100644 --- a/views/pages/admin/main.ejs +++ b/views/pages/admin/main.ejs @@ -11,7 +11,7 @@
-
+
@@ -25,7 +25,7 @@
-
+

@@ -46,7 +46,7 @@

-
+

@@ -63,7 +63,7 @@

-
+

@@ -80,7 +80,7 @@

-
+

@@ -97,7 +97,7 @@

-
+

@@ -143,4 +143,4 @@

-
\ No newline at end of file +
diff --git a/views/pages/admin/tabs/users.ejs b/views/pages/admin/tabs/users.ejs index fb3af1a..762e5f6 100644 --- a/views/pages/admin/tabs/users.ejs +++ b/views/pages/admin/tabs/users.ejs @@ -7,7 +7,7 @@ - -
-
- Showing <%= totalUsers %> users -
-
- -
+
@@ -90,13 +83,9 @@ @@ -140,4 +130,4 @@ - \ No newline at end of file + diff --git a/views/pages/user/tabs/filemanager/infinite-scroll/no-more-data.ejs b/views/pages/user/tabs/filemanager/infinite-scroll/no-more-data.ejs index 421cc43..d9819e4 100644 --- a/views/pages/user/tabs/filemanager/infinite-scroll/no-more-data.ejs +++ b/views/pages/user/tabs/filemanager/infinite-scroll/no-more-data.ejs @@ -6,6 +6,6 @@ - You have no more files to load! <%= settingsDatabase.appEmoji ? settingsDatabase.appEmoji : '🍆' %> + There are no more files to load. - \ No newline at end of file + diff --git a/views/templates/errors/404.ejs b/views/templates/errors/404.ejs index a905614..3b00951 100644 --- a/views/templates/errors/404.ejs +++ b/views/templates/errors/404.ejs @@ -4,15 +4,13 @@
-
404
-
Oops. This page does not exist.
-
You may have mistyped the address or <%= settingsDatabase.name ? settingsDatabase.name.toUpperCase() : "DICK" %> seems to be malfunctioning
- - Back to Home - +
Error 404
+
Page Not Found
+
The page you were looking for does not exist. You may have mistyped the URL or the page may have moved.
+ Return Home
- \ No newline at end of file + diff --git a/views/templates/partials/nav/breadcrumb.ejs b/views/templates/partials/nav/breadcrumb.ejs index 7481125..73a438f 100644 --- a/views/templates/partials/nav/breadcrumb.ejs +++ b/views/templates/partials/nav/breadcrumb.ejs @@ -10,7 +10,6 @@ <% if(path == '/'){ %>
Dashboard
<% } %> - <% if(path == '/admin'){ %>
Admin Dashboard
<% } %> - + <% if(path == '/admin'){ %>
Admin
<% } %> - \ No newline at end of file + diff --git a/views/templates/partials/nav/profile.ejs b/views/templates/partials/nav/profile.ejs index 81d8e6e..0551490 100644 --- a/views/templates/partials/nav/profile.ejs +++ b/views/templates/partials/nav/profile.ejs @@ -17,19 +17,17 @@ - \ No newline at end of file + diff --git a/views/templates/public.ejs b/views/templates/public.ejs index 58a7fc5..6e7cbc5 100644 --- a/views/templates/public.ejs +++ b/views/templates/public.ejs @@ -10,4 +10,4 @@ -<%- include("./partials/footer") %> \ No newline at end of file +<%- include("./partials/footer") %> diff --git a/views/templates/user.ejs b/views/templates/user.ejs index 2aeb209..e8f692d 100644 --- a/views/templates/user.ejs +++ b/views/templates/user.ejs @@ -24,6 +24,5 @@ <% } %> <%- include("./partials/footer") %> - - \ No newline at end of file +