Code Monkey home page Code Monkey logo

hajimari's Introduction

Hajimari πŸŒ…

...The beginning of a pleasant experience


Discord Go GitHub Workflow Status


Hajiwhatsi?

Hajimari is a simplistically beautiful startpage designed to be the entrypoint for your self-hosted Kubernetes cluster.

Hajimari

User config

App groups

Features

  • Web and app search with customizable search providers
  • Dynamically list apps discovered from Kubernetes Ingresses or Custom Resources
  • Display replica status for ingress endpoints
  • Support for non-Kubernetes apps via custom apps config
  • Customizable list of bookmarks
  • Selectable themes and custom theme support
  • Automatic light/dark mode
  • Custom configuration overrides per user/browser
  • Multiple instance support

Installation

Helm

helm repo add hajimari https://hajimari.io

helm repo update

helm install hajimari hajimari/hajimari

Helm docs

Locally

Clone the repo and run the following command to generate the hajimari binary:

make deps
make build

Or for local development with hot reload:

make deps
make dev

You will need to have go 1.19 and node 18 installed.

Hajimari will need access to a kubeconfig file for a service account with access to ingress and endpoint slice objects.

Usage

Ingresses

Hajimari looks for specific annotations on Ingresses.

  • Add the following annotations to your ingresses in order for it to be discovered by Hajimari:
Annotation Description Required
hajimari.io/enable Add this with value true to the ingress of the app you want to show in Hajimari true
hajimari.io/icon Icon name from MDI icons false
hajimari.io/appName A custom name for your application. Use if you don't want to use the name of the ingress false
hajimari.io/group A custom group name. Use if you want the application to show in a different group than the namespace it is running in false
hajimari.io/instance A comma separated list of name/s of the Hajimari instance/s where you want this application to appear. Use when you have multiple Hajimari instances false
hajimari.io/url A URL for the Hajimari app (This will override the ingress URL). It MUST begin with a scheme i.e., http:// or https:// false
hajimari.io/targetBlank Determines if links should open in new tabs/windows false
hajimari.io/info A short description of the Hajimari app false

Config

Hajimari supports the following configuration options that can be modified by either ConfigMap or values.yaml if you are using Helm

Field Description Default Type
instanceName Name of the Hajimari instance "" string
defaultEnable Set to true to expose all ingresses in selected namespaces by default false bool
namespaceSelector Namespace selector which uses a combination of hardcoded namespaces as well as label selectors any: true NamespaceSelector
name Name to use in the greeting "You" string
title Browser title for this Hajimari instance "Hajimari" string
lightTheme Theme to use when the browser prefers light themes "gazette" string
darkTheme Theme to use when the brwoser prefers dark themes "horizon" string
customThemes A list of custom themes [] []Theme
showGreeting Toggle showing the greeting and date true bool
showAppGroups Toggle grouping apps by group (namespaces) true bool
showAppUrls Toggle displaying app URLs true bool
showAppInfo Toggle showing app info false bool
showAppStatus Toggle showing app replica status indicators true bool
showBookmarkGroups Toggle grouping bookmarks by group true bool
showGlobalBookmarks Toggle showing global bookmarks on custom startpages false bool
alwaysTargetBlank Set to true to open apps/bookmarks in a new window by default false bool
defaultSearchProvider name of the configured search provider to use as default "Google" string
searchProviders A list of custom search providers [...] []SearchProvider
customApps A list of custom apps to add to the discovered apps [] []AppGroup
globalBookmarks A list of bookmark groups to add [] []BookmarkGroup

HajimariApp objects

It also possible to define Apps via Kubernetes Custom Resources for those using Istio's Virtual Services, Traefik's IngressRoutes or other solutions, which does not reply on native Ingress objects:

apiVersion: hajimari.io/v1alpha1
kind: Application
metadata:
  name: hajimari-issues
spec:
  name: Hajimari Issues
  group: info
  icon: simple-icons:github
  url: https://github.com/toboshii/hajimari/issues
  info: Submit issue to this project
  targetBlank: true

NamespaceSelector

It is a selector for selecting namespaces either selecting all namespaces or a list of namespaces, or filtering namespaces through labels.

Field Description Default Type
any Boolean describing whether all namespaces are selected in contrast to a list restricting them false bool
labelSelector Filter namespaces based on kubernetes metav1.LabelSelector type null metav1.LabelSelector
matchNames List of namespace names null []string

Note: If you specify both labelSelector and matchNames, Hajimari will take a union of all namespaces matched and use them.

Theme

If you want to add custom themes you can provide a list of custom theme atrributes.

Field Description Type
name Name of the theme String
backgroundColor Background color hex value String
primaryColor Primary color hex value String
accentColor Accent color hex value String

SearchProvider

If you want to add custom search providers you can provide a list of custom providers to override the defaults.

Field Description Type
name Name of the search provider String
token Short token used to activate this provider in the search bar String
icon Icon name or URL to use for this search provider String
searchUrl URL to use for searches, the token {query} will be replaced with the query String
url URL to use when only token is entered in search bar String
Default Search Providers

searchProviders defaults to the following values:

