Merge pull request #9249 from renovate/ghcr.io-hargata-lubelogger-1.x

This commit is contained in:
okxlin
2026-11-20 10:27:11 +08:00
7 changed files with 268 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
PANEL_APP_PORT_HTTP=8080
LUBELOGGER_ROOT_USERNAME=admin
LUBELOGGER_ROOT_PASSWORD=LubeLogger_Admin_2026!
TIME_ZONE=Etc/UTC
APP_DATA_DIR=./data
CONTAINER_NAME=
+86
View File
@@ -0,0 +1,86 @@
additionalProperties:
formFields:
- default: 8080
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: 端口
label:
en: Port
zh: 端口
zh-Hant: 埠
ja: ポート
ko: 포트
ru: Порт
ms: Port
pt-br: Porta
required: true
rule: paramPort
type: number
- default: admin
edit: true
envKey: LUBELOGGER_ROOT_USERNAME
labelEn: Root Username
labelZh: 根管理员用户名
label:
en: Root Username
zh: 根管理员用户名
zh-Hant: 根管理員使用者名稱
ja: ルート管理者ユーザー名
ko: 루트 관리자 사용자 이름
ru: Имя корневого администратора
ms: Nama Pengguna Pentadbir Root
pt-br: Nome do Administrador Raiz
required: true
rule: paramCommon
type: text
- default: LubeLogger_Admin_2026!
edit: true
envKey: LUBELOGGER_ROOT_PASSWORD
labelEn: Root Password
labelZh: 根管理员密码
label:
en: Root Password
zh: 根管理员密码
zh-Hant: 根管理員密碼
ja: ルート管理者パスワード
ko: 루트 관리자 비밀번호
ru: Пароль корневого администратора
ms: Kata Laluan Pentadbir Root
pt-br: Senha do Administrador Raiz
random: true
required: true
rule: paramComplexity
type: password
- default: Etc/UTC
edit: true
envKey: TIME_ZONE
labelEn: Time Zone
labelZh: 时区
label:
en: Time Zone
zh: 时区
zh-Hant: 時區
ja: タイムゾーン
ko: 시간대
ru: Часовой пояс
ms: Zon Masa
pt-br: Fuso Horario
required: true
type: text
- default: ./data
edit: true
envKey: APP_DATA_DIR
labelEn: Data Directory
labelZh: 数据目录
label:
en: Data Directory
zh: 数据目录
zh-Hant: 資料目錄
ja: データディレクトリ
ko: 데이터 디렉터리
ru: Каталог данных
ms: Direktori Data
pt-br: Diretorio de Dados
required: true
type: text
+1
View File
@@ -0,0 +1 @@
+46
View File
@@ -0,0 +1,46 @@
services:
lubelogger:
image: "ghcr.io/hargata/lubelogger:v1.7.5@sha256:cdfd841eea84b652cca5401dc7edfca9f400970ab472025246f92323b2ce36e1"
container_name: ${CONTAINER_NAME}
restart: unless-stopped
init: true
user: "1000:1000"
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_HTTP}:8080"
env_file:
- path: "${APP_DATA_DIR}/.lubelogger-auth.env"
required: false
environment:
- HOME=/App/data
- TZ=${TIME_ZONE}
- ASPNETCORE_HTTP_PORTS=8080
- Kestrel__EndpointDefaults__Protocols=Http1
- DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP2SUPPORT=false
- LUBELOGGER_LOCALE_OVERRIDE=en_US
- LUBELOGGER_LOCALE_DT_OVERRIDE=en_US
read_only: true
tmpfs:
- /tmp:size=64m,mode=1777
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
healthcheck:
test:
- CMD-SHELL
- >-
bash -lc 'exec 3<>/dev/tcp/127.0.0.1/8080; exec 3>&-; exec 3<&-'
interval: 30s
timeout: 5s
start_period: 15s
retries: 3
volumes:
- "${APP_DATA_DIR}:/App/data"
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true
+123
View File
@@ -0,0 +1,123 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
ENV_FILE="${ENV_FILE:-$ROOT_DIR/.env}"
read_env_value() {
local key="$1"
[[ -f "$ENV_FILE" ]] || return 0
local value
value="$(sed -n "s/^${key}=//p" "$ENV_FILE" | tail -n 1)"
case "$value" in
\"*\") value="${value#\"}"; value="${value%\"}" ;;
\'*\') value="${value#\'}"; value="${value%\'}" ;;
esac
printf '%s\n' "$value"
}
configured_value() {
local key="$1"
local default_value="$2"
local value="${!key:-}"
if [[ -z "$value" ]]; then
value="$(read_env_value "$key")"
fi
printf '%s\n' "${value:-$default_value}"
}
reject_control_characters() {
local name="$1"
local value="$2"
if [[ "$value" == *$'\n'* || "$value" == *$'\r'* ]]; then
printf '%s must not contain line breaks\n' "$name" >&2
exit 1
fi
}
prepare_lubelogger() {
local raw path username password username_hash password_hash auth_file temp_file
raw="$(configured_value APP_DATA_DIR ./data)"
username="$(configured_value LUBELOGGER_ROOT_USERNAME admin)"
password="$(configured_value LUBELOGGER_ROOT_PASSWORD '')"
[[ -n "$raw" ]] || {
printf '%s\n' 'APP_DATA_DIR must not be empty' >&2
exit 1
}
if [[ "$raw" = /* ]]; then
printf '%s\n' 'APP_DATA_DIR must be relative to the application version directory' >&2
exit 1
fi
path="$(realpath -m -- "$ROOT_DIR/${raw#./}")"
case "$path" in
"$ROOT_DIR"/*) ;;
*)
printf '%s\n' 'APP_DATA_DIR must remain inside the application version directory' >&2
exit 1
;;
esac
install -d -m 0750 "$path"
path="$(realpath -e -- "$path")"
case "$path" in
"$ROOT_DIR"/*) ;;
*)
printf '%s\n' 'APP_DATA_DIR resolves outside the application version directory' >&2
exit 1
;;
esac
[[ -n "$username" && ${#username} -le 128 ]] || {
printf '%s\n' 'LUBELOGGER_ROOT_USERNAME must contain 1 to 128 characters' >&2
exit 1
}
[[ ${#password} -ge 12 && ${#password} -le 256 ]] || {
printf '%s\n' 'LUBELOGGER_ROOT_PASSWORD must contain 12 to 256 characters' >&2
exit 1
}
reject_control_characters LUBELOGGER_ROOT_USERNAME "$username"
reject_control_characters LUBELOGGER_ROOT_PASSWORD "$password"
username_hash="$(printf '%s' "$username" | sha256sum | cut -d ' ' -f 1)"
password_hash="$(printf '%s' "$password" | sha256sum | cut -d ' ' -f 1)"
[[ "$username_hash" =~ ^[0-9a-f]{64}$ && "$password_hash" =~ ^[0-9a-f]{64}$ ]] || {
printf '%s\n' 'Failed to generate LubeLogger credential hashes' >&2
exit 1
}
auth_file="$path/.lubelogger-auth.env"
if [[ -L "$auth_file" ]]; then
printf '%s\n' 'LubeLogger authentication file must not be a symbolic link' >&2
exit 1
fi
if [[ -e "$auth_file" && ! -f "$auth_file" ]]; then
printf '%s\n' 'LubeLogger authentication path must be a regular file' >&2
exit 1
fi
umask 077
temp_file="$(mktemp "$path/.lubelogger-auth.env.tmp.XXXXXX")"
trap 'rm -f -- "${temp_file:-}"' EXIT
printf '%s\n' \
'EnableAuth=true' \
"UserNameHash=$username_hash" \
"UserPasswordHash=$password_hash" \
'DisableRegistration=true' \
'LUBELOGGER_OPEN_REGISTRATION=false' >"$temp_file"
chmod 0600 "$temp_file"
chown 1000:1000 "$temp_file"
mv -f -- "$temp_file" "$auth_file"
trap - EXIT
chown 1000:1000 "$path"
chmod 0750 "$path"
[[ "$(stat -c '%a' -- "$auth_file")" = 600 ]] || {
printf '%s\n' 'LubeLogger authentication file permissions must be 0600' >&2
exit 1
}
}
prepare_lubelogger
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker-compose down --volumes
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail
"$(dirname "$0")/init.sh"