mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 18:31:02 +01:00
Compare commits
25 Commits
codex/empt
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db819141b4 | ||
|
|
960ed1fc78 | ||
|
|
ee0b45c41f | ||
|
|
d6cd035641 | ||
|
|
361381af27 | ||
|
|
d7e782f460 | ||
|
|
aea56a0ddd | ||
|
|
497763c568 | ||
|
|
b65adfedae | ||
|
|
525097746c | ||
|
|
eee1a982c5 | ||
|
|
962f47a182 | ||
|
|
6aee9243bd | ||
|
|
54bf2c7e89 | ||
|
|
741055cd79 | ||
|
|
1603ebc8ac | ||
|
|
aef148d8cd | ||
|
|
25034e2e47 | ||
|
|
8c0ea30920 | ||
|
|
6f76debdd6 | ||
|
|
217a7c7cd1 | ||
|
|
b71d394508 | ||
|
|
d08b9fbb12 | ||
|
|
dda5966197 | ||
|
|
8cdc0858af |
@@ -56,7 +56,7 @@ If you want to do add the repository manually, please follow the procedure highl
|
||||
|
||||
### Number of addons
|
||||
|
||||
- In the repository : 118
|
||||
- In the repository : 119
|
||||
- Installed : 63855
|
||||
|
||||
### Top 3
|
||||
@@ -440,6 +440,13 @@ If you want to do add the repository manually, please follow the procedure highl
|
||||
![aarch64][aarch64-badge]
|
||||
![amd64][amd64-badge]
|
||||
|
||||
✓ [Karakeep](karakeep/) : A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
|
||||
|
||||
  
|
||||

|
||||
![aarch64][aarch64-badge]
|
||||
![amd64][amd64-badge]
|
||||
|
||||
✓ [Kometa](kometa/) : Python script to update metadata information for movies, shows, and collections as well as automatically build collections
|
||||
|
||||
  