searchProviders:
  - name: Google
    token: g
    icon: simple-icons:google
    searchUrl: https://www.google.com/search?q={query}
    url: https://www.google.com
  - name: DuckDuckGo
    token: d
    icon: simple-icons:duckduckgo
    searchUrl: https://duckduckgo.com/?q={query}
    url: https://duckduckgo.com
  - name: IMDB
    token: i
    icon: simple-icons:imdb
    searchUrl: https://www.imdb.com/find?q={query}
    url: https://www.imdb.com
  - name: Reddit
    token: r
    icon: simple-icons:reddit
    searchUrl: https://www.reddit.com/search?q={query}
    url: https://www.reddit.com
  - name: YouTube
    token: 'y'
    icon: simple-icons:youtube
    searchUrl: https://www.youtube.com/results?search_query={query}
    url: https://www.youtube.com
  - name: Spotify
    token: s
    icon: simple-icons:spotify
    searchUrl: hhttps://open.spotify.com/search/{query}
    url: https://open.spotify.com

AppGroup

If you want to add any apps that are not exposed through ingresses or are external to the cluster, you can use the custom apps feature. You can pass a list of custom apps inside the config.

Field Description Type
group Name of the group (namespace) String
apps A list of custom apps []App
App

Custom apps can be added by configuring a list of apps under an app group.

Field Description Type
name Name of the custom app String
icon Icon name or URL for the custom app String
url URL of the custom app String
info Short description of the custom app String
targetBlank Open app in a new window/tab Bool

BookmarkGroup

Bookmark groups can be added by creating a list of groups and associated bookmarks.

Field Description Type
group Name of the bookmark group String
bookmarks Array of bookmarks []Bookmark

Bookmarks can be added by configuring a list of bookmarks under a group.

Bookmark
Field Description Type
name Name of the bookmark String
icon Icon name or URL for the bookmark String
url URL of the bookmark String
targetBlank Open bookmark in a new window/tab Bool

Search

The search bar has a few functionalities:

  • If a query starts with / (similiar to vi/vim's search) it will filter the applications in real time allowing you to quickly find the app you're looking for.
  • If a query starts with @<token> and matches a token configured for a searchProvider then the request will be forwarded to the configured searchUrl with {query} replaced with the portion of the query after the token.
  • If no query is provided following the token or there is no searchUrl configured for the provider, then the user will be redirected to the contents of url. This allows you to use tokens to quickly access external sites.

Icons

Any icon field can be either an Iconify supported icon (ex: mdi:kubernetes, simple-icons:google) or a URL to an image.

Custom startpage setup

  1. Open Hajimari in your browser, click the hamburger menu in the lower lefthand corner.
  2. Modify the options you wish to change in the built-in YAML editor.
  3. Click Save and you'll be redirected to your new custom page with a random ID on the URL. Set this page as your homepage/new tab page. For the best experience in Firefox I recommend the New Tab Override extension; for Chrome Custom New Tab URL.
  4. You can make further modifications to this page at anytime under the hamburger menu.

Please note there is no authentication. You might want to run this behind ingress with access restrictions.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Run make help for information on linting, tests, etc.

About

Why Hajimari?

Hajimari (ε§‹γΎγ‚Š) is Japanese for beginnings. Hajimari's original intended purpose is to be used as a browser startpage, so the name seemed fitting as it's the beginning of all new tabs/windows :)

Thank you / dependencies

  • SUI For the great startpage template
  • Forecastle Ideas for integrating k8s ingress

License

Apache-2.0

hajimari's People

Contributors

agrrh avatar chii-bot[bot] avatar h3mmy avatar invakid404 avatar onedr0p avatar toboshii avatar tobru avatar ullbergm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hajimari's Issues

Add option to hide applications section

Is your feature request related to a problem? Please describe.
Similar to #24, it would be nice to be able to remove the applications section entirely. I just want to have pre-created bookmark columns.

Make icons a link / clickable / navigable

Is your feature request related to a problem? Please describe.
Allow icons accompanying applications to be clicked to navigate to a URL - not just the title.

Describe the solution you'd like
Application icons can be clicked to navigate to the application URL.

Saving theme causes redirect to error page

Describe the Bug
When selecting a new theme and hitting save, I am redirected to a empty page with the text startpage not found.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://hajimari.k.example.org/
  2. Click on hamburger menu in bottom left.
  3. Select new theme from the listed options
  4. Click on Save in the Options modal

Expected Behavior
Theme is saved and the modal closes or indicates the saved state

