Add Linkding CT/install scripts and frontend
Add Linkding integration: new CT template (ct/linkding.sh) and installer (install/linkding-install.sh) to deploy Linkding as a container. Installer fetches the GitHub release, builds the frontend, compiles the SQLite ICU extension, creates .env with generated admin password, and installs systemd services (linkding, linkding-tasks). Also add frontend metadata (frontend/public/json/linkding.json) for the app catalog. Minor tweak: remove unused import_local_ip from install/wger-install.sh.
This commit is contained in:
parent
4b36571661
commit
e61d4f9978
80
ct/linkding.sh
Normal file
80
ct/linkding.sh
Normal file
@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (MickLesk)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://linkding.link/
|
||||
|
||||
APP="linkding"
|
||||
var_tags="${var_tags:-bookmarks;management}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-1024}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/linkding ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "linkding" "sissbruecker/linkding"; then
|
||||
msg_info "Stopping Services"
|
||||
systemctl stop linkding linkding-tasks
|
||||
msg_ok "Stopped Services"
|
||||
|
||||
msg_info "Backing up Data"
|
||||
cp -r /opt/linkding/data /opt/linkding_data_backup
|
||||
cp /opt/linkding/.env /opt/linkding_env_backup
|
||||
cp /opt/linkding/libicu.so /opt/linkding_libicu_backup
|
||||
msg_ok "Backed up Data"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "linkding" "sissbruecker/linkding"
|
||||
|
||||
msg_info "Restoring Data"
|
||||
cp -r /opt/linkding_data_backup/. /opt/linkding/data
|
||||
cp /opt/linkding_env_backup /opt/linkding/.env
|
||||
cp /opt/linkding_libicu_backup /opt/linkding/libicu.so
|
||||
rm -rf /opt/linkding_data_backup /opt/linkding_env_backup /opt/linkding_libicu_backup
|
||||
msg_ok "Restored Data"
|
||||
|
||||
msg_info "Updating ${APP}"
|
||||
cd /opt/linkding
|
||||
rm -f bookmarks/settings/dev.py
|
||||
touch bookmarks/settings/custom.py
|
||||
$STD npm ci
|
||||
$STD npm run build
|
||||
$STD uv sync --no-dev
|
||||
$STD uv pip install gunicorn
|
||||
set -a && source /opt/linkding/.env && set +a
|
||||
$STD uv run python manage.py migrate
|
||||
$STD uv run python manage.py collectstatic --no-input
|
||||
msg_ok "Updated ${APP}"
|
||||
|
||||
msg_info "Starting Services"
|
||||
systemctl start linkding linkding-tasks
|
||||
msg_ok "Started Services"
|
||||
msg_ok "Updated Successfully"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9090${CL}"
|
||||
40
frontend/public/json/linkding.json
Normal file
40
frontend/public/json/linkding.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "linkding",
|
||||
"slug": "linkding",
|
||||
"categories": [
|
||||
12
|
||||
],
|
||||
"date_created": "2026-02-09",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 9090,
|
||||
"documentation": "https://linkding.link/",
|
||||
"website": "https://linkding.link/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/linkding.webp",
|
||||
"config_path": "/opt/linkding/.env",
|
||||
"description": "linkding is a self-hosted bookmark manager that is designed to be minimal, fast, and easy to set up. It features a clean UI, tag-based organization, bulk editing, Markdown notes, read it later functionality, sharing, REST API, and browser extensions for Firefox and Chrome.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/linkding.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 1024,
|
||||
"hdd": 4,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": "admin",
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Admin credentials are stored in /opt/linkding/.env",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
116
install/linkding-install.sh
Normal file
116
install/linkding-install.sh
Normal file
@ -0,0 +1,116 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (MickLesk)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://linkding.link/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
build-essential \
|
||||
pkg-config \
|
||||
libpq-dev \
|
||||
libicu-dev \
|
||||
libsqlite3-dev \
|
||||
libffi-dev \
|
||||
unzip \
|
||||
wget
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
setup_uv
|
||||
|
||||
fetch_and_deploy_gh_release "linkding" "sissbruecker/linkding"
|
||||
|
||||
msg_info "Building Frontend"
|
||||
cd /opt/linkding
|
||||
$STD npm ci
|
||||
$STD npm run build
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_info "Compiling SQLite ICU Extension"
|
||||
cd /tmp
|
||||
SQLITE_RELEASE_YEAR=2023
|
||||
SQLITE_RELEASE=3430000
|
||||
$STD wget https://www.sqlite.org/${SQLITE_RELEASE_YEAR}/sqlite-amalgamation-${SQLITE_RELEASE}.zip
|
||||
$STD unzip -o sqlite-amalgamation-${SQLITE_RELEASE}.zip
|
||||
cp sqlite-amalgamation-${SQLITE_RELEASE}/sqlite3.h .
|
||||
cp sqlite-amalgamation-${SQLITE_RELEASE}/sqlite3ext.h .
|
||||
$STD wget "https://www.sqlite.org/src/raw/ext/icu/icu.c?name=91c021c7e3e8bbba286960810fa303295c622e323567b2e6def4ce58e4466e60" -O icu.c
|
||||
$STD gcc -fPIC -shared icu.c $(pkg-config --libs --cflags icu-uc icu-io) -o /opt/linkding/libicu.so
|
||||
rm -rf sqlite-amalgamation-${SQLITE_RELEASE}* icu.c sqlite3.h sqlite3ext.h
|
||||
cd /opt/linkding
|
||||
msg_ok "Compiled SQLite ICU Extension"
|
||||
|
||||
msg_info "Setting up ${APP}"
|
||||
rm -f bookmarks/settings/dev.py
|
||||
touch bookmarks/settings/custom.py
|
||||
$STD uv sync --no-dev
|
||||
$STD uv pip install gunicorn
|
||||
mkdir -p data/{favicons,previews,assets}
|
||||
ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
|
||||
cat <<EOF >/opt/linkding/.env
|
||||
LD_SUPERUSER_NAME=admin
|
||||
LD_SUPERUSER_PASSWORD=${ADMIN_PASS}
|
||||
LD_CSRF_TRUSTED_ORIGINS=http://${LOCAL_IP}:9090
|
||||
EOF
|
||||
set -a && source /opt/linkding/.env && set +a
|
||||
$STD uv run python manage.py generate_secret_key
|
||||
$STD uv run python manage.py migrate
|
||||
$STD uv run python manage.py enable_wal
|
||||
$STD uv run python manage.py create_initial_superuser
|
||||
$STD uv run python manage.py collectstatic --no-input
|
||||
msg_ok "Set up ${APP}"
|
||||
|
||||
msg_info "Creating Services"
|
||||
cat <<EOF >/etc/systemd/system/linkding.service
|
||||
[Unit]
|
||||
Description=linkding Bookmark Manager
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
WorkingDirectory=/opt/linkding
|
||||
EnvironmentFile=/opt/linkding/.env
|
||||
ExecStart=/opt/linkding/.venv/bin/gunicorn \
|
||||
--bind 0.0.0.0:9090 \
|
||||
--workers 3 \
|
||||
--threads 2 \
|
||||
--timeout 120 \
|
||||
bookmarks.wsgi:application
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
cat <<EOF >/etc/systemd/system/linkding-tasks.service
|
||||
[Unit]
|
||||
Description=linkding Background Tasks
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
WorkingDirectory=/opt/linkding
|
||||
EnvironmentFile=/opt/linkding/.env
|
||||
ExecStart=/opt/linkding/.venv/bin/python manage.py run_huey
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now linkding linkding-tasks
|
||||
msg_ok "Created Services"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@ -21,7 +21,6 @@ $STD apt install -y \
|
||||
libpq-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
import_local_ip
|
||||
NODE_VERSION="22" NODE_MODULE="sass" setup_nodejs
|
||||
setup_uv
|
||||
PG_VERSION="16" setup_postgresql
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user