From c914b54a433f4077fc2b5f08903b4a818183961a Mon Sep 17 00:00:00 2001 From: WalkxCode Date: Wed, 11 May 2022 15:10:05 +0200 Subject: [PATCH 01/19] docs: Update docs progress --- README-old.md | 33 ++++++++++++++++++++ README.md | 86 +++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 95 insertions(+), 24 deletions(-) create mode 100644 README-old.md diff --git a/README-old.md b/README-old.md new file mode 100644 index 000000000..9e6b45ce6 --- /dev/null +++ b/README-old.md @@ -0,0 +1,33 @@ +# MyHomePage, a home page for your home server +### Do not hesitate to star ⭐ this repo if you like the project ! ![](https://img.shields.io/github/stars/ajnart/myhomepage?label=%E2%AD%90&style=for-the-badge?branch=master&kill_cache=1") +### Join the discord ! : https://discord.gg/C2WTXkzkwK +## What is MyHomePage ? + +HomePage is a web page for your home server, it provides a user friendly interface to access docker containers or other services. + +## Install +### Docker installation +Required : Docker +#### Standard docker install +To install the MyHomePage docker image simply execute ``docker pull ghcr.io/ajnart/mhp`` +To run the docker file ``docker run --name my-home-page -p 7575:80 -d ghcr.io/ajnart/mhp`` + +*Note: Currently the port used is 80 (Nginx default port) It will change to be 7575 by default* +#### Docker compose +Here's a docker compose example on how to integrate MHP into your container stack +```docker +services: + mhp: + image: ghcr.io/ajnart/mhp + ports: + - '7575:80' + restart: always +``` +### Local installation +Required: Node (LTS) +#### Install using node +To install MyHomePage locally: +- Clone the source code or download it. +- Execute ``npm install`` or ``yarn install`` *(prefered)* to install the dependencies +- Execute ``yarn export`` to build the source code into the final HTML pages in the ``./out`` folder +- Run a web server to serve the content of the ``./out`` folder. Example: ``python -m http.server 7575 --directory out`` diff --git a/README.md b/README.md index 9e6b45ce6..127654014 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,71 @@ -# MyHomePage, a home page for your home server -### Do not hesitate to star ⭐ this repo if you like the project ! ![](https://img.shields.io/github/stars/ajnart/myhomepage?label=%E2%AD%90&style=for-the-badge?branch=master&kill_cache=1") -### Join the discord ! : https://discord.gg/C2WTXkzkwK -## What is MyHomePage ? +

+

Homarr

-HomePage is a web page for your home server, it provides a user friendly interface to access docker containers or other services. +

+ A homepage for your server. +
+ Demo ↗️ Install ➡️ +

+

