Compare commits

...

52 Commits

Author SHA1 Message Date
Amir Raminfar b066433933 chore: release v5.4.2 2023-11-14 13:06:04 -08:00
Amir Raminfar 52dc1ff2d1 fix: fixes collapse button to not cover the menu on left. see #2500 (#2501) 2023-11-14 13:05:01 -08:00
Suresh Ramakrishnaiah 10ea7cfb51 docs: update authentication.md (#2492) 2023-11-13 18:41:25 -08:00
renovate[bot] eea9813f84 fix(deps): update all non-major dependencies (#2498)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-14 00:52:30 +00:00
Amir Raminfar 8ac79c707c chore: updates go version for CI (#2499) 2023-11-14 00:48:28 +00:00
Amir Raminfar 4637b49075 chore: fixes golang version 2023-11-13 14:29:21 -08:00
renovate[bot] 147902f191 fix(deps): update all non-major dependencies (#2493)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-13 14:28:59 -08:00
Amir Raminfar f83b5c948e fix: converts HSL colors OKLCH with DaisyUI v4 (#2497) 2023-11-13 14:00:35 -08:00
Amir Raminfar 542c895812 chore: fixes padding 2023-11-11 14:08:11 -08:00
Amir Raminfar d14d140cb6 chore(test): adds test for simple mode (#2491) 2023-11-11 22:04:45 +00:00
Amir Raminfar be74d48de7 fix: improves the alignment of drop downs 2023-11-11 13:48:14 -08:00
Amir Raminfar f8a9396f6e chore(test): adds test for proxy mode (#2490) 2023-11-11 13:22:06 -08:00
Amir Raminfar 009529f20e chore: release v5.4.1 2023-11-11 06:41:45 -08:00
Amir Raminfar 63f16ef575 fix: fixes proxy pass not finding user (#2488) 2023-11-11 06:37:06 -08:00
Amir Raminfar 9de964dac4 chore: release v5.4.0 2023-11-10 15:20:41 -08:00
Amir Raminfar 1ff0b5541d chore: fixes incorrect version in doc 2023-11-10 13:47:30 -08:00
Amir Raminfar 55326cdd41 docs: adds sponsor section (#2487) 2023-11-10 21:08:32 +00:00
Amir Raminfar 9fa4911aec feat: list of releases can now be seen at the top (#2480) 2023-11-10 19:45:47 +00:00
Amir Raminfar 7dae54df26 chore: fixes golang version 2023-11-10 09:04:30 -08:00
renovate[bot] 1b101e62da chore(deps): update all non-major dependencies (#2485)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-10 09:04:07 -08:00
Amir Raminfar 5c5cd17fb6 chore: removes netlify files 2023-11-10 08:46:27 -08:00
Amir Raminfar c697be659b docs: adds docs for custom content (#2483) 2023-11-08 14:58:48 -08:00
Amir Raminfar d469066c07 feat: moves user's name and email to dropdown (#2479) 2023-11-07 11:07:34 -08:00
Amir Raminfar 4380681812 feat: supports default avatar when gravatar is missing (#2478) 2023-11-07 09:26:48 -08:00
Amir Raminfar 75cf2f045a chore: release v5.3.1 2023-11-06 15:29:56 -08:00
Amir Raminfar ab5807b3ae chore: fixes go.mod 2023-11-06 15:24:50 -08:00
renovate[bot] fe0f163090 chore(deps): update all non-major dependencies (#2477)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-06 15:23:04 -08:00
Amir Raminfar 38d1f99387 fix: reduces padding on mobile (#2476) 2023-11-06 21:59:53 +00:00
Amir Raminfar 11298e83b0 chore: release v5.3.0 2023-11-06 12:39:29 -08:00
Amir Raminfar 32de313c27 feat: supports having custom content with markdown (#2466) 2023-11-06 12:39:11 -08:00
renovate[bot] 1e1c64d6e7 fix(deps): update all non-major dependencies (#2474)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-06 01:13:20 +00:00
Amir Raminfar 0f02de2070 chore: release v5.2.3 2023-11-05 12:30:54 -08:00
Amir Raminfar bb085affb2 fix: removes fetch request when user does not exist (#2473) 2023-11-05 12:29:44 -08:00
Amir Raminfar 1d022b51b5 fix: fixes bad icon (#2472) 2023-11-04 20:53:24 +00:00
Amir Raminfar eb31b46e6f fix: fixes a potential rare edge case that log entry has no payload. see #2451. (#2471) 2023-11-04 13:51:29 -07:00
Amir Raminfar 066541288a docs: updates readme (#2470) 2023-11-03 21:10:21 +00:00
renovate[bot] eba7d92ba6 fix(deps): update all non-major dependencies (#2468)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-03 17:44:40 +00:00
Jacek Dobosz 579ae12920 docs: installation on podman (#2467) 2023-11-03 05:41:48 -07:00
Amir Raminfar ba9531dc59 chore: release v5.2.2 2023-11-01 12:36:12 -07:00
Amir Raminfar c4cc233720 chore: updates go.mod 2023-11-01 12:13:47 -07:00
Amir Raminfar 6c1f59c7e3 feat: removes request analytics on page load (#2464) 2023-11-01 12:13:17 -07:00
Amir Raminfar ebc02900b6 feat: prints local docker engine error 2023-10-31 16:02:58 -07:00
Amir Raminfar 4e5f7ae1cf chore: release v5.2.1 2023-10-31 15:11:58 -07:00
Amir Raminfar 55f076382e fix: fixes not being able to create /data dir (#2463) 2023-10-31 15:11:15 -07:00
Amir Raminfar cae8f2740d feat: warns against using username and password 2023-10-31 12:45:30 -07:00
Amir Raminfar c75b5a598d chore: fixes typo 2023-10-31 12:33:43 -07:00
Amir Raminfar 701f16fcc2 chore: release v5.2.0 2023-10-31 12:33:12 -07:00
Amir Raminfar 49d53ce255 chore(docs): updates gh pages to have simple auth 2023-10-31 12:30:39 -07:00
Amir Raminfar e57d038221 fix: changes mime type for fetching between to application/x-jsonl. see #2458 (#2461) 2023-10-31 11:22:27 -07:00
Amir Raminfar c74384d012 fix: fixes blank name for proxy mode 2023-10-31 11:15:50 -07:00
Amir Raminfar 5a068133bf fix: fixes forward proxy bug not working (#2460) 2023-10-30 22:42:40 +00:00
Amir Raminfar e85a4aefa2 feat: adds support for user.yml from disk (#2455) 2023-10-30 12:20:00 -07:00
78 changed files with 2025 additions and 1135 deletions
+2 -1
View File
@@ -31,7 +31,8 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x
check-latest: true
- name: Checkout code
uses: actions/checkout@v4
- name: Run Go Tests with Coverage
+2 -1
View File
@@ -54,7 +54,8 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x
check-latest: true
- name: Checkout code
uses: actions/checkout@v4
- name: Run Go Tests with Coverage
+3 -2
View File
@@ -22,7 +22,7 @@ COPY public ./public
# Build assets
RUN pnpm build
FROM --platform=$BUILDPLATFORM golang:1.21.3-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.21.4-alpine AS builder
RUN apk add --no-cache ca-certificates && mkdir /dozzle
@@ -46,11 +46,12 @@ ARG TARGETOS TARGETARCH
# Build binary
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=$TAG" -o dozzle
RUN mkdir /data
FROM scratch
ENV PATH /bin
COPY --from=builder /data /data
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /dozzle/dozzle /dozzle
+40 -145
View File
@@ -15,71 +15,27 @@ https://user-images.githubusercontent.com/260667/227634771-9ebbe381-16a8-465a-b2
- Search logs using regex 🔦
- Small memory footprint 🏎
- Split screen for viewing multiple logs
- Download logs easy
- Download logs easily
- Live stats with memory and CPU usage
- Authentication with username and password 🚨
- Multi-user authentication with support for proxy forward authorization 🚨
Dozzle should work for most. It has been tested with hundreds of containers. However, it doesn't support offline searching. Products like [Loggly](https://www.loggly.com), [Papertrail](https://papertrailapp.com) or [Kibana](https://www.elastic.co/products/kibana) are more suited for full search capabilities.
Dozzle has been tested with hundreds of containers. However, it doesn't support offline searching. Products like [Loggly](https://www.loggly.com), [Papertrail](https://papertrailapp.com) or [Kibana](https://www.elastic.co/products/kibana) are more suited for full search capabilities.
Dozzle doesn't cost any money and aims to focus on real-time debugging.
## Getting Started
## Getting Dozzle
Dozzle is a very small Docker container (4 MB compressed). Pull the latest release from the index:
Dozzle is a small container (4 MB compressed). Pull the latest release with:
$ docker pull amir20/dozzle:latest
## Using Dozzle
### Running Dozzle
The simplest way to use dozzle is to run the docker container. Also, mount the Docker Unix socket with `--volume` to `/var/run/docker.sock`:
$ docker run --name dozzle -d --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:8080 amir20/dozzle:latest
Dozzle will be available at [http://localhost:8888/](http://localhost:8888/). You can change `-p 8888:8080` to any port. For example, if you want to view dozzle over port 4040 then you would do `-p 4040:8080`.
Dozzle will be available at [http://localhost:8888/](http://localhost:8888/).
### Connecting with Docker compose
version: "3"
services:
dozzle:
container_name: dozzle
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 9999:8080
### Connecting to remote hosts
Dozzle supports connecting to multiple remote hosts via `tcp://` using TLS or without. Appropriate certs need to be mounted for Dozzle to be able to successfully connect. At this point, `ssh://` is not supported because Dozzle docker image does not ship with any ssh clients.
To configure remote hosts, `--remote-host` or `DOZZLE_REMOTE_HOST` need to provided and the `pem` files need to be mounted to `/cert` directory. The `/cert` directory expects to have `/certs/{ca,cert,key}.pem` or `/certs/{host}/{ca,cert,key}.pem` in case of multiple hosts.
Below are examples of using `--remote-host` via CLI:
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/certs:/certs -p 8080:8080 amir20/dozzle --remote-host tcp://167.99.1.1:2376
Multiple `--remote-host` flags can be used to specify multiple hosts.
Or to use compose:
version: "3"
services:
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /path/to/certs:/certs
ports:
- 8080:8080
environment:
DOZZLE_REMOTE_HOST: tcp://167.99.1.1:2376,tcp://167.99.1.2:2376
You need to make sure appropriate certs are provided in `/certs/167.99.1.1/{ca,cert,key}.pem` and `/certs/167.99.1.2/{ca,cert,key}.pem` for both hosts to work.
### Adding health check
Dozzle doesn't enable healthcheck by default as it adds extra CPU usage. `healthcheck` can be enabled manually.
Here is the Docker Compose file:
version: "3"
services:
@@ -90,49 +46,50 @@ Dozzle doesn't enable healthcheck by default as it adds extra CPU usage. `health
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8080:8080
environment:
DOZZLE_LEVEL: trace
healthcheck:
test: [ "CMD", "/dozzle", "healthcheck" ]
interval: 3s
timeout: 30s
retries: 5
start_period: 30s
#### Security
For advanced options like [authentication](https://dozzle.dev/guide/authentication), [remote hosts](https://dozzle.dev/guide/remote-hosts) or common [questions](https://dozzle.dev/guide/faq) see documentation at [dozzle.dev](https://dozzle.dev/guide/getting-started).
You can control the device Dozzle binds to by passing `--addr` parameter. For example,
## Technical Details
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:1224 amir20/dozzle:latest --addr localhost:1224
Dozzle users automatic API negotiation which works with most Docker configurations. Dozzle also works with [Colima](https://github.com/abiosoft/colima) and [Podman](https://podman.io/).
will bind to `localhost` on port `1224`. You can then use a reverse proxy to control who can see dozzle.
### Installation on podman
If you wish to restrict the containers shown you can pass the `--filter` parameter. For example,
By default Podman doesn't have a background process but you can enable this for Dozzle to work.
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:1224 amir20/dozzle:latest --filter name=foo
Verify first if your podman installation has enabled remote socket:
this would then only allow you to view containers with a name starting with "foo". You can use other filters like `status` as well, please check the official docker [command line docs](https://docs.docker.com/engine/reference/commandline/ps/#filtering) for available filters. Multiple `--filter` arguments can be provided.
```
podman info
```
#### Authentication
When you get under the key remote socket output like this, its already enabled:
Dozzle supports a very simple authentication out of the box with just username and password. You should deploy using SSL to keep the credentials safe. See configuration to use `--username` and `--password`. You can also use [docker secrets](https://docs.docker.com/engine/swarm/secrets/) `--usernamefile` and `--passwordfile`.
```
remoteSocket:
exists: true
path: /run/user/1000/podman/podman.sock
```
#### Changing base URL
If it's not enabled please follow [this tutorial](https://github.com/containers/podman/blob/main/docs/tutorials/socket_activation.md) to enable it.
Dozzle by default mounts to "/". If you want to control the base path you can use the `--base` option. For example, if you want to mount at "/foobar",
then you can override by using `--base /foobar`. See env variables below for using `DOZZLE_BASE` to change this.
Once you have the podman remote socket you can run Dozzle on podman.
$ docker run --volume=/var/run/docker.sock:/var/run/docker.sock -p 8080:8080 amir20/dozzle:latest --base /foobar
```
podman run --volume=/run/user/1000/podman/podman.sock:/var/run/docker.sock -d -p 8080:8080 amir20/dozzle:latest
```
Dozzle will be available at [http://localhost:8080/foobar/](http://localhost:8080/foobar/).
## Security
#### Analytics collected
Dozzle supports file based authentication and forward proxy like [Authelia](https://www.authelia.com/). These are documented at https://dozzle.dev/guide/authentication.
## Analytics collected
Dozzle collects anonymous user configurations using Google Analytics. Why? Dozzle is an open source project with no funding. As a result, there is no time to do user studies of Dozzle. Analytics is collected to prioritize features and fixes based on how people use Dozzle. This data is completely public and can be viewed live using [ Data Studio dashboard](https://datastudio.google.com/s/naeIu0MiWsY).
If you do not want to be tracked at all, see the `--no-analytics` flag below.
#### Environment variables and configuration
## Environment variables and configuration
Dozzle follows the [12-factor](https://12factor.net/) model. Configurations can use the CLI flags or environment variables. The table below outlines all supported options and their respective env vars.
@@ -150,77 +107,15 @@ Dozzle follows the [12-factor](https://12factor.net/) model. Configurations can
| `--no-analytics` | `DOZZLE_NO_ANALYTICS` | false |
| `--remote-host` | `DOZZLE_REMOTE_HOST` | |
## Troubleshooting and FAQs
## Support
<details>
<summary>I installed Dozzle, but logs are slow or they never load. Help!</summary>
There are many ways you can support Dozzle:
Dozzle uses Server Sent Events (SSE) which connects to a server using a HTTP stream without closing the connection. If any proxy tries to buffer this connection, then Dozzle never receives the data and hangs forever waiting for the reverse proxy to flush the buffer. Since version `1.23.0`, Dozzle sends the `X-Accel-Buffering: no` header which should stop reverse proxies buffering. However, some proxies may ignore this header. In those cases, you need to explicitly disable any buffering.
- Use it! Write about it! Star it! If you love Dozzle, drop me a line and tell me what you love.
- Blog about Dozzle to spread the word. If you are good at writing send PRs to improve the documentation at [dozzle.dev](https://dozzle.dev/)
- Sponsor my work at https://www.buymeacoffee.com/amirraminfar
Below is an example with nginx and using `proxy_pass` to disable buffering.
```
server {
...
location / {
proxy_pass http://<dozzle.container.ip.address>:8080;
}
location /api {
proxy_pass http://<dozzle.container.ip.address>:8080;
proxy_buffering off;
proxy_cache off;
}
}
```
</details>
<details>
<summary>What data does Dozzle collect?</summary>
Dozzle does collect some analytics. Analytics is anonymous usage tracking of the features which are used the most. See the section above on how to disable any analytic collection.
In the browser, Dozzle has a [strict](https://github.com/amir20/dozzle/blob/master/web/csp.go#L9) Content Security Policy which only allows the following policies:
- Allow connect to `api.github.com` to fetch most recent version.
- Only allow `<script>` and `<style>` files from `self`
Dozzle opens all links with `rel="noopener"`.
</details>
<details>
<summary>We have tools that uses Dozzle when a new container is created. How can I get a direct link to a container by name?</summary>
Dozzle has a [special route](https://github.com/amir20/dozzle/blob/master/assets/pages/Show.vue) that can be used to search containers by name and then forward to that container. For example, if you have a container with name `"foo.bar"` and id `abc123`, you can send your users to `/show?name=foo.bar` which will be forwarded to `/container/abc123`.
</details>
<details>
<summary>I installed Dozzle but memory consumption doesn't show up!</summary>
_This is an issue specific to ARM devices_
Dozzle uses the Docker API to gather information about the containers' memory usage. If the memory usage is not showing up, then it is likely that the Docker API is not returning the memory usage.
You can verify this by running `docker info`, and you should see the following:
```
WARNING: No memory limit support
WARNING: No swap limit support
```
In this case, you'll need to add the following line to your `/boot/cmdline.txt` file and reboot your device.
```
cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
```
</details>
<a href="https://www.buymeacoffee.com/amirraminfar" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
## License
@@ -232,6 +127,6 @@ To Build and test locally:
1. Install [NodeJs](https://nodejs.org/en/download/) and [pnpm](https://pnpm.io/installation).
2. Install [Go](https://go.dev/doc/install).
3. Install [reflex](https://github.com/cespare/reflex) with `go get -u github.com/cespare/reflex` outside of dozzle.
3. Install [reflex](https://github.com/cespare/reflex) with `go install github.com/cespare/reflex@latest`.
4. Install node modules `pnpm install`.
5. Do `pnpm dev`
+46 -39
View File
@@ -26,7 +26,7 @@ declare global {
const computedInject: typeof import('@vueuse/core')['computedInject']
const computedWithControl: typeof import('@vueuse/core')['computedWithControl']
const config: typeof import('./stores/config')['default']
const containerContext: typeof import('./composables/containerContext')['containerContext']
const containerContext: typeof import('./composable/containerContext')['containerContext']
const controlledComputed: typeof import('@vueuse/core')['controlledComputed']
const controlledRef: typeof import('@vueuse/core')['controlledRef']
const createApp: typeof import('vue')['createApp']
@@ -56,14 +56,14 @@ declare global {
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const getDeep: typeof import('./utils/index')['getDeep']
const globalShowPopup: typeof import('./composables/popup')['globalShowPopup']
const globalShowPopup: typeof import('./composable/popup')['globalShowPopup']
const h: typeof import('vue')['h']
const hourStyle: typeof import('./stores/settings')['hourStyle']
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
const inject: typeof import('vue')['inject']
const injectLocal: typeof import('@vueuse/core')['injectLocal']
const isDefined: typeof import('@vueuse/core')['isDefined']
const isMobile: typeof import('./composables/media')['isMobile']
const isMobile: typeof import('./composable/media')['isMobile']
const isObject: typeof import('./utils/index')['isObject']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
@@ -102,10 +102,10 @@ declare global {
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
const persistentVisibleKeys: typeof import('./composables/storage')['persistentVisibleKeys']
const pinnedContainers: typeof import('./composables/storage')['pinnedContainers']
const persistentVisibleKeys: typeof import('./composable/storage')['persistentVisibleKeys']
const pinnedContainers: typeof import('./composable/storage')['pinnedContainers']
const provide: typeof import('vue')['provide']
const provideContainerContext: typeof import('./composables/containerContext')['provideContainerContext']
const provideContainerContext: typeof import('./composable/containerContext')['provideContainerContext']
const provideLocal: typeof import('@vueuse/core')['provideLocal']
const reactify: typeof import('@vueuse/core')['reactify']
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
@@ -120,14 +120,15 @@ declare global {
const refDefault: typeof import('@vueuse/core')['refDefault']
const refThrottled: typeof import('@vueuse/core')['refThrottled']
const refWithControl: typeof import('@vueuse/core')['refWithControl']
const releases: typeof import('./stores/releases')['default']
const resolveComponent: typeof import('vue')['resolveComponent']
const resolveRef: typeof import('@vueuse/core')['resolveRef']
const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
const search: typeof import('./stores/settings')['search']
const sessionHost: typeof import('./composables/storage')['sessionHost']
const sessionHost: typeof import('./composable/storage')['sessionHost']
const setActivePinia: typeof import('pinia')['setActivePinia']
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
const setTitle: typeof import('./composables/title')['setTitle']
const setTitle: typeof import('./composable/title')['setTitle']
const settings: typeof import('./stores/settings')['settings']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
@@ -188,10 +189,11 @@ declare global {
const useCeil: typeof import('@vueuse/math')['useCeil']
const useClamp: typeof import('@vueuse/math')['useClamp']
const useClipboard: typeof import('@vueuse/core')['useClipboard']
const useClipboardItems: typeof import('@vueuse/core')['useClipboardItems']
const useCloned: typeof import('@vueuse/core')['useCloned']
const useColorMode: typeof import('@vueuse/core')['useColorMode']
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
const useContainerContext: typeof import('./composables/containerContext')['useContainerContext']
const useContainerContext: typeof import('./composable/containerContext')['useContainerContext']
const useContainerStore: typeof import('./stores/container')['useContainerStore']
const useCounter: typeof import('@vueuse/core')['useCounter']
const useCssModule: typeof import('vue')['useCssModule']
@@ -245,7 +247,7 @@ declare global {
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
const useLink: typeof import('vue-router')['useLink']
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
const useLogStream: typeof import('./composables/eventsource')['useLogStream']
const useLogStream: typeof import('./composable/eventsource')['useLogStream']
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
const useMath: typeof import('@vueuse/math')['useMath']
@@ -284,6 +286,7 @@ declare global {
const useProjection: typeof import('@vueuse/math')['useProjection']
const useRafFn: typeof import('@vueuse/core')['useRafFn']
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
const useReleases: typeof import('./stores/releases')['useReleases']
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
const useRound: typeof import('@vueuse/math')['useRound']
const useRoute: typeof import('vue-router')['useRoute']
@@ -293,7 +296,7 @@ declare global {
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
const useScroll: typeof import('@vueuse/core')['useScroll']
const useScrollLock: typeof import('@vueuse/core')['useScrollLock']
const useSearchFilter: typeof import('./composables/search')['useSearchFilter']
const useSearchFilter: typeof import('./composable/search')['useSearchFilter']
const useSeoMeta: typeof import('@vueuse/head')['useSeoMeta']
const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
const useShare: typeof import('@vueuse/core')['useShare']
@@ -323,7 +326,7 @@ declare global {
const useTitle: typeof import('@vueuse/core')['useTitle']
const useToNumber: typeof import('@vueuse/core')['useToNumber']
const useToString: typeof import('@vueuse/core')['useToString']
const useToast: typeof import('./composables/toast')['useToast']
const useToast: typeof import('./composable/toast')['useToast']
const useToggle: typeof import('@vueuse/core')['useToggle']
const useTransition: typeof import('@vueuse/core')['useTransition']
const useTrunc: typeof import('@vueuse/math')['useTrunc']
@@ -333,7 +336,7 @@ declare global {
const useVModels: typeof import('@vueuse/core')['useVModels']
const useVibrate: typeof import('@vueuse/core')['useVibrate']
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
const useVisibleFilter: typeof import('./composables/visible')['useVisibleFilter']
const useVisibleFilter: typeof import('./composable/visible')['useVisibleFilter']
const useWakeLock: typeof import('@vueuse/core')['useWakeLock']
const useWebNotification: typeof import('@vueuse/core')['useWebNotification']
const useWebSocket: typeof import('@vueuse/core')['useWebSocket']
@@ -390,7 +393,7 @@ declare module 'vue' {
readonly computedInject: UnwrapRef<typeof import('@vueuse/core')['computedInject']>
readonly computedWithControl: UnwrapRef<typeof import('@vueuse/core')['computedWithControl']>
readonly config: UnwrapRef<typeof import('./stores/config')['default']>
readonly containerContext: UnwrapRef<typeof import('./composables/containerContext')['containerContext']>
readonly containerContext: UnwrapRef<typeof import('./composable/containerContext')['containerContext']>
readonly controlledComputed: UnwrapRef<typeof import('@vueuse/core')['controlledComputed']>
readonly controlledRef: UnwrapRef<typeof import('@vueuse/core')['controlledRef']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
@@ -418,14 +421,14 @@ declare module 'vue' {
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getDeep: UnwrapRef<typeof import('./utils/index')['getDeep']>
readonly globalShowPopup: UnwrapRef<typeof import('./composables/popup')['globalShowPopup']>
readonly globalShowPopup: UnwrapRef<typeof import('./composable/popup')['globalShowPopup']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly hourStyle: UnwrapRef<typeof import('./stores/settings')['hourStyle']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly injectLocal: UnwrapRef<typeof import('@vueuse/core')['injectLocal']>
readonly isDefined: UnwrapRef<typeof import('@vueuse/core')['isDefined']>
readonly isMobile: UnwrapRef<typeof import('./composables/media')['isMobile']>
readonly isMobile: UnwrapRef<typeof import('./composable/media')['isMobile']>
readonly isObject: UnwrapRef<typeof import('./utils/index')['isObject']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
@@ -461,10 +464,10 @@ declare module 'vue' {
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
readonly persistentVisibleKeys: UnwrapRef<typeof import('./composables/storage')['persistentVisibleKeys']>
readonly pinnedContainers: UnwrapRef<typeof import('./composables/storage')['pinnedContainers']>
readonly persistentVisibleKeys: UnwrapRef<typeof import('./composable/storage')['persistentVisibleKeys']>
readonly pinnedContainers: UnwrapRef<typeof import('./composable/storage')['pinnedContainers']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly provideContainerContext: UnwrapRef<typeof import('./composables/containerContext')['provideContainerContext']>
readonly provideContainerContext: UnwrapRef<typeof import('./composable/containerContext')['provideContainerContext']>
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
readonly reactify: UnwrapRef<typeof import('@vueuse/core')['reactify']>
readonly reactifyObject: UnwrapRef<typeof import('@vueuse/core')['reactifyObject']>
@@ -483,10 +486,10 @@ declare module 'vue' {
readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
readonly search: UnwrapRef<typeof import('./stores/settings')['search']>
readonly sessionHost: UnwrapRef<typeof import('./composables/storage')['sessionHost']>
readonly sessionHost: UnwrapRef<typeof import('./composable/storage')['sessionHost']>
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
readonly setTitle: UnwrapRef<typeof import('./composables/title')['setTitle']>
readonly setTitle: UnwrapRef<typeof import('./composable/title')['setTitle']>
readonly settings: UnwrapRef<typeof import('./stores/settings')['settings']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
@@ -543,10 +546,11 @@ declare module 'vue' {
readonly useBrowserLocation: UnwrapRef<typeof import('@vueuse/core')['useBrowserLocation']>
readonly useCached: UnwrapRef<typeof import('@vueuse/core')['useCached']>
readonly useClipboard: UnwrapRef<typeof import('@vueuse/core')['useClipboard']>
readonly useClipboardItems: UnwrapRef<typeof import('@vueuse/core')['useClipboardItems']>
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
readonly useContainerContext: UnwrapRef<typeof import('./composables/containerContext')['useContainerContext']>
readonly useContainerContext: UnwrapRef<typeof import('./composable/containerContext')['useContainerContext']>
readonly useContainerStore: UnwrapRef<typeof import('./stores/container')['useContainerStore']>
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
@@ -599,7 +603,7 @@ declare module 'vue' {
readonly useLastChanged: UnwrapRef<typeof import('@vueuse/core')['useLastChanged']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useLocalStorage: UnwrapRef<typeof import('@vueuse/core')['useLocalStorage']>
readonly useLogStream: UnwrapRef<typeof import('./composables/eventsource')['useLogStream']>
readonly useLogStream: UnwrapRef<typeof import('./composable/eventsource')['useLogStream']>
readonly useMagicKeys: UnwrapRef<typeof import('@vueuse/core')['useMagicKeys']>
readonly useManualRefHistory: UnwrapRef<typeof import('@vueuse/core')['useManualRefHistory']>
readonly useMediaControls: UnwrapRef<typeof import('@vueuse/core')['useMediaControls']>
@@ -633,6 +637,7 @@ declare module 'vue' {
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
readonly useRefHistory: UnwrapRef<typeof import('@vueuse/core')['useRefHistory']>
readonly useReleases: UnwrapRef<typeof import('./stores/releases')['useReleases']>
readonly useResizeObserver: UnwrapRef<typeof import('@vueuse/core')['useResizeObserver']>
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
@@ -641,7 +646,7 @@ declare module 'vue' {
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
readonly useScroll: UnwrapRef<typeof import('@vueuse/core')['useScroll']>
readonly useScrollLock: UnwrapRef<typeof import('@vueuse/core')['useScrollLock']>
readonly useSearchFilter: UnwrapRef<typeof import('./composables/search')['useSearchFilter']>
readonly useSearchFilter: UnwrapRef<typeof import('./composable/search')['useSearchFilter']>
readonly useSeoMeta: UnwrapRef<typeof import('@vueuse/head')['useSeoMeta']>
readonly useSessionStorage: UnwrapRef<typeof import('@vueuse/core')['useSessionStorage']>
readonly useShare: UnwrapRef<typeof import('@vueuse/core')['useShare']>
@@ -670,7 +675,7 @@ declare module 'vue' {
readonly useTitle: UnwrapRef<typeof import('@vueuse/core')['useTitle']>
readonly useToNumber: UnwrapRef<typeof import('@vueuse/core')['useToNumber']>
readonly useToString: UnwrapRef<typeof import('@vueuse/core')['useToString']>
readonly useToast: UnwrapRef<typeof import('./composables/toast')['useToast']>
readonly useToast: UnwrapRef<typeof import('./composable/toast')['useToast']>
readonly useToggle: UnwrapRef<typeof import('@vueuse/core')['useToggle']>
readonly useTransition: UnwrapRef<typeof import('@vueuse/core')['useTransition']>
readonly useUrlSearchParams: UnwrapRef<typeof import('@vueuse/core')['useUrlSearchParams']>
@@ -679,7 +684,7 @@ declare module 'vue' {
readonly useVModels: UnwrapRef<typeof import('@vueuse/core')['useVModels']>
readonly useVibrate: UnwrapRef<typeof import('@vueuse/core')['useVibrate']>
readonly useVirtualList: UnwrapRef<typeof import('@vueuse/core')['useVirtualList']>
readonly useVisibleFilter: UnwrapRef<typeof import('./composables/visible')['useVisibleFilter']>
readonly useVisibleFilter: UnwrapRef<typeof import('./composable/visible')['useVisibleFilter']>
readonly useWakeLock: UnwrapRef<typeof import('@vueuse/core')['useWakeLock']>
readonly useWebNotification: UnwrapRef<typeof import('@vueuse/core')['useWebNotification']>
readonly useWebSocket: UnwrapRef<typeof import('@vueuse/core')['useWebSocket']>
@@ -730,7 +735,7 @@ declare module '@vue/runtime-core' {
readonly computedInject: UnwrapRef<typeof import('@vueuse/core')['computedInject']>
readonly computedWithControl: UnwrapRef<typeof import('@vueuse/core')['computedWithControl']>
readonly config: UnwrapRef<typeof import('./stores/config')['default']>
readonly containerContext: UnwrapRef<typeof import('./composables/containerContext')['containerContext']>
readonly containerContext: UnwrapRef<typeof import('./composable/containerContext')['containerContext']>
readonly controlledComputed: UnwrapRef<typeof import('@vueuse/core')['controlledComputed']>
readonly controlledRef: UnwrapRef<typeof import('@vueuse/core')['controlledRef']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
@@ -758,14 +763,14 @@ declare module '@vue/runtime-core' {
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getDeep: UnwrapRef<typeof import('./utils/index')['getDeep']>
readonly globalShowPopup: UnwrapRef<typeof import('./composables/popup')['globalShowPopup']>
readonly globalShowPopup: UnwrapRef<typeof import('./composable/popup')['globalShowPopup']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly hourStyle: UnwrapRef<typeof import('./stores/settings')['hourStyle']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly injectLocal: UnwrapRef<typeof import('@vueuse/core')['injectLocal']>
readonly isDefined: UnwrapRef<typeof import('@vueuse/core')['isDefined']>
readonly isMobile: UnwrapRef<typeof import('./composables/media')['isMobile']>
readonly isMobile: UnwrapRef<typeof import('./composable/media')['isMobile']>
readonly isObject: UnwrapRef<typeof import('./utils/index')['isObject']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
@@ -801,10 +806,10 @@ declare module '@vue/runtime-core' {
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
readonly persistentVisibleKeys: UnwrapRef<typeof import('./composables/storage')['persistentVisibleKeys']>
readonly pinnedContainers: UnwrapRef<typeof import('./composables/storage')['pinnedContainers']>
readonly persistentVisibleKeys: UnwrapRef<typeof import('./composable/storage')['persistentVisibleKeys']>
readonly pinnedContainers: UnwrapRef<typeof import('./composable/storage')['pinnedContainers']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly provideContainerContext: UnwrapRef<typeof import('./composables/containerContext')['provideContainerContext']>
readonly provideContainerContext: UnwrapRef<typeof import('./composable/containerContext')['provideContainerContext']>
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
readonly reactify: UnwrapRef<typeof import('@vueuse/core')['reactify']>
readonly reactifyObject: UnwrapRef<typeof import('@vueuse/core')['reactifyObject']>
@@ -823,10 +828,10 @@ declare module '@vue/runtime-core' {
readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
readonly search: UnwrapRef<typeof import('./stores/settings')['search']>
readonly sessionHost: UnwrapRef<typeof import('./composables/storage')['sessionHost']>
readonly sessionHost: UnwrapRef<typeof import('./composable/storage')['sessionHost']>
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
readonly setTitle: UnwrapRef<typeof import('./composables/title')['setTitle']>
readonly setTitle: UnwrapRef<typeof import('./composable/title')['setTitle']>
readonly settings: UnwrapRef<typeof import('./stores/settings')['settings']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
@@ -883,10 +888,11 @@ declare module '@vue/runtime-core' {
readonly useBrowserLocation: UnwrapRef<typeof import('@vueuse/core')['useBrowserLocation']>
readonly useCached: UnwrapRef<typeof import('@vueuse/core')['useCached']>
readonly useClipboard: UnwrapRef<typeof import('@vueuse/core')['useClipboard']>
readonly useClipboardItems: UnwrapRef<typeof import('@vueuse/core')['useClipboardItems']>
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
readonly useContainerContext: UnwrapRef<typeof import('./composables/containerContext')['useContainerContext']>
readonly useContainerContext: UnwrapRef<typeof import('./composable/containerContext')['useContainerContext']>
readonly useContainerStore: UnwrapRef<typeof import('./stores/container')['useContainerStore']>
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
@@ -939,7 +945,7 @@ declare module '@vue/runtime-core' {
readonly useLastChanged: UnwrapRef<typeof import('@vueuse/core')['useLastChanged']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useLocalStorage: UnwrapRef<typeof import('@vueuse/core')['useLocalStorage']>
readonly useLogStream: UnwrapRef<typeof import('./composables/eventsource')['useLogStream']>
readonly useLogStream: UnwrapRef<typeof import('./composable/eventsource')['useLogStream']>
readonly useMagicKeys: UnwrapRef<typeof import('@vueuse/core')['useMagicKeys']>
readonly useManualRefHistory: UnwrapRef<typeof import('@vueuse/core')['useManualRefHistory']>
readonly useMediaControls: UnwrapRef<typeof import('@vueuse/core')['useMediaControls']>
@@ -973,6 +979,7 @@ declare module '@vue/runtime-core' {
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
readonly useRefHistory: UnwrapRef<typeof import('@vueuse/core')['useRefHistory']>
readonly useReleases: UnwrapRef<typeof import('./stores/releases')['useReleases']>
readonly useResizeObserver: UnwrapRef<typeof import('@vueuse/core')['useResizeObserver']>
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
@@ -981,7 +988,7 @@ declare module '@vue/runtime-core' {
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
readonly useScroll: UnwrapRef<typeof import('@vueuse/core')['useScroll']>
readonly useScrollLock: UnwrapRef<typeof import('@vueuse/core')['useScrollLock']>
readonly useSearchFilter: UnwrapRef<typeof import('./composables/search')['useSearchFilter']>
readonly useSearchFilter: UnwrapRef<typeof import('./composable/search')['useSearchFilter']>
readonly useSeoMeta: UnwrapRef<typeof import('@vueuse/head')['useSeoMeta']>
readonly useSessionStorage: UnwrapRef<typeof import('@vueuse/core')['useSessionStorage']>
readonly useShare: UnwrapRef<typeof import('@vueuse/core')['useShare']>
@@ -1010,7 +1017,7 @@ declare module '@vue/runtime-core' {
readonly useTitle: UnwrapRef<typeof import('@vueuse/core')['useTitle']>
readonly useToNumber: UnwrapRef<typeof import('@vueuse/core')['useToNumber']>
readonly useToString: UnwrapRef<typeof import('@vueuse/core')['useToString']>
readonly useToast: UnwrapRef<typeof import('./composables/toast')['useToast']>
readonly useToast: UnwrapRef<typeof import('./composable/toast')['useToast']>
readonly useToggle: UnwrapRef<typeof import('@vueuse/core')['useToggle']>
readonly useTransition: UnwrapRef<typeof import('@vueuse/core')['useTransition']>
readonly useUrlSearchParams: UnwrapRef<typeof import('@vueuse/core')['useUrlSearchParams']>
@@ -1019,7 +1026,7 @@ declare module '@vue/runtime-core' {
readonly useVModels: UnwrapRef<typeof import('@vueuse/core')['useVModels']>
readonly useVibrate: UnwrapRef<typeof import('@vueuse/core')['useVibrate']>
readonly useVirtualList: UnwrapRef<typeof import('@vueuse/core')['useVirtualList']>
readonly useVisibleFilter: UnwrapRef<typeof import('./composables/visible')['useVisibleFilter']>
readonly useVisibleFilter: UnwrapRef<typeof import('./composable/visible')['useVisibleFilter']>
readonly useWakeLock: UnwrapRef<typeof import('@vueuse/core')['useWakeLock']>
readonly useWebNotification: UnwrapRef<typeof import('@vueuse/core')['useWebNotification']>
readonly useWebSocket: UnwrapRef<typeof import('@vueuse/core')['useWebSocket']>
+6 -1
View File
@@ -29,12 +29,14 @@ declare module 'vue' {
DistanceTime: typeof import('./components/common/DistanceTime.vue')['default']
DockerEventLogItem: typeof import('./components/LogViewer/DockerEventLogItem.vue')['default']
Dropdown: typeof import('./components/common/Dropdown.vue')['default']
DropdownMenu: typeof import('./components/common/DropdownMenu.vue')['default']
FieldList: typeof import('./components/LogViewer/FieldList.vue')['default']
FuzzySearchModal: typeof import('./components/FuzzySearchModal.vue')['default']
'Ic:sharpFindInPage': typeof import('~icons/ic/sharp-find-in-page')['default']
'Ic:sharpKeyboardReturn': typeof import('~icons/ic/sharp-keyboard-return')['default']
InfiniteLoader: typeof import('./components/InfiniteLoader.vue')['default']
KeyShortcut: typeof import('./components/common/KeyShortcut.vue')['default']
Links: typeof import('./components/Links.vue')['default']
LogActionsToolbar: typeof import('./components/LogViewer/LogActionsToolbar.vue')['default']
LogContainer: typeof import('./components/LogViewer/LogContainer.vue')['default']
LogDate: typeof import('./components/LogViewer/LogDate.vue')['default']
@@ -43,7 +45,9 @@ declare module 'vue' {
LogStd: typeof import('./components/LogViewer/LogStd.vue')['default']
LogViewer: typeof import('./components/LogViewer/LogViewer.vue')['default']
LogViewerWithSource: typeof import('./components/LogViewer/LogViewerWithSource.vue')['default']
'Mdi:announcement': typeof import('~icons/mdi/announcement')['default']
'Mdi:arrowUp': typeof import('~icons/mdi/arrow-up')['default']
'Mdi:check': typeof import('~icons/mdi/check')['default']
'Mdi:chevronDoubleDown': typeof import('~icons/mdi/chevron-double-down')['default']
'Mdi:chevronLeft': typeof import('~icons/mdi/chevron-left')['default']
'Mdi:chevronRight': typeof import('~icons/mdi/chevron-right')['default']
@@ -53,15 +57,16 @@ declare module 'vue' {
'Mdi:keyboardEsc': typeof import('~icons/mdi/keyboard-esc')['default']
'Mdi:logout': typeof import('~icons/mdi/logout')['default']
'Mdi:magnify': typeof import('~icons/mdi/magnify')['default']
'MdiLight:check': typeof import('~icons/mdi/check')['default']
MobileMenu: typeof import('./components/common/MobileMenu.vue')['default']
'Octicon:container24': typeof import('~icons/octicon/container24')['default']
'Octicon:download24': typeof import('~icons/octicon/download24')['default']
'Octicon:trash24': typeof import('~icons/octicon/trash24')['default']
PageWithLinks: typeof import('./components/PageWithLinks.vue')['default']
'Ph:command': typeof import('~icons/ph/command')['default']
'Ph:computerTower': typeof import('~icons/ph/computer-tower')['default']
'Ph:controlBold': typeof import('~icons/ph/control-bold')['default']
Popup: typeof import('./components/Popup.vue')['default']
Releases: typeof import('./components/Releases.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
ScrollableView: typeof import('./components/ScrollableView.vue')['default']
+63
View File
@@ -0,0 +1,63 @@
<template>
<div class="flex items-center justify-end gap-4">
<template v-if="config.pages">
<router-link
:to="{ name: 'content-id', params: { id: page.id } }"
:title="page.title"
v-for="page in config.pages"
:key="page.id"
class="link-primary"
>
{{ page.title }}
</router-link>
</template>
<dropdown class="dropdown-end" @closed="latestTag = latest?.tag ?? config.version">
<template #trigger>
<mdi:announcement class="h-6 w-6 -rotate-12" />
<span
class="absolute right-px top-0 h-2 w-2 rounded-full bg-red"
v-if="hasUpdate && latestTag != latest?.tag"
></span>
</template>
<template #content>
<div class="w-72">
<releases />
</div>
</template>
</dropdown>
<dropdown class="dropdown-end" v-if="config.user">
<template #trigger>
<img class="h-6 w-6 max-w-none rounded-full p-px ring-1 ring-base-content/60" :src="config.user.avatar" />
</template>
<template #content>
<div class="p-2">
<div class="font-bold">
{{ config.user.name }}
</div>
<div class="text-sm font-light">
{{ config.user.email }}
</div>
</div>
<ul class="menu mt-4 p-0">
<li v-if="config.authProvider === 'simple'">
<button @click.prevent="logout()" class="p-2 text-primary">{{ $t("button.logout") }}</button>
</li>
</ul>
</template>
</dropdown>
</div>
</template>
<script lang="ts" setup>
async function logout() {
await fetch(withBase("/api/token"), {
method: "DELETE",
});
location.reload();
}
const { hasUpdate, latest } = useReleases();
const latestTag = useStorage("DOZZLE_LATEST_TAG", config.version);
</script>
@@ -5,11 +5,11 @@ import EventSource, { sources } from "eventsourcemock";
import LogEventSource from "./LogEventSource.vue";
import LogViewer from "./LogViewer.vue";
import { settings } from "@/stores/settings";
import { useSearchFilter } from "@/composables/search";
import { useSearchFilter } from "@/composable/search";
import { vi, describe, expect, beforeEach, test, afterEach } from "vitest";
import { computed, nextTick } from "vue";
import { createRouter, createWebHistory } from "vue-router";
import { containerContext } from "@/composables/containerContext";
import { containerContext } from "@/composable/containerContext";
vi.mock("@/stores/config", () => ({
__esModule: true,
+2 -2
View File
@@ -7,7 +7,7 @@
:class="{ 'border border-secondary': toRaw(item) === toRaw(lastSelectedItem) }"
>
<a
class="jump-context tooltip-primary tooltip tooltip-right"
class="jump-context tooltip tooltip-right tooltip-primary"
v-if="isSearching()"
data-tip="Jump to Context"
@click="handleJumpLineSelected($event, item)"
@@ -78,7 +78,7 @@ watch(
}
.jump-context {
@apply mr-2 flex items-center font-sans text-secondary hover:text-secondary-focus;
@apply mr-2 flex items-center font-sans text-secondary;
}
}
@@ -66,7 +66,7 @@ exports[`<LogEventSource /> > render html correctly > should render messages wit
exports[`<LogEventSource /> > render html correctly > should render messages with filter 1`] = `
"<ul data-v-2e92daca=\\"\\" class=\\"events group py-4 medium\\">
<li data-v-2e92daca=\\"\\" data-key=\\"2\\" class=\\"\\"><a data-v-2e92daca=\\"\\" class=\\"jump-context tooltip-primary tooltip tooltip-right\\" data-tip=\\"Jump to Context\\" href=\\"#2\\"><svg data-v-2e92daca=\\"\\" viewBox=\\"0 0 24 24\\" width=\\"1.2em\\" height=\\"1.2em\\">
<li data-v-2e92daca=\\"\\" data-key=\\"2\\" class=\\"\\"><a data-v-2e92daca=\\"\\" class=\\"jump-context tooltip tooltip-right tooltip-primary\\" data-tip=\\"Jump to Context\\" href=\\"#2\\"><svg data-v-2e92daca=\\"\\" viewBox=\\"0 0 24 24\\" width=\\"1.2em\\" height=\\"1.2em\\">
<path fill=\\"currentColor\\" d=\\"M20 19.59V8l-6-6H4v20l15.57-.02l-4.81-4.81c-.8.52-1.74.83-2.76.83c-2.76 0-5-2.24-5-5s2.24-5 5-5s5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3s-1.34-3-3-3s-3 1.34-3 3z\\"></path>
</svg></a>
<div data-v-2e92daca=\\"\\" class=\\"flex items-start gap-x-2\\" visible-keys=\\"\\">
+12
View File
@@ -0,0 +1,12 @@
<template>
<div class="flex flex-col gap-8 px-4 py-4 md:px-8">
<section>
<links />
</section>
<slot></slot>
</div>
</template>
<script setup lang="ts"></script>
<style scoped></style>
+1 -1
View File
@@ -14,7 +14,7 @@
</template>
<script lang="ts" setup>
import { globalShowPopup } from "@/composables/popup";
import { globalShowPopup } from "@/composable/popup";
let glopbalShow = globalShowPopup();
let show = ref(glopbalShow.value);
+74
View File
@@ -0,0 +1,74 @@
<template>
<ul class="space-y-4 p-2">
<li v-for="release in releases" v-if="releases?.length">
<div class="flex items-baseline gap-1">
<carbon:warning class="h-4.25 w-4.25 self-center stroke-orange" v-if="release.breaking > 0" />
<a :href="release.htmlUrl" class="link-primary text-lg font-bold" target="_blank" rel="noreferrer noopener">
{{ release.name }}
</a>
<span class="ml-1 text-xs"><distance-time :date="new Date(release.createdAt)" /></span>
<tag class="ml-auto bg-red px-1 py-1 text-xs" v-if="release.tag === latest?.tag">
{{ $t("releases.latest") }}
</tag>
</div>
<div class="text-sm text-base-content/80">
{{ summary(release) }}
</div>
</li>
<li v-else>
<div class="text-sm text-base-content/80">
{{ $t("releases.no_releases") }}
</div>
</li>
</ul>
</template>
<script setup lang="ts">
const { releases, latest } = useReleases();
const { t } = useI18n();
function summary(release: { features: number; bugFixes: number; breaking: number }) {
if (release.features > 0 && release.bugFixes > 0 && release.breaking > 0) {
return t("releases.three_parts", {
first: t("releases.breaking", { count: release.breaking }),
second: t("releases.features", { count: release.features }),
third: t("releases.bugFixes", { count: release.bugFixes }),
});
}
if (release.features > 0 && release.bugFixes > 0) {
return t("releases.two_parts", {
first: t("releases.features", { count: release.features }),
second: t("releases.bugFixes", { count: release.bugFixes }),
});
}
if (release.features > 0 && release.breaking > 0) {
return t("releases.two_parts", {
first: t("releases.features", { count: release.features }),
second: t("releases.breaking", { count: release.breaking }),
});
}
if (release.bugFixes > 0 && release.breaking > 0) {
return t("releases.two_parts", {
first: t("releases.bugFixes", { count: release.bugFixes }),
second: t("releases.breaking", { count: release.breaking }),
});
}
if (release.features > 0) {
return t("releases.features", { count: release.features });
}
if (release.bugFixes > 0) {
return t("releases.bugFixes", { count: release.bugFixes });
}
if (release.breaking > 0) {
return t("releases.breaking", { count: release.breaking });
}
}
</script>
<style scoped></style>
+2 -2
View File
@@ -20,8 +20,8 @@
<div class="mr-16 text-right">
<transition name="fade">
<button
class="fixed bottom-8 rounded bg-primary p-3 text-primary-content shadow transition-colors hover:bg-primary-focus"
:class="hasMore ? 'animate-bounce-fast bg-secondary text-secondary-content hover:bg-secondary-focus' : ''"
class="btn btn-primary fixed bottom-8 rounded p-3 text-primary-content shadow transition-colors"
:class="hasMore ? 'btn-secondary animate-bounce-fast text-secondary-content' : ''"
@click="scrollToBottom()"
v-show="paused"
>
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="input input-primary flex h-auto items-center">
<mdi:magnify />
<input
class="input flex-1"
class="input input-ghost flex-1"
type="text"
placeholder="Find / RegEx"
ref="input"
+1 -1
View File
@@ -63,7 +63,7 @@
<script lang="ts" setup>
import { Container } from "@/models/Container";
import { sessionHost } from "@/composables/storage";
import { sessionHost } from "@/composable/storage";
const { t } = useI18n();
+21 -40
View File
@@ -1,44 +1,25 @@
<template>
<details class="dropdown" ref="details" v-on-click-outside="close">
<summary class="btn btn-primary flex-nowrap" v-bind="$attrs">
<slot name="trigger"> {{ values[modelValue] ?? defaultLabel }} <carbon:caret-down /></slot>
</summary>
<ul class="menu dropdown-content rounded-box z-50 w-52 bg-base p-2 shadow">
<slot>
<li v-for="item in options">
<a @click="modelValue = item.value">
<mdi-light:check class="w-4" v-if="modelValue == item.value" />
<div v-else class="w-4"></div>
{{ item.label }}
</a>
</li>
</slot>
</ul>
</details>
<div class="dropdown">
<label tabindex="0" class="btn btn-circle btn-sm" @mousedown="checkAndCloseDropDown($event)" @blur="closed()">
<slot name="trigger"></slot>
</label>
<div
tabindex="0"
class="min-w-52 dropdown-content rounded-box z-50 mt-1 border border-base-content/20 bg-base p-2 shadow"
>
<slot name="content"></slot>
</div>
</div>
</template>
<script lang="ts" setup>
import { vOnClickOutside } from "@vueuse/components";
type DropdownItem = {
label: string;
value: string;
};
const { options = [], defaultLabel = "" } = defineProps<{ options?: DropdownItem[]; defaultLabel?: string }>();
const { modelValue } = defineModels<{
modelValue: string;
}>();
const values = computed(() =>
options.reduce(
(acc, curr) => {
acc[curr.value] = curr.label;
return acc;
},
{} as Record<string, string>,
),
);
const details = ref<HTMLElement | null>(null);
const close = () => details.value?.removeAttribute("open");
watch(modelValue, () => close());
<script setup lang="ts">
const closed = defineEmit();
function checkAndCloseDropDown(e: MouseEvent) {
const target = e.currentTarget as HTMLElement;
if (target?.matches(":focus")) {
setTimeout(() => target.blur(), 0);
}
}
</script>
<style scoped></style>
+44
View File
@@ -0,0 +1,44 @@
<template>
<details class="dropdown" ref="details" v-on-click-outside="close">
<summary class="btn btn-primary flex-nowrap" v-bind="$attrs">
<slot name="trigger"> {{ values[modelValue] ?? defaultLabel }} <carbon:caret-down /></slot>
</summary>
<ul class="menu dropdown-content rounded-box z-50 mt-1 w-52 border border-base-content/20 bg-base p-2 shadow">
<slot>
<li v-for="item in options">
<a @click="modelValue = item.value">
<mdi:check class="w-4" v-if="modelValue == item.value" />
<div v-else class="w-4"></div>
{{ item.label }}
</a>
</li>
</slot>
</ul>
</details>
</template>
<script lang="ts" setup>
import { vOnClickOutside } from "@vueuse/components";
type DropdownItem = {
label: string;
value: string;
};
const { options = [], defaultLabel = "" } = defineProps<{ options?: DropdownItem[]; defaultLabel?: string }>();
const { modelValue } = defineModels<{
modelValue: string;
}>();
const values = computed(() =>
options.reduce(
(acc, curr) => {
acc[curr.value] = curr.label;
return acc;
},
{} as Record<string, string>,
),
);
const details = ref<HTMLElement | null>(null);
const close = () => details.value?.removeAttribute("open");
watch(modelValue, () => close());
</script>
+2 -2
View File
@@ -22,7 +22,7 @@
<transition name="fade">
<div v-show="show">
<div class="mt-4 flex items-center justify-center gap-2">
<dropdown
<dropdown-menu
v-model="sessionHost"
:options="hosts"
defaultLabel="Hosts"
@@ -57,7 +57,7 @@
<script lang="ts" setup>
const { base, secured } = config;
import { sessionHost } from "@/composables/storage";
import { sessionHost } from "@/composable/storage";
const store = useContainerStore();
const route = useRoute();
const { visibleContainers } = storeToRefs(store);
+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<label class="label inline-flex cursor-pointer gap-4 font-normal">
<input type="checkbox" class="toggle toggle-primary hover:bg-primary-focus" v-model="modelValue" />
<input type="checkbox" class="toggle toggle-primary" v-model="modelValue" />
<slot />
</label>
</template>
+3 -3
View File
@@ -25,12 +25,12 @@
</pane>
</splitpanes>
<label
class="btn btn-circle swap swap-rotate fixed bottom-8 left-4"
:class="{ '!-left-3': collapseNav }"
class="btn btn-circle swap btn-neutral swap-rotate fixed -left-12 bottom-4 w-16 transition-all hover:-left-4"
:class="{ '!-left-6': collapseNav }"
v-if="!isMobile"
>
<input type="checkbox" v-model="collapseNav" />
<mdi:chevron-right class="swap-on text-secondary" />
<mdi:chevron-right class="swap-on" />
<mdi:chevron-left class="swap-off" />
</label>
</div>
+27 -25
View File
@@ -1,25 +1,21 @@
@import "splitpanes/dist/splitpanes.css";
@define-mixin light {
--base-lighter-color: 0 0% 100%;
--base-color: 0 0% 97%;
--base-darker-color: 0 0% 90%;
--base-content-color: 0 0% 21%;
--primary-color: 171 100% 41%;
--primary-focus-color: 171 100% 31%;
--secondary-color: 34 95% 53%;
--secondary-focus-color: 34 95% 43%;
--base-lighter-color: 100% 0 0;
--base-color: 97% 0 0;
--base-darker-color: 90% 0 0;
--base-content-color: 33% 0 0;
--primary-color: 76.96% 0.143 176.65;
--secondary-color: 76.04% 0.168 64.07;
}
@define-mixin dark {
--base-lighter-color: 0 0% 14%;
--base-color: 0 0% 7%;
--base-darker-color: 0 0% 4%;
--base-content-color: 0 0% 86%;
--primary-color: 171 100% 41%;
--primary-focus-color: 171 100% 31%;
--secondary-color: 44 100% 77%;
--secondary-focus-color: 44 100% 67%;
--base-lighter-color: 25% 0 0;
--base-color: 18% 0 0;
--base-darker-color: 11% 0 0;
--base-content-color: 89.23% 0 0;
--primary-color: 76.96% 0.143 176.65;
--secondary-color: 91.36% 0.11098 90.1243;
}
@tailwind base;
@@ -29,19 +25,18 @@
@layer base {
:root {
--p: var(--primary-color);
--pf: var(--primary-focus-color);
--pc: 0 0% 100%;
--pc: 89.23% 0;
--s: var(--secondary-color);
--sf: var(--secondary-focus-color);
--sc: 0 0% 4%;
--sc: 14.57% 0 0;
--b1: var(--base-lighter-color);
--b2: var(--base-color);
--b3: var(--base-darker-color);
--bc: var(--base-content-color);
--in: 207 90% 54%;
--inc: 207 90% 94%;
--er: 4 90% 58%;
--erc: 4 90% 98%;
--in: 65% 0.171 249.5;
--inc: 99% 0.171 249.5;
--er: 64% 0.218 28.85;
--erc: 99% 0.218 28.85;
--n: var(--base-lighter-color);
}
html[data-theme="dark"] {
@mixin dark;
@@ -94,7 +89,10 @@
@layer components {
.input {
@apply focus:outline-none;
@apply !outline-none;
&.input-ghost {
@apply focus:border-transparent;
}
}
.btn {
@@ -118,4 +116,8 @@
--nc: var(--pc);
@apply active;
}
.link-primary {
@apply underline-offset-4 hover:underline;
}
}
-1
View File
@@ -1,4 +1,3 @@
// import "./styles.scss";
import "./main.css";
import { createApp, App as VueApp } from "vue";
import App from "./App.vue";
+9 -9
View File
@@ -144,7 +144,15 @@ export class SkippedLogsEntry extends LogEntry<string> {
}
export function asLogEntry(event: LogEvent): LogEntry<string | JSONObject> {
if (typeof event.m === "string") {
if (isObject(event.m)) {
return new ComplexLogEntry(
event.m,
event.id,
new Date(event.ts),
event.l,
event.s === "unknown" ? "stderr" : event.s ?? "stderr",
);
} else {
return new SimpleLogEntry(
event.m,
event.id,
@@ -153,13 +161,5 @@ export function asLogEntry(event: LogEvent): LogEntry<string | JSONObject> {
event.p,
event.s === "unknown" ? "stderr" : event.s ?? "stderr",
);
} else {
return new ComplexLogEntry(
event.m,
event.id,
new Date(event.ts),
event.l,
event.s === "unknown" ? "stderr" : event.s ?? "stderr",
);
}
}
+7 -5
View File
@@ -1,11 +1,13 @@
<template>
<div class="hero min-h-screen bg-base-200">
<div class="hero-content text-center">
<div class="max-w-md">
<p class="py-6 text-2xl font-bold">{{ $t("error.page-not-found") }}</p>
<page-with-links>
<div class="hero min-h-screen bg-base-200">
<div class="hero-content text-center">
<div class="max-w-md">
<p class="py-6 text-2xl font-bold">{{ $t("error.page-not-found") }}</p>
</div>
</div>
</div>
</div>
</page-with-links>
</template>
<script lang="ts" setup>
+18
View File
@@ -0,0 +1,18 @@
<template>
<page-with-links>
<section>
<article class="prose" v-html="data.content" v-if="data"></article>
</section>
</page-with-links>
</template>
<script lang="ts" setup>
const { id } = defineProps<{ id: string }>();
const { data } = useFetch(() => withBase("/api/content/" + id), {
refetch: true,
})
.get()
.json<{ title: string; content: string }>();
</script>
<style lang="postcss" scoped></style>
+2 -10
View File
@@ -1,13 +1,5 @@
<template>
<div class="flex flex-col gap-16 px-4 pt-8 md:px-8">
<section v-if="config.user">
<div class="flex items-center gap-4">
<div class="ml-auto">
{{ config.user?.email }}
</div>
<img class="h-10 w-10 rounded-full p-1 ring-2 ring-base-content/50" :src="config.user.avatar" />
</div>
</section>
<page-with-links class="gap-16">
<section>
<div class="stats grid bg-base-lighter shadow">
<div class="stat">
@@ -33,7 +25,7 @@
<section>
<container-table :containers="runningContainers"></container-table>
</section>
</div>
</page-with-links>
</template>
<script lang="ts" setup>
+3 -2
View File
@@ -49,9 +49,10 @@ let password = $ref("");
let form: HTMLFormElement | undefined = $ref();
async function onLogin() {
const response = await fetch(withBase("/api/validateCredentials"), {
const url = config.authProvider === "simple" ? "/api/token" : "/api/validateCredentials";
const response = await fetch(withBase(url), {
body: new FormData(form),
method: "post",
method: "POST",
});
if (response.status == 200) {
+17 -40
View File
@@ -1,15 +1,15 @@
<template>
<div class="mt-10 flex flex-col gap-8 px-4 md:px-8">
<page-with-links>
<section>
<div class="has-underline">
<h2>{{ $t("settings.about") }}</h2>
</div>
<div>
<span v-html="$t('settings.using-version', { version: currentVersion })"></span>
<span v-html="$t('settings.using-version', { version: config.version })"></span>
<div
v-if="hasUpdate"
v-html="$t('settings.update-available', { nextVersion: nextRelease.name, href: nextRelease.html_url })"
v-html="$t('settings.update-available', { nextVersion: latest?.name, href: latest?.htmlUrl })"
></div>
</div>
</section>
@@ -34,7 +34,7 @@
</div>
<div class="flex items-center gap-6">
<dropdown
<dropdown-menu
v-model="hourStyle"
:options="[
{ label: 'Auto', value: 'auto' },
@@ -45,7 +45,7 @@
{{ $t("settings.12-24-format") }}
</div>
<div class="flex items-center gap-6">
<dropdown
<dropdown-menu
v-model="size"
:options="[
{ label: 'Small', value: 'small' },
@@ -56,7 +56,7 @@
{{ $t("settings.font-size") }}
</div>
<div class="flex items-center gap-6">
<dropdown
<dropdown-menu
v-model="lightTheme"
:options="[
{ label: 'Auto', value: 'auto' },
@@ -85,50 +85,27 @@
<toggle v-model="automaticRedirect">{{ $t("settings.automatic-redirect") }}</toggle>
</div>
</section>
</div>
</page-with-links>
</template>
<script lang="ts" setup>
import {
search,
lightTheme,
smallerScrollbars,
showTimestamp,
showStd,
hourStyle,
showAllContainers,
size,
softWrap,
automaticRedirect,
hourStyle,
lightTheme,
search,
showAllContainers,
showStd,
showTimestamp,
size,
smallerScrollbars,
softWrap,
} from "@/stores/settings";
const { t } = useI18n();
setTitle(t("title.settings"));
const currentVersion = config.version;
let nextRelease = $ref({ html_url: "", name: "" });
let hasUpdate = $ref(false);
async function fetchNextRelease() {
if (!["dev", "master"].includes(currentVersion)) {
const response = await fetch("https://api.github.com/repos/amir20/dozzle/releases/latest");
if (response.ok) {
const release = await response.json();
hasUpdate =
release.tag_name.slice(1).localeCompare(currentVersion, undefined, { numeric: true, sensitivity: "base" }) > 0;
nextRelease = release;
}
} else {
hasUpdate = true;
nextRelease = {
html_url: "",
name: "master",
};
}
}
fetchNextRelease();
const { latest, hasUpdate } = useReleases();
</script>
<style lang="postcss" scoped>
.has-underline {
+2
View File
@@ -10,6 +10,7 @@ interface Config {
maxLogs: number;
hostname: string;
hosts: { name: string; id: string }[];
authProvider: "simple" | "none" | "forward-proxy";
user?: {
username: string;
email: string;
@@ -17,6 +18,7 @@ interface Config {
avatar: string;
};
serverSettings?: Settings;
pages?: { id: string; title: string }[];
}
const pageConfig = JSON.parse(text);
+29
View File
@@ -0,0 +1,29 @@
const { data: releases } = useFetch(withBase("/api/releases")).get().json<
{
name: string;
mentionsCount: number;
createdAt: string;
body: string;
tag: string;
htmlUrl: string;
latest: boolean;
features: number;
bugFixes: number;
breaking: number;
}[]
>();
const hasUpdate = computed(() => {
if (!releases.value?.length) return false;
return releases.value[0].tag !== config.version;
});
const latest = computed(() => releases.value?.find((release) => release.latest));
export function useReleases() {
return {
hasUpdate,
latest,
releases,
};
}
+7 -5
View File
@@ -33,12 +33,14 @@ export const DEFAULT_SETTINGS: Settings = {
export const settings = useStorage(DOZZLE_SETTINGS_KEY, DEFAULT_SETTINGS);
settings.value = { ...DEFAULT_SETTINGS, ...settings.value, ...config.serverSettings };
watch(settings, (value) => {
fetch(withBase("/api/profile/settings"), {
method: "PUT",
body: JSON.stringify(value),
if (config.user) {
watch(settings, (value) => {
fetch(withBase("/api/profile/settings"), {
method: "PUT",
body: JSON.stringify(value),
});
});
});
}
export const {
collapseNav,
+1
View File
@@ -68,6 +68,7 @@ export default defineConfig({
{ text: "Healthcheck", link: "/guide/healthcheck" },
{ text: "Hostname", link: "/guide/hostname" },
{ text: "Remote Hosts", link: "/guide/remote-hosts" },
{ text: "Custom Documentation", link: "/guide/custom-documentation" },
{ text: "Supported Env Vars", link: "/guide/supported-env-vars" },
{ text: "Logging Files on Disk", link: "/guide/log-files-on-disk" },
{ text: "Analytics", link: "/guide/analytics" },
-30
View File
@@ -1,30 +0,0 @@
import { Handler, HandlerEvent, HandlerContext } from "@netlify/functions";
let cache;
let cacheTime = 0;
const handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {
if (cache && Date.now() - cacheTime < 1000 * 60 * 10) {
const headers = {
"x-cache": "HIT",
};
return {
headers,
statusCode: 200,
body: JSON.stringify(cache),
};
}
const response = await fetch("https://hub.docker.com/v2/repositories/amir20/dozzle");
const data = await response.json();
const { full_description, ...rest } = data;
cache = rest;
cacheTime = Date.now();
return {
statusCode: 200,
body: JSON.stringify(rest),
};
};
export { handler };
+44 -4
View File
@@ -4,7 +4,9 @@ title: Authentication
# Setting Up Authentication
Dozzle support two models of authentication. If you have already setup authentication behind a proxy then Dozzle can work out of the box by reading forwarded headers. If you do not currently have an authentication solution then Dozzle has a simple file based user management solution. Authentication providers are setup using `--auth-provider` flag.
Dozzle support two configurations for authentication. In the first configuration, you bring your own authentication method by protecting Dozzle through a proxy. Dozzle can read appropriate headers out of the box.
If you do not have an authentication solution then Dozzle has a simple file based user management solution. Authentication providers are setup using `--auth-provider` flag. In both of these configurations, Dozzle will try to save user settings to disk. This data is written to `/data`.
## Forward Proxy
@@ -178,14 +180,52 @@ Valid SSL keys are required because Authelia only supports SSL.
## File Based User Management
::: info
More details coming soon.
Dozzle supports multi-user authentication by setting `--auth-provider` to `simple`. In this mode, Dozzle will try to read `/data/users.yml`. The content of the file looks like
```yml
users:
# "admin" here is username
admin:
name: "Admin"
# Just sha-256 which can be computed with "echo -n password | shasum -a 256"
password: "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"
email: me@email.net
```
Dozzle uses `email` to generate avatars using [Gravatar](https://gravatar.com/). It is optional.
The password is hashed using `sha256` which can be generated with `echo -n "secret-password" | shasum -a 256` or `echo -n "secret-password" | sha256sum` on linux.
You will need to mount this file for Dozzle to find it. Here is an example:
::: code-group
```sh [cli]
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/dozzle/data:/data -p 8080:8080 amir20/dozzle --auth-provider simple
```
```yaml [docker-compose.yml]
version: "3"
services:
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /path/to/dozzle/data:/data
ports:
- 8080:8080
environment:
DOZZLE_AUTH_PROVIDER: simple
```
:::
Dozzle uses [JWT](https://en.wikipedia.org/wiki/JSON_Web_Token) to generate tokens for authentication. This token is saved in a cookie.
## Single Username/Password
::: danger
This authentication method will be removed in v6.x in favor of a file based solution currently in development.
`--username` and `--password` flags will be removed in v6.x in favor of `--auth-provider`.
:::
Dozzle supports a very simple authentication out of the box with just username and password. You should deploy using SSL to keep the credentials safe. See configuration to use `--username` and `--password`. You can also use docker secrets `--usernamefile` and `--passwordfile`.
+56
View File
@@ -0,0 +1,56 @@
---
title: Customizing Help Content
---
# Documentation and Content
::: tip Note
This feature was introduced in version `v5.1.x`
:::
Dozzle can be used by many users from different levels. Some teams what a central place to explain how to use Dozzle and what each of their containers do. Dozzle supports markdown content by reading `/data/content/*.md` files. Multiple files are supported. Each file will create a link at the top of Dozzle. Here is an example of what `/data/content/help.md` might look like:
```yml
---
title: Help
---
# This is help
Hello, from Dozzle.
Tables are also supported!
| foo | bar |
| --- | --- |
| baz | bim |
```
`title` is used to show a link on Dozzle's home screen to `/content/help`. Dozzle will need `/data` mounted. Here is an example:
::: code-group
```sh [cli]
$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/dozzle/data:/data -p 8080:8080 amir20/dozzle
```
```yaml [docker-compose.yml]
version: "3"
services:
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /path/to/dozzle/data:/data
ports:
- 8080:8080
```
```yml [help.md]
---
title: Help
---
# This is help
Hello, from Dozzle.
```
:::
+4 -5
View File
@@ -3,12 +3,11 @@
"type": "module",
"name": "docs",
"devDependencies": {
"@netlify/functions": "^2.3.0",
"@unocss/preset-typography": "^0.57.1",
"@unocss/reset": "^0.57.1",
"@unocss/transformer-directives": "^0.57.1",
"@unocss/preset-typography": "^0.57.3",
"@unocss/reset": "^0.57.3",
"@unocss/transformer-directives": "^0.57.3",
"dozzle": "workspace:*",
"sitemap": "^7.1.1",
"unocss": "^0.57.1"
"unocss": "^0.57.3"
}
}
+125 -156
View File
@@ -5,18 +5,15 @@ settings:
excludeLinksFromLockfile: false
devDependencies:
'@netlify/functions':
specifier: ^2.3.0
version: 2.3.0
'@unocss/preset-typography':
specifier: ^0.57.1
version: 0.57.1
specifier: ^0.57.3
version: 0.57.3
'@unocss/reset':
specifier: ^0.57.1
version: 0.57.1
specifier: ^0.57.3
version: 0.57.3
'@unocss/transformer-directives':
specifier: ^0.57.1
version: 0.57.1
specifier: ^0.57.3
version: 0.57.3
dozzle:
specifier: workspace:*
version: link:..
@@ -24,8 +21,8 @@ devDependencies:
specifier: ^7.1.1
version: 7.1.1
unocss:
specifier: ^0.57.1
version: 0.57.1(postcss@8.4.31)(vite@4.5.0)
specifier: ^0.57.3
version: 0.57.3(postcss@8.4.31)(vite@4.5.0)
packages:
@@ -293,27 +290,6 @@ packages:
'@jridgewell/sourcemap-codec': 1.4.15
dev: true
/@netlify/functions@2.3.0:
resolution: {integrity: sha512-E3kzXPWMP/r1rAWhjTaXcaOT47dhEvg/eQUJjRLhD9Zzp0WqkdynHr+bqff4rFNv6tuXrtFZrpbPJFKHH0c0zw==}
engines: {node: '>=14.0.0'}
dependencies:
'@netlify/serverless-functions-api': 1.9.0
is-promise: 4.0.0
dev: true
/@netlify/node-cookies@0.1.0:
resolution: {integrity: sha512-OAs1xG+FfLX0LoRASpqzVntVV/RpYkgpI0VrUnw2u0Q1qiZUzcPffxRK8HF3gc4GjuhG5ahOEMJ9bswBiZPq0g==}
engines: {node: ^14.16.0 || >=16.0.0}
dev: true
/@netlify/serverless-functions-api@1.9.0:
resolution: {integrity: sha512-Jq4uk1Mwa5vyxImupJYXPP+I5yYcp3PtguvXtJRutKdm9DPALXfZVtCQzBWMNdZiqVWCM3La9hvaBsPjSMfeug==}
engines: {node: ^14.18.0 || >=16.0.0}
dependencies:
'@netlify/node-cookies': 0.1.0
urlpattern-polyfill: 8.0.2
dev: true
/@nodelib/fs.scandir@2.1.5:
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
@@ -367,37 +343,37 @@ packages:
'@types/node': 17.0.45
dev: true
/@unocss/astro@0.57.1(vite@4.5.0):
resolution: {integrity: sha512-KNaqN/SGM/uz1QitajIkzNEw0jy9Zx9Wp8fl4GhfGYEMAN2+M4cuvBZRmlb6cLctSXmSAJQDG91ivbD1JijGnw==}
/@unocss/astro@0.57.3(vite@4.5.0):
resolution: {integrity: sha512-Kwu/k8iGNVrMtOuzJ7jKOvjYZFZz3recSxd7ceDp5Hi5SMsmjvXXHzkQ1Iypj1g0nczWcX4U+krROr2EH0GlnA==}
peerDependencies:
vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0
peerDependenciesMeta:
vite:
optional: true
dependencies:
'@unocss/core': 0.57.1
'@unocss/reset': 0.57.1
'@unocss/vite': 0.57.1(vite@4.5.0)
'@unocss/core': 0.57.3
'@unocss/reset': 0.57.3
'@unocss/vite': 0.57.3(vite@4.5.0)
vite: 4.5.0
transitivePeerDependencies:
- rollup
dev: true
/@unocss/cli@0.57.1:
resolution: {integrity: sha512-wKuOaygrPNzDm5L7+2SfHsIi3knJrAQ8nH6OasVqB+bGDz6ybDlULV7wvUco6Os72ydh7YbWC2/WpqFii8U/3w==}
/@unocss/cli@0.57.3:
resolution: {integrity: sha512-F5k0IjkbHFlZDcGAUr7UTa2xehxobfqWzooDL0tU9PtvAk6S4Edf5Iq0HymAcVK1k9yO17i7Pvg6dw7gOM0TIg==}
engines: {node: '>=14'}
hasBin: true
dependencies:
'@ampproject/remapping': 2.2.1
'@rollup/pluginutils': 5.0.5
'@unocss/config': 0.57.1
'@unocss/core': 0.57.1
'@unocss/preset-uno': 0.57.1
'@unocss/config': 0.57.3
'@unocss/core': 0.57.3
'@unocss/preset-uno': 0.57.3
cac: 6.7.14
chokidar: 3.5.3
colorette: 2.0.20
consola: 3.2.3
fast-glob: 3.3.1
fast-glob: 3.3.2
magic-string: 0.30.5
pathe: 1.1.1
perfect-debounce: 1.0.0
@@ -405,170 +381,171 @@ packages:
- rollup
dev: true
/@unocss/config@0.57.1:
resolution: {integrity: sha512-mbuVO0mH1PX7rEkViMNWb3jG1ji7TUydo2DdnMHhJE+dOrGtnQzhzXGlAd4qqel1fnt/VWuOyZKwJA3QO6VCtg==}
/@unocss/config@0.57.3:
resolution: {integrity: sha512-jrjvmcrrdiHHLqp6LBpHWs7VAnumFK3fEdMH7celRe+99CTOvRn73caUThyD2Ftt8rDIMejmteR1hqVBH51kug==}
engines: {node: '>=14'}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
unconfig: 0.3.11
dev: true
/@unocss/core@0.57.1:
resolution: {integrity: sha512-cqQW/4gCuk+bFMPg9lBanuRNQ9Lx1l4PpMN/6uKxI5WROpq7ce/Xb4uGvAxKLh3ITtFSpXs2cLfsy7QD6cVD/Q==}
/@unocss/core@0.57.3:
resolution: {integrity: sha512-o6snDo5vwAenIqA+wjjI6BUsftJXXSqrPHYqplb+QX5bLfxW/OU1xhBRlnhiP0BOGGZXqgGEETU1ym8MM9bLwA==}
dev: true
/@unocss/extractor-arbitrary-variants@0.57.1:
resolution: {integrity: sha512-9s+azHhBnwjxm46TsD1RY0krDAwOR8tcw58Vtl3emd6C0VQsAOdoprt7UHE7GEXMvDVq7nMf8lAT0BM0LteW3w==}
/@unocss/extractor-arbitrary-variants@0.57.3:
resolution: {integrity: sha512-OmF+2TjJ97i7KOCR8wPgZK/pkp8Rcfo4tzqT/4jBUIi7rfDGZx/eE3aZKFpZSZlUuTH5cdReaKxymXQmJ4dibA==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
dev: true
/@unocss/inspector@0.57.1:
resolution: {integrity: sha512-qV7ta7iHGX2EpZJ4IWY/05kgyhKFeWlvVJbrOnGsaH8gVt33T/43YAhB/8K5GIXBXIwkhwk13iB13nlg2gSheg==}
/@unocss/inspector@0.57.3:
resolution: {integrity: sha512-Oj5cUbuwx+4/rckW3mfpdKMWzhOOSehXChzuJ7x7tMDDB5ywdHwnDsxtK07Y+5UwKHC322T3I3VtLolOfsdlCA==}
dependencies:
'@unocss/rule-utils': 0.57.1
'@unocss/core': 0.57.3
'@unocss/rule-utils': 0.57.3
gzip-size: 6.0.0
sirv: 2.0.3
dev: true
/@unocss/postcss@0.57.1(postcss@8.4.31):
resolution: {integrity: sha512-DexrV+v/qkVh6t660rXigNr2Y6lON8jxD1z2KVk2bjHKhFflF6q6seps6d/MquyLJI1mXF2uANTeFAeL2q6evw==}
/@unocss/postcss@0.57.3(postcss@8.4.31):
resolution: {integrity: sha512-rYXQ2/iXeF59/g8xbvoyYJ9EClQCBcWj2oeJCt85dykOYyQJCWJT+LoYF0s/kvg7m+x5ovdNQfXtAACLYBqh9g==}
engines: {node: '>=14'}
peerDependencies:
postcss: ^8.4.21
dependencies:
'@unocss/config': 0.57.1
'@unocss/core': 0.57.1
'@unocss/rule-utils': 0.57.1
'@unocss/config': 0.57.3
'@unocss/core': 0.57.3
'@unocss/rule-utils': 0.57.3
css-tree: 2.3.1
fast-glob: 3.3.1
fast-glob: 3.3.2
magic-string: 0.30.5
postcss: 8.4.31
dev: true
/@unocss/preset-attributify@0.57.1:
resolution: {integrity: sha512-pvGQHaqBlB0jQysWhNbcKLOGrkj8b53k0sAa9LYxQjD1fa8t/dwbuMpZv4twX+gysF0vBhxRoWBPLH1/S6zRZg==}
/@unocss/preset-attributify@0.57.3:
resolution: {integrity: sha512-leX9jxM2PnqvZn42thDb2rPdE0nq6WtIr98pvdnkRZKt5gLwtOJCANXH/gVP6tPdRRf6FiZstA8jvAxVGL1sIA==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
dev: true
/@unocss/preset-icons@0.57.1:
resolution: {integrity: sha512-ve4jC6yREfS0mv97DCld9xLjMuiSCcsQPKucdtpUfCjLMqtGd1ZGGdFv02Q+92NkW7HDfgj+izEw1SKh9695Ow==}
/@unocss/preset-icons@0.57.3:
resolution: {integrity: sha512-cG7gaFQzSidHS+nHPV9HEB3aaUVs/PjZywxMl5jwkJIWHuFMU/SQZXMorH6avU2jH8PoYkRZfjLdRWA+h/+fPA==}
dependencies:
'@iconify/utils': 2.1.11
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
ofetch: 1.3.3
transitivePeerDependencies:
- supports-color
dev: true
/@unocss/preset-mini@0.57.1:
resolution: {integrity: sha512-v9ZsIUGDfZNXbIrOc7zrBp+RFbFFGSQN/vKIf761js4fJ31j6lan4pPQPGcY17xHConkI1HJT/+yb/UVJaAcHw==}
/@unocss/preset-mini@0.57.3:
resolution: {integrity: sha512-2KFxbbxRqhc+0fyWNYSiRGGr+3jp4jEQIRnjT8sv5uAMo1OaUmUTwz2qzYhSc3sCM8ZEofblZY2BOcqJwZ5yxA==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/extractor-arbitrary-variants': 0.57.1
'@unocss/rule-utils': 0.57.1
'@unocss/core': 0.57.3
'@unocss/extractor-arbitrary-variants': 0.57.3
'@unocss/rule-utils': 0.57.3
dev: true
/@unocss/preset-tagify@0.57.1:
resolution: {integrity: sha512-GV8knxnsOVH/XiG2KB+mVZeEJqr0PZvvkSTPftGPbjttoKVZ+28Y5q9/qezH7p4W6RYVAAK+3qHHy5wWZosiMw==}
/@unocss/preset-tagify@0.57.3:
resolution: {integrity: sha512-GXs5Hu6XtHcIRLexPghHkfb6ekSodh4Xs8895xrvP5H7Tm/+wEIHALXkW762Rujl1Rtq+xzxAeCoeFxW+y9eLw==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
dev: true
/@unocss/preset-typography@0.57.1:
resolution: {integrity: sha512-C4cqCiGW0OSoSXsVQKgfLulYxY5C8M40f+a8VtBlAaEaN6eSlEt+catXb0chF9T2mvz/b87b0PahPvPwJdDf1Q==}
/@unocss/preset-typography@0.57.3:
resolution: {integrity: sha512-C/pIfRY56wxBuV4bTIeZMZYMmYc0gD8DU+sJSPWiZJP1JHiLc3FzSnc51BYcT/Dqdx0fDWhJyP2qqo9000VFKQ==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/preset-mini': 0.57.1
'@unocss/core': 0.57.3
'@unocss/preset-mini': 0.57.3
dev: true
/@unocss/preset-uno@0.57.1:
resolution: {integrity: sha512-0+DKZiowYjYzq2swJzQA2dhqDvLJdm0Y437ITzc2GzZMKGUUuNi+w2v3/SzwkpkRd9zTB9/YaOIJVfdrx6ZOXQ==}
/@unocss/preset-uno@0.57.3:
resolution: {integrity: sha512-dLZrFc6GrE5J0zAZMFXk/c4WKq7fmU0jCgHvbDXLGdKdJ7zpByslhc2YTPqkLW40F6+73SCN7DlARInSh2fa4g==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/preset-mini': 0.57.1
'@unocss/preset-wind': 0.57.1
'@unocss/rule-utils': 0.57.1
'@unocss/core': 0.57.3
'@unocss/preset-mini': 0.57.3
'@unocss/preset-wind': 0.57.3
'@unocss/rule-utils': 0.57.3
dev: true
/@unocss/preset-web-fonts@0.57.1:
resolution: {integrity: sha512-9DCIMlBRaGrljLmeciH4WqP+uRx2z2nLxvrvEmGbpJJpMn2H4higR5Zu5tDyKYGr9QBl9vXdWgib+43OSswkqA==}
/@unocss/preset-web-fonts@0.57.3:
resolution: {integrity: sha512-W/voQjgo98oj/D/oGrhL4xAS0XsR6fF9yULu3xf4nWrUkdkZq/64/rOM5uLBgUFSmkulW524Dsjd1INYmPzz8w==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
ofetch: 1.3.3
dev: true
/@unocss/preset-wind@0.57.1:
resolution: {integrity: sha512-5UairNahUXNDe9AggPtTCodyPjl6NgPCsiEB22LVgN20UjBXjaqzN5wUe1OgtpLoAUaSk0KI7eLWhnWbTbST3A==}
/@unocss/preset-wind@0.57.3:
resolution: {integrity: sha512-LymBZtNK86qEpLpbH5eOAiHNFvkIAjfL+Jlok5xI/yO/GCqjnTiw1QAxu2vxLUnQlqlvu7IykOx+Hk1nNvkSaA==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/preset-mini': 0.57.1
'@unocss/rule-utils': 0.57.1
'@unocss/core': 0.57.3
'@unocss/preset-mini': 0.57.3
'@unocss/rule-utils': 0.57.3
dev: true
/@unocss/reset@0.57.1:
resolution: {integrity: sha512-f/ofoudjFN/HMtv1XV5phP58pOmNruBhr0GbVdBNylyieMQkFHowA7iSemChnC/fTbCcY6oSOAcFl4n9AefjdA==}
/@unocss/reset@0.57.3:
resolution: {integrity: sha512-E6Q8jucQlVLOM+d+F5DKGi/8GVc8KDwAQnbcpbrGL/1iix4IM3emRkPmujgTLWS+HIRRcWcEvT6sNwnd9r6H2A==}
dev: true
/@unocss/rule-utils@0.57.1:
resolution: {integrity: sha512-Hdicz7YORZx7SHICldzOGjPNeJwk/Xhy3cycqiPbg6nB6d639bpgZn5BsbDzHCPKpguwDomUqTZS6+C3s7tUVg==}
/@unocss/rule-utils@0.57.3:
resolution: {integrity: sha512-koWXeRJHFt/SJdb3m7s/2+NrBCcUtl67SX7rSHJc99Z+dwZgIsPUfdfRKM4mZD43MayybvDrd1Wue2LNQg5R/g==}
engines: {node: '>=14'}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
magic-string: 0.30.5
dev: true
/@unocss/scope@0.57.1:
resolution: {integrity: sha512-ZAzg6lLGwKNQGCvJXEie3TvGztkAyajEFqygu0mjtHb+CmDql4iAjoygs+3dnRI5hSDwfMYFrJ2azX26+2CsoA==}
/@unocss/scope@0.57.3:
resolution: {integrity: sha512-hL0Gjd5getA6ziiOvu1M2Jw5e+FnD9rzu+t+4SnxWcpP+bZtu+LBrt5FeqrizwUHfE/723iuEvg16W5hjhGLQA==}
dev: true
/@unocss/transformer-attributify-jsx-babel@0.57.1:
resolution: {integrity: sha512-EOCPB8OGmhroAuFU0i0W5p6GmJpx6mAkP4KmsqVLd4QMgw+8aXkG7SKyLnxQZnekM0/dSo0TcpVGeGrZaUNgvQ==}
/@unocss/transformer-attributify-jsx-babel@0.57.3:
resolution: {integrity: sha512-b5esljHAz274tv0sXe8GmHew7FXzwkRQrod6NdR9pyFlPQ9gn7gxi0MIsvIV0U8PdSz3HOHOuT0tU/zphjaJDA==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
dev: true
/@unocss/transformer-attributify-jsx@0.57.1:
resolution: {integrity: sha512-ohgSEwm2j98ltPWl1zRPvZhRjQPpd7qZtgoROTQh6n2W7wEO1SlnYjgBBz+pGuo2dkfBN5NjuZJ93AEjS10Ysw==}
/@unocss/transformer-attributify-jsx@0.57.3:
resolution: {integrity: sha512-OgejFNN7AcCgudh/HGe2BS00TbRv7Bi+siWeUS7AEGEG+p7cQZn92XljCFZGqIyvgfVWypb6/xve9H4oY3/E+w==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
dev: true
/@unocss/transformer-compile-class@0.57.1:
resolution: {integrity: sha512-z0WZN6hbgpyBm2xqIrojqEjpQMhiyzHRbaBjWzI/6ieHWoFo5ajIwnReaFUEfJRNruLTd7/9hFDZdRXRPhttFw==}
/@unocss/transformer-compile-class@0.57.3:
resolution: {integrity: sha512-DqmRTQujqAdk4uSrqy+t9xSVmKM9E3yW9PCwDxI1evva0/qTFexzjoR42glq8x7LSn0ZmFyflXcQoeXmwjsBrg==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
dev: true
/@unocss/transformer-directives@0.57.1:
resolution: {integrity: sha512-rIk3XEU2NywEJUOkngBSmJfvS3IVgxkkqgMvuIqz8ZDbwWhepuMxsiI0QR3ypkipGr/eKK5DJ7eK0OVlo6FPFA==}
/@unocss/transformer-directives@0.57.3:
resolution: {integrity: sha512-GXedqnb0PB+XkjdfNEInuLxxLjPbaCQLCUhSvTcw67+kalGgX2Mn/hYwpSHmDMLe+Uld5n0vcJRu2a8chBdAwA==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/rule-utils': 0.57.1
'@unocss/core': 0.57.3
'@unocss/rule-utils': 0.57.3
css-tree: 2.3.1
dev: true
/@unocss/transformer-variant-group@0.57.1:
resolution: {integrity: sha512-qwydzn2Lqz/8zW6UUXdORaUl8humsG8ll74LN/z8cjEsqtXZkVdkV0l6Brpp9Xp/XPbKwO+II+KH3/1LGwXSzQ==}
/@unocss/transformer-variant-group@0.57.3:
resolution: {integrity: sha512-PpKtnwyb4ncjDhsTm/PtiL0RUdmaee+07W0AzSEz29IFFwyrueIP6WHmD6agKmgDPoaw5Ywebt6DdkSbnfYHzw==}
dependencies:
'@unocss/core': 0.57.1
'@unocss/core': 0.57.3
dev: true
/@unocss/vite@0.57.1(vite@4.5.0):
resolution: {integrity: sha512-kEBDvGgQNkX2n87S6Ao5seyFb1kuWZ5p96dGOS7VFpD7HvR5xholkJXaVhUK9/exCldjLExbo5UtVlbxFLUFYg==}
/@unocss/vite@0.57.3(vite@4.5.0):
resolution: {integrity: sha512-SX2wtxRFLka0CgMwqokKuhaBUptj8vcpmLObVRRgV+7dSdx6GMbZcjZfQfibMKhJY3d5iSAylcfyW2JqTX2F+g==}
peerDependencies:
vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0
dependencies:
'@ampproject/remapping': 2.2.1
'@rollup/pluginutils': 5.0.5
'@unocss/config': 0.57.1
'@unocss/core': 0.57.1
'@unocss/inspector': 0.57.1
'@unocss/scope': 0.57.1
'@unocss/transformer-directives': 0.57.1
'@unocss/config': 0.57.3
'@unocss/core': 0.57.3
'@unocss/inspector': 0.57.3
'@unocss/scope': 0.57.3
'@unocss/transformer-directives': 0.57.3
chokidar: 3.5.3
fast-glob: 3.3.1
fast-glob: 3.3.2
magic-string: 0.30.5
vite: 4.5.0
transitivePeerDependencies:
@@ -724,8 +701,8 @@ packages:
strip-final-newline: 2.0.0
dev: true
/fast-glob@3.3.1:
resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==}
/fast-glob@3.3.2:
resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==}
engines: {node: '>=8.6.0'}
dependencies:
'@nodelib/fs.stat': 2.0.5
@@ -812,10 +789,6 @@ packages:
engines: {node: '>=0.12.0'}
dev: true
/is-promise@4.0.0:
resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==}
dev: true
/is-stream@2.0.1:
resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
engines: {node: '>=8'}
@@ -1101,11 +1074,11 @@ packages:
mlly: 1.4.2
dev: true
/unocss@0.57.1(postcss@8.4.31)(vite@4.5.0):
resolution: {integrity: sha512-xLsyJ8+T1/Ux93yrqOvuQy268wF5rSzydlsbqZ5EVfi01PxYyydez3nycPqbyPZientkJ0Yohzd5aBqmZgku3A==}
/unocss@0.57.3(postcss@8.4.31)(vite@4.5.0):
resolution: {integrity: sha512-reIvKa1sG9bwRZ6oGwj8p2XZSmT5On/NEisqkxsk1vTV5ZHIagbilG3aNMb5vNcI7MhRb4dy0Z4cvyNGd3194Q==}
engines: {node: '>=14'}
peerDependencies:
'@unocss/webpack': 0.57.1
'@unocss/webpack': 0.57.3
vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0
peerDependenciesMeta:
'@unocss/webpack':
@@ -1113,26 +1086,26 @@ packages:
vite:
optional: true
dependencies:
'@unocss/astro': 0.57.1(vite@4.5.0)
'@unocss/cli': 0.57.1
'@unocss/core': 0.57.1
'@unocss/extractor-arbitrary-variants': 0.57.1
'@unocss/postcss': 0.57.1(postcss@8.4.31)
'@unocss/preset-attributify': 0.57.1
'@unocss/preset-icons': 0.57.1
'@unocss/preset-mini': 0.57.1
'@unocss/preset-tagify': 0.57.1
'@unocss/preset-typography': 0.57.1
'@unocss/preset-uno': 0.57.1
'@unocss/preset-web-fonts': 0.57.1
'@unocss/preset-wind': 0.57.1
'@unocss/reset': 0.57.1
'@unocss/transformer-attributify-jsx': 0.57.1
'@unocss/transformer-attributify-jsx-babel': 0.57.1
'@unocss/transformer-compile-class': 0.57.1
'@unocss/transformer-directives': 0.57.1
'@unocss/transformer-variant-group': 0.57.1
'@unocss/vite': 0.57.1(vite@4.5.0)
'@unocss/astro': 0.57.3(vite@4.5.0)
'@unocss/cli': 0.57.3
'@unocss/core': 0.57.3
'@unocss/extractor-arbitrary-variants': 0.57.3
'@unocss/postcss': 0.57.3(postcss@8.4.31)
'@unocss/preset-attributify': 0.57.3
'@unocss/preset-icons': 0.57.3
'@unocss/preset-mini': 0.57.3
'@unocss/preset-tagify': 0.57.3
'@unocss/preset-typography': 0.57.3
'@unocss/preset-uno': 0.57.3
'@unocss/preset-web-fonts': 0.57.3
'@unocss/preset-wind': 0.57.3
'@unocss/reset': 0.57.3
'@unocss/transformer-attributify-jsx': 0.57.3
'@unocss/transformer-attributify-jsx-babel': 0.57.3
'@unocss/transformer-compile-class': 0.57.3
'@unocss/transformer-directives': 0.57.3
'@unocss/transformer-variant-group': 0.57.3
'@unocss/vite': 0.57.3(vite@4.5.0)
vite: 4.5.0
transitivePeerDependencies:
- postcss
@@ -1140,10 +1113,6 @@ packages:
- supports-color
dev: true
/urlpattern-polyfill@8.0.2:
resolution: {integrity: sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==}
dev: true
/vite@4.5.0:
resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==}
engines: {node: ^14.18.0 || >=16.0.0}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

+23 -5
View File
@@ -10,7 +10,7 @@ require (
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.0.1
github.com/gogo/protobuf v1.3.2 // indirect
github.com/gorilla/sessions v1.2.1
github.com/gorilla/sessions v1.2.2
github.com/magiconair/properties v1.8.7
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect
github.com/morikuni/aec v1.0.0 // indirect
@@ -23,24 +23,42 @@ require (
github.com/stretchr/testify v1.8.4
golang.org/x/net v0.14.0 // indirect
golang.org/x/sys v0.11.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1
)
require github.com/go-chi/chi/v5 v5.0.10
require (
github.com/PuerkitoBio/goquery v1.8.1
github.com/go-chi/chi/v5 v5.0.10
github.com/go-chi/jwtauth/v5 v5.1.1
github.com/yuin/goldmark v1.6.0
github.com/yuin/goldmark-meta v1.1.0
)
require (
github.com/alexflint/go-scalar v1.2.0 // indirect
github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.4 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx/v2 v2.0.11 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
golang.org/x/tools v0.12.0 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gotest.tools/v3 v3.0.3 // indirect
)
go 1.21
go 1.21.4
+63 -6
View File
@@ -42,11 +42,15 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/alexflint/go-arg v1.4.3 h1:9rwwEBpMXfKQKceuZfYcwuc/7YY7tWJbFsgG5cAU/uo=
github.com/alexflint/go-arg v1.4.3/go.mod h1:3PZ/wp/8HuqRZMUUgu7I+e1qcpUbvmS258mRXkFH4IA=
github.com/alexflint/go-scalar v1.1.0/go.mod h1:LoFvNMqS1CPrMVltza4LvnGKhaSpc3oyLEBUZVhhS2o=
github.com/alexflint/go-scalar v1.2.0 h1:WR7JPKkeNpnYIOfHRa7ivM21aWAdHD0gEWHCx+WQBRw=
github.com/alexflint/go-scalar v1.2.0/go.mod h1:LoFvNMqS1CPrMVltza4LvnGKhaSpc3oyLEBUZVhhS2o=
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/beme/abide v0.0.0-20190723115211-635a09831760 h1:FvTM5NSN5HYvfKpgL+8x73U5v063vHsd7AX05eV1DnM=
github.com/beme/abide v0.0.0-20190723115211-635a09831760/go.mod h1:6+8gCKsZnxzhGTmKRh4BSkLos9CbWRJNcrp55We4SqQ=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -61,12 +65,11 @@ github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v24.0.5+incompatible h1:WmgcE4fxyI6EEXxBRxsHnZXrO1pQ3smi0k/jho4HLeY=
github.com/docker/docker v24.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v24.0.6+incompatible h1:hceabKCtUgDqPu+qm0NgsaXf28Ljf4/pWFL7xjWWDgE=
github.com/docker/docker v24.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM=
github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
@@ -83,9 +86,13 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/jwtauth/v5 v5.1.1 h1:Pjixqu5YkjE9sCLpzE01L0Q4sQzJIPdo7uz9r8ftp/c=
github.com/go-chi/jwtauth/v5 v5.1.1/go.mod h1:CYP1WSbzD4MPuKCr537EM3kfFhSQgpUEtMJFuYJjqWU=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@@ -146,8 +153,12 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA=
github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo=
github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/gorilla/sessions v1.2.2 h1:lqzMYz6bOfvn2WriPUjNByzeXIlVzURcPmgMczkmTjY=
github.com/gorilla/sessions v1.2.2/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
@@ -163,6 +174,19 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lestrrat-go/blackmagic v1.0.1 h1:lS5Zts+5HIC/8og6cGHb0uCcNCa3OUt1ygh3Qz2Fe80=
github.com/lestrrat-go/blackmagic v1.0.1/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU=
github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=
github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E=
github.com/lestrrat-go/httprc v1.0.4 h1:bAZymwoZQb+Oq8MEbyipag7iSq6YIga8Wj6GOiJGdI8=
github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo=
github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI=
github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4=
github.com/lestrrat-go/jwx/v2 v2.0.11 h1:ViHMnaMeaO0qV16RZWBHM7GTrAnX2aFLVKofc7FuKLQ=
github.com/lestrrat-go/jwx/v2 v2.0.11/go.mod h1:ZtPtMFlrfDrH2Y0iwfa3dRFn8VzwBrB+cyrm3IBWdDg=
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk=
@@ -181,12 +205,12 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
@@ -197,6 +221,7 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
@@ -206,6 +231,11 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68=
github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc=
github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@@ -218,7 +248,11 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -252,6 +286,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -285,7 +321,12 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -307,6 +348,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -345,10 +388,18 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -357,6 +408,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -414,6 +467,8 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -515,6 +570,8 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+9 -24
View File
@@ -6,17 +6,15 @@ import (
"encoding/hex"
"net/http"
"strings"
log "github.com/sirupsen/logrus"
)
type contextKey string
const remoteUser contextKey = "remoteUser"
type User struct {
Username string `json:"username"`
Email string `json:"email"`
Name string `json:"name"`
Avatar string `json:"avatar,omitempty"`
type proxyAuthAuth struct {
}
func hashEmail(email string) string {
@@ -27,20 +25,11 @@ func hashEmail(email string) string {
return hex.EncodeToString(hash[:])
}
func newUser(username, email, name string) *User {
avatar := ""
if email != "" {
avatar = "https://gravatar.com/avatar/" + hashEmail(email)
}
return &User{
Username: username,
Email: email,
Name: name,
Avatar: avatar,
}
func NewForwardProxyAuth() *proxyAuthAuth {
return &proxyAuthAuth{}
}
func ForwardProxyAuthorizationRequired(next http.Handler) http.Handler {
func (p *proxyAuthAuth) AuthMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("Remote-Email") != "" {
user := newUser(r.Header.Get("Remote-User"), r.Header.Get("Remote-Email"), r.Header.Get("Remote-Name"))
@@ -49,14 +38,10 @@ func ForwardProxyAuthorizationRequired(next http.Handler) http.Handler {
} else {
next.ServeHTTP(w, r)
}
})
}
func RemoteUserFromContext(ctx context.Context) *User {
user, ok := ctx.Value(remoteUser).(*User)
if !ok {
return nil
}
return user
func (p *proxyAuthAuth) CreateToken(username, password string) (string, error) {
log.Fatalf("CreateToken not implemented for proxy auth")
return "", nil
}
+49
View File
@@ -0,0 +1,49 @@
package auth
import (
"crypto/sha256"
"errors"
"net/http"
"time"
"github.com/go-chi/jwtauth/v5"
)
type simpleAuthContext struct {
UserDatabase UserDatabase
tokenAuth *jwtauth.JWTAuth
}
var ErrInvalidCredentials = errors.New("invalid credentials")
func NewSimpleAuth(userDatabase UserDatabase) *simpleAuthContext {
h := sha256.New()
for _, user := range userDatabase.Users {
h.Write([]byte(user.Password))
}
tokenAuth := jwtauth.New("HS256", h.Sum(nil), nil)
return &simpleAuthContext{
UserDatabase: userDatabase,
tokenAuth: tokenAuth,
}
}
func (a *simpleAuthContext) CreateToken(username, password string) (string, error) {
user := a.UserDatabase.FindByPassword(username, password)
if user == nil {
return "", ErrInvalidCredentials
}
_, tokenString, err := a.tokenAuth.Encode(map[string]interface{}{"username": user.Username, "email": user.Email, "name": user.Name, "timestamp": time.Now()})
if err != nil {
return "", err
}
return tokenString, nil
}
func (a *simpleAuthContext) AuthMiddleware(next http.Handler) http.Handler {
return jwtauth.Verifier(a.tokenAuth)(next)
}
+115
View File
@@ -0,0 +1,115 @@
package auth
import (
"context"
"crypto/sha256"
"encoding/hex"
"fmt"
"net/http"
"os"
"github.com/go-chi/jwtauth/v5"
"gopkg.in/yaml.v3"
)
type User struct {
Username string `json:"username"`
Email string `json:"email" yaml:"email"`
Name string `json:"name" yaml:"name"`
Avatar string `json:"avatar,omitempty"`
Password string `json:"-" yaml:"password"`
}
func newUser(username, email, name string) User {
avatar := ""
if email != "" {
avatar = fmt.Sprintf("https://gravatar.com/avatar/%s?d=https%%3A%%2F%%2Fui-avatars.com%%2Fapi%%2F/%s/128", hashEmail(email), name)
}
return User{
Username: username,
Email: email,
Name: name,
Avatar: avatar,
}
}
type UserDatabase struct {
Users map[string]*User `yaml:"users"`
}
func ReadUsersFromFile(path string) (UserDatabase, error) {
users := UserDatabase{}
file, err := os.Open(path)
if err != nil {
return users, err
}
defer file.Close()
if err := yaml.NewDecoder(file).Decode(&users); err != nil {
return users, err
}
for username, user := range users.Users {
user.Username = username
}
return users, nil
}
func (u *UserDatabase) Find(username string) *User {
user, ok := u.Users[username]
if !ok {
return nil
}
return user
}
func (u *UserDatabase) FindByPassword(username, password string) *User {
user := u.Find(username)
if user == nil {
return nil
}
if user.Password != sha256sum(password) {
return nil
}
return user
}
func sha256sum(s string) string {
bytes := sha256.Sum256([]byte(s))
return hex.EncodeToString(bytes[:])
}
func UserFromContext(ctx context.Context) *User {
if user, ok := ctx.Value(remoteUser).(User); ok {
return &user
} else {
if _, claims, err := jwtauth.FromContext(ctx); err == nil {
username, ok := claims["username"].(string)
if !ok {
return nil
}
if username == "" {
return nil
}
email := claims["email"].(string)
name := claims["name"].(string)
user := newUser(username, email, name)
return &user
}
return nil
}
}
func RequireAuthentication(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
user := UserFromContext(r.Context())
if user != nil {
next.ServeHTTP(w, r)
} else {
http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
}
})
}
+67
View File
@@ -0,0 +1,67 @@
package content
import (
"bytes"
"fmt"
"os"
"path/filepath"
"github.com/yuin/goldmark"
meta "github.com/yuin/goldmark-meta"
"github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/parser"
)
type Page struct {
Id string `json:"id"`
Title string `json:"title"`
Content string `json:"content,omitempty"`
}
func ReadAll() ([]Page, error) {
var pages []Page
files, err := filepath.Glob("data/content/*.md")
if err != nil {
return nil, fmt.Errorf("error reading /data/content/*.md: %w", err)
}
for _, file := range files {
id := filepath.Base(file)
id = id[0 : len(id)-3]
page, err := Read(id)
if err != nil {
return nil, fmt.Errorf("error reading %s: %w", id, err)
}
pages = append(pages, page)
}
return pages, nil
}
func Read(id string) (Page, error) {
data, err := os.ReadFile("data/content/" + id + ".md")
if err != nil {
return Page{}, fmt.Errorf("error reading /data/content/%s.md: %w", id, err)
}
markdown := goldmark.New(
goldmark.WithExtensions(extension.GFM, meta.New()),
)
context := parser.NewContext()
var buf bytes.Buffer
if err := markdown.Convert(data, &buf, parser.WithContext(context)); err != nil {
return Page{}, fmt.Errorf("error converting markdown: %w", err)
}
metaData := meta.Get(context)
page := Page{
Content: buf.String(),
Id: id,
Title: id,
}
if title, ok := metaData["title"]; ok {
page.Title = title.(string)
}
return page, nil
}
+6 -6
View File
@@ -43,7 +43,7 @@ func init() {
data_path = path
}
func SaveUserSettings(user *auth.User, settings *Settings) error {
func SaveUserSettings(user auth.User, settings Settings) error {
path := filepath.Join(data_path, user.Username)
// Create user directory if it doesn't exist
@@ -76,24 +76,24 @@ func SaveUserSettings(user *auth.User, settings *Settings) error {
return f.Sync()
}
func LoadUserSettings(user *auth.User) (*Settings, error) {
func LoadUserSettings(user auth.User) (Settings, error) {
path := filepath.Join(data_path, user.Username)
settings_path := filepath.Join(path, "settings.json")
if _, err := os.Stat(settings_path); os.IsNotExist(err) {
return &Settings{}, errors.New("Settings file does not exist")
return Settings{}, errors.New("Settings file does not exist")
}
f, err := os.Open(settings_path)
if err != nil {
return nil, err
return Settings{}, err
}
defer f.Close()
var settings Settings
if err := json.NewDecoder(f).Decode(&settings); err != nil {
return nil, err
return Settings{}, err
}
return &settings, nil
return settings, nil
}
+90
View File
@@ -0,0 +1,90 @@
package releases
import (
"bytes"
"encoding/json"
"net/http"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
"github.com/yuin/goldmark"
)
type githubRelease struct {
Name string `json:"name"`
MentionsCount int `json:"mentions_count"`
TagName string `json:"tag_name"`
Body string `json:"body"`
CreatedAt time.Time `json:"created_at"`
HtmlUrl string `json:"html_url"`
}
type Release struct {
Name string `json:"name"`
MentionsCount int `json:"mentionsCount"`
Tag string `json:"tag"`
Body string `json:"body"`
CreatedAt time.Time `json:"createdAt"`
HtmlUrl string `json:"htmlUrl"`
Latest bool `json:"latest"`
Features int `json:"features"`
BugFixes int `json:"bugFixes"`
Breaking int `json:"breaking"`
}
func Fetch(currentVersion string) ([]Release, error) {
response, err := http.Get("https://api.github.com/repos/amir20/dozzle/releases?per_page=9")
if err != nil {
return nil, err
}
defer response.Body.Close()
var githubReleases []githubRelease
if err := json.NewDecoder(response.Body).Decode(&githubReleases); err != nil {
return []Release{}, err
}
var releases []Release
for _, githubRelease := range githubReleases {
var buffer bytes.Buffer
goldmark.Convert([]byte(githubRelease.Body), &buffer)
html := buffer.String()
if githubRelease.TagName == currentVersion {
break
}
release := Release{
Name: githubRelease.Name,
MentionsCount: githubRelease.MentionsCount,
Tag: githubRelease.TagName,
Body: html,
CreatedAt: githubRelease.CreatedAt,
HtmlUrl: githubRelease.HtmlUrl,
}
doc, _ := goquery.NewDocumentFromReader(&buffer)
doc.Find("h3").Each(func(i int, s *goquery.Selection) {
if strings.Contains(s.Text(), "Features") {
release.Features = s.Next().Find("li").Length()
}
if strings.Contains(s.Text(), "Bug Fixes") {
release.BugFixes = s.Next().Find("li").Length()
}
if strings.Contains(s.Text(), "Breaking Changes") {
release.Breaking = s.Next().Find("li").Length()
}
})
releases = append(releases, release)
}
if len(releases) > 0 {
releases[0].Latest = true
}
return releases, nil
}
+10 -1
View File
@@ -32,6 +32,15 @@ Location: /foobar/login
<a href="/foobar/login">Temporary Redirect</a>.
/* snapshot: Test_createRoutes_simple_redirect */
HTTP/1.1 307 Temporary Redirect
Connection: close
Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' gravatar.com data:; manifest-src 'self'; connect-src 'self' api.github.com;
Content-Type: text/html; charset=utf-8
Location: /login
<a href="/login">Temporary Redirect</a>.
/* snapshot: Test_createRoutes_username_password */
HTTP/1.1 307 Temporary Redirect
Connection: close
@@ -75,7 +84,7 @@ Content-Type: text/html
HTTP/1.1 200 OK
Connection: close
Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' gravatar.com data:; manifest-src 'self'; connect-src 'self' api.github.com;
Content-Type: application/ld+json; charset=UTF-8
Content-Type: application/x-jsonl; charset=UTF-8
{"m":"INFO Testing stdout logs...","ts":1589396137772,"id":466600245,"l":"info","s":"stdout"}
{"m":"INFO Testing stderr logs...","ts":1589396197772,"id":1101501603,"l":"info","s":"stderr"}
+34
View File
@@ -101,6 +101,40 @@ func (h *handler) validateCredentials(w http.ResponseWriter, r *http.Request) {
http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
}
func (h *handler) createToken(w http.ResponseWriter, r *http.Request) {
user := r.PostFormValue("username")
pass := r.PostFormValue("password")
if token, err := h.config.Authorization.Authorizer.CreateToken(user, pass); err == nil {
http.SetCookie(w, &http.Cookie{
Name: "jwt",
Value: token,
HttpOnly: true,
Path: "/",
SameSite: http.SameSiteLaxMode,
})
log.Infof("Token created for user %s", user)
w.WriteHeader(http.StatusOK)
w.Write([]byte(http.StatusText(http.StatusOK)))
} else {
log.Errorf("Error while creating token: %v", err)
http.Error(w, err.Error(), http.StatusUnauthorized)
}
}
func (h *handler) deleteToken(w http.ResponseWriter, r *http.Request) {
http.SetCookie(w, &http.Cookie{
Name: "jwt",
Value: "",
HttpOnly: true,
Path: "/",
SameSite: http.SameSiteLaxMode,
Expires: time.Unix(0, 0),
})
w.WriteHeader(http.StatusOK)
w.Write([]byte(http.StatusText(http.StatusOK)))
}
func (h *handler) clearSession(w http.ResponseWriter, r *http.Request) {
if !secured {
log.Panic("Validating credentials with secured=false should not happen")
+25
View File
@@ -0,0 +1,25 @@
package web
import (
"encoding/json"
"net/http"
"github.com/amir20/dozzle/internal/content"
"github.com/go-chi/chi/v5"
log "github.com/sirupsen/logrus"
)
func (h *handler) staticContent(w http.ResponseWriter, r *http.Request) {
id := chi.URLParam(r, "id")
content, err := content.Read(id)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
log.Warnf("error reading content: %v", err)
return
}
w.Header().Set("Content-Type", "application/json")
if err := json.NewEncoder(w).Encode(content); err != nil {
log.Errorf("json encoding error while streaming %v", err.Error())
}
}
+68 -82
View File
@@ -7,11 +7,10 @@ import (
"sort"
"net/http"
"os"
"path"
"github.com/amir20/dozzle/internal/analytics"
"github.com/amir20/dozzle/internal/auth"
"github.com/amir20/dozzle/internal/content"
"github.com/amir20/dozzle/internal/docker"
"github.com/amir20/dozzle/internal/profile"
@@ -27,12 +26,71 @@ func (h *handler) index(w http.ResponseWriter, req *http.Request) {
http.Redirect(w, req, path.Clean(h.config.Base+"/login"), http.StatusTemporaryRedirect)
return
}
go h.sendRequestEvent()
h.executeTemplate(w, req)
}
}
func (h *handler) executeTemplate(w http.ResponseWriter, req *http.Request) {
base := ""
if h.config.Base != "/" {
base = h.config.Base
}
hosts := make([]*docker.Host, 0, len(h.clients))
for _, v := range h.clients {
hosts = append(hosts, v.Host())
}
sort.Slice(hosts, func(i, j int) bool {
return hosts[i].Name < hosts[j].Name
})
config := map[string]interface{}{
"base": base,
"version": h.config.Version,
"authorizationNeeded": h.isAuthorizationNeeded(req),
"secured": secured,
"hostname": h.config.Hostname,
"hosts": hosts,
"authProvider": h.config.Authorization.Provider,
}
pages, err := content.ReadAll()
if err != nil {
log.Errorf("error reading content: %v", err)
} else if len(pages) > 0 {
for _, page := range pages {
page.Content = ""
}
config["pages"] = pages
}
user := auth.UserFromContext(req.Context())
if user != nil {
if settings, err := profile.LoadUserSettings(*user); err == nil {
config["serverSettings"] = settings
} else {
config["serverSettings"] = struct{}{}
}
config["user"] = user
} else if h.config.Authorization.Provider == FORWARD_PROXY {
log.Error("Unable to find remote user. Please check your proxy configuration. Expecting headers Remote-Email, Remote-User, Remote-Name.")
log.Debugf("Dumping all headers for url /%s", req.URL.String())
for k, v := range req.Header {
log.Debugf("%s: %s", k, v)
}
http.Error(w, "Unauthorized user", http.StatusUnauthorized)
return
} else if h.config.Authorization.Provider == SIMPLE && req.URL.Path != "login" {
log.Debugf("Redirecting to login page for url /%s", req.URL.String())
http.Redirect(w, req, path.Clean(h.config.Base+"/login"), http.StatusTemporaryRedirect)
return
}
data := map[string]interface{}{
"Config": config,
"Dev": h.config.Dev,
"Manifest": h.readManifest(),
"Base": base,
}
file, err := h.content.Open("index.html")
if err != nil {
log.Panic(err)
@@ -43,62 +101,19 @@ func (h *handler) executeTemplate(w http.ResponseWriter, req *http.Request) {
}
tmpl, err := template.New("index.html").Funcs(template.FuncMap{
"marshal": func(v interface{}) template.JS {
a, _ := json.Marshal(v)
return template.JS(a)
var p []byte
if h.config.Dev {
p, _ = json.MarshalIndent(v, "", " ")
} else {
p, _ = json.Marshal(v)
}
return template.JS(p)
},
}).Parse(string(bytes))
if err != nil {
log.Panic(err)
}
path := ""
if h.config.Base != "/" {
path = h.config.Base
}
hosts := make([]*docker.Host, 0, len(h.clients))
for _, v := range h.clients {
hosts = append(hosts, v.Host())
}
sort.Slice(hosts, func(i, j int) bool {
return hosts[i].Name < hosts[j].Name
})
config := map[string]interface{}{
"base": path,
"version": h.config.Version,
"authorizationNeeded": h.isAuthorizationNeeded(req),
"secured": secured,
"hostname": h.config.Hostname,
"hosts": hosts,
}
if h.config.AuthProvider == FORWARD_PROXY {
user := auth.RemoteUserFromContext(req.Context())
if user == nil {
log.Error("Unable to find remote user. Please check your proxy configuration. Expecting headers Remote-Email, Remote-User, Remote-Name.")
log.Debugf("Dumping all headers for url /%s", req.URL.String())
for k, v := range req.Header {
log.Debugf("%s: %s", k, v)
}
http.Error(w, "Unauthorized user", http.StatusUnauthorized)
return
}
config["user"] = user
if settings, err := profile.LoadUserSettings(user); err == nil {
config["serverSettings"] = settings
} else {
config["serverSettings"] = struct{}{}
}
}
data := map[string]interface{}{
"Config": config,
"Dev": h.config.Dev,
"Manifest": h.readManifest(),
"Base": path,
}
err = tmpl.Execute(w, data)
if err != nil {
log.Panic(err)
@@ -127,32 +142,3 @@ func (h *handler) readManifest() map[string]interface{} {
return manifest
}
}
func (h *handler) sendRequestEvent() {
if !h.config.NoAnalytics {
host, _ := os.Hostname()
var client DockerClient
for _, v := range h.clients {
client = v
break
}
if containers, err := client.ListContainers(); err == nil {
totalContainers := len(containers)
runningContainers := 0
for _, container := range containers {
if container.State == "running" {
runningContainers++
}
}
re := analytics.RequestEvent{
ClientId: host,
TotalContainers: totalContainers,
RunningContainers: runningContainers,
}
analytics.SendRequestEvent(re)
}
}
}
+1 -1
View File
@@ -51,7 +51,7 @@ func (h *handler) downloadLogs(w http.ResponseWriter, r *http.Request) {
}
func (h *handler) fetchLogsBetweenDates(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/ld+json; charset=UTF-8")
w.Header().Set("Content-Type", "application/x-jsonl; charset=UTF-8")
from, _ := time.Parse(time.RFC3339, r.URL.Query().Get("from"))
to, _ := time.Parse(time.RFC3339, r.URL.Query().Get("to"))
+2 -2
View File
@@ -16,13 +16,13 @@ func (h *handler) saveSettings(w http.ResponseWriter, r *http.Request) {
return
}
user := auth.RemoteUserFromContext(r.Context())
user := auth.UserFromContext(r.Context())
if user == nil {
http.Error(w, "Unable to find user", http.StatusInternalServerError)
return
}
if err := profile.SaveUserSettings(user, &settings); err != nil {
if err := profile.SaveUserSettings(*user, settings); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
log.Errorf("Unable to save user settings: %s", err)
return
+24
View File
@@ -0,0 +1,24 @@
package web
import (
"encoding/json"
"net/http"
"github.com/amir20/dozzle/internal/releases"
log "github.com/sirupsen/logrus"
)
func (h *handler) releases(w http.ResponseWriter, r *http.Request) {
releases, err := releases.Fetch(h.config.Version)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
log.Warnf("error reading releases: %v", err)
return
}
w.Header().Set("Content-Type", "application/json")
if err := json.NewEncoder(w).Encode(releases); err != nil {
log.Errorf("json encoding error while streaming %v", err.Error())
}
}
+41 -16
View File
@@ -19,21 +19,32 @@ import (
type AuthProvider string
const (
NONE AuthProvider = "none"
SIMPLE AuthProvider = "simple"
FORWARD_PROXY AuthProvider = "forward-proxy"
)
// Config is a struct for configuring the web service
type Config struct {
Base string
Addr string
Version string
Username string
Password string
Hostname string
NoAnalytics bool
Dev bool
AuthProvider AuthProvider
Base string
Addr string
Version string
Username string
Password string
Hostname string
NoAnalytics bool
Dev bool
Authorization Authorization
}
type Authorization struct {
Provider AuthProvider
Authorizer Authorizer
}
type Authorizer interface {
AuthMiddleware(http.Handler) http.Handler
CreateToken(string, string) (string, error)
}
type handler struct {
@@ -75,20 +86,29 @@ func createRouter(h *handler) *chi.Mux {
r.Use(cspHeaders)
}
if h.config.Authorization.Provider != NONE && h.config.Authorization.Authorizer == nil {
log.Panic("Authorization provider is set but no authorizer is provided")
}
r.Route(base, func(r chi.Router) {
if h.config.Authorization.Provider != NONE {
r.Use(h.config.Authorization.Authorizer.AuthMiddleware)
}
r.Group(func(r chi.Router) {
if h.config.AuthProvider == FORWARD_PROXY {
r.Use(auth.ForwardProxyAuthorizationRequired)
}
r.Group(func(r chi.Router) {
r.Use(authorizationRequired)
if h.config.Authorization.Provider != NONE {
r.Use(auth.RequireAuthentication)
}
r.Use(authorizationRequired) // TODO remove this
r.Get("/api/logs/stream/{host}/{id}", h.streamLogs)
r.Get("/api/logs/download/{host}/{id}", h.downloadLogs)
r.Get("/api/logs/{host}/{id}", h.fetchLogsBetweenDates)
r.Get("/api/events/stream", h.streamEvents)
r.Get("/logout", h.clearSession)
r.Get("/version", h.version)
r.Get("/api/releases", h.releases)
r.Put("/api/profile/settings", h.saveSettings)
r.Get("/api/content/{id}", h.staticContent)
r.Get("/logout", h.clearSession) // TODO remove this
r.Get("/version", h.version)
})
defaultHandler := http.StripPrefix(strings.Replace(base+"/", "//", "/", 1), http.HandlerFunc(h.index))
@@ -97,7 +117,12 @@ func createRouter(h *handler) *chi.Mux {
})
})
r.Post("/api/validateCredentials", h.validateCredentials)
if h.config.Authorization.Provider == SIMPLE {
r.Post("/api/token", h.createToken)
r.Delete("/api/token", h.deleteToken)
}
r.Post("/api/validateCredentials", h.validateCredentials) // TODO remove this
r.Get("/healthcheck", h.healthcheck)
})
+12 -12
View File
@@ -27,7 +27,7 @@ func Test_createRoutes_index(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/"})
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/", Authorization: Authorization{Provider: NONE}})
req, err := http.NewRequest("GET", "/", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
@@ -40,7 +40,7 @@ func Test_createRoutes_redirect(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/foobar"})
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/foobar", Authorization: Authorization{Provider: NONE}})
req, err := http.NewRequest("GET", "/foobar", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
@@ -53,7 +53,7 @@ func Test_createRoutes_redirect_with_auth(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/foobar", Username: "amir", Password: "password"})
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/foobar", Username: "amir", Password: "password", Authorization: Authorization{Provider: NONE}})
req, err := http.NewRequest("GET", "/foobar/", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
@@ -66,7 +66,7 @@ func Test_createRoutes_foobar(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("foo page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/foobar"})
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/foobar", Authorization: Authorization{Provider: NONE}})
req, err := http.NewRequest("GET", "/foobar/", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
@@ -80,7 +80,7 @@ func Test_createRoutes_foobar_file(t *testing.T) {
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
require.NoError(t, afero.WriteFile(fs, "test", []byte("test page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/foobar"})
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/foobar", Authorization: Authorization{Provider: NONE}})
req, err := http.NewRequest("GET", "/foobar/test", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
@@ -92,7 +92,7 @@ func Test_createRoutes_foobar_file(t *testing.T) {
func Test_createRoutes_version(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/", Version: "dev"})
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/", Version: "dev", Authorization: Authorization{Provider: NONE}})
req, err := http.NewRequest("GET", "/version", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
@@ -103,7 +103,7 @@ func Test_createRoutes_version(t *testing.T) {
func Test_createRoutes_username_password(t *testing.T) {
handler := createHandler(nil, nil, Config{Base: "/", Username: "amir", Password: "password"})
handler := createHandler(nil, nil, Config{Base: "/", Username: "amir", Password: "password", Authorization: Authorization{Provider: NONE}})
req, err := http.NewRequest("GET", "/", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
@@ -112,7 +112,7 @@ func Test_createRoutes_username_password(t *testing.T) {
}
func Test_createRoutes_username_password_invalid(t *testing.T) {
handler := createHandler(nil, nil, Config{Base: "/", Username: "amir", Password: "password"})
handler := createHandler(nil, nil, Config{Base: "/", Username: "amir", Password: "password", Authorization: Authorization{Provider: NONE}})
req, err := http.NewRequest("GET", "/api/logs/stream/localhost/123?stdout=1&stderr=1", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
@@ -121,7 +121,7 @@ func Test_createRoutes_username_password_invalid(t *testing.T) {
}
func Test_createRoutes_username_password_login_happy(t *testing.T) {
handler := createHandler(nil, nil, Config{Base: "/", Username: "amir", Password: "password"})
handler := createHandler(nil, nil, Config{Base: "/", Username: "amir", Password: "password", Authorization: Authorization{Provider: NONE}})
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
@@ -151,7 +151,7 @@ func Test_createRoutes_username_password_login_happy(t *testing.T) {
}
func Test_createRoutes_username_password_login_failed(t *testing.T) {
handler := createHandler(nil, nil, Config{Base: "/", Username: "amir", Password: "password"})
handler := createHandler(nil, nil, Config{Base: "/", Username: "amir", Password: "password", Authorization: Authorization{Provider: NONE}})
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
@@ -181,7 +181,7 @@ func Test_createRoutes_username_password_valid_session(t *testing.T) {
mockedClient := new(MockedClient)
mockedClient.On("FindContainer", "123").Return(docker.Container{ID: "123"}, nil)
mockedClient.On("ContainerLogs", mock.Anything, "123", "", docker.STDALL).Return(io.NopCloser(strings.NewReader("test data")), io.EOF)
handler := createHandler(mockedClient, nil, Config{Base: "/", Username: "amir", Password: "password"})
handler := createHandler(mockedClient, nil, Config{Base: "/", Username: "amir", Password: "password", Authorization: Authorization{Provider: NONE}})
// Get cookie first
req, err := http.NewRequest("GET", "/api/logs/stream/localhost/123?stdout=1&stderr=1", nil)
@@ -205,7 +205,7 @@ func Test_createRoutes_username_password_invalid_session(t *testing.T) {
mockedClient := new(MockedClient)
mockedClient.On("FindContainer", "123").Return(docker.Container{ID: "123"}, nil)
mockedClient.On("ContainerLogs", mock.Anything, "since", docker.STDALL).Return(io.NopCloser(strings.NewReader("test data")), io.EOF)
handler := createHandler(mockedClient, nil, Config{Base: "/", Username: "amir", Password: "password"})
handler := createHandler(mockedClient, nil, Config{Base: "/", Username: "amir", Password: "password", Authorization: Authorization{Provider: NONE}})
req, err := http.NewRequest("GET", "/api/logs/stream/localhost/123?stdout=1&stderr=1", nil)
require.NoError(t, err, "NewRequest should not return an error.")
req.AddCookie(&http.Cookie{Name: "session", Value: "baddata"})
+54
View File
@@ -0,0 +1,54 @@
package web
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/amir20/dozzle/internal/auth"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/spf13/afero"
)
func Test_createRoutes_proxy_missing_headers(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/",
Authorization: Authorization{
Provider: FORWARD_PROXY,
Authorizer: auth.NewForwardProxyAuth(),
},
})
req, err := http.NewRequest("GET", "/", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
handler.ServeHTTP(rr, req)
assert.Equal(t, 401, rr.Code, "Response code should be 401.")
}
func Test_createRoutes_proxy_happy(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/",
Authorization: Authorization{
Provider: FORWARD_PROXY,
Authorizer: auth.NewForwardProxyAuth(),
},
})
req, err := http.NewRequest("GET", "/", nil)
req.Header.Set("Remote-Email", "amir@test.com")
req.Header.Set("Remote-Name", "Amir")
req.Header.Set("Remote-User", "amir")
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
handler.ServeHTTP(rr, req)
assert.Equal(t, 200, rr.Code, "Response code should be 200.")
}
+132
View File
@@ -0,0 +1,132 @@
package web
import (
"bytes"
"io"
"mime/multipart"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/amir20/dozzle/internal/auth"
"github.com/beme/abide"
"github.com/magiconair/properties/assert"
"github.com/stretchr/testify/require"
"github.com/spf13/afero"
)
func Test_createRoutes_simple_redirect(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/",
Authorization: Authorization{
Provider: SIMPLE,
Authorizer: auth.NewSimpleAuth(auth.UserDatabase{
Users: map[string]*auth.User{
"amir": {
Username: "amir",
Password: "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",
},
},
}),
},
})
req, err := http.NewRequest("GET", "/", nil)
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
handler.ServeHTTP(rr, req)
abide.AssertHTTPResponse(t, t.Name(), rr.Result())
}
func Test_createRoutes_simple_valid_token(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/",
Authorization: Authorization{
Provider: SIMPLE,
Authorizer: auth.NewSimpleAuth(auth.UserDatabase{
Users: map[string]*auth.User{
"amir": {
Username: "amir",
Password: "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",
},
},
}),
},
})
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
fw, err := writer.CreateFormField("username")
require.NoError(t, err, "Creating field should not be error.")
_, err = io.Copy(fw, strings.NewReader("amir"))
require.NoError(t, err, "Copying field should not result in error.")
fw, err = writer.CreateFormField("password")
require.NoError(t, err, "Creating field should not be error.")
_, err = io.Copy(fw, strings.NewReader("password"))
require.NoError(t, err, "Copying field should not result in error.")
writer.Close()
req, err := http.NewRequest("POST", "/api/token", bytes.NewReader(body.Bytes()))
req.Header.Set("Content-Type", writer.FormDataContentType())
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
handler.ServeHTTP(rr, req)
assert.Equal(t, rr.Code, 200)
cookie := rr.Header().Get("Set-Cookie")
assert.Matches(t, cookie, "jwt=.+")
}
func Test_createRoutes_simple_bad_password(t *testing.T) {
fs := afero.NewMemMapFs()
require.NoError(t, afero.WriteFile(fs, "index.html", []byte("index page"), 0644), "WriteFile should have no error.")
handler := createHandler(nil, afero.NewIOFS(fs), Config{Base: "/",
Authorization: Authorization{
Provider: SIMPLE,
Authorizer: auth.NewSimpleAuth(auth.UserDatabase{
Users: map[string]*auth.User{
"amir": {
Username: "amir",
Password: "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",
},
},
}),
},
})
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
fw, err := writer.CreateFormField("username")
require.NoError(t, err, "Creating field should not be error.")
_, err = io.Copy(fw, strings.NewReader("amir"))
require.NoError(t, err, "Copying field should not result in error.")
fw, err = writer.CreateFormField("badpassword")
require.NoError(t, err, "Creating field should not be error.")
_, err = io.Copy(fw, strings.NewReader("password"))
require.NoError(t, err, "Copying field should not result in error.")
writer.Close()
req, err := http.NewRequest("POST", "/api/token", bytes.NewReader(body.Bytes()))
req.Header.Set("Content-Type", writer.FormDataContentType())
require.NoError(t, err, "NewRequest should not return an error.")
rr := httptest.NewRecorder()
handler.ServeHTTP(rr, req)
assert.Equal(t, rr.Code, 401, "Response code should be 401.")
}
+1 -1
View File
@@ -80,5 +80,5 @@ func createHandler(client DockerClient, content fs.FS, config Config) *chi.Mux {
}
func createDefaultHandler(client DockerClient) *chi.Mux {
return createHandler(client, nil, Config{Base: "/"})
return createHandler(client, nil, Config{Base: "/", Authorization: Authorization{Provider: NONE}})
}
+8
View File
@@ -80,3 +80,11 @@ settings:
rel="noreferrer noopener">{nextVersion}</a>.
show-std: Show stdout and stderr labels
automatic-redirect: Automatically redirect to new containers with the same name
releases:
features: one new feature | {count} features
bugFixes: one bug fix | {count} fixes
breaking: one breaking change | {count} breaking changes
three_parts: "{first}, {second} and {third}"
two_parts: "{first} with {second}"
latest: Latest
no_releases: You have the latest version
+35 -12
View File
@@ -7,6 +7,7 @@ import (
"net/http"
"os"
"os/signal"
"path/filepath"
"reflect"
"strings"
"syscall"
@@ -14,6 +15,7 @@ import (
"github.com/alexflint/go-arg"
"github.com/amir20/dozzle/internal/analytics"
"github.com/amir20/dozzle/internal/auth"
"github.com/amir20/dozzle/internal/docker"
"github.com/amir20/dozzle/internal/healthcheck"
"github.com/amir20/dozzle/internal/web"
@@ -173,23 +175,42 @@ func createClients(args args,
func createServer(args args, clients map[string]web.DockerClient) *http.Server {
_, dev := os.LookupEnv("DEV")
var provider web.AuthProvider
var provider web.AuthProvider = web.NONE
var authorizer web.Authorizer
if args.AuthProvider == "forward-proxy" {
provider = web.FORWARD_PROXY
authorizer = auth.NewForwardProxyAuth()
} else if args.AuthProvider == "simple" {
provider = web.SIMPLE
path, err := filepath.Abs("./data/users.yml")
if err != nil {
log.Fatalf("Could not find absolute path to users.yml file: %s", err)
}
if _, err := os.Stat(path); os.IsNotExist(err) {
log.Fatalf("Could not find users.yml file at %s", path)
}
users, err := auth.ReadUsersFromFile(path)
if err != nil {
log.Fatalf("Could not read users.yml file at %s: %s", path, err)
}
authorizer = auth.NewSimpleAuth(users)
}
config := web.Config{
Addr: args.Addr,
Base: args.Base,
Version: version,
Username: args.Username,
Password: args.Password,
Hostname: args.Hostname,
NoAnalytics: args.NoAnalytics,
Dev: dev,
AuthProvider: provider,
Addr: args.Addr,
Base: args.Base,
Version: version,
Username: args.Username,
Password: args.Password,
Hostname: args.Hostname,
NoAnalytics: args.NoAnalytics,
Dev: dev,
Authorization: web.Authorization{
Provider: provider,
Authorizer: authorizer,
},
}
assets, err := fs.Sub(content, "dist")
@@ -224,8 +245,9 @@ func createLocalClient(args args, localClientFactory func(map[string][]string) (
dockerClient, err := localClientFactory(args.Filter)
if err == nil {
_, err := dockerClient.ListContainers()
if err == nil {
if err != nil {
log.Warnf("Could not connect to local Docker Engine: %s", err)
} else {
log.Debugf("Connected to local Docker Engine")
return dockerClient
}
@@ -269,6 +291,7 @@ func parseArgs() args {
}
if args.Username != "" || args.Password != "" {
log.Warn("Using --username and --password is being deprecated and removed in v6.x. Use --auth-provider instead. See https://dozzle.dev/guide/authentication#file-based-user-management for more information.")
if args.Username == "" || args.Password == "" {
log.Fatalf("Username AND password are required for authentication")
}
-6
View File
@@ -1,6 +0,0 @@
[build]
publish = "docs/.vitepress/dist"
command = "pnpm docs:build"
[functions]
directory = "docs/functions"
+29 -28
View File
@@ -1,12 +1,12 @@
{
"name": "dozzle",
"version": "5.1.2",
"version": "5.4.2",
"description": "Realtime log viewer for docker containers. ",
"homepage": "https://github.com/amir20/dozzle#readme",
"bugs": {
"url": "https://github.com/amir20/dozzle/issues"
},
"packageManager": "pnpm@8.10.0",
"packageManager": "pnpm@8.10.4",
"repository": {
"type": "git",
"url": "git+https://github.com/amir20/dozzle.git"
@@ -33,12 +33,13 @@
"@iconify-json/mdi-light": "^1.1.7",
"@iconify-json/octicon": "^1.1.49",
"@iconify-json/ph": "^1.1.6",
"@intlify/unplugin-vue-i18n": "^1.4.0",
"@vueuse/components": "^10.5.0",
"@vueuse/core": "^10.5.0",
"@vueuse/integrations": "^10.5.0",
"@vueuse/math": "^10.5.0",
"@vueuse/router": "^10.5.0",
"@intlify/unplugin-vue-i18n": "^1.5.0",
"@tailwindcss/typography": "^0.5.10",
"@vueuse/components": "^10.6.1",
"@vueuse/core": "^10.6.1",
"@vueuse/integrations": "^10.6.1",
"@vueuse/math": "^10.6.1",
"@vueuse/router": "^10.6.1",
"ansi-to-html": "^0.7.2",
"autoprefixer": "^10.4.16",
"d3-array": "^3.2.4",
@@ -47,7 +48,7 @@
"d3-selection": "^3.0.0",
"d3-shape": "^3.2.0",
"d3-transition": "^3.0.1",
"daisyui": "^3.9.4",
"daisyui": "^4.0.4",
"date-fns": "^2.30.0",
"entities": "^4.5.0",
"fuse.js": "^7.0.0",
@@ -58,31 +59,31 @@
"splitpanes": "^3.1.5",
"tailwindcss": "^3.3.5",
"unplugin-auto-import": "^0.16.7",
"unplugin-icons": "^0.17.1",
"unplugin-icons": "^0.17.4",
"unplugin-vue-components": "^0.25.2",
"unplugin-vue-macros": "^2.6.1",
"unplugin-vue-macros": "^2.6.2",
"vite": "4.5.0",
"vite-plugin-pages": "^0.31.0",
"vite-plugin-vue-layouts": "^0.8.0",
"vue": "^3.3.7",
"vue-i18n": "^9.6.2",
"vue": "^3.3.8",
"vue-i18n": "^9.6.5",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@iconify-json/ic": "^1.1.14",
"@pinia/testing": "^0.1.3",
"@playwright/test": "^1.39.0",
"@types/d3-array": "^3.0.9",
"@types/d3-ease": "^3.0.1",
"@types/d3-scale": "^4.0.6",
"@types/d3-selection": "^3.0.8",
"@types/d3-shape": "^3.1.4",
"@types/d3-transition": "^3.0.6",
"@types/lodash.debounce": "^4.0.8",
"@types/node": "^20.8.9",
"@types/semver": "^7.5.4",
"@vitejs/plugin-vue": "4.4.0",
"@vue/compiler-sfc": "^3.3.7",
"@types/d3-array": "^3.2.1",
"@types/d3-ease": "^3.0.2",
"@types/d3-scale": "^4.0.8",
"@types/d3-selection": "^3.0.10",
"@types/d3-shape": "^3.1.5",
"@types/d3-transition": "^3.0.8",
"@types/lodash.debounce": "^4.0.9",
"@types/node": "^20.9.0",
"@types/semver": "^7.5.5",
"@vitejs/plugin-vue": "4.4.1",
"@vue/compiler-sfc": "^3.3.8",
"@vue/test-utils": "^2.4.1",
"bumpp": "^9.2.0",
"c8": "^8.0.1",
@@ -90,13 +91,13 @@
"eventsourcemock": "^2.0.0",
"jest-serializer-vue": "^3.1.0",
"jsdom": "^22.1.0",
"lint-staged": "^15.0.2",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.6",
"lint-staged": "^15.1.0",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.7",
"simple-git-hooks": "^2.9.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vitepress": "1.0.0-rc.24",
"vitepress": "1.0.0-rc.25",
"vitest": "^0.34.6",
"vue-tsc": "^1.8.22"
},
+433 -380
View File
File diff suppressed because it is too large Load Diff
+13 -15
View File
@@ -1,5 +1,6 @@
import type { Config } from "tailwindcss";
import DaisyUI from "daisyui";
import Typography from "@tailwindcss/typography";
export default {
content: ["./assets/**/*.{vue,js,ts}", "./public/index.html"],
@@ -9,24 +10,21 @@ export default {
"bounce-fast": "bounce 0.5s 2 both",
},
colors: {
green: "hsl(177 100% 35%)",
red: "hsl(4 90% 58%)",
purple: "hsl(291 64% 42%)",
blue: "hsl(207 90% 54%)",
orange: "hsl(25 95% 53%)",
base: "hsl(var(--base-color) / <alpha-value>)",
"base-darker": "hsl(var(--base-darker-color) / <alpha-value>)",
"base-lighter": "hsl(var(--base-lighter-color) / <alpha-value>)",
"base-content": "hsl(var(--base-content-color) / <alpha-value>)",
primary: "hsl(var(--primary-color) / <alpha-value>)",
"primary-focus": "hsl(var(--primary-focus-color) / <alpha-value>)",
secondary: "hsl(var(--secondary-color) / <alpha-value>)",
"secondary-focus": "hsl(var(--secondary-focus-color) / <alpha-value>)",
green: "oklch(69% 0.119722 188.479048)",
red: "oklch(64% 0.218 28.85)",
purple: "oklch(51.49% 0.215 321.03)",
blue: "oklch(65% 0.171 249.5)",
orange: "oklch(70% 0.186 48.13)",
base: "oklch(var(--base-color) / <alpha-value>)",
"base-darker": "oklch(var(--base-darker-color) / <alpha-value>)",
"base-lighter": "oklch(var(--base-lighter-color) / <alpha-value>)",
"base-content": "oklch(var(--base-content-color) / <alpha-value>)",
primary: "oklch(var(--primary-color) / <alpha-value>)",
secondary: "oklch(var(--secondary-color) / <alpha-value>)",
},
},
},
plugins: [DaisyUI],
plugins: [DaisyUI, Typography],
daisyui: {
themes: [],
base: false,
+1 -1
View File
@@ -54,7 +54,7 @@ export default defineConfig(() => ({
AutoImport({
imports: ["vue", "vue-router", "vue-i18n", "vue/macros", "pinia", "@vueuse/head", "@vueuse/core"],
dts: "assets/auto-imports.d.ts",
dirs: ["assets/composables", "assets/stores", "assets/utils"],
dirs: ["assets/composable", "assets/stores", "assets/utils"],
vueTemplate: true,
}),
VueI18nPlugin({