diff options
-rw-r--r-- | .dockerignore | 3 | ||||
-rw-r--r-- | Dockerfile | 6 | ||||
-rw-r--r-- | Dockerfile.arm32v7 | 3 | ||||
-rw-r--r-- | Dockerfile.arm64v8 | 3 | ||||
-rw-r--r-- | README.md | 16 | ||||
-rw-r--r-- | docs/configuration.md | 2 | ||||
-rw-r--r-- | docs/tips-and-tricks.md | 2 | ||||
-rw-r--r-- | entrypoint.sh | 15 | ||||
-rw-r--r-- | public/assets/config.yml.dist (renamed from public/config.yml.dist) | 0 | ||||
-rw-r--r-- | public/assets/config.yml.dist.sample-sui (renamed from public/config.yml.dist.sample-sui) | 0 | ||||
-rw-r--r-- | src/App.vue | 2 |
11 files changed, 29 insertions, 23 deletions
diff --git a/.dockerignore b/.dockerignore index 6d01701..461e021 100644 --- a/.dockerignore +++ b/.dockerignore | |||
@@ -2,4 +2,5 @@ assets/* | |||
2 | dockerfile | 2 | dockerfile |
3 | *.md | 3 | *.md |
4 | .git | 4 | .git |
5 | screenshot.png \ No newline at end of file | 5 | screenshot.png |
6 | node_modules | ||
@@ -19,12 +19,12 @@ ENV UID 911 | |||
19 | ENV PORT 8080 | 19 | ENV PORT 8080 |
20 | 20 | ||
21 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ | 21 | RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ |
22 | apk add -U darkhttpd | 22 | apk add -U --no-cache su-exec darkhttpd |
23 | 23 | ||
24 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | 24 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ |
25 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
25 | COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh | 26 | COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh |
26 | 27 | ||
27 | USER ${USER} | ||
28 | EXPOSE ${PORT} | 28 | EXPOSE ${PORT} |
29 | VOLUME [ "/www/config.yml", "/www/assets" ] | 29 | VOLUME /www/assets |
30 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] | 30 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |
diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index ef01d1f..ba9c95d 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 | |||
@@ -32,9 +32,10 @@ RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} & | |||
32 | rm /usr/bin/qemu-arm-static | 32 | rm /usr/bin/qemu-arm-static |
33 | 33 | ||
34 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | 34 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ |
35 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
35 | COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh | 36 | COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh |
36 | 37 | ||
37 | USER ${USER} | 38 | USER ${USER} |
38 | EXPOSE ${PORT} | 39 | EXPOSE ${PORT} |
39 | VOLUME [ "/www/config.yml", "/www/assets" ] | 40 | VOLUME /www/assets |
40 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] | 41 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |
diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index 7899027..4e307d8 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 | |||
@@ -32,9 +32,10 @@ RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} & | |||
32 | rm /usr/bin/qemu-aarch64-static | 32 | rm /usr/bin/qemu-aarch64-static |
33 | 33 | ||
34 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ | 34 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ |
35 | COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist/assets /www/default-assets | ||
35 | COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh | 36 | COPY --chown=${USER}:${GROUP} entrypoint.sh /entrypoint.sh |
36 | 37 | ||
37 | USER ${USER} | 38 | USER ${USER} |
38 | EXPOSE ${PORT} | 39 | EXPOSE ${PORT} |
39 | VOLUME [ "/www/config.yml", "/www/assets" ] | 40 | VOLUME /www/assets |
40 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] | 41 | ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |
@@ -38,31 +38,25 @@ ervices on hand, from a simple `yaml` configuration file. | |||
38 | 38 | ||
39 | 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**. | 39 | 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**. |
40 | 40 | ||
41 | For more information about the `config.yml` file see [configuration](docs/configuration.md) the section. | 41 | See [documentation](docs/configuration.md) for information about the configuration (`assets/config.yml`) options. |
42 | 42 | ||
43 | ### Using docker | 43 | ### Using docker |
44 | 44 | ||
45 | ```sh | 45 | ```sh |
46 | docker run -p 8080:8080 -v /your/local/config.yml:/www/config.yml -v /your/local/assets/:/www/assets b4bz/homer:latest | 46 | docker run -p 8080:8080 -v /your/local/assets/:/www/assets b4bz/homer:latest |
47 | ``` | 47 | ``` |
48 | 48 | ||
49 | As a bind mount is used here, docker will not copy the initial content of the `assets` directory to the mounted directory. | 49 | 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" [...]`). |
50 | You can initialise your assets directory with the content provided in this repository | ||
51 | ```sh | ||
52 | cp -r /public/assets/* /your/local/assets/ | ||
53 | ``` | ||
54 | |||
55 | **Alternatively** if you just want to provide images/icons without customizing the other files (app manifest & pwa icons), you can mount a custom directory in the `www` directory and use it in your `config.yml` for icons path. | ||
56 | 50 | ||
57 | ### Using the release tarball (prebuilt, ready to use) | 51 | ### Using the release tarball (prebuilt, ready to use) |
58 | 52 | ||
59 | Download and extract the latest the latest release (`homer.zip`) from the [release page](https://github.com/bastienwirtz/homer/releases), rename the `config.yml.dist` file to `config.yml`, and put it behind a webserver. | 53 | Download and extract the latest 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 webserver. |
60 | 54 | ||
61 | ```sh | 55 | ```sh |
62 | wget https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip | 56 | wget https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip |
63 | unzip homer.zip | 57 | unzip homer.zip |
64 | cd homer | 58 | cd homer |
65 | cp config.yml.dist config.yml | 59 | cp assets/config.yml.dist assets/config.yml |
66 | npx serve # or python -m http.server 8010 or apache, nginx ... | 60 | npx serve # or python -m http.server 8010 or apache, nginx ... |
67 | ``` | 61 | ``` |
68 | 62 | ||
diff --git a/docs/configuration.md b/docs/configuration.md index a2469ed..409db34 100644 --- a/docs/configuration.md +++ b/docs/configuration.md | |||
@@ -1,6 +1,6 @@ | |||
1 | ## Configuration | 1 | ## Configuration |
2 | 2 | ||
3 | Title, icons, links, colors, and services can be configured in the `config.yml` file (located in project root directory once built, or in the `public/` directory in developement mode), using [yaml](http://yaml.org/) format. | 3 | Title, icons, links, colors, and services can be configured in the `config.yml` file (located in `/assets` directory once built, or in the `public/assets` directory in developement mode), using [yaml](http://yaml.org/) format. |
4 | 4 | ||
5 | ```yaml | 5 | ```yaml |
6 | --- | 6 | --- |
diff --git a/docs/tips-and-tricks.md b/docs/tips-and-tricks.md index 632b62d..fda670d 100644 --- a/docs/tips-and-tricks.md +++ b/docs/tips-and-tricks.md | |||
@@ -74,7 +74,7 @@ Great if you have a lot of services or a lot of tags! | |||
74 | 74 | ||
75 | Homer doesn't yet provide a way to edit your configuration from inside Homer itself, but that doesnt mean it cant be done! | 75 | Homer doesn't yet provide a way to edit your configuration from inside Homer itself, but that doesnt mean it cant be done! |
76 | 76 | ||
77 | You can setup and use [Code-Server](https://github.com/cdr/code-server) to edit your config.yml file from anywhere! | 77 | You can setup and use [Code-Server](https://github.com/cdr/code-server) to edit your `config.yml` file from anywhere! |
78 | 78 | ||
79 | If you're running Homer in docker, you can setup a Code-Server container and pass your homer config directory into it. | 79 | If you're running Homer in docker, you can setup a Code-Server container and pass your homer config directory into it. |
80 | Simply pass your homer config directory as and extra -v parameter to your code-server container: | 80 | Simply pass your homer config directory as and extra -v parameter to your code-server container: |
diff --git a/entrypoint.sh b/entrypoint.sh index 7623322..dd55cdb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh | |||
@@ -1,6 +1,15 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | yes n | cp -i /www/config.yml.dist /www/config.yml | 3 | # Ensure default assets are present. |
4 | while true; do echo n; done | cp -Ri /app/dist/www/assets /www/assets 2>/dev/null | 4 | while true; do echo n; done | cp -Ri /www/default-assets/* /www/assets/ &> /dev/null |
5 | 5 | ||
6 | darkhttpd /www/ --no-listing --port $PORT | 6 | # Ensure compatibility with previous version (config.yml was in the root directory) |
7 | if [ -f "/www/config.yml" ]; then | ||
8 | yes n | cp -i /www/config.yml /www/assets/ &> /dev/null | ||
9 | fi | ||
10 | |||
11 | # Install default config if no one is available. | ||
12 | yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml &> /dev/null | ||
13 | |||
14 | chown -R $UID:$GID /www/assets/* | ||
15 | exec su-exec $USER:$GROUP darkhttpd /www/ --no-listing --port "$PORT" | ||
diff --git a/public/config.yml.dist b/public/assets/config.yml.dist index 6be66e1..6be66e1 100644 --- a/public/config.yml.dist +++ b/public/assets/config.yml.dist | |||
diff --git a/public/config.yml.dist.sample-sui b/public/assets/config.yml.dist.sample-sui index 71eaef0..71eaef0 100644 --- a/public/config.yml.dist.sample-sui +++ b/public/assets/config.yml.dist.sample-sui | |||
diff --git a/src/App.vue b/src/App.vue index fec020c..b13b98f 100644 --- a/src/App.vue +++ b/src/App.vue | |||
@@ -156,7 +156,7 @@ export default { | |||
156 | document.title = `${this.config.title} | ${this.config.subtitle}`; | 156 | document.title = `${this.config.title} | ${this.config.subtitle}`; |
157 | }, | 157 | }, |
158 | methods: { | 158 | methods: { |
159 | getConfig: function (path = "config.yml") { | 159 | getConfig: function (path = "assets/config.yml") { |
160 | return fetch(path).then((response) => { | 160 | return fetch(path).then((response) => { |
161 | if (!response.ok) { | 161 | if (!response.ok) { |
162 | throw Error(response.statusText); | 162 | throw Error(response.statusText); |