-## Install -### Docker installation -Required : Docker -#### Standard docker install -To install the MyHomePage docker image simply execute ``docker pull ghcr.io/ajnart/mhp`` -To run the docker file ``docker run --name my-home-page -p 7575:80 -d ghcr.io/ajnart/mhp`` +# 📃 Table of Contents +- [📃 Table of Contents](#-table-of-contents) +- [🚀 Getting Started](#-getting-started) + - [ℹ️ About](#ℹ️-about) + - [⚡ Installation](#-installation) + - [Deploying from Docker Image 🐳](#deploying-from-docker-image-) + - [Building from Source 🛠️](#building-from-source-️) -*Note: Currently the port used is 80 (Nginx default port) It will change to be 7575 by default* -#### Docker compose -Here's a docker compose example on how to integrate MHP into your container stack -```docker + +# 🚀 Getting Started + +## ℹ️ About + +Homarr is a simple and lightweight homepage for your server, that helps you easily access all of your services in one place. + +## ⚡ Installation + +### Deploying from Docker Image 🐳 +> Supported architectures: x86-64, ARM, ARM64 + +_Requirements_: +- [Docker](https://docs.docker.com/get-docker/) + +**Standard Docker Install** +```sh +docker run --name homarr -p 7575:80 -d ghcr.io/ajnart/mhp +``` + +**Docker Compose** +```yml +--- +version: '3' +#--------------------------------------------------------------------------------------------# +# Homarr - A homepage for your server. # +#--------------------------------------------------------------------------------------------# services: mhp: + container_name: homarr image: ghcr.io/ajnart/mhp + restart: unless-stopped ports: - '7575:80' - restart: always ``` -### Local installation -Required: Node (LTS) -#### Install using node -To install MyHomePage locally: -- Clone the source code or download it. -- Execute ``npm install`` or ``yarn install`` *(prefered)* to install the dependencies -- Execute ``yarn export`` to build the source code into the final HTML pages in the ``./out`` folder -- Run a web server to serve the content of the ``./out`` folder. Example: ``python -m http.server 7575 --directory out`` + +### Building from Source 🛠️ + +_Requirements_: +- [Git](https://git-scm.com/downloads) +- [NodeJS](https://nodejs.org/en/) _(Latest or LTS)_ +- [Yarn](https://yarnpkg.com/) +- Some web server + +**Installing** + +- Clone the GitHub repo: `git clone https://github.com/ajnart/homarr.git` & `cd myhomepage` +- Install all dependencies: `yarn install` +- Build the source: `yarn export` +- Start a web server (Any web server will work): + - _Examples:_ + - NodeJS serve: `npm i -g serve` or `yarn global add serve` & `serve ./out` + - python http.server: `python -m http.server 7474 --directory out` From 86590e72790e7a8ec0a1a520e4ba6e4ecd236e84 Mon Sep 17 00:00:00 2001 From: WalkxCode Date: Wed, 11 May 2022 15:10:58 +0200 Subject: [PATCH 02/19] feat: Move to Dashboard Icons --- components/AppShelf/AddAppShelfItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/AppShelf/AddAppShelfItem.tsx b/components/AppShelf/AddAppShelfItem.tsx index d8e619a9d..4aa0f8a3d 100644 --- a/components/AppShelf/AddAppShelfItem.tsx +++ b/components/AppShelf/AddAppShelfItem.tsx @@ -86,7 +86,7 @@ function MatchIcon( // https://data.jsdelivr.com/v1/package/gh/IceWhaleTech/AppIcon@main // and then iterate over the files -> files -> name and then remove the extension (.png) // Compare it to the input and then fetch the icon - fetch(`https://cdn.jsdelivr.net/gh/IceWhaleTech/AppIcon@main/all/${name.toLowerCase()}.png`) + fetch(`https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name.toLowerCase()}.png`) .then((res) => { if (res.status === 200) { form.setFieldValue('icon', res.url); From 0c7606793a686b2eb2f8ea8d63713f9615cd916d Mon Sep 17 00:00:00 2001 From: Aj - Thomas Date: Thu, 12 May 2022 02:41:13 +0200 Subject: [PATCH 03/19] Add new update notification on main dashboard --- .prettierrc | 9 ++++++ .prettierrc.js | 1 - components/Settings/SettingsMenu.tsx | 41 +++++++++++++++++++++++++--- data/constants.ts | 2 ++ 4 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 .prettierrc delete mode 100644 .prettierrc.js create mode 100644 data/constants.ts diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..48f1261fd --- /dev/null +++ b/.prettierrc @@ -0,0 +1,9 @@ +{ + "printWidth": 100, + "tabWidth": 2, + "parser": "typescript", + "singleQuote": true, + "trailingComma": "es5", + "useTabs": false, + "endOfLine": "lf" +} \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index dd23f0d31..000000000 --- a/.prettierrc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('eslint-config-mantine/.prettierrc.js'); diff --git a/components/Settings/SettingsMenu.tsx b/components/Settings/SettingsMenu.tsx index 41ef8c9ef..47a41fee1 100644 --- a/components/Settings/SettingsMenu.tsx +++ b/components/Settings/SettingsMenu.tsx @@ -7,10 +7,13 @@ import { Text, Tooltip, SegmentedControl, + Indicator, + Alert, } from '@mantine/core'; import { useColorScheme } from '@mantine/hooks'; -import { useState } from 'react'; -import { Settings as SettingsIcon } from 'tabler-icons-react'; +import { useEffect, useState } from 'react'; +import { AlertCircle, Settings as SettingsIcon } from 'tabler-icons-react'; +import { CURRENT_VERSION, REPO_URL } from '../../data/constants'; import { useConfig } from '../../tools/state'; import { ColorSchemeSwitch } from '../ColorSchemeToggle/ColorSchemeSwitch'; import SaveConfigComponent from '../Config/SaveConfig'; @@ -19,13 +22,23 @@ import ModuleEnabler from './ModuleEnabler'; function SettingsMenu(props: any) { const { config, setConfig } = useConfig(); const colorScheme = useColorScheme(); + const { current, latest } = props; const matches = [ { label: 'Google', value: 'https://google.com/search?q=' }, { label: 'DuckDuckGo', value: 'https://duckduckgo.com/?q=' }, { label: 'Bing', value: 'https://bing.com/search?q=' }, ]; + return ( + } + title="Update available" + radius="lg" + hidden={current === latest} + > + Version {latest} is available. Current : {current} + { + // Fetch Data here when component first mounted + fetch(`https://api.github.com/repos/${REPO_URL}/releases/latest`).then((res) => { + res.json().then((data) => { + setLatestVersion(data.tag_name); + if (data.tag_name !== CURRENT_VERSION) { + setUpdate(true); + } + }); + }); + }, []); return ( <> setOpened(false)} > - + setOpened(true)} > - + + + diff --git a/data/constants.ts b/data/constants.ts new file mode 100644 index 000000000..195d0a18d --- /dev/null +++ b/data/constants.ts @@ -0,0 +1,2 @@ +export const REPO_URL = 'ajnart/myhomepage'; +export const CURRENT_VERSION = 'v0.1.5'; From d7a052c1b158f9967f97a6dd827a643d1bf475ce Mon Sep 17 00:00:00 2001 From: Aj - Thomas Date: Wed, 11 May 2022 21:41:20 +0200 Subject: [PATCH 04/19] Fix error in GitHub CI --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6814b9ddb..7a3b32392 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,7 +4,6 @@ on: push: tags: - v* - workflow_dispatch: workflow_dispatch: From fac7dd1fae3296a9914b3a41083acba8f9eed11e Mon Sep 17 00:00:00 2001 From: Aj - Thomas Date: Wed, 11 May 2022 21:43:17 +0200 Subject: [PATCH 05/19] Fix error in GitHub CI --- .github/workflows/docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7a3b32392..846055bdb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,8 +4,7 @@ on: push: tags: - v* - -workflow_dispatch: + workflow_dispatch: env: IMAGE_NAME: mhp From 4c042ccb057cfbf2f0ffae7d6ce50cbd3d1f0a12 Mon Sep 17 00:00:00 2001 From: WalkxCode Date: Thu, 12 May 2022 13:07:47 +0200 Subject: [PATCH 06/19] feat: Multiple QoL updates --- .github/ISSUE_TEMPLATE/bug.yml | 52 +++++++ .github/ISSUE_TEMPLATE/feature-request.yml | 25 ++++ README-old.md | 33 ---- README.md | 8 +- components/AppShelf/AddAppShelfItem.tsx | 6 +- components/layout/Footer.tsx | 2 +- components/layout/Logo.tsx | 15 +- package.json | 166 ++++++++++----------- pages/_app.tsx | 2 +- 9 files changed, 175 insertions(+), 134 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml delete mode 100644 README-old.md diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 000000000..ac7f3daf5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,52 @@ +name: 🐛 Bug Report +description: Report something that's broken, or not working like intented! +title: '[🐛 Bug] ' +labels: ['🐛 Bug'] +assignees: + - ajnart +body: + - type: dropdown + id: environment + attributes: + label: Environment + description: How have you deployed Homarr? + options: + - Docker + - NodeJS + - Cloud Service (Static) + validations: + required: true + - type: input + id: version + attributes: + label: Version + description: What version of Homarr are you running? + placeholder: 0.1.0 + validations: + required: false + - type: textarea + id: repro + attributes: + label: Describe the problem + description: Please describe the problem exactly, how to reproduce it, actual results, and expected results. + validations: + required: true + - type: textarea + id: logs + attributes: + label: Additional info + description: Logs? Screenshots? More info? + validations: + required: false + - type: checkboxes + id: idiot-check + attributes: + label: Please tick the boxes + description: Before submitting, please ensure that + options: + - label: You've read the [docs](https://github.com/ajnart/homarr#readme) + required: true + - label: You've checked for [duplicate issues](https://github.com/ajnart/homarr/issues) + required: true + - label: You've tried to debug yourself + required: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 000000000..4a4844335 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,25 @@ +name: ✨ Feature Request +description: Request a feature to help improve Homarr! +title: '[✨ Feature] <title>' +labels: ['✨ Feature'] +assignees: + - ajnart +body: + - type: textarea + id: feature + attributes: + label: Describe the feature you would like to see + placeholder: An outline of the feature you would like to see implemented, include as much detail as possible! + validations: + required: true + - type: dropdown + id: priority + attributes: + label: Priority + description: How urgent is the development of this feature? + options: + - Low (Nice-to-have) + - Medium (Would be very useful) + - High (App breaking feature) + validations: + required: true diff --git a/README-old.md b/README-old.md deleted file mode 100644 index 9e6b45ce6..000000000 --- a/README-old.md +++ /dev/null @@ -1,33 +0,0 @@ -# MyHomePage, a home page for your home server -### Do not hesitate to star ⭐ this repo if you like the project ! ![](https://img.shields.io/github/stars/ajnart/myhomepage?label=%E2%AD%90&style=for-the-badge?branch=master&kill_cache=1") -### Join the discord ! : https://discord.gg/C2WTXkzkwK -## What is MyHomePage ? - -HomePage is a web page for your home server, it provides a user friendly interface to access docker containers or other services. - -## Install -### Docker installation -Required : Docker -#### Standard docker install -To install the MyHomePage docker image simply execute ``docker pull ghcr.io/ajnart/mhp`` -To run the docker file ``docker run --name my-home-page -p 7575:80 -d ghcr.io/ajnart/mhp`` - -*Note: Currently the port used is 80 (Nginx default port) It will change to be 7575 by default* -#### Docker compose -Here's a docker compose example on how to integrate MHP into your container stack -```docker -services: - mhp: - image: ghcr.io/ajnart/mhp - ports: - - '7575:80' - restart: always -``` -### Local installation -Required: Node (LTS) -#### Install using node -To install MyHomePage locally: -- Clone the source code or download it. -- Execute ``npm install`` or ``yarn install`` *(prefered)* to install the dependencies -- Execute ``yarn export`` to build the source code into the final HTML pages in the ``./out`` folder -- Run a web server to serve the content of the ``./out`` folder. Example: ``python -m http.server 7575 --directory out`` diff --git a/README.md b/README.md index 127654014..671b1c846 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ A homepage for <i>your</i> server. <br/> <a href = "https://github.com/ajnart/homarr/deployments/activity_log?environment=Production" > <strong> Demo ↗️ </strong> </a> • <a href = "#install" > <strong> Install ➡️ </strong> </a> + <br /> + <br /> + <a href = "https://discord.gg/aCsmEV5RgA" > <img src="https://discordapp.com/api/guilds/972958686051962910/widget.png?style=shield" > </a> </p> </p> @@ -15,6 +18,7 @@ - [⚡ Installation](#-installation) - [Deploying from Docker Image 🐳](#deploying-from-docker-image-) - [Building from Source 🛠️](#building-from-source-️) +- [💖 Contributing](#-contributing) <!-- Getting Started --> # 🚀 Getting Started @@ -62,10 +66,12 @@ _Requirements_: **Installing** -- Clone the GitHub repo: `git clone https://github.com/ajnart/homarr.git` & `cd myhomepage` +- Clone the GitHub repo: `git clone https://github.com/ajnart/homarr.git` & `cd homarr` - Install all dependencies: `yarn install` - Build the source: `yarn export` - Start a web server (Any web server will work): - _Examples:_ - NodeJS serve: `npm i -g serve` or `yarn global add serve` & `serve ./out` - python http.server: `python -m http.server 7474 --directory out` + +# 💖 Contributing diff --git a/components/AppShelf/AddAppShelfItem.tsx b/components/AppShelf/AddAppShelfItem.tsx index 4aa0f8a3d..249c0d5e2 100644 --- a/components/AppShelf/AddAppShelfItem.tsx +++ b/components/AppShelf/AddAppShelfItem.tsx @@ -82,11 +82,7 @@ function MatchIcon( apiKey: any; }> ) { - // TODO: In order to avoid all the requests, we could fetch - // https://data.jsdelivr.com/v1/package/gh/IceWhaleTech/AppIcon@main - // and then iterate over the files -> files -> name and then remove the extension (.png) - // Compare it to the input and then fetch the icon - fetch(`https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name.toLowerCase()}.png`) + fetch(`https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name.replace(/\s+/g, '-').toLowerCase()}.png`) .then((res) => { if (res.status === 200) { form.setFieldValue('icon', res.url); diff --git a/components/layout/Footer.tsx b/components/layout/Footer.tsx index 6683ec8e7..8727905c4 100644 --- a/components/layout/Footer.tsx +++ b/components/layout/Footer.tsx @@ -60,7 +60,7 @@ export function Footer({ links }: FooterCenteredProps) { > <Group className={classes.links}>{items}</Group> <Group spacing="xs" position="right" noWrap> - <ActionIcon<'a'> component="a" href="https://github.com/ajnart/myhomepage" size="lg"> + <ActionIcon<'a'> component="a" href="https://github.com/ajnart/homarr" size="lg"> <BrandGithub size={18} /> </ActionIcon> </Group> diff --git a/components/layout/Logo.tsx b/components/layout/Logo.tsx index b3d0305de..9f0b15f59 100644 --- a/components/layout/Logo.tsx +++ b/components/layout/Logo.tsx @@ -2,14 +2,9 @@ import { Text } from '@mantine/core'; import * as React from 'react'; export function Logo({ style }: any) { - return ( - <Text - sx={style} - weight="bold" - variant="gradient" - gradient={{ from: 'red', to: 'orange', deg: 145 }} - > - MyHomePage - </Text> - ); + return ( + <Text sx={style} weight="bold" variant="gradient" gradient={{ from: 'red', to: 'orange', deg: 145 }}> + Homarr + </Text> + ); } diff --git a/package.json b/package.json index 30a1ebd53..924c75624 100644 --- a/package.json +++ b/package.json @@ -1,84 +1,84 @@ { - "name": "homarr", - "version": "0.0.1", - "private": "false", - "description": "Customizable browser's home page to interact with your homeserver's Docker containers (i.e. Sonarr/Radarr)", - "repository": { - "type": "git", - "url": "https://github.com/ajnart/myhomepage" - }, - "scripts": { - "dev": "next dev", - "build": "next build", - "analyze": "ANALYZE=true next build", - "start": "next start", - "typecheck": "tsc --noEmit", - "export": "next build && next export", - "lint": "next lint", - "jest": "jest", - "jest:watch": "jest --watch", - "prettier:check": "prettier --check \"**/*.{ts,tsx}\"", - "prettier:write": "prettier --write \"**/*.{ts,tsx}\"", - "test": "npm run prettier:check && npm run lint && npm run typecheck && npm run jest", - "storybook": "start-storybook -p 7001", - "storybook:build": "build-storybook" - }, - "dependencies": { - "@mantine/core": "^4.2.1", - "@mantine/dates": "^4.2.1", - "@mantine/dropzone": "^4.2.1", - "@mantine/form": "^4.2.1", - "@mantine/hooks": "^4.2.1", - "@mantine/modals": "^4.2.1", - "@mantine/next": "^4.2.1", - "@mantine/notifications": "^4.2.1", - "@mantine/prism": "^4.2.1", - "@mantine/spotlight": "^4.2.1", - "@modulz/radix-icons": "^4.0.0", - "cookies-next": "^2.0.4", - "dayjs": "^1.11.1", - "framer-motion": "^6.3.1", - "js-file-download": "^0.4.12", - "next": "12.1.5-canary.4", - "prism-react-renderer": "^1.3.1", - "react": "18.0.0", - "react-dom": "18.0.0", - "tabler-icons-react": "^1.46.0" - }, - "devDependencies": { - "@babel/core": "^7.17.8", - "@next/bundle-analyzer": "^12.1.4", - "@next/eslint-plugin-next": "^12.1.4", - "@storybook/addon-essentials": "^6.4.22", - "@storybook/addon-links": "^6.4.22", - "@storybook/react": "^6.4.22", - "@testing-library/dom": "^8.12.0", - "@testing-library/jest-dom": "^5.16.3", - "@testing-library/react": "^13.0.0", - "@testing-library/user-event": "^14.0.4", - "@types/jest": "^27.4.1", - "@types/node": "^17.0.23", - "@types/react": "17.0.43", - "@typescript-eslint/eslint-plugin": "^5.16.0", - "@typescript-eslint/parser": "^5.16.0", - "babel-loader": "^8.2.4", - "eslint": "^8.11.0", - "eslint-config-airbnb": "19.0.4", - "eslint-config-airbnb-typescript": "^16.1.4", - "eslint-config-mantine": "1.1.0", - "eslint-plugin-import": "^2.25.4", - "eslint-plugin-jest": "^26.1.3", - "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-react": "^7.29.4", - "eslint-plugin-react-hooks": "^4.3.0", - "eslint-plugin-storybook": "^0.5.11", - "eslint-plugin-testing-library": "^5.2.0", - "eslint-plugin-unused-imports": "^2.0.0", - "jest": "^27.5.1", - "prettier": "^2.6.2", - "storybook-addon-turbo-build": "^1.1.0", - "storybook-dark-mode": "^1.0.9", - "ts-jest": "^27.1.4", - "typescript": "4.6.3" - } -} \ No newline at end of file + "name": "homarr", + "version": "0.0.1", + "private": "false", + "description": "Homarr - A homepage for your server.", + "repository": { + "type": "git", + "url": "https://github.com/ajnart/homarr" + }, + "scripts": { + "dev": "next dev", + "build": "next build", + "analyze": "ANALYZE=true next build", + "start": "next start", + "typecheck": "tsc --noEmit", + "export": "next build && next export", + "lint": "next lint", + "jest": "jest", + "jest:watch": "jest --watch", + "prettier:check": "prettier --check \"**/*.{ts,tsx}\"", + "prettier:write": "prettier --write \"**/*.{ts,tsx}\"", + "test": "npm run prettier:check && npm run lint && npm run typecheck && npm run jest", + "storybook": "start-storybook -p 7001", + "storybook:build": "build-storybook" + }, + "dependencies": { + "@mantine/core": "^4.2.1", + "@mantine/dates": "^4.2.1", + "@mantine/dropzone": "^4.2.1", + "@mantine/form": "^4.2.1", + "@mantine/hooks": "^4.2.1", + "@mantine/modals": "^4.2.1", + "@mantine/next": "^4.2.1", + "@mantine/notifications": "^4.2.1", + "@mantine/prism": "^4.2.1", + "@mantine/spotlight": "^4.2.1", + "@modulz/radix-icons": "^4.0.0", + "cookies-next": "^2.0.4", + "dayjs": "^1.11.1", + "framer-motion": "^6.3.1", + "js-file-download": "^0.4.12", + "next": "12.1.5-canary.4", + "prism-react-renderer": "^1.3.1", + "react": "18.0.0", + "react-dom": "18.0.0", + "tabler-icons-react": "^1.46.0" + }, + "devDependencies": { + "@babel/core": "^7.17.8", + "@next/bundle-analyzer": "^12.1.4", + "@next/eslint-plugin-next": "^12.1.4", + "@storybook/addon-essentials": "^6.4.22", + "@storybook/addon-links": "^6.4.22", + "@storybook/react": "^6.4.22", + "@testing-library/dom": "^8.12.0", + "@testing-library/jest-dom": "^5.16.3", + "@testing-library/react": "^13.0.0", + "@testing-library/user-event": "^14.0.4", + "@types/jest": "^27.4.1", + "@types/node": "^17.0.23", + "@types/react": "17.0.43", + "@typescript-eslint/eslint-plugin": "^5.16.0", + "@typescript-eslint/parser": "^5.16.0", + "babel-loader": "^8.2.4", + "eslint": "^8.11.0", + "eslint-config-airbnb": "19.0.4", + "eslint-config-airbnb-typescript": "^16.1.4", + "eslint-config-mantine": "1.1.0", + "eslint-plugin-import": "^2.25.4", + "eslint-plugin-jest": "^26.1.3", + "eslint-plugin-jsx-a11y": "^6.5.1", + "eslint-plugin-react": "^7.29.4", + "eslint-plugin-react-hooks": "^4.3.0", + "eslint-plugin-storybook": "^0.5.11", + "eslint-plugin-testing-library": "^5.2.0", + "eslint-plugin-unused-imports": "^2.0.0", + "jest": "^27.5.1", + "prettier": "^2.6.2", + "storybook-addon-turbo-build": "^1.1.0", + "storybook-dark-mode": "^1.0.9", + "ts-jest": "^27.1.4", + "typescript": "4.6.3" + } +} diff --git a/pages/_app.tsx b/pages/_app.tsx index 48877263c..a3a3a6794 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -22,7 +22,7 @@ export default function App(props: AppProps & { colorScheme: ColorScheme }) { return ( <> <Head> - <title>MyHomePage - Your new browser homepage! + Homarr - A homepage for your server! From 99a9aef4a3cd10e30c3055362b9c8a1a042da509 Mon Sep 17 00:00:00 2001 From: WalkxCode Date: Thu, 12 May 2022 13:50:14 +0200 Subject: [PATCH 07/19] feat: Add Contribution guide --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 671b1c846..d7cc2f27f 100644 --- a/README.md +++ b/README.md @@ -75,3 +75,6 @@ _Requirements_: - python http.server: `python -m http.server 7474 --directory out` # 💖 Contributing +You can contribute by [Submitting Bugs](https://github.com/ajnart/homarr/issues/new), [Requesting Features](https://github.com/ajnart/homarr/issues/new), or [Making a pull request](https://github.com/ajnart/homarr/compare)! + +All contributions are highly appreciated. From 8469d1c4775db1ca44a2965a5c9b77886daa4e68 Mon Sep 17 00:00:00 2001 From: Chris <15677803+c00ldude1oo@users.noreply.github.com> Date: Thu, 12 May 2022 02:18:37 -0400 Subject: [PATCH 08/19] Change nginx base to alpine Changed nginx to use alpine instead of debian/ubuntu Image size is 93MB smaller and build time is shorter. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ca782c441..d59093471 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,2 @@ -FROM nginx:1.21.6 -COPY ./out /usr/share/nginx/html \ No newline at end of file +FROM nginx:alpine +COPY ./out /usr/share/nginx/html From e38c4f6be0e7648f1f18a8cc24f83ed77de2cd98 Mon Sep 17 00:00:00 2001 From: Chris <15677803+c00ldude1oo@users.noreply.github.com> Date: Wed, 11 May 2022 23:59:09 -0400 Subject: [PATCH 09/19] Update docker.yml Add cache for yarn and nextjs. `yarn install` takes about 25s off `yarn export` takes about 40s --- .github/workflows/docker.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 846055bdb..9bd9c872f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,11 +15,35 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v3 - - uses: actions/checkout@v3 + - name: Setup + uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Yarn cache + uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: ${{ runner.os }}-yarn- + - name: Nextjs cache + uses: actions/cache@v2 + with: + # See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node + path: | + ~/.npm + ${{ github.workspace }}/.next/cache + # Generate a new cache whenever packages or source files change. + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - run: yarn install --frozen-lockfile - run: yarn export - - uses: actions/cache@v2 + - name: Cache build output + uses: actions/cache@v2 id: restore-build with: path: ./out/ From d5377423b1d7cf65163c33f8ad5e2031d58e645c Mon Sep 17 00:00:00 2001 From: Chris <15677803+c00ldude1oo@users.noreply.github.com> Date: Thu, 12 May 2022 02:05:59 -0400 Subject: [PATCH 10/19] Revert "Change to alpine base image" This reverts commit 49241f56144335f5ac27690c819837f8fe2bb444. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d59093471..ca782c441 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,2 @@ -FROM nginx:alpine -COPY ./out /usr/share/nginx/html +FROM nginx:1.21.6 +COPY ./out /usr/share/nginx/html \ No newline at end of file From 07c088507dd8831ba4e602153a065daddbcc3e02 Mon Sep 17 00:00:00 2001 From: Aj - Thomas <49837342+ajnart@users.noreply.github.com> Date: Thu, 12 May 2022 09:44:51 +0200 Subject: [PATCH 11/19] Update docker.yml --- .github/workflows/docker.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9bd9c872f..591a17f71 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -104,5 +104,9 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 context: . push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} + tags: | + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + # minimal + type=pep440,pattern={{version}} labels: ${{ steps.meta.outputs.labels }} From bcb9669e445123ce2cfa43fbf20e8979d12bf880 Mon Sep 17 00:00:00 2001 From: Aj - Thomas <49837342+ajnart@users.noreply.github.com> Date: Thu, 12 May 2022 09:49:12 +0200 Subject: [PATCH 12/19] Update docker.yml --- .github/workflows/docker.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 591a17f71..89b6c6a9e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -105,8 +105,6 @@ jobs: context: . push: ${{ github.event_name != 'pull_request' }} tags: | - # set latest tag for default branch type=raw,value=latest,enable={{is_default_branch}} - # minimal type=pep440,pattern={{version}} labels: ${{ steps.meta.outputs.labels }} From a1094be40b94d880f1669cb113fce5b802b2680a Mon Sep 17 00:00:00 2001 From: Aj - Thomas <49837342+ajnart@users.noreply.github.com> Date: Thu, 12 May 2022 09:56:05 +0200 Subject: [PATCH 13/19] Update docker.yml --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 89b6c6a9e..1a2a4b9a6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -105,6 +105,6 @@ jobs: context: . push: ${{ github.event_name != 'pull_request' }} tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=pep440,pattern={{version}} + type=raw,value=latest,enable={{is_default_branch}} + type=pep440,pattern={{version}} labels: ${{ steps.meta.outputs.labels }} From 153693b3e8e3ddf905a0e259964fcce8746d9f7f Mon Sep 17 00:00:00 2001 From: Aj - Thomas Date: Thu, 12 May 2022 10:04:05 +0200 Subject: [PATCH 14/19] Trying to fix CI tags --- .github/workflows/docker.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1a2a4b9a6..673115419 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -73,13 +73,8 @@ jobs: ghcr.io/ajnart/mhp # generate Docker tags based on the following events/attributes tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha + type=raw,value=latest,enable={{is_default_branch}} + type=pep440,pattern={{version}} - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx @@ -104,7 +99,5 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 context: . push: ${{ github.event_name != 'pull_request' }} - tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=pep440,pattern={{version}} + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 2c225c308d1d7d709b2356de263ac1841d4ac3f6 Mon Sep 17 00:00:00 2001 From: Walkx Date: Thu, 12 May 2022 14:10:40 +0200 Subject: [PATCH 15/19] feat: Add Back to Top buttons --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index d7cc2f27f..a9adae83c 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ ## ℹ️ About Homarr is a simple and lightweight homepage for your server, that helps you easily access all of your services in one place. + +**[⤴️ Back to Top](#-table-of-contents)** ## ⚡ Installation @@ -73,8 +75,12 @@ _Requirements_: - _Examples:_ - NodeJS serve: `npm i -g serve` or `yarn global add serve` & `serve ./out` - python http.server: `python -m http.server 7474 --directory out` + +**[⤴️ Back to Top](#-table-of-contents)** # 💖 Contributing You can contribute by [Submitting Bugs](https://github.com/ajnart/homarr/issues/new), [Requesting Features](https://github.com/ajnart/homarr/issues/new), or [Making a pull request](https://github.com/ajnart/homarr/compare)! All contributions are highly appreciated. + +**[⤴️ Back to Top](#-table-of-contents)** From bb61a19c1671f7d599aea90d0e76d9355b4702be Mon Sep 17 00:00:00 2001 From: Aj - Thomas Date: Wed, 11 May 2022 21:41:20 +0200 Subject: [PATCH 16/19] Fix error in GitHub CI --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 673115419..971a9f859 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,7 +4,6 @@ on: push: tags: - v* - workflow_dispatch: env: IMAGE_NAME: mhp From f2f2a3df39fdc01e7e52ec038139000869cce77e Mon Sep 17 00:00:00 2001 From: Aj - Thomas Date: Wed, 11 May 2022 21:43:17 +0200 Subject: [PATCH 17/19] Fix error in GitHub CI --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 971a9f859..673115419 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,6 +4,7 @@ on: push: tags: - v* + workflow_dispatch: env: IMAGE_NAME: mhp From cc3e1ce848368c6dfb922083e251fbe45f15e2a7 Mon Sep 17 00:00:00 2001 From: Walkx Date: Thu, 12 May 2022 14:14:48 +0200 Subject: [PATCH 18/19] fix: Fix type error --- components/AppShelf/AddAppShelfItem.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/components/AppShelf/AddAppShelfItem.tsx b/components/AppShelf/AddAppShelfItem.tsx index 6858e1e46..c7d5f1f28 100644 --- a/components/AppShelf/AddAppShelfItem.tsx +++ b/components/AppShelf/AddAppShelfItem.tsx @@ -72,16 +72,7 @@ export default function AddItemShelfItem(props: any) { ); } -function MatchIcon( - name: string, - form: UseForm<{ - type: any; - name: any; - icon: any; - url: any; - apiKey: any; - }> -) { +function MatchIcon(name: string, form: any) { fetch(`https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name.replace(/\s+/g, '-').toLowerCase()}.png`) .then((res) => { if (res.status === 200) { From e3af7629aa11e9b5df1bd4f2d0ec0f537451b6d6 Mon Sep 17 00:00:00 2001 From: Aj - Thomas Date: Thu, 12 May 2022 14:24:15 +0200 Subject: [PATCH 19/19] Rename MyHomePage to Homarr --- .github/workflows/docker.yml | 6 +++--- README.md | 6 +++--- components/AppShelf/AddAppShelfItem.tsx | 8 ++++++-- components/layout/Logo.tsx | 15 ++++++++++----- data/constants.ts | 4 ++-- package.json | 2 +- pages/_app.tsx | 2 +- 7 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 673115419..8bc8a13f5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - IMAGE_NAME: mhp + IMAGE_NAME: homarr jobs: # Push image to GitHub Packages. @@ -69,8 +69,8 @@ jobs: with: # list of Docker images to use as base name for tags images: | - ajnart/mhp - ghcr.io/ajnart/mhp + ajnart/homarr + ghcr.io/ajnart/homarr # generate Docker tags based on the following events/attributes tags: | type=raw,value=latest,enable={{is_default_branch}} diff --git a/README.md b/README.md index a9adae83c..5cabbbdc6 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ _Requirements_: **Standard Docker Install** ```sh -docker run --name homarr -p 7575:80 -d ghcr.io/ajnart/mhp +docker run --name homarr -p 7575:80 -d ghcr.io/ajnart/homarr ``` **Docker Compose** @@ -50,9 +50,9 @@ version: '3' # Homarr - A homepage for your server. # #--------------------------------------------------------------------------------------------# services: - mhp: + homarr: container_name: homarr - image: ghcr.io/ajnart/mhp + image: ghcr.io/ajnart/homarr restart: unless-stopped ports: - '7575:80' diff --git a/components/AppShelf/AddAppShelfItem.tsx b/components/AppShelf/AddAppShelfItem.tsx index c7d5f1f28..37eac451e 100644 --- a/components/AppShelf/AddAppShelfItem.tsx +++ b/components/AppShelf/AddAppShelfItem.tsx @@ -73,7 +73,11 @@ export default function AddItemShelfItem(props: any) { } function MatchIcon(name: string, form: any) { - fetch(`https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name.replace(/\s+/g, '-').toLowerCase()}.png`) + fetch( + `https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name + .replace(/\s+/g, '-') + .toLowerCase()}.png` + ) .then((res) => { if (res.status === 200) { form.setFieldValue('icon', res.url); @@ -85,7 +89,7 @@ function MatchIcon(name: string, form: any) { return false; } - + export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } & any) { const { setOpened } = props; const { addService, config, setConfig } = useConfig(); diff --git a/components/layout/Logo.tsx b/components/layout/Logo.tsx index 9f0b15f59..824688a1b 100644 --- a/components/layout/Logo.tsx +++ b/components/layout/Logo.tsx @@ -2,9 +2,14 @@ import { Text } from '@mantine/core'; import * as React from 'react'; export function Logo({ style }: any) { - return ( - - Homarr - - ); + return ( + + Homarr + + ); } diff --git a/data/constants.ts b/data/constants.ts index 195d0a18d..a01eb18c6 100644 --- a/data/constants.ts +++ b/data/constants.ts @@ -1,2 +1,2 @@ -export const REPO_URL = 'ajnart/myhomepage'; -export const CURRENT_VERSION = 'v0.1.5'; +export const REPO_URL = 'ajnart/homarr'; +export const CURRENT_VERSION = 'v0.1.6'; diff --git a/package.json b/package.json index bcaa57504..e0ee483b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homarr", - "version": "0.1.3", + "version": "0.1.6", "private": "false", "description": "Homarr - A homepage for your server.", "repository": { diff --git a/pages/_app.tsx b/pages/_app.tsx index cd977f0a6..bb54e75df 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -22,7 +22,7 @@ export default function App(props: AppProps & { colorScheme: ColorScheme }) { return ( <> - Homarr - A homepage for your server! + Homarr - A homepage for your server!