add mkdocs

This commit is contained in:
Ben Phelps 2023-09-29 21:01:11 +03:00
parent b215843b26
commit 47765ee05e
144 changed files with 4219 additions and 3 deletions

42
docs/more/development.md Normal file
View file

@ -0,0 +1,42 @@
---
title: Development
description: Homepage Development
---
## Development Overview
First, clone the homepage repository.
For installing NPM packages, this project uses [pnpm](https://pnpm.io/) (and so should you!):
```bash
pnpm install
```
Start the development server:
```bash
pnpm dev
```
Open [http://localhost:3000](http://localhost:3000) to start.
This is a [Next.js](https://nextjs.org/) application, see their documentation for more information.
## Code Linting
Once dependencies have been installed you can lint your code with
```bash
pnpm lint
```
## Service Widget Guidelines
To ensure cohesiveness of various widgets, the following should be used as a guide for developing new widgets:
- Please only submit widgets that have been requested and have at least 5 'up-votes'
- Widgets should be only one row of blocks
- Widgets should be no more than 4 blocks wide
- Minimize the number of API calls
- Avoid the use of custom proxy unless absolutely necessary

6
docs/more/index.md Normal file
View file

@ -0,0 +1,6 @@
---
title: More
description: More homepage resources and guides.
---
Here you'll find resources and guides for Homepage, troubleshooting tips, and more.

14
docs/more/translations.md Normal file
View file

@ -0,0 +1,14 @@
---
title: Translations
description: Contributing Translations
---
Homepage is developed in English, most other supported languages are provided via Google Translate. When a i18n key is not found, the fallback language is English.
## Support Translations
If you'd like to lend a hand in translating Homepage into more languages, or to improve existing translations, the process is very simple.
Everything can be done from a simple to use web interface here: https://hosted.weblate.org/projects/homepage/homepage/
When creating a new language, it can take 5 to 10 minutes before you'll see translatable strings added, but the process _is_ automatic. Once the strings are added, you can then start translating them.

View file

@ -0,0 +1,64 @@
---
title: Troubleshooting
description: Basic Troubleshooting
hide:
- navigation
---
## General Troubleshooting Tips
- For API errors, clicking the "API Error Information" button in the widget will usually show some helpful information as to whether the issue is reaching the service host, an authentication issue, etc.
- Check config/logs/homepage.log, on docker simply e.g. `docker logs homepage`. This may provide some insight into the reason for an error.
- Check the browser error console, this can also sometimes provide useful information.
- Consider setting the `ENV` variable `LOG_LEVEL` to `debug`.
## Service Widget Errors
All service widgets work essentially the same, that is, homepage makes a proxied call to an API made available by that service. The majority of the time widgets don't work it is a configuration issue. Of course, sometimes things do break. Some basic steps to try:
1. Ensure that you follow the rule mentioned on https://gethomepage.dev/en/configs/service-widgets/. **Unless otherwise noted, URLs should not end with a / or other API path. Each widget will handle the path on its own.**. This is very important as including a trailing slash can result in an error.
2. Verify the homepage installation can connect to the IP address or host you are using for the widget `url`. This is most simply achieved by pinging the server from the homepage machine, in Docker this means _from inside the container_ itself, e.g.:
```
docker exec homepage ping SERVICEIPORDOMAIN
```
If your homepage install (container) cannot reach the service then you need to figure out why, for example in Docker this can mean putting the two containers on the same network, checking firewall issues, etc.
3. If you have verified that homepage can in fact reach the service then you can also check the API output using e.g. `curl`, which is often helpful if you do need to file a bug report. Again, depending on your networking setup this may need to be run from _inside the container_ as IP / hostname resolution can differ inside vs outside.
_Note: `curl` is not installed in the base image by default but can be added inside the container with `apk add curl`._
The exact API endpoints and authentication vary of course, but in many cases instructions can be found by searching the web or if you feel comfortable looking at the homepage source code (e.g. `src/widgets/{widget}/widget.js`).
It is out of the scope of this to go into full detail about how to , but an example for PiHole would be:
```
curl -L -k http://PIHOLEIPORHOST/admin/api.php
```
Or for AdGuard:
```
curl -L -k -u 'username:password' http://ADGUARDIPORHOST/control/stats
```
Or for Portainer:
```
curl -L -k -H 'X-Api-Key:YOURKEY' 'https://PORTAINERIPORHOST:PORT/api/endpoints/2/docker/containers/json'
```
Sonarr:
```
curl -L -k 'http://SONARRIPORHOST:PORT/api/v3/queue?apikey=YOURAPIKEY'
```
This will return some data which may reveal an issue causing a true bug in the service widget.
## Missing custom icons
If, after correctly adding and mapping your custom icons via the [Icons](../configs/services.md#icons) instructions, you are still unable to see your icons please try recreating your container.