|
||||
|
||||
@@ -1,2 +1,8 @@
|
||||
## 0.30.0-4 (11-01-2026)
|
||||
- Minor bugs fixed
|
||||
## 0.30.0-3 (11-01-2026)
|
||||
- Minor bugs fixed
|
||||
## 0.30.0-2 (11-01-2026)
|
||||
- Minor bugs fixed
|
||||
## 0.30.0 (2026-01-11)
|
||||
- Initial add-on release
|
||||
|
||||
@@ -57,6 +57,7 @@ RUN \
|
||||
ttf-freefont \
|
||||
font-noto-emoji \
|
||||
font-wqy-zenhei \
|
||||
unzip \
|
||||
&& mkdir -p /usr/src/chrome \
|
||||
&& adduser -D chrome \
|
||||
&& chown -R chrome:chrome /usr/src/chrome
|
||||
@@ -107,7 +108,30 @@ RUN chmod 777 /ha_entrypoint.sh /ha_entrypoint_modif.sh && /ha_entrypoint_modif.
|
||||
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/bashio-standalone.sh" "/.bashio-standalone.sh"
|
||||
RUN chmod 777 /.bashio-standalone.sh
|
||||
|
||||
RUN sed -i "s|/usr/bin/env|/usr/bin/with-contenv|g" /etc/cont-init.d/*
|
||||
RUN set -e; \
|
||||
extensions_dir="/usr/src/chrome/extensions"; \
|
||||
mkdir -p "${extensions_dir}"; \
|
||||
for entry in \
|
||||
"i-dont-care-about-cookies:fllaojicojecljbmefodhfapmkghcbnh" \
|
||||
"ublock-origin:cjpalhdlnbpafiamejdnhcphjbkeiagm"; do \
|
||||
name="${entry%%:*}"; \
|
||||
ext_id="${entry##*:}"; \
|
||||
curl -fsSL "https://clients2.google.com/service/update2/crx?response=redirect&prodversion=120.0&acceptformat=crx2,crx3&x=id%3D${ext_id}%26installsource%3Dondemand%26uc" \
|
||||
-o "/tmp/${name}.crx"; \
|
||||
rm -rf "${extensions_dir:?}/${name}"; \
|
||||
mkdir -p "${extensions_dir}/${name}"; \
|
||||
rc=0; \
|
||||
unzip -q "/tmp/${name}.crx" -d "${extensions_dir}/${name}" || rc=$$?; \
|
||||
if [ "$$rc" -ne 0 ] && [ "$$rc" -ne 1 ]; then \
|
||||
echo "ERROR: unzip failed for ${name} (rc=$$rc)"; \
|
||||
exit "$$rc"; \
|
||||
fi; \
|
||||
rm -f "/tmp/${name}.crx"; \
|
||||
done; \
|
||||
chown -R chrome:chrome "${extensions_dir}"
|
||||
|
||||
ENTRYPOINT [ "/usr/bin/env" ]
|
||||
CMD [ "/ha_entrypoint.sh" ]
|
||||
|
||||
############
|
||||
# 5 Labels #
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Home assistant add-on: Karakeep
|
||||
|
||||
I maintain this and other Home Assistant add-ons in my free time: keeping up with upstream changes, HA changes, and testing on real hardware takes a lot of time (and some money). I use around 5-10 of my >110 addons so regularly I install test machines (and purchase some test services such as vpn) that I don't use myself to troubleshoot and improve the addons
|
||||
I maintain this and other Home Assistant add-ons in my free time: keeping up with upstream changes, Home Assistant changes, and testing on real hardware takes a lot of time (and some money). I use around 5–10 of my >110 addons so regularly I install test machines (and purchase some test services such as VPNs) that I do not use myself, in order to troubleshoot and improve the addons.
|
||||
|
||||
If this add-on saves you time or makes your setup easier, I would be very grateful for your support!
|
||||
If this add-on saves you time or makes your setup easier, I would be very grateful for your support.
|
||||
|
||||
[![Buy me a coffee][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
|
||||
[![Donate via PayPal][paypal-badge]](https://www.paypal.com/donate/?hosted_button_id=DZFULJZTP3UQA)
|
||||
@@ -10,100 +10,94 @@ If this add-on saves you time or makes your setup easier, I would be very gratef
|
||||
## Addon informations
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
[](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade)
|
||||
[](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard)
|
||||
[](https://github.com/alexbelgium/hassio-addons/actions/workflows/weekly-supelinter.yaml)
|
||||
[](https://github.com/alexbelgium/hassio-addons/actions/workflows/onpush_builder.yaml)
|
||||
|
||||
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
|
||||
[paypal-badge]: https://img.shields.io/badge/Donate%20via%20PayPal-0070BA?logo=paypal&style=flat&logoColor=white
|
||||
|
||||
_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_
|
||||
_Thanks to everyone who has starred my repo!_
|
||||
|
||||
[](https://github.com/alexbelgium/hassio-addons/stargazers)
|
||||
[](https://github.com/alexbelgium/hassio-addons/stargazers)
|
||||
|
||||
---
|
||||
|
||||
## About
|
||||
|
||||
[Karakeep](https://karakeep.app/) is a bookmark-everything app with a touch of AI for the data hoarders out there. It stores content, screenshots, and metadata with search powered by Meilisearch.
|
||||
[Karakeep](https://karakeep.app/) is a bookmark-everything app with a touch of AI for data hoarders.
|
||||
It stores pages, screenshots, files, and metadata with fast full-text and semantic search powered by **Meilisearch**.
|
||||
|
||||
This addon is based on the [official Karakeep Docker image](https://github.com/karakeep-app/karakeep).
|
||||
This add-on is based on the official Karakeep Docker image.
|
||||
|
||||
This Home Assistant add-on integrates Karakeep in a **Supervisor-native way**:
|
||||
- Internal services (Meilisearch, Chromium, cache, paths) are pre-wired and hidden from the UI
|
||||
- Secrets are **auto-generated and persisted**
|
||||
- Only meaningful user settings are exposed
|
||||
|
||||
Add additional environment variables with [env_vars](https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2)
|
||||
|
||||
---
|
||||
|
||||
## Secrets & Security
|
||||
|
||||
Two secrets are required for Karakeep to work securely:
|
||||
|
||||
- `NEXTAUTH_SECRET`
|
||||
- `MEILI_MASTER_KEY`
|
||||
|
||||
If you leave them empty, the add-on will:
|
||||
- Generate strong cryptographic secrets automatically
|
||||
- Store them permanently in the add-on options
|
||||
- Reuse them across restarts and upgrades
|
||||
|
||||
You do **not** need to manage them manually.
|
||||
|
||||
---
|
||||
|
||||
## Configuration
|
||||
|
||||
Webui can be found at `<your-ip>:3000`.
|
||||
Only **safe, meaningful options** are exposed.
|
||||
All infrastructure (Meilisearch, Chromium, cache, paths, analytics, etc.) is managed automatically by the add-on.
|
||||
|
||||
### Options
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `NEXTAUTH_SECRET` | password | | Secret key for authentication (auto-generated if left blank). |
|
||||
| `NEXTAUTH_SECRET` | password | *(auto)* | Authentication secret (auto-generated if empty). |
|
||||
| `NEXTAUTH_URL` | str | | Public URL used by NextAuth (optional). |
|
||||
| `DISABLE_SIGNUPS` | bool | `false` | Disable new account signups. |
|
||||
| `MAX_ASSET_SIZE_MB` | int | `4` | Max asset upload size. |
|
||||
| `OCR_LANGS` | str | | OCR language codes (comma-separated). |
|
||||
| `OCR_CONFIDENCE_THRESHOLD` | int | | OCR confidence threshold (0-100). |
|
||||
| `OPENAI_BASE_URL` | str | | Custom OpenAI base URL. |
|
||||
| `OPENAI_API_KEY` | password | | OpenAI API key. |
|
||||
| `OLLAMA_BASE_URL` | str | | Ollama base URL. |
|
||||
| `INFERENCE_TEXT_MODEL` | str | | Text inference model name. |
|
||||
| `INFERENCE_IMAGE_MODEL` | str | | Image inference model name. |
|
||||
| `EMBEDDING_TEXT_MODEL` | str | | Embedding model name. |
|
||||
| `INFERENCE_CONTEXT_LENGTH` | int | | Inference context length. |
|
||||
| `INFERENCE_LANG` | str | | Language used for inference. |
|
||||
| `INFERENCE_JOB_TIMEOUT_SEC` | int | | Timeout for inference jobs. |
|
||||
| `CRAWLER_DOWNLOAD_BANNER_IMAGE` | bool | `true` | Download banner image during crawl. |
|
||||
| `CRAWLER_STORE_SCREENSHOT` | bool | `false` | Store screenshot during crawl. |
|
||||
| `CRAWLER_FULL_PAGE_SCREENSHOT` | bool | `false` | Capture full-page screenshots. |
|
||||
| `CRAWLER_FULL_PAGE_ARCHIVE` | bool | `false` | Store full-page archive. |
|
||||
| `CRAWLER_JOB_TIMEOUT_SEC` | int | | Crawler job timeout. |
|
||||
| `CRAWLER_NAVIGATE_TIMEOUT_SEC` | int | | Navigation timeout. |
|
||||
| `CRAWLER_VIDEO_DOWNLOAD` | bool | | Enable video downloads. |
|
||||
| `CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE` | int | | Max video size (MB). |
|
||||
| `CRAWLER_VIDEO_DOWNLOAD_TIMEOUT_SEC` | int | | Video download timeout. |
|
||||
| `CRAWLER_ENABLE_ADBLOCKER` | bool | `true` | Enable ad blocking in the crawler. |
|
||||
| `CHROME_EXTENSIONS_DIR` | str | `/share/karakeep/extensions` | Host-mounted extensions directory for headless Chromium. |
|
||||
| `MEILI_MASTER_KEY` | password | | Meilisearch master key (auto-generated if left blank). |
|
||||
| `MEILI_ADDR` | str | | Meilisearch URL. |
|
||||
| `BROWSER_WEB_URL` | str | | Chromium remote debugging URL. |
|
||||
| `DATA_DIR` | str | | Data directory (leave default). |
|
||||
| `DISABLE_SIGNUPS` | bool | `false` | Disable new user signups. |
|
||||
| `MAX_ASSET_SIZE_MB` | int | `4` | Maximum asset upload size. |
|
||||
| `OPENAI_API_KEY` | password | | OpenAI API key for AI features. |
|
||||
| `OCR_LANGS` | str | | OCR languages (comma separated). |
|
||||
| `INFERENCE_LANG` | str | | Language used for AI inference. |
|
||||
| `CRAWLER_DOWNLOAD_BANNER_IMAGE` | bool | `true` | Download banner image. |
|
||||
| `CRAWLER_STORE_SCREENSHOT` | bool | `true` | Store page screenshots. |
|
||||
| `CRAWLER_FULL_PAGE_SCREENSHOT` | bool | `true` | Capture full-page screenshots. |
|
||||
| `CRAWLER_FULL_PAGE_ARCHIVE` | bool | `true` | Store full-page archive. |
|
||||
| `CRAWLER_ENABLE_ADBLOCKER` | bool | `true` | Enable ad blocking. |
|
||||
| `CRAWLER_VIDEO_DOWNLOAD` | bool | `false` | Enable video downloads. |
|
||||
| `TZ` | str | `Etc/UTC` | Timezone. |
|
||||
|
||||
### Extensions for headless Chromium
|
||||
|
||||
This add-on loads extensions in headless Chromium with the `--headless=new` flag. To use the included defaults:
|
||||
|
||||
1. Create these folders on the host (via the `/share` mount):
|
||||
- `/share/karakeep/extensions/i-dont-care-about-cookies`
|
||||
- `/share/karakeep/extensions/ublock-origin`
|
||||
2. Unzip each extension into its corresponding folder.
|
||||
3. Restart the add-on.
|
||||
|
||||
You can override the base folder with the `CHROME_EXTENSIONS_DIR` option. Any missing extension folder is skipped at runtime.
|
||||
|
||||
### Custom Scripts and Environment Variables
|
||||
|
||||
This addon supports custom scripts and environment variables through the `addon_config` mapping:
|
||||
|
||||
- **Custom scripts**: See [Running Custom Scripts in Addons](https://github.com/alexbelgium/hassio-addons/wiki/Running-custom-scripts-in-Addons)
|
||||
- **env_vars option**: Use the add-on `env_vars` option to pass extra environment variables (uppercase or lowercase names). See https://github.com/alexbelgium/hassio-addons/wiki/Add-Environment-variables-to-your-Addon-2 for details.
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
The installation of this add-on is pretty straightforward and not different in
|
||||
comparison to installing any other Hass.io add-on.
|
||||
1. Add my Home Assistant add-ons repository
|
||||
[![Add repository][repository-badge]][repository-url]
|
||||
|
||||
1. [Add my Hass.io add-ons repository][repository] to your Hass.io instance. [![Add repository on my Home Assistant][repository-badge]][repository-url]
|
||||
1. Install this add-on.
|
||||
1. Click the `Save` button to store your configuration.
|
||||
1. Start the add-on (secrets are auto-generated if left blank).
|
||||
1. Check the logs of the add-on to see if everything went well.
|
||||
1. Open the webUI and complete the onboarding.
|
||||
2. Install **Karakeep**
|
||||
3. Click **Save**
|
||||
4. Start the add-on (secrets are auto-generated)
|
||||
5. Open the Web UI and complete onboarding
|
||||
|
||||
---
|
||||
|
||||
## Support
|
||||
|
||||
Create an issue on GitHub if you need support.
|
||||
Create an issue on GitHub if you need help.
|
||||
|
||||
[repository]: https://github.com/alexbelgium/hassio-addons
|
||||
[repository-badge]: https://img.shields.io/badge/Add%20repository%20to%20my-Home%20Assistant-41BDF5?logo=home-assistant&style=for-the-badge
|
||||
|
||||
@@ -1,78 +1,58 @@
|
||||
arch:
|
||||
- aarch64
|
||||
- amd64
|
||||
description: bookmark-everything app with a touch of AI for the data hoarders out there
|
||||
environment:
|
||||
BROWSER_WEB_URL: http://127.0.0.1:9222
|
||||
CHROME_EXTENSIONS_DIR: /share/karakeep/extensions
|
||||
DATA_DIR: /data
|
||||
DISABLE_NEW_RELEASE_CHECK: "true"
|
||||
MEILI_ADDR: http://127.0.0.1:7700
|
||||
MEILI_MASTER_KEY: ""
|
||||
MEILI_NO_ANALYTICS: "true"
|
||||
XDG_CACHE_HOME: /data/cache
|
||||
name: Karakeep
|
||||
slug: karakeep
|
||||
description: A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
|
||||
version: 0.30.0-4
|
||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/karakeep
|
||||
image: ghcr.io/alexbelgium/karakeep-{arch}
|
||||
init: false
|
||||
map:
|
||||
- addon_config:rw
|
||||
- share:rw
|
||||
name: Karakeep
|
||||
options:
|
||||
env_vars: []
|
||||
CHROME_EXTENSIONS_DIR: /share/karakeep/extensions
|
||||
CRAWLER_DOWNLOAD_BANNER_IMAGE: true
|
||||
CRAWLER_ENABLE_ADBLOCKER: true
|
||||
CRAWLER_FULL_PAGE_ARCHIVE: false
|
||||
CRAWLER_FULL_PAGE_SCREENSHOT: false
|
||||
CRAWLER_STORE_SCREENSHOT: false
|
||||
DISABLE_SIGNUPS: false
|
||||
BROWSER_WEB_URL: http://127.0.0.1:9222
|
||||
DATA_DIR: /data
|
||||
MAX_ASSET_SIZE_MB: 4
|
||||
MEILI_ADDR: http://127.0.0.1:7700
|
||||
MEILI_MASTER_KEY: ""
|
||||
NEXTAUTH_SECRET: ""
|
||||
TZ: Etc/UTC
|
||||
ports:
|
||||
3000/tcp: 3000
|
||||
ports_description:
|
||||
3000/tcp: Web UI
|
||||
webui: "[PROTO:ssl]://[HOST]:[PORT:3000]"
|
||||
map:
|
||||
- addon_config:rw
|
||||
- share:rw
|
||||
environment:
|
||||
DATA_DIR: /data
|
||||
XDG_CACHE_HOME: /data/cache
|
||||
BROWSER_WEB_URL: http://127.0.0.1:9222
|
||||
CHROME_EXTENSIONS_DIR: /usr/src/chrome/extensions
|
||||
MEILI_ADDR: http://127.0.0.1:7700
|
||||
MEILI_NO_ANALYTICS: "true"
|
||||
DISABLE_NEW_RELEASE_CHECK: "true"
|
||||
options:
|
||||
TZ: Etc/UTC
|
||||
DISABLE_SIGNUPS: false
|
||||
NEXTAUTH_SECRET: ""
|
||||
NEXTAUTH_URL: ""
|
||||
MAX_ASSET_SIZE_MB: 4
|
||||
OPENAI_API_KEY: ""
|
||||
OCR_LANGS: ""
|
||||
INFERENCE_LANG: ""
|
||||
MEILI_MASTER_KEY: "" # <-- add this
|
||||
CRAWLER_DOWNLOAD_BANNER_IMAGE: true
|
||||
CRAWLER_STORE_SCREENSHOT: true
|
||||
CRAWLER_FULL_PAGE_SCREENSHOT: true
|
||||
CRAWLER_FULL_PAGE_ARCHIVE: true
|
||||
CRAWLER_ENABLE_ADBLOCKER: true
|
||||
CRAWLER_VIDEO_DOWNLOAD: false
|
||||
schema:
|
||||
env_vars:
|
||||
- name: match(^[A-Za-z0-9_]+$)
|
||||
value: str?
|
||||
BROWSER_WEB_URL: str?
|
||||
CHROME_EXTENSIONS_DIR: str?
|
||||
DATA_DIR: str?
|
||||
TZ: str?
|
||||
DISABLE_SIGNUPS: bool
|
||||
MEILI_ADDR: str?
|
||||
MEILI_MASTER_KEY: password?
|
||||
MAX_ASSET_SIZE_MB: int?
|
||||
NEXTAUTH_SECRET: password?
|
||||
NEXTAUTH_URL: str?
|
||||
OCR_LANGS: str?
|
||||
OCR_CONFIDENCE_THRESHOLD: int(0,100)?
|
||||
OPENAI_BASE_URL: str?
|
||||
MAX_ASSET_SIZE_MB: int?
|
||||
OPENAI_API_KEY: password?
|
||||
OLLAMA_BASE_URL: str?
|
||||
INFERENCE_TEXT_MODEL: str?
|
||||
INFERENCE_IMAGE_MODEL: str?
|
||||
EMBEDDING_TEXT_MODEL: str?
|
||||
INFERENCE_CONTEXT_LENGTH: int(0,)?
|
||||
OCR_LANGS: str?
|
||||
INFERENCE_LANG: str?
|
||||
INFERENCE_JOB_TIMEOUT_SEC: int(0,)?
|
||||
MEILI_MASTER_KEY: password? # <-- change to password?
|
||||
CRAWLER_DOWNLOAD_BANNER_IMAGE: bool
|
||||
CRAWLER_STORE_SCREENSHOT: bool
|
||||
CRAWLER_FULL_PAGE_SCREENSHOT: bool
|
||||
CRAWLER_FULL_PAGE_ARCHIVE: bool
|
||||
CRAWLER_JOB_TIMEOUT_SEC: int(0,)?
|
||||
CRAWLER_NAVIGATE_TIMEOUT_SEC: int(0,)?
|
||||
CRAWLER_VIDEO_DOWNLOAD: bool?
|
||||
CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE: int?
|
||||
CRAWLER_VIDEO_DOWNLOAD_TIMEOUT_SEC: int(0,)?
|
||||
CRAWLER_ENABLE_ADBLOCKER: bool
|
||||
TZ: str?
|
||||
slug: karakeep
|
||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/karakeep
|
||||
version: "0.30.0"
|
||||
webui: "[PROTO:ssl]://[HOST]:[PORT:3000]"
|
||||
CRAWLER_VIDEO_DOWNLOAD: bool?
|
||||
|
||||
@@ -7,9 +7,9 @@ bashio::log.info "Creating folders"
|
||||
mkdir -p \
|
||||
/data/cache \
|
||||
/data/chrome \
|
||||
/share/karakeep/extensions \
|
||||
/config/meili
|
||||
/config/meili \
|
||||
/usr/src/chrome/extensions
|
||||
|
||||
if id chrome &>/dev/null; then
|
||||
chown -R chrome:chrome /data/cache /data/chrome
|
||||
chown -R chrome:chrome /data/cache /data/chrome /usr/src/chrome/extensions
|
||||
fi
|
||||
|
||||
@@ -1,16 +1,36 @@
|
||||
#!/command/with-contenv bashio
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
generate_secret() {
|
||||
tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 64
|
||||
# Avoid SIGPIPE from `tr` when `head` terminates early under pipefail.
|
||||
(
|
||||
set +o pipefail 2>/dev/null || true
|
||||
tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 64
|
||||
)
|
||||
}
|
||||
|
||||
set_option() {
|
||||
local key="$1"
|
||||
local value="$2"
|
||||
|
||||
# Store permanently in Home Assistant add-on options
|
||||
bashio::addon.option "${key}" "${value}"
|
||||
|
||||
# Export into current process
|
||||
export "${key}=${value}"
|
||||
|
||||
# Export into s6 so all services inherit it
|
||||
if [ -d /var/run/s6/container_environment ]; then
|
||||
printf "%s" "${value}" > "/var/run/s6/container_environment/${key}"
|
||||
fi
|
||||
}
|
||||
|
||||
load_option() {
|
||||
local key="$1"
|
||||
local value
|
||||
|
||||
value="$(bashio::config "${key}")"
|
||||
export "${key}=${value}"
|
||||
|
||||
if [ -d /var/run/s6/container_environment ]; then
|
||||
@@ -20,13 +40,10 @@ set_option() {
|
||||
|
||||
for key in MEILI_MASTER_KEY NEXTAUTH_SECRET; do
|
||||
if bashio::config.has_value "${key}"; then
|
||||
value="$(bashio::config "${key}")"
|
||||
export "${key}=${value}"
|
||||
if [ -d /var/run/s6/container_environment ]; then
|
||||
printf "%s" "${value}" > "/var/run/s6/container_environment/${key}"
|
||||
fi
|
||||
bashio::log.info "Using existing ${key}"
|
||||
load_option "${key}"
|
||||
else
|
||||
bashio::log.warning "${key} is not set. Generating a new value and storing it in addon options."
|
||||
bashio::log.warning "${key} not set, generating persistent secret"
|
||||
value="$(generate_secret)"
|
||||
set_option "${key}" "${value}"
|
||||
fi
|
||||
|
||||
46
karakeep/rootfs/etc/cont-init.d/92-chrome-extensions.sh
Executable file
46
karakeep/rootfs/etc/cont-init.d/92-chrome-extensions.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/command/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
EXTENSIONS_DIR="${CHROME_EXTENSIONS_DIR:-/usr/src/chrome/extensions}"
|
||||
bashio::log.info "Refreshing Chromium extensions in ${EXTENSIONS_DIR}"
|
||||
|
||||
mkdir -p "${EXTENSIONS_DIR}"
|
||||
|
||||
download_extension() {
|
||||
local name="$1"
|
||||
local extension_id="$2"
|
||||
local crx_path rc
|
||||
|
||||
crx_path="$(mktemp)"
|
||||
|
||||
if ! curl -fsSL \
|
||||
"https://clients2.google.com/service/update2/crx?response=redirect&prodversion=120.0&acceptformat=crx2,crx3&x=id%3D${extension_id}%26installsource%3Dondemand%26uc" \
|
||||
-o "${crx_path}"; then
|
||||
rm -f "${crx_path}"
|
||||
bashio::log.warning "Failed to download extension ${name}. Continuing without refresh."
|
||||
return 0
|
||||
fi
|
||||
|
||||
rm -rf "${EXTENSIONS_DIR:?}/${name}"
|
||||
mkdir -p "${EXTENSIONS_DIR}/${name}"
|
||||
|
||||
rc=0
|
||||
unzip -q "${crx_path}" -d "${EXTENSIONS_DIR}/${name}" || rc=$?
|
||||
rm -f "${crx_path}"
|
||||
|
||||
# unzip may return 1 even though files extracted (common with CRX zip metadata)
|
||||
if [ "${rc}" -ne 0 ] && [ "${rc}" -ne 1 ]; then
|
||||
bashio::log.warning "Failed to unzip extension ${name} (rc=${rc}). Continuing."
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
download_extension "i-dont-care-about-cookies" "fllaojicojecljbmefodhfapmkghcbnh"
|
||||
download_extension "ublock-origin" "cjpalhdlnbpafiamejdnhcphjbkeiagm"
|
||||
|
||||
if id chrome &>/dev/null; then
|
||||
chown -R chrome:chrome "${EXTENSIONS_DIR}"
|
||||
fi
|
||||
@@ -2,7 +2,7 @@
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
EXTENSIONS_DIR="${CHROME_EXTENSIONS_DIR:-/share/karakeep/extensions}"
|
||||
EXTENSIONS_DIR="${CHROME_EXTENSIONS_DIR:-/usr/src/chrome/extensions}"
|
||||
|
||||
extensions=()
|
||||
for extension in "${EXTENSIONS_DIR}/i-dont-care-about-cookies" "${EXTENSIONS_DIR}/ublock-origin"; do
|
||||
|
||||
Reference in New Issue
Block a user