"use strict";(self.webpackChunkdashy=self.webpackChunkdashy||[]).push([[733],{3905:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return h}});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),d=p(n),h=o,m=d["".concat(l,".").concat(h)]||d[h]||u[h]||r;return n?a.createElement(m,i(i({ref:t},c),{},{components:n})):a.createElement(m,i({ref:t},c))}));function h(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,i=new Array(r);i[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:o,i[1]=s;for(var p=2;p\n Options Indexes FollowSymLinks\n AllowOverride All\n Require all granted\n\n\n\n RewriteEngine On\n RewriteBase /\n RewriteRule ^index\\.html$ - [L]\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule . /index.html [L]\n\n")),(0,r.kt)("p",null,"Add a ",(0,r.kt)("inlineCode",{parentName:"p"},".htaccess")," file within ",(0,r.kt)("inlineCode",{parentName:"p"},"/var/www/html/dashy/.htaccess"),", and add:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"Options -MultiViews\nRewriteEngine On\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule ^ index.html [QSA,L]\n")),(0,r.kt)("p",null,"Then restart Apache, with ",(0,r.kt)("inlineCode",{parentName:"p"},"sudo systemctl restart apache2")),(0,r.kt)("h3",{id:"caddy"},"Caddy"),(0,r.kt)("p",null,"Caddy v2"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"try_files {path} /\n")),(0,r.kt)("p",null,"Caddy v1"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},"rewrite {\n regexp .*\n to {path} /\n}\n")),(0,r.kt)("h3",{id:"firebase-hosting"},"Firebase Hosting"),(0,r.kt)("p",null,"Create a file names ",(0,r.kt)("inlineCode",{parentName:"p"},"firebase.json"),", and populate it with something similar to:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre"},'{\n "hosting": {\n "public": "dist",\n "rewrites": [\n {\n "source": "**",\n "destination": "/index.html"\n }\n ]\n }\n}\n')),(0,r.kt)("h3",{id:"cpanel"},"cPanel"),(0,r.kt)("ol",null,(0,r.kt)("li",{parentName:"ol"},"Login to your WHM"),(0,r.kt)("li",{parentName:"ol"},"Open 'Feature Manager' on the left sidebar"),(0,r.kt)("li",{parentName:"ol"},"Under 'Manage feature list', click 'Edit'"),(0,r.kt)("li",{parentName:"ol"},"Find 'Application manager' in the list, enable it and hit 'Save'"),(0,r.kt)("li",{parentName:"ol"},"Log into your users cPanel account, and under 'Software' find 'Application Manager'"),(0,r.kt)("li",{parentName:"ol"},"Click 'Register Application', fill in the form using the path that Dashy is located, and choose a domain, and hit 'Save'"),(0,r.kt)("li",{parentName:"ol"},"The application should now show up in the list, click 'Ensure dependencies', and move the toggle switch to 'Enabled'"),(0,r.kt)("li",{parentName:"ol"},"If you need to change the port, click 'Add environmental variable', give it the name 'PORT', choose a port number and press 'Save'."),(0,r.kt)("li",{parentName:"ol"},"Dashy should now be running at your selected path an on a given port")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},(0,r.kt)("a",{parentName:"strong",href:"#"},"\u2b06\ufe0f Back to Top"))),(0,r.kt)("hr",null),(0,r.kt)("h2",{id:"running-a-modified-version-of-the-app"},"Running a Modified Version of the App"),(0,r.kt)("p",null,"If you'd like to make any code changes to the app, and deploy your modified version, this section briefly explains how."),(0,r.kt)("p",null,"The first step is to fork the project on GitHub, and clone it to your local system. Next, install the dependencies (",(0,r.kt)("inlineCode",{parentName:"p"},"yarn"),"), and start the development server (",(0,r.kt)("inlineCode",{parentName:"p"},"yarn dev"),") and visit ",(0,r.kt)("inlineCode",{parentName:"p"},"localhost:8080")," in your browser. You can then make changes to the codebase, and see the live app update in real-time. Once you've finished, running ",(0,r.kt)("inlineCode",{parentName:"p"},"yarn build")," will build the app for production, and output the assets into ",(0,r.kt)("inlineCode",{parentName:"p"},"./dist")," which can then be deployed using a web server, CDN or the built-in Node server with ",(0,r.kt)("inlineCode",{parentName:"p"},"yarn start"),". For more info on all of this, take a look at the ",(0,r.kt)("a",{parentName:"p",href:"/docs/developing"},"Developing Docs"),". To build your own Docker container from the modified app, see ",(0,r.kt)("a",{parentName:"p",href:"#building-your-own-container"},"Building your Own Container")),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},(0,r.kt)("a",{parentName:"strong",href:"#"},"\u2b06\ufe0f Back to Top"))),(0,r.kt)("hr",null),(0,r.kt)("h2",{id:"building-your-own-container"},"Building your Own Container"),(0,r.kt)("p",null,"Similar to above, you'll first need to fork and clone Dashy to your local system, and then install dependencies."),(0,r.kt)("p",null,"Then, either use Dashy's default ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/Lissy93/dashy/blob/master/Dockerfile"},(0,r.kt)("inlineCode",{parentName:"a"},"Dockerfile"))," as is, or modify it according to your needs."),(0,r.kt)("p",null,"To build and deploy locally, first build the app with: ",(0,r.kt)("inlineCode",{parentName:"p"},"docker build -t dashy ."),", and then start the app with ",(0,r.kt)("inlineCode",{parentName:"p"},"docker run -p 8080:80 --name my-dashboard dashy"),". Or modify the ",(0,r.kt)("inlineCode",{parentName:"p"},"docker-compose.yml")," file, replacing ",(0,r.kt)("inlineCode",{parentName:"p"},"image: lissy93/dashy")," with ",(0,r.kt)("inlineCode",{parentName:"p"},"build: .")," and run ",(0,r.kt)("inlineCode",{parentName:"p"},"docker compose up"),"."),(0,r.kt)("p",null,"Your container should now be running, and will appear in the list when you run ",(0,r.kt)("inlineCode",{parentName:"p"},"docker container ls \u2013a"),". If you'd like to enter the container, run ",(0,r.kt)("inlineCode",{parentName:"p"},"docker exec -it [container-id] /bin/ash"),"."),(0,r.kt)("p",null,"You may wish to upload your image to a container registry for easier access. Note that if you choose to do this on a public registry, please name your container something other than just 'dashy', to avoid confusion with the official image.\nYou can push your build image, by running: ",(0,r.kt)("inlineCode",{parentName:"p"},"docker push ghcr.io/OWNER/IMAGE_NAME:latest"),". You will first need to authenticate, this can be done by running ",(0,r.kt)("inlineCode",{parentName:"p"},"echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin"),", where ",(0,r.kt)("inlineCode",{parentName:"p"},"CR_PAT")," is an environmental variable containing a token generated from your GitHub account. For more info, see the ",(0,r.kt)("a",{parentName:"p",href:"https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry"},"Container Registry Docs"),"."),(0,r.kt)("p",null,(0,r.kt)("strong",{parentName:"p"},(0,r.kt)("a",{parentName:"strong",href:"#"},"\u2b06\ufe0f Back to Top"))),(0,r.kt)("hr",null))}d.isMDXComponent=!0}}]);