Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
!/postcss.config.js
!/pyproject.toml
!/rollup.config.mjs
!/scripts/setup-ublock.sh
!/supervisord-tasks.conf
!/supervisord-all.conf
!/uv.lock
Expand Down
Binary file modified bookmarks/static/maskable-logo-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bookmarks/static/maskable-logo-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion bookmarks/static/maskable-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 3 additions & 11 deletions docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,11 @@ CMD ["./bootstrap.sh"]

FROM node:22-alpine AS ublock-build
WORKDIR /etc/linkding
COPY scripts/setup-ublock.sh .
# Install necessary tools
# Download and unzip the latest uBlock Origin Lite release
# Patch manifest to enable annoyances by default
# Download and unzip uBlock Origin Lite, patch manifest to enable annoyances by default
RUN apk add --no-cache curl jq unzip && \
TAG=$(curl -sL https://api.github.com/repos/uBlockOrigin/uBOL-home/releases/latest | jq -r '.tag_name') && \
DOWNLOAD_URL=https://github.com/uBlockOrigin/uBOL-home/releases/download/$TAG/uBOLite_$TAG.chromium.zip && \
echo "Downloading $DOWNLOAD_URL" && \
curl -L -o uBOLite.zip $DOWNLOAD_URL && \
unzip uBOLite.zip -d uBOLite.chromium.mv3 && \
rm uBOLite.zip && \
jq '.declarative_net_request.rule_resources |= map(if .id == "annoyances-overlays" or .id == "annoyances-cookies" or .id == "annoyances-social" or .id == "annoyances-widgets" or .id == "annoyances-others" then .enabled = true else . end)' \
uBOLite.chromium.mv3/manifest.json > temp.json && \
mv temp.json uBOLite.chromium.mv3/manifest.json
sh setup-ublock.sh


FROM linkding AS linkding-plus
Expand Down
14 changes: 3 additions & 11 deletions docker/default.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,11 @@ CMD ["./bootstrap.sh"]

FROM node:22-alpine AS ublock-build
WORKDIR /etc/linkding
COPY scripts/setup-ublock.sh .
# Install necessary tools
# Download and unzip the latest uBlock Origin Lite release
# Patch manifest to enable annoyances by default
# Download and unzip uBlock Origin Lite, patch manifest to enable annoyances by default
RUN apk add --no-cache curl jq unzip && \
TAG=$(curl -sL https://api.github.com/repos/uBlockOrigin/uBOL-home/releases/latest | jq -r '.tag_name') && \
DOWNLOAD_URL=https://github.com/uBlockOrigin/uBOL-home/releases/download/$TAG/uBOLite_$TAG.chromium.zip && \
echo "Downloading $DOWNLOAD_URL" && \
curl -L -o uBOLite.zip $DOWNLOAD_URL && \
unzip uBOLite.zip -d uBOLite.chromium.mv3 && \
rm uBOLite.zip && \
jq '.declarative_net_request.rule_resources |= map(if .id == "annoyances-overlays" or .id == "annoyances-cookies" or .id == "annoyances-social" or .id == "annoyances-widgets" or .id == "annoyances-others" then .enabled = true else . end)' \
uBOLite.chromium.mv3/manifest.json > temp.json && \
mv temp.json uBOLite.chromium.mv3/manifest.json
sh setup-ublock.sh


FROM linkding AS linkding-plus
Expand Down
16 changes: 12 additions & 4 deletions scripts/setup-ublock.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/bin/sh
# Also used by the Docker builds to set up uBlock Origin Lite, see docker/*.Dockerfile
set -e

rm -rf uBOLite.chromium.mv3

# Download uBlock Origin Lite
TAG=$(curl -sL https://api.github.com/repos/uBlockOrigin/uBOL-home/releases/latest | jq -r '.tag_name')
DOWNLOAD_URL=https://github.com/uBlockOrigin/uBOL-home/releases/download/$TAG/uBOLite_$TAG.chromium.zip
# Download the latest stable uBlock Origin Lite release with a Chromium asset
DOWNLOAD_URL=$(curl -fsSL "https://api.github.com/repos/uBlockOrigin/uBOL-home/releases?per_page=20" | \
jq -r 'first(.[] | select(.prerelease == false) | .assets[] | select(.name | endswith(".chromium.zip")) | .browser_download_url) // empty')
if [ -z "$DOWNLOAD_URL" ]; then
echo "No uBlock Origin Lite release with a .chromium.zip asset found (or the GitHub API is unavailable / rate limited)" >&2
exit 1
fi
echo "Downloading $DOWNLOAD_URL"
curl -L -o uBOLite.zip $DOWNLOAD_URL
curl -fL -o uBOLite.zip "$DOWNLOAD_URL"
unzip uBOLite.zip -d uBOLite.chromium.mv3
rm uBOLite.zip

Expand Down
Loading