diff options
author | Evan Steinkerchner <esteinkerchner@gmail.com> | 2022-03-22 18:22:16 -0400 |
---|---|---|
committer | Evan Steinkerchner <esteinkerchner@gmail.com> | 2022-03-22 18:22:16 -0400 |
commit | 828582351780582558cb0f4a475ef9eeb4dc1299 (patch) | |
tree | ec165822c987924f30e2b8bdcebf3729ec772227 | |
parent | 6f9a74ddcf4833e50df4033ae4291d718af784d9 (diff) | |
download | homer-828582351780582558cb0f4a475ef9eeb4dc1299.tar.gz homer-828582351780582558cb0f4a475ef9eeb4dc1299.tar.zst homer-828582351780582558cb0f4a475ef9eeb4dc1299.zip |
Created new custom home page, moved Getting started to its own page, fixed requirements.txt, added docs/README.md
-rw-r--r-- | docs/README.md | 25 | ||||
-rw-r--r-- | docs/getting_started.md | 70 | ||||
-rw-r--r-- | docs/index.md | 125 | ||||
-rw-r--r-- | docs/overrides/assets/stylesheets/home.css | 81 | ||||
-rw-r--r-- | docs/overrides/home.html | 49 | ||||
-rw-r--r-- | docs/stylesheets/styles.css | 7 | ||||
-rw-r--r-- | mkdocs.yml | 13 | ||||
-rw-r--r-- | requirements.txt | 99 |
8 files changed, 259 insertions, 210 deletions
diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..5fca6ed --- /dev/null +++ b/docs/README.md | |||
@@ -0,0 +1,25 @@ | |||
1 | # Homer docs | ||
2 | |||
3 | Live on github pages: [https://bastienwirtz.github.io/homer/](https://bastienwirtz.github.io/homer/) | ||
4 | |||
5 | ## Local development | ||
6 | |||
7 | ### Install Python dependencies | ||
8 | |||
9 | Homer's documentation is built using [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/). To get started, you'll need Python 3 installed on your machine and set up your local environment. | ||
10 | |||
11 | ```sh | ||
12 | python -m venv venv | ||
13 | source venv/bin/activate | ||
14 | pip install -r requirements.txt | ||
15 | ``` | ||
16 | |||
17 | ### Preview local copy | ||
18 | |||
19 | MkDocs comes with a command-line utility for building and serving the static documentation site every time you save a file. To launch it, run the `serve` command. | ||
20 | |||
21 | ```sh | ||
22 | mkdocs serve | ||
23 | ``` | ||
24 | |||
25 | Your local version of the docs site will now be available at http://localhost:8000/. | ||
diff --git a/docs/getting_started.md b/docs/getting_started.md new file mode 100644 index 0000000..2a123e2 --- /dev/null +++ b/docs/getting_started.md | |||
@@ -0,0 +1,70 @@ | |||
1 | Homer is a full static html/js dashboard, generated from the source in `/src` using webpack. It's meant to be served by an HTTP server, **it will not work if you open dist/index.html directly over file:// protocol**. | ||
2 | |||
3 | See [documentation](docs/configuration.md) for information about the configuration (`assets/config.yml`) options. | ||
4 | |||
5 | ## Using docker | ||
6 | |||
7 | To launch container: | ||
8 | |||
9 | ```sh | ||
10 | docker run -d \ | ||
11 | -p 8080:8080 \ | ||
12 | -v </your/local/assets/>:/www/assets \ | ||
13 | --restart=always \ | ||
14 | b4bz/homer:latest | ||
15 | ``` | ||
16 | |||
17 | Default assets will be automatically installed in the `/www/assets` directory. Use `UID` and/or `GID` env var to change the assets owner (`docker run -e "UID=1000" -e "GID=1000" [...]`). | ||
18 | |||
19 | ## Using docker-compose | ||
20 | |||
21 | The `docker-compose.yml` file must be edited to match your needs. | ||
22 | Set the port and volume (equivalent to `-p` and `-v` arguments): | ||
23 | |||
24 | ```yaml | ||
25 | volumes: | ||
26 | - /your/local/assets/:/www/assets | ||
27 | ports: | ||
28 | - 8080:8080 | ||
29 | ``` | ||
30 | |||
31 | To launch container: | ||
32 | |||
33 | ```sh | ||
34 | cd /path/to/docker-compose.yml | ||
35 | docker-compose up -d | ||
36 | ``` | ||
37 | |||
38 | Default assets will be automatically installed in the `/www/assets` directory. Use `UID` and/or `GID` env var to change the assets owner, also in `docker-compose.yml`: | ||
39 | |||
40 | ```yaml | ||
41 | environment: | ||
42 | - UID=1000 | ||
43 | - GID=1000 | ||
44 | ``` | ||
45 | |||
46 | ## Using the release tarball (prebuilt, ready to use) | ||
47 | |||
48 | Download and extract the latest release (`homer.zip`) from the [release page](https://github.com/bastienwirtz/homer/releases), rename the `assets/config.yml.dist` file to `assets/config.yml`, and put it behind a web server. | ||
49 | |||
50 | ```sh | ||
51 | wget https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip | ||
52 | unzip homer.zip | ||
53 | cd homer | ||
54 | cp assets/config.yml.dist assets/config.yml | ||
55 | npx serve # or python -m http.server 8010 or apache, nginx ... | ||
56 | ``` | ||
57 | |||
58 | ## Build manually | ||
59 | |||
60 | ```sh | ||
61 | # Using yarn (recommended) | ||
62 | yarn install | ||
63 | yarn build | ||
64 | |||
65 | # **OR** Using npm | ||
66 | npm install | ||
67 | npm run build | ||
68 | ``` | ||
69 | |||
70 | Then your dashboard is ready to use in the `/dist` directory. | ||
diff --git a/docs/index.md b/docs/index.md index b7ac66c..a572d90 100644 --- a/docs/index.md +++ b/docs/index.md | |||
@@ -1,122 +1,3 @@ | |||
1 | <div class="centered"> | 1 | --- |
2 | <img width="180" | 2 | template: home.html |
3 | alt="Homer's donut" | 3 | --- |
4 | src="images/logo.png" /> | ||
5 | <h1>Homer</h1> | ||
6 | </div> | ||
7 | |||
8 | <p class="centered"> | ||
9 | A dead simple static <strong>HOM</strong>epage for your serv<strong>ER</strong> to keep | ||
10 | your services on hand, from a simple <code>yaml</code> configuration file. | ||
11 | </p> | ||
12 | |||
13 | <div class="centered"> | ||
14 | <a href="https://opensource.org/licenses/Apache-2.0"> | ||
15 | <img alt="License: Apache 2" | ||
16 | src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /> | ||
17 | </a> | ||
18 | <a href="https://gitter.im/homer-dashboard/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"> | ||
19 | <img alt="Gitter chat" | ||
20 | src="https://badges.gitter.im/homer-dashboard/community.svg" /> | ||
21 | </a> | ||
22 | <a href="https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip"> | ||
23 | <img alt="Download homer static build" | ||
24 | src="https://img.shields.io/badge/Download-homer.zip-orange" /> | ||
25 | </a> | ||
26 | <a href="https://github.com/awesome-selfhosted/awesome-selfhosted"> | ||
27 | <img alt="Awesome" | ||
28 | src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" /> | ||
29 | </a> | ||
30 | </div> | ||
31 | |||
32 | ## Demo | ||
33 | |||
34 | [![Demo](images/screenshot.png)](https://homer-demo.netlify.app) | ||
35 | [Check out the demo!](https://homer-demo.netlify.app) | ||
36 | |||
37 | ## Features | ||
38 | |||
39 | - [yaml](http://yaml.org/) file configuration | ||
40 | - Installable (pwa) | ||
41 | - Search | ||
42 | - Grouping | ||
43 | - Theme customization | ||
44 | - Offline health check | ||
45 | - keyboard shortcuts: | ||
46 | - `/` Start searching. | ||
47 | - `Escape` Stop searching. | ||
48 | - `Enter` Open the first matching result (respects the bookmark's `_target` property). | ||
49 | - `Alt`/`Option` + `Enter` Open the first matching result in a new tab. | ||
50 | |||
51 | ## Getting started | ||
52 | |||
53 | Homer is a full static html/js dashboard, generated from the source in `/src` using webpack. It's meant to be served by an HTTP server, **it will not work if you open dist/index.html directly over file:// protocol**. | ||
54 | |||
55 | See [documentation](docs/configuration.md) for information about the configuration (`assets/config.yml`) options. | ||
56 | |||
57 | ### Using docker | ||
58 | |||
59 | To launch container: | ||
60 | |||
61 | ```sh | ||
62 | docker run -d \ | ||
63 | -p 8080:8080 \ | ||
64 | -v </your/local/assets/>:/www/assets \ | ||
65 | --restart=always \ | ||
66 | b4bz/homer:latest | ||
67 | ``` | ||
68 | |||
69 | Default assets will be automatically installed in the `/www/assets` directory. Use `UID` and/or `GID` env var to change the assets owner (`docker run -e "UID=1000" -e "GID=1000" [...]`). | ||
70 | |||
71 | ### Using docker-compose | ||
72 | |||
73 | The `docker-compose.yml` file must be edited to match your needs. | ||
74 | Set the port and volume (equivalent to `-p` and `-v` arguments): | ||
75 | |||
76 | ```yaml | ||
77 | volumes: | ||
78 | - /your/local/assets/:/www/assets | ||
79 | ports: | ||
80 | - 8080:8080 | ||
81 | ``` | ||
82 | |||
83 | To launch container: | ||
84 | |||
85 | ```sh | ||
86 | cd /path/to/docker-compose.yml | ||
87 | docker-compose up -d | ||
88 | ``` | ||
89 | |||
90 | Default assets will be automatically installed in the `/www/assets` directory. Use `UID` and/or `GID` env var to change the assets owner, also in `docker-compose.yml`: | ||
91 | |||
92 | ```yaml | ||
93 | environment: | ||
94 | - UID=1000 | ||
95 | - GID=1000 | ||
96 | ``` | ||
97 | |||
98 | ### Using the release tarball (prebuilt, ready to use) | ||
99 | |||
100 | Download and extract the latest release (`homer.zip`) from the [release page](https://github.com/bastienwirtz/homer/releases), rename the `assets/config.yml.dist` file to `assets/config.yml`, and put it behind a web server. | ||
101 | |||
102 | ```sh | ||
103 | wget https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip | ||
104 | unzip homer.zip | ||
105 | cd homer | ||
106 | cp assets/config.yml.dist assets/config.yml | ||
107 | npx serve # or python -m http.server 8010 or apache, nginx ... | ||
108 | ``` | ||
109 | |||
110 | ### Build manually | ||
111 | |||
112 | ```sh | ||
113 | # Using yarn (recommended) | ||
114 | yarn install | ||
115 | yarn build | ||
116 | |||
117 | # **OR** Using npm | ||
118 | npm install | ||
119 | npm run build | ||
120 | ``` | ||
121 | |||
122 | Then your dashboard is ready to use in the `/dist` directory. | ||
diff --git a/docs/overrides/assets/stylesheets/home.css b/docs/overrides/assets/stylesheets/home.css new file mode 100644 index 0000000..76f585b --- /dev/null +++ b/docs/overrides/assets/stylesheets/home.css | |||
@@ -0,0 +1,81 @@ | |||
1 | .hero { | ||
2 | padding: 32px 2.8rem; | ||
3 | color: var(--md-primary-bg-color); | ||
4 | background: linear-gradient( | ||
5 | to bottom, | ||
6 | var(--md-primary-fg-color), | ||
7 | hsla(160deg, 47%, 55%, 1) 99%, | ||
8 | #fff 99% | ||
9 | ); | ||
10 | } | ||
11 | |||
12 | .hero-container { | ||
13 | display: flex; | ||
14 | flex-direction: row; | ||
15 | align-items: center; | ||
16 | justify-content: space-between; | ||
17 | padding: 1rem 0; | ||
18 | } | ||
19 | |||
20 | .hero-content { | ||
21 | flex: 0 0 40%; | ||
22 | } | ||
23 | |||
24 | .hero-title { | ||
25 | height: 4rem; | ||
26 | display: flex; | ||
27 | flex-direction: row; | ||
28 | align-items: center; | ||
29 | } | ||
30 | |||
31 | .hero-title > img { | ||
32 | max-height: 100%; | ||
33 | width: auto; | ||
34 | } | ||
35 | |||
36 | .hero-title > h1 { | ||
37 | margin: 0 0 0 0.5rem; | ||
38 | font-size: 4rem; | ||
39 | line-height: 1; | ||
40 | color: currentColor; | ||
41 | font-weight: 700; | ||
42 | } | ||
43 | |||
44 | .hero-image { | ||
45 | width: 17rem; | ||
46 | height: auto; | ||
47 | flex: 0 0 50%; | ||
48 | transform: perspective(300px) rotate3D(0, 1, 0, -5deg); | ||
49 | box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2); | ||
50 | } | ||
51 | |||
52 | .hero .md-button { | ||
53 | margin-top: 0.5rem; | ||
54 | margin-right: 0.5rem; | ||
55 | color: var(--md-primary-bg-color); | ||
56 | } | ||
57 | |||
58 | .hero .md-button-primary { | ||
59 | background-color: var(--md-primary-bg-color); | ||
60 | color: hsla(280deg, 37%, 48%, 1); | ||
61 | border-color: var(--md-primary-bg-color); | ||
62 | } | ||
63 | |||
64 | .hero .md-button:focus, | ||
65 | .hero .md-button:hover { | ||
66 | background-color: var(--md-accent-fg-color); | ||
67 | color: var(--md-default-bg-color); | ||
68 | border-color: var(--md-accent-fg-color); | ||
69 | } | ||
70 | |||
71 | .md-header { | ||
72 | position: initial; | ||
73 | } | ||
74 | |||
75 | .md-main__inner { | ||
76 | margin: 0; | ||
77 | } | ||
78 | |||
79 | .md-content { | ||
80 | display: none; | ||
81 | } | ||
diff --git a/docs/overrides/home.html b/docs/overrides/home.html new file mode 100644 index 0000000..81ef4aa --- /dev/null +++ b/docs/overrides/home.html | |||
@@ -0,0 +1,49 @@ | |||
1 | {% extends "base.html" %} | ||
2 | |||
3 | {% block extrahead %} | ||
4 | <link | ||
5 | rel="stylesheet" | ||
6 | href="{{ 'overrides/assets/stylesheets/home.css' | url }}" /> | ||
7 | {% endblock %} | ||
8 | |||
9 | {% block tabs %} | ||
10 | {{ super() }} | ||
11 | |||
12 | <section class="hero"> | ||
13 | <div class="md-grid md-typeset hero-container"> | ||
14 | <div class="hero-content"> | ||
15 | <div class="hero-title"> | ||
16 | <img src="images/logo.png" draggable="false" /> | ||
17 | <h1>Homer</h1> | ||
18 | </div> | ||
19 | <p> | ||
20 | A dead simple static <strong>HOM</strong>epage for your serv<strong>ER</strong> | ||
21 | to keep your services on hand, from a simple <code>yaml</code> configuration file. | ||
22 | </p> | ||
23 | <a | ||
24 | href="{{ page.next_page.url | url }}" | ||
25 | title="{{ page.next_page.title | striptags }}" | ||
26 | class="md-button md-button-primary" | ||
27 | > | ||
28 | Get started | ||
29 | </a> | ||
30 | <a | ||
31 | href="{{ config.repo_url }}" | ||
32 | title="{{ lang.t('source.link.title') }}" | ||
33 | class="md-button" | ||
34 | > | ||
35 | Go to GitHub | ||
36 | </a> | ||
37 | </div> | ||
38 | <img class="hero-image" src="images/screenshot.png" draggable="false" /> | ||
39 | </div> | ||
40 | </section> | ||
41 | |||
42 | <div> | ||
43 | TODO! | ||
44 | </div> | ||
45 | {% endblock %} | ||
46 | |||
47 | {% block site_nav %}{% endblock %} | ||
48 | {% block content %}{% endblock %} | ||
49 | {% block footer %}{% endblock %} | ||
diff --git a/docs/stylesheets/styles.css b/docs/stylesheets/styles.css deleted file mode 100644 index e1e1a3e..0000000 --- a/docs/stylesheets/styles.css +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | .centered { | ||
2 | text-align: center; | ||
3 | } | ||
4 | |||
5 | .bold { | ||
6 | font-weight: bold; | ||
7 | } \ No newline at end of file | ||
@@ -1,22 +1,21 @@ | |||
1 | # Project information | 1 | # Project information |
2 | site_name: Homer | 2 | site_name: Homer |
3 | site_url: https://bastienwirtz.github.io/homer/ | 3 | site_url: https://bastienwirtz.github.io/ |
4 | 4 | ||
5 | # Repository | 5 | # Repository |
6 | repo_name: bastienwirtz/homer | 6 | repo_name: bastienwirtz/homer |
7 | repo_url: https://github.com/bastienwirtz/homer | 7 | repo_url: https://github.com/bastienwirtz/homer |
8 | edit_uri: "" | 8 | edit_uri: "" |
9 | 9 | ||
10 | # Stylesheet | ||
11 | extra_css: | ||
12 | - stylesheets/styles.css | ||
13 | |||
14 | # Theme | 10 | # Theme |
15 | theme: | 11 | theme: |
12 | favicon: images/logo.png | ||
16 | logo: images/logo.png | 13 | logo: images/logo.png |
17 | name: material | 14 | name: material |
15 | custom_dir: docs/overrides/ | ||
18 | icon: | 16 | icon: |
19 | repo: fontawesome/brands/github | 17 | repo: fontawesome/brands/github |
18 | language: en | ||
20 | palette: | 19 | palette: |
21 | - media: "(prefers-color-scheme: light)" | 20 | - media: "(prefers-color-scheme: light)" |
22 | scheme: default | 21 | scheme: default |
@@ -42,6 +41,9 @@ theme: | |||
42 | - search.share | 41 | - search.share |
43 | - search.suggest | 42 | - search.suggest |
44 | - toc.follow | 43 | - toc.follow |
44 | # Don't include MkDocs' JavaScript | ||
45 | include_search_page: false | ||
46 | search_index_only: true | ||
45 | 47 | ||
46 | # Copyright - name for footer text | 48 | # Copyright - name for footer text |
47 | copyright: Homer dashboard | 49 | copyright: Homer dashboard |
@@ -76,6 +78,7 @@ markdown_extensions: | |||
76 | # Page tree | 78 | # Page tree |
77 | nav: | 79 | nav: |
78 | - Home: index.md | 80 | - Home: index.md |
81 | - Getting started: getting_started.md | ||
79 | - Configuration: configuration.md | 82 | - Configuration: configuration.md |
80 | - Custom services: customservices.md | 83 | - Custom services: customservices.md |
81 | - Tips & tricks: tips-and-tricks.md | 84 | - Tips & tricks: tips-and-tricks.md |
diff --git a/requirements.txt b/requirements.txt index 568942b..078b3dc 100644 --- a/requirements.txt +++ b/requirements.txt | |||
@@ -1,76 +1,23 @@ | |||
1 | attrs==19.3.0 | 1 | bracex==2.2.1 |
2 | Automat==0.8.0 | 2 | click==8.0.4 |
3 | blinker==1.4 | 3 | ghp-import==2.0.2 |
4 | certifi==2019.11.28 | 4 | importlib-metadata==4.11.3 |
5 | chardet==3.0.4 | 5 | Jinja2==3.0.3 |
6 | Click==7.0 | 6 | Markdown==3.3.6 |
7 | cloud-init==21.4 | 7 | MarkupSafe==2.1.1 |
8 | colorama==0.4.3 | 8 | mergedeep==1.3.4 |
9 | command-not-found==0.3 | 9 | mkdocs==1.2.3 |
10 | configobj==5.0.6 | 10 | mkdocs-awesome-pages-plugin==2.7.0 |
11 | constantly==15.1.0 | 11 | mkdocs-material==8.2.5 |
12 | cryptography==2.8 | 12 | mkdocs-material-extensions==1.0.3 |
13 | cupshelpers==1.0 | 13 | packaging==21.3 |
14 | dbus-python==1.2.16 | 14 | Pygments==2.11.2 |
15 | defer==1.0.6 | 15 | pymdown-extensions==9.3 |
16 | distro==1.4.0 | 16 | pyparsing==3.0.7 |
17 | distro-info===0.23ubuntu1 | 17 | python-dateutil==2.8.2 |
18 | entrypoints==0.3 | 18 | PyYAML==6.0 |
19 | httplib2==0.14.0 | 19 | pyyaml-env-tag==0.1 |
20 | hyperlink==19.0.0 | 20 | six==1.16.0 |
21 | idna==2.8 | 21 | watchdog==2.1.6 |
22 | importlib-metadata==1.5.0 | 22 | wcmatch==8.3 |
23 | incremental==16.10.1 | 23 | zipp==3.7.0 |
24 | Jinja2==2.10.1 | ||
25 | jsonpatch==1.22 | ||
26 | jsonpointer==2.0 | ||
27 | jsonschema==3.2.0 | ||
28 | keyring==18.0.1 | ||
29 | language-selector==0.1 | ||
30 | launchpadlib==1.10.13 | ||
31 | lazr.restfulclient==0.14.2 | ||
32 | lazr.uri==1.0.3 | ||
33 | macaroonbakery==1.3.1 | ||
34 | MarkupSafe==1.1.0 | ||
35 | more-itertools==4.2.0 | ||
36 | netifaces==0.10.4 | ||
37 | oauthlib==3.1.0 | ||
38 | pexpect==4.6.0 | ||
39 | powerline-shell==0.7.0 | ||
40 | protobuf==3.6.1 | ||
41 | psutil==5.5.1 | ||
42 | pyasn1==0.4.2 | ||
43 | pyasn1-modules==0.2.1 | ||
44 | pycairo==1.16.2 | ||
45 | pycups==1.9.73 | ||
46 | PyGObject==3.36.0 | ||
47 | PyHamcrest==1.9.0 | ||
48 | PyJWT==1.7.1 | ||
49 | pymacaroons==0.13.0 | ||
50 | PyNaCl==1.3.0 | ||
51 | pyOpenSSL==19.0.0 | ||
52 | pyRFC3339==1.1 | ||
53 | pyrsistent==0.15.5 | ||
54 | pyserial==3.4 | ||
55 | python-apt==2.0.0+ubuntu0.20.4.6 | ||
56 | python-debian===0.1.36ubuntu1 | ||
57 | pytz==2019.3 | ||
58 | pyxdg==0.26 | ||
59 | PyYAML==5.3.1 | ||
60 | requests==2.22.0 | ||
61 | requests-unixsocket==0.2.0 | ||
62 | SecretStorage==2.3.1 | ||
63 | service-identity==18.1.0 | ||
64 | simplejson==3.16.0 | ||
65 | six==1.14.0 | ||
66 | sos==4.2 | ||
67 | ssh-import-id==5.10 | ||
68 | systemd-python==234 | ||
69 | Twisted==18.9.0 | ||
70 | ubuntu-advantage-tools==27.5 | ||
71 | ufw==0.36 | ||
72 | unattended-upgrades==0.1 | ||
73 | urllib3==1.25.8 | ||
74 | wadllib==1.3.3 | ||
75 | zipp==1.0.0 | ||
76 | zope.interface==4.7.1 | ||