Actual Behavior
I am redirected to a new URL (example: https://hajimari.k.example.org/J3KP51T9zfYPOExLjiJuq) with the startpage not found text.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Linux, POP_OS! 21.04
  • Browser: Firefox
  • Version: 91.0.1

Broken links detected in docs πŸ”—

Summary

Status Count
πŸ” Total 35
βœ… Successful 32
⏳ Timeouts 0
πŸ”€ Redirected 0
πŸ‘» Excluded 0
❓ Unknown 0
🚫 Errors 3

Errors per input

Errors in charts/hajimari/README.md

Errors in frontend/src/app.html

  • [ERR] file:///home/runner/work/hajimari/hajimari/frontend/src/%25sveltekit.assets%25/favicon.png | Failed: Cannot find file

Full Github Actions output

Enabling debug logs for Hajimari

Hi, I am wondering if there is a way to enable debug logs in Hajimari?

I am running into a problem (below), and I am trying to figure out where the issue is. While reading through the codebase, I can see that there are various logger.Debug statements, but I can't figure out how to surface those, since it seems like logrus doesn't have environment variable based logging.

time="2023-06-13T02:19:31Z" level=info msg="Using config file: /config/config.yaml" _source="hajimari/main.go:31"
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/toboshii/hajimari/internal/kube/wrappers.(*IngressWrapper).tryGetTLSHost(...)
	/build/internal/kube/wrappers/ingress.go:124
github.com/toboshii/hajimari/internal/kube/wrappers.(*IngressWrapper).GetURL(0xc00049ee60)
	/build/internal/kube/wrappers/ingress.go:103 +0x24f
github.com/toboshii/hajimari/internal/hajimari/ingressapps.convertIngressesToHajimariApps({0xc000307400?, 0x8, 0x5?}, {{0x0, 0x0}, 0x1, 0x1, {0x1aaf4b8, 0xc000342c00}})
	/build/internal/hajimari/ingressapps/apps.go:91 +0x705
github.com/toboshii/hajimari/internal/hajimari/ingressapps.(*List).Populate(0xc00049fba0, {0xc00039f300?, 0xc0001299d8?, 0x177ee2f?})
	/build/internal/hajimari/ingressapps/apps.go:53 +0x2b6
github.com/toboshii/hajimari/internal/services.getIngressApps()
	/build/internal/services/app.go:76 +0x305
github.com/toboshii/hajimari/internal/services.NewAppService(0xc00039ee80)
	/build/internal/services/app.go:38 +0x59
github.com/toboshii/hajimari/internal/handlers.NewHandler()
	/build/internal/handlers/handler.go:51 +0xad9
main.main()
	/build/cmd/hajimari/main.go:50 +0x1d

Embed Google icon in Good search box

Is your feature request related to a problem? Please describe.

I originally thought this was a filter for the apps, it would be neat to embed a Google icon in the search textbox

E.g.

image

Applications not grouped by namespace

Describe the bug
Applications aren't grouped by namespace.

To Reproduce
Steps to reproduce the behavior:

  1. Install Hajimari
  2. Set defaultEnable to true and configure namespaceSelector as any: true
  3. Configure ingresses for applications in multiple namespaces, without annotating with hajimari.io/group
  4. Open Hajimari

Expected behavior
Hajimari should be grouping applications by namespace.

Docs for hajimari.io/group say to Use if you want the application to show in a different group than the namespace it is running in

permission denied: when editing preferences using a longhorn volume

Describe the bug
A clear and concise description of what the bug is.

Saving preferences when configured against a default longhorn (https://longhorn.io) volume returns a 'permission denied' error.

This is because by default the mounted pvc is root, and the container permissions are 'hajimari' (uid: 100, gid: 101). I've fixed this by adding this to the deployment securityContext:

securityContext:
fsGroup: 101
fsGroupChangePolicy: "OnRootMismatch"

You might want to considering adding something like this to the helm chart for the future.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Add status/health of services

While showing Kubernetes services is fine, it would be great if you also got some sort of health indicator for them.

So you can see a green checkmark or green icon next to each service.

There are many ways to check health in Kubernetes (count number of active pods, curl the service, define healthcheck etc)

Change default config path

Is your feature request related to a problem? Please describe.

Set default config path to /config instead of /etc/hajimari

Ref:

viper.AddConfigPath("/etc/hajimari/") // path to look for the config file in

Application/Link Keyboard Shortcuts

Is your feature request related to a problem? Please describe.
Using a trackpad is tedious when you are used to keyboard based navigation.

Describe the solution you'd like
I would like to be able to use some keyboard based shortcut to quickly navigate to a wanted application or link. Having the shortcut be user-defined and not-enabled by default is fine as the user can then just annotate the applications and links they care about getting to quicker.

Describe alternatives you've considered
I am currently using my trackpad to navigate to the wanted links and tabbing until you get to the link you want (albeit slowly) does work.

Additional context
N/A

Add support for Gateway-API

Describe the solution you'd like

Gateway API is an open source project managed by the SIG-NETWORK community. It is an API (collection of resources) that model service networking in Kubernetes. These resources - GatewayClass, Gateway, HTTPRoute, TCPRoute, etc., as well as the Kubernetes Service resource - aim to evolve Kubernetes service networking through expressive, extensible, and role-oriented interfaces that are implemented by many vendors and have broad industry support.

I mainly use API-Gateway (mostly because they are roles-based) and I think Hajimari support would be great. The annotations would be placed on the "HTTPRoute" resource (which works in a similar way to ingress).

Official documentation

Additional context
Example of HTTPRoute:

apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: example-route
  annotations:
    hajimari.io/enable = "true"
    hajimari.io/url = "example.com"
spec:
  parentRefs:
  - name: example-gateway
  hostnames:
  - "example.com"
  rules:
  - backendRefs:
    - name: example-svc
      port: 80

Support default "open in new tab" option for links

Is your feature request related to a problem? Please describe.
When clicking links on the dashboard they default to opening in the same tab.

Describe the solution you'd like
Provide an option that either defaults or provides for a user specified / per object configuration that opens links in a new tab.

Describe alternatives you've considered
N/A

Additional context
N/A

Allow custom ports to be added to namespaceSelector

Is your feature request related to a problem? Please describe.
I have a prod and dev k8s cluster which I expose to the world through different port forwards at my firewall. I would like to be able to customize the namespaceSelector settings to allow a custom port to be added to the end of the link it gleans from the cluster. I know you can do this with customApps but it would be nice to have it be automatic

Describe the solution you'd like
When I go to my dev hajimari instance I want to see that the links are using the correct port assigned to that cluster's ingress

Describe alternatives you've considered
I could stop using namespaceSelector and use customApps instead but that isn't as clean

Support system dark mode

It would be great if hajimari allowed us to configure a different theme option for system light/dark mode and then automatically detected which one to use!

Renovate Dashboard πŸ€–

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

Renovate tried to run on this repository, but found these problems.

  • WARN: Found renovate config warnings

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

dockerfile
Dockerfile
  • docker.io/node 16.20-alpine
  • docker.io/golang 1.20.2-alpine
  • docker.io/alpine 3.17
github-actions
.github/workflows/ci.yaml
  • actions/checkout v3
  • docker/setup-qemu-action v2
  • docker/setup-buildx-action v2
  • docker/login-action v2
  • docker/build-push-action v4
  • ubuntu 20.04
.github/workflows/lint-test-chart.yaml
  • actions/checkout v3
  • azure/setup-helm v3
  • actions/setup-python v4
  • helm/chart-testing-action v2.3.1
  • helm/kind-action v1.5.0
.github/workflows/meta-label-size.yaml
  • tibdex/github-app-token v1
  • pascalgn/size-label-action v0.4.3
.github/workflows/meta-labeler.yml
  • tibdex/github-app-token v1
  • actions/labeler v4
.github/workflows/meta-sync-labels.yaml
  • actions/checkout v3
  • tibdex/github-app-token v1
  • EndBug/label-sync v2
.github/workflows/release-chart.yaml
  • actions/checkout v3
  • azure/setup-helm v3
  • helm/chart-releaser-action v1.5.0
.github/workflows/release.yaml
  • actions/checkout v3
  • docker/setup-qemu-action v2
  • docker/setup-buildx-action v2
  • docker/login-action v2
  • docker/build-push-action v4
  • ubuntu 20.04
.github/workflows/schedule-link-checker.yaml
  • actions/checkout v3
  • tibdex/github-app-token v1
  • lycheeverse/lychee-action v1.6.1
  • micalevisk/last-issue-action v2
  • peter-evans/create-issue-from-file v4
.github/workflows/schedule-renovate.yaml
  • actions/checkout v3
  • tibdex/github-app-token v1
  • renovatebot/github-action v36.0.2
gomod
go.mod
  • go 1.19
  • github.com/chi-middleware/logrus-logger v0.2.0
  • github.com/fsnotify/fsnotify v1.5.4
  • github.com/go-chi/chi/v5 v5.0.8
  • github.com/go-chi/cors v1.2.1
  • github.com/go-chi/render v1.0.2
  • github.com/matoous/go-nanoid/v2 v2.0.0
  • github.com/mitchellh/mapstructure v1.5.0
  • github.com/onrik/logrus v0.9.0
  • github.com/sirupsen/logrus v1.9.2
  • github.com/spf13/viper v1.13.0
  • gopkg.in/yaml.v3 v3.0.1
  • k8s.io/api v0.25.2
  • k8s.io/apimachinery v0.25.2
  • k8s.io/client-go v0.25.2
helm-values
charts/hajimari/values.yaml
  • ghcr.io/toboshii/hajimari v0.3.1
helmv3
charts/hajimari/Chart.yaml
  • common 0.2.2
npm
frontend/package.json
  • @fontsource/roboto 5.0.1
  • codemirror 5.65.9
  • js-yaml 4.1.0
  • svelte-portal 2.2.0
  • @iconify/svelte 3.1.0
  • @sveltejs/adapter-static 1.0.0-next.44
  • @sveltejs/kit 1.0.0-next.507
  • @types/codemirror 5.60.5
  • @types/js-yaml 4.0.5
  • svelte 3.50.1
  • svelte-check 2.9.1
  • svelte-preprocess 4.10.7
  • tslib 2.4.0
  • typescript 4.8.4
  • vite 3.1.7

Support custom templates

Is your feature request related to a problem? Please describe.
I love hajimari because it's so lightweight and easy to add ingresses to the dashboard

At the same time, some parts of the dashboard don't work great for me

e.g., I don't use bookmarks. I'd like my applications to be grouped rather than bundled. It'd be nice to edit the CSS or themes.

Describe the solution you'd like
It would be silly to expect @toboshii to fix all of these things, and it's a lot of work to build a ton of options into hajimari while maintaining its lightweight nature.

Instead, it would be super cool if there was a way to just… override the index.html.tmpl file or anything else under web/.

Ideally, there would also be a way to specify a map of additional properties for Apps via annotations and values so we could reference them from custom templates.

Maybe a custom: map[string]interface{} added to the App, CustomApp, and/or Link structs?

docker run success,but can't connect web ui

root@unraid:/mnt/user/appdata/hajimari# docker run -d --name=hajimari -v /mnt/user/appdata/hajimari:/config -p 12345:3000 ghcr.io/toboshii/hajimari:v0.2.0
c7a1926825a451ed19dd08d9f21dae43754ae8e745b097f0a27047687e69a19d

root@unraid:/mnt/user/appdata/hajimari# docker logs c7a1926825a4
time="2022-08-29T07:59:07Z" level=info msg="Listening on :3000\n" _source="/build/main.go:69"
time="2022-08-29T07:59:14Z" level=fatal msg="Cannot get kubernetes config: stat /home/hajimari/.kube/config: no such file or directory" _source="kube/client.go:56"

Change Default Search Engine

Users should be able to determine what search engine to use from their Hajimari start page.

A simple setting to support other search engines. Could be a drop down on the main page, with a config setting the default option..but i'm open to any solution to support:

  • DuckDuckGo
  • Yahoo
  • Bing

I'm really just asking because I dislike using google most of the time :)

Support CRD

Is your feature request related to a problem? Please describe.
Seems like it only works for type: Ingress. It would be nice to add support for Traefiks IngressRoute for instance.

Describe the solution you'd like
Some way of configuring CRD ingress

Describe alternatives you've considered
Hardcoding the ingresses to the applications list, which seems rather pointless.

Hajimari dont find ingress or dont store config

Describe the bug
Hajimari dont find ingress or dont store config (or maybe delete defaultEnable in config file)

To Reproduce

apiVersion: apps/v1
kind: Deployment
metadata:
  name: hajimari
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/instance: hajimari
      app.kubernetes.io/name: hajimari
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: hajimari
        app.kubernetes.io/name: hajimari
    spec:
      volumes:
        - name: config
          persistentVolumeClaim:
            claimName: hajimari-config
      containers:
        - name: hajimari
          image: ghcr.io/toboshii/hajimari:latest
          ports:
            - name: http
              containerPort: 3000
              protocol: TCP
          env:
            - name: TZ
              value: UTC
          resources: {}
          volumeMounts:
            - name: config
              mountPath: /config
          livenessProbe:
            tcpSocket:
              port: 3000
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            tcpSocket:
              port: 3000
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          startupProbe:
            tcpSocket:
              port: 3000
            timeoutSeconds: 1
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 30
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      serviceAccountName: hajimari
      serviceAccount: hajimari
  strategy:
    type: Recreate
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: hajimari-config
  namespace: default
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  volumeMode: Filesystem`
apiVersion: v1
kind: Service
metadata:
  name: hajimari
  namespace: default
spec:
  ports:
    - name: http
      protocol: TCP
      port: 3000
      targetPort: http
  selector:
    app.kubernetes.io/instance: hajimari
    app.kubernetes.io/name: hajimari
  type: ClusterIP
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hajimari
  namespace: default
spec:
  ingressClassName: nginx
  tls:
    - hosts:
        - 
      secretName: 
  rules:
    - host: www.ardasar.com
      http:
        paths:
          - path: /haji(/|$)(.*)
            pathType: Prefix
            backend:
              service:
                name: hajimari
                port:
                  number: 3000
customApps: []
defaultEnable: true
groups: []

Expected behavior
Hajimari discover ingress on kubernetes cluster

Additional context
RBAC are deployed.

CSS x-axis scrolling

Describe the bug
There's x-axis window scrolling at every breakpoint/screen size in Chrome. At certain breakpoints the x-axis scrolling grows longer.

With a large amount of apps in different sections, I see the app sections aren't wrapping to a new row and overflow on the right side of the window.

To Reproduce
This appears to occur with longer domain names in the .app_address class.

Expected behavior
No x-axis scrolling at any screen size.

Screenshots
Notice the sliver of x-axis scrolling that occurs at every screen size in Chrome:
Screen Shot 2022-10-25 at 2 29 36 PM

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 106.0.5249.119 (Official Build) (arm64)

Additional context
I also see this problem in Firefox on MacOS at certain breakpoints/screen sizes.

I'll try to play around with the CSS and see if I can add more context. I'm sure there's a rogue style that's the culprit or something with the grid .apps_loop.

Set default theme

Being able to add a default Theme via the config (config.yaml) file is necessary.
So all new users get one of the beautiful Theme we Set, rather than they be required to change in their browsers individually

Support for Istio VirtualService (or CRD ala Forecastle)

Is your feature request related to a problem? Please describe.
In clusters that use Istio there are generally few, if any Ingress objects. Application end points are instead handled via a VirtualService CRD. A similar issue was presented for Forecastle which they solved by adding their own CRD to describe application endpoints.

Describe the solution you'd like
Support for discovering application endpoints via non-Ingress objects such as Istio's VirtualService or a custom CRD.

Describe alternatives you've considered
n/a

Additional context
n/a

Support URL for icons

Is your feature request related to a problem? Please describe.
In Homer I am able use custom icons which is handy to have the real app icon

Describe the solution you'd like
Custom apps support URLs so if this support could be added to the annotation for ingress apps then any icon might be used.

Extended feature would be to upload icons that could be served by the hajimari web server.

Describe alternatives you've considered
For the icons a custom container might be created that has the apps each user has but it is an "advanced" feature to build your own container. It would work for me thought.

Additional context
Add any other context or screenshots about the feature request here.

Updating the Configmap should trigger hajimari to reload it's settings

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Updating the Configmap in the helm chart doesn't update hajimari until the pod is restarted

Describe the solution you'd like
A clear and concise description of what you want to happen.

Maybe it's possible to split the ui config from the server config and have the ui config be reloaded on change by hajimari?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

You can use stakater/reloader to have it bounce the pod when the configmap changes.

Additional context
Add any other context or screenshots about the feature request here.

Create Helm chart

Describe the solution you'd like
Create Helm chart to deploy to kubernetes. Preferably based on KAH commons.

Hajimari forbidden from accessing ingress resources

Describe the bug
When I run Hajimari, the dashboard is empty because the service account is forbidden from accessing ingress resources.

To Reproduce
Steps to reproduce the behavior:

  1. Run RKE2 with default configuration which deploys the nginx ingress
  2. Deploy Hajimari setting with value defaultEnable: true
  3. Open dashboard and see no resources

Expected behavior
I expected the dashboard to be populated with all ingress resources in the scanned namespaces

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Linux
  • Firefox
  • 108

Additional context
I believe this is related to the ServiceAccount/ClusterRole/ClusterRoleBinding being used by Hajimari.

The logs from Hajimari are:

time="2023-01-12T13:36:42+08:00" level=error msg="An error occurred while looking for hajimari [appsingresses.networking.k8s.io](http://appsingresses.networking.k8s.io/) is forbidden: User \"system:serviceaccount:default:hajimari\" cannot list resource \"ingresses\" in API group \"[networking.k8s.io](http://networking.k8s.io/)\" in the namespace \"default\"" _source="services/app.go:78"
$ kubectl describe serviceaccounts hajimari
Name:hajimari
Namespace: default
Labels: app.kubernetes.io/instance=hajimari
             app.kubernetes.io/managed-by=Helm
             app.kubernetes.io/name=hajimari
             app.kubernetes.io/version=v0.3.1
             helm.sh/chart=hajimari-2.0.2Annotations
Annotations: <none>
Image pull secrets: <none>
Mountable secrets: <none>
Tokens: <none>
Events: <none>
$ kubectl describe clusterrole.rbac.authorization.k8s.io hajimari
Name: hajimari
Labels: app.kubernetes.io/instance=hajimari
        app.kubernetes.io/managed-by=Helm
        app.kubernetes.io/name=hajimari
        app.kubernetes.io/version=v0.3.1
        helm.sh/chart=hajimari-2.0.2
Annotations: <none>
PolicyRule: Resources Non-Resource URLs Resource Names Verbs
            --------- ----------------- -------------- -----
            endpointslices [] [] [get list]
            ingresses [] [] [get list]
            namespaces [] [] [get list]
            endpointslices.discovery.k8s.io [] [] [get list]
            ingresses.discovery.k8s.io [] [] [get list]
            namespaces.discovery.k8s.io [] [] [get list]
            endpointslices.extensions [] [] [get list]
            endpointslices.networking.k8s.io [] [] [get list]
            ingresses.networking.k8s.io [] [] [get list]
            namespaces.networking.k8s.io [] [] [get list]
kubectl describe clusterrolebinding.rbac.authorization.k8s.io hajimari
Name: hajimari
Labels: app.kubernetes.io/instance=hajimari
        app.kubernetes.io/managed-by=Helm
        app.kubernetes.io/name=hajimari
        app.kubernetes.io/version=v0.3.1
        helm.sh/chart=hajimari-2.0.2
Annotations: <none>
Role: Kind: ClusterRole
Name: hajimari
Subjects: Kind Name Namespace
          ---- ---- ---------
          ServiceAccount hajimari hajimari
$ kubectl auth can-i list ingresses.networking.k8s.io --as=system:serviceaccount:default:hajimari
no

Helm chart references old v0.1.0 image tag

Describe the bug
The Helm chart still references the v0.1.0 image tag, while v0.2.0 is available

To Reproduce
Steps to reproduce the behavior:

  1. Add Helm repo
  2. Install chart following repo instructions
  3. Note that container is running tag v0.1.0

Expected behavior
The Helm chart should deploy the latest version (v0.2.0)

Additional context
I originally noticed the issue because I'm running k8s v1.22.2 and experienced #22

Please create new release (or provide helm dev installation instructions)

Describe the bug
I was trying to get Hajimari running via Helm to use the CRD support. However, turns out the CRD wasn't getting installed and after manually installing it, I wouldn't pick up any Application resources.

Turns out that v0.3.1 doesn't yet ship this functionality.

I'd really like to use Hajimari but do depend on the new CRD support.

Expected behavior
Is it possible to get a new release cut?

Or could you provide instructions how to run a development version?

Thank you!

Configurable sorting of applications

Is your feature request related to a problem? Please describe.
The application list (specifically the autodetected Kubernetes applications) appears to be in "last modified" order. Currently, there seems to be no way to sort them in a custom way (e.g. in alphabetical order).

Describe the solution you'd like
I'd like to have a global configuration option, which allows me to specify in what order I want the applications to be. Perhaps "ascending" and "descending" would be enough as a start.

Describe alternatives you've considered
N/A

Additional context
N/A

Issue with adding an annotation to the traefik dashboard

Describe the bug

I set hajimari to watch the networking namespace, added an annotation to the traefik dashboard ingress. It blew up

hajimari-6d9759fd7c-lsqpn hajimari  panic: runtime error: index out of range [0] with length 0
hajimari-6d9759fd7c-lsqpn hajimari
hajimari-6d9759fd7c-lsqpn hajimari  -> github.com/toboshii/hajimari/internal/kube/wrappers.(*IngressWrapper).tryGetTLSHost
hajimari-6d9759fd7c-lsqpn hajimari  ->   /build/internal/kube/wrappers/ingress.go:97
hajimari-6d9759fd7c-lsqpn hajimari
hajimari-6d9759fd7c-lsqpn hajimari     github.com/toboshii/hajimari/internal/kube/wrappers.(*IngressWrapper).GetURL
hajimari-6d9759fd7c-lsqpn hajimari       /build/internal/kube/wrappers/ingress.go:76
hajimari-6d9759fd7c-lsqpn hajimari     github.com/toboshii/hajimari/internal/hajimari/ingressapps.convertIngressesToHajimariApps
hajimari-6d9759fd7c-lsqpn hajimari       /build/internal/hajimari/ingressapps/apps.go:69
hajimari-6d9759fd7c-lsqpn hajimari     github.com/toboshii/hajimari/internal/hajimari/ingressapps.(*List).Populate
hajimari-6d9759fd7c-lsqpn hajimari       /build/internal/hajimari/ingressapps/apps.go:50
hajimari-6d9759fd7c-lsqpn hajimari     github.com/toboshii/hajimari/internal/handlers.(*startpageResource).GetStartpage
hajimari-6d9759fd7c-lsqpn hajimari       /build/internal/handlers/startpage.go:102
hajimari-6d9759fd7c-lsqpn hajimari     net/http.HandlerFunc.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2049
hajimari-6d9759fd7c-lsqpn hajimari     github.com/go-chi/chi/v5.(*Mux).routeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:442
hajimari-6d9759fd7c-lsqpn hajimari     net/http.HandlerFunc.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2049
hajimari-6d9759fd7c-lsqpn hajimari     github.com/go-chi/chi/v5.(*Mux).ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:71
hajimari-6d9759fd7c-lsqpn hajimari     github.com/go-chi/chi/v5.(*Mux).Mount.func1
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:314
hajimari-6d9759fd7c-lsqpn hajimari     net/http.HandlerFunc.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2049
hajimari-6d9759fd7c-lsqpn hajimari     github.com/go-chi/chi/v5.(*Mux).routeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:442
hajimari-6d9759fd7c-lsqpn hajimari     net/http.HandlerFunc.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2049
hajimari-6d9759fd7c-lsqpn hajimari     github.com/go-chi/chi/middleware.Timeout.func1.1
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/go-chi/[email protected]/middleware/timeout.go:45
hajimari-6d9759fd7c-lsqpn hajimari     net/http.HandlerFunc.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2049
hajimari-6d9759fd7c-lsqpn hajimari     github.com/go-chi/chi/middleware.Recoverer.func1
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/go-chi/[email protected]/middleware/recoverer.go:37
hajimari-6d9759fd7c-lsqpn hajimari     net/http.HandlerFunc.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2049
hajimari-6d9759fd7c-lsqpn hajimari     github.com/chi-middleware/logrus-logger.Logger.func1.1
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/chi-middleware/[email protected]/middleware.go:48
hajimari-6d9759fd7c-lsqpn hajimari     net/http.HandlerFunc.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2049
hajimari-6d9759fd7c-lsqpn hajimari     github.com/go-chi/chi/middleware.RealIP.func1
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/go-chi/[email protected]/middleware/realip.go:34
hajimari-6d9759fd7c-lsqpn hajimari     net/http.HandlerFunc.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2049
hajimari-6d9759fd7c-lsqpn hajimari     github.com/go-chi/chi/middleware.RequestID.func1
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/go-chi/[email protected]/middleware/request_id.go:76
hajimari-6d9759fd7c-lsqpn hajimari     net/http.HandlerFunc.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2049
hajimari-6d9759fd7c-lsqpn hajimari     github.com/go-chi/chi/v5.(*Mux).ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:88
hajimari-6d9759fd7c-lsqpn hajimari     net/http.serverHandler.ServeHTTP
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2867
hajimari-6d9759fd7c-lsqpn hajimari     net/http.(*conn).serve
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:1932
hajimari-6d9759fd7c-lsqpn hajimari     created by net/http.(*Server).Serve
hajimari-6d9759fd7c-lsqpn hajimari       /usr/local/go/src/net/http/server.go:2993
hajimari-6d9759fd7c-lsqpn hajimari

Add user configuration overrides

Describe the solution you'd like
Allow users to POST select custom portions of the configuration to and endpoint and receive back a tokenized URL that merges that config with the base config allowing for custom name, bookmarks, and themes.

Additional context
Viper allows loading and merging configuration values so that part is easy. Just need to figure out how to store the user configs to disk.

Duplicated application groups

Describe the bug
Application groups injected via ingress annotations and customApps are not merged. This results in the group appearing twice:

image

I checked the that they written exactly the same: Admin

To Reproduce
Steps to reproduce the behavior:

  1. Add following annotation
        hajimari.io/enable: "true"
        hajimari.io/icon: logos:kubernetes
        hajimari.io/info: Kubernetes dashboard
        hajimari.io/group: Admin
    
  2. Add following custom app
            customApps:
            - group: Admin
              apps:
                - name: Test
                  url: 'https://example.com'
                  icon: 'mdi:test-tube'
                  info: This is a test app
    
  3. See the duplication

Expected behavior

Both apps showing in the same group

Screenshots

See above

Desktop (please complete the following information):

  • OS: Windows
  • Browser Frirefox
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version 105.0.3

Additional context
NA

Move ingress parsing off main thread

Is your feature request related to a problem? Please describe.
Currently ingresses are read and processed for every request. Not great for performance.

Describe the solution you'd like
Store ingress apps in a cache and update them periodically via background job.

Helm chart doesn't trigger config reload

Describe the bug
When changes are made to just the hajimari config in the help chart, eg turning showAppUrls off the container does not pick up the config change automatically

To Reproduce
Steps to reproduce the behavior:

  1. Deploy helm chart
  2. Make a change to showAppUrls in values.yaml
  3. Wait until chart is deployed (via flux)
  4. Refresh hajimari, config is not updated
  5. Delete pod, and let it restart
  6. Config is updated

Expected behavior
Changing the config should either restart the pod or otherwise trigger a reload of the config.

Removing application url

Is it possible to remove the link URL from the application section? So that you only have the application name without any URL.

Favicon

Is your feature request related to a problem? Please describe.

Hajimari is missing a favicon

support specifying extra attributes for `a` tags

Is your feature request related to a problem? Please describe.
If I try to go to my self-hosted qBittorrent instance through Hajimari, I get hit with an "unauthorized" due to the CSRF protection of qBittorrent. More specifically, because of the requirement that the Referer and Target headers must be the same:

(W) 2022-09-28T09:47:04 - WebUI: Referer header & Target origin mismatch! Source IP: '::ffff:10.42.0.16'. Referer header: 'https://lab.invak.id/'. Target origin: 'qbit.lab.invak.id'

Note: lab.invak.id is Hajimari, and qbit.lab.invak.id is my qBittorrent instance.

Describe the solution you'd like
I'd like to have a way of specifying rel="noreferrer" on the link. Speaking more generally, I think it makes sense to have a way to add extra attributes to the a tags. For example, it could be useful for opening links in a new tab (target="_blank") as well.

Describe alternatives you've considered
For my specific case, an alternative would be to disable the CSRF protection of qBittorrent. Still, I'm not really a fan of the idea of deliberately reducing security settings in order to be able to have my qBittorrent instance bookmarked. And I do think that my feature request would be useful in the general case as well.

Additional context
FWIW, here are my full Hajimari manifests: link to my home cluster repo

Add custom app support

Describe the solution you'd like
Allow users to add custom apps in addition to the k8s ingress apps. These will be defined in the customApps configuration variable.

add arm based docker image

Is your feature request related to a problem? Please describe.
i cannot run succesffuly the helm chart on my raspberry based k8s cluster, since it fails in pulling the image
Describe the solution you'd like
A clear and concise description of what you want to happen.
can you please add an arm based docker image

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
i have considered uploading my own arm version, but it seems it is better to have it from the source repository
Additional context
Add any other context or screenshots about the feature request here.

Bookmarks don't work

Trying to migrate groups to bookmarks, but can't get them to render. Documentation is a bit unclear, but in the sample values.yaml I found the bookmarks element, so I tried the following:

  bookmarks:
    - group: Test
      bookmarks:
        - name: sample
          url: "https://sample.url"

However this did not work. The page rendered the following:

Bookmarks

No bookmarks here...yet

Note that I also tried globalBookmarks and these worked when showGlobalBookmarks is set to true.

Add handler interface

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Eliminate iOS input zooming

TL;DR: If mobile font-sizes in text inputs are at least 16px, browsers on iOS devices won't zoom into the element when the user selects the input.


Is your feature request related to a problem? Please describe.
Selecting (or "focusing" on) the search input on iOS devices makes the browser zoom into the element.

Describe the solution you'd like
Change the fontsize of the input to a value >= 16px.

Since the search input's fontsize is 1rem, I suppose you could also change the body element's fontsize to 16px for the same result.

While I'm here, you may also consider setting border-radius to 0 since some browsers add default styles to the input, or -webkit-appearance: none; might do the trick.

Describe alternatives you've considered
None

Additional context
Submitting this as a feature rather than a bug because it's a rather annoying nuance with iOS devices.

For more context, here's a similar submission I made to Meta StackOverflow: https://meta.stackoverflow.com/q/389464/6817437

Hide bookmarks/links section when empty

I don't have any bookmarks defined, but hajimari still shows the bookmarks section -- just with no content.

It would be nice if it were hidden when empty.

Links should expose valid port assigned to ingress controller

Describe the bug
Currently automatically generated links point into 443 port (via https prefix). If there's more ingress controllers, they use different ports. So some links are incorrect, because misses valid port

To Reproduce
Steps to reproduce the behavior:

  1. Expose ingress controller on port different than default 443
  2. Links are generated with 443 port
  3. Links doesn't work

Expected behavior
Links should be created with valid port. As we can have multiple ingress controllers supporting the same ingress, we don't know which port to choose, so the easiest way would be to allow to override default 443 port via annotation like:
hajimari.io/port: "2000"

Error message after k3s update to 1.22.2

Describe the bug
After upgrading k3s to 1.22.2 i got the error message
the server could not find the requested resource (get ingresses.extensions)

Seems to be a API change.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.