Skip to main content

linktools toolkit

Project description

Linktools Cntr

Docker / Podman 容器部署和管理工具,为 homelab 及服务器环境提供统一的容器生命周期管理(命令前缀 ct-cntr)。

开始使用

以基于 Debian 的系统为例,先安装运行环境:

# 安装 Python3、Git、Docker、Docker Compose
wget -qO- get.docker.com | bash
sudo apt-get update
sudo apt-get install -y python3 python3-pip git docker-compose-plugin

安装 linktools-cntr:

python3 -m pip install -U linktools linktools-cntr

# 安装 GitHub 最新开发版
python3 -m pip install --ignore-installed \
  "linktools@ git+https://github.com/linktools-toolkit/linktools.git@master#subdirectory=linktools" \
  "linktools-cntr@ git+https://github.com/linktools-toolkit/linktools.git@master#subdirectory=linktools-cntr"

容器部署示例

All in one 环境

PVE、OpenWRT、飞牛 OS、WAF、SSO、导航页等等

👉 搭建文档

Xray Server

gRPC + SSL + VLESS

👉 搭建文档

Redroid

Docker 版 Android 容器,以及编译环境

👉 搭建文档

内置容器

linktools-cntr 内置了常用容器定义,开箱即用:

容器 说明
nginx 反向代理(含 ACME 自动证书)
lldap 轻量级 LDAP 目录服务
authelia 单点登录 / 双因素认证
safeline Web 应用防火墙
portainer 容器可视化管理界面

更多容器可通过添加外部仓库获取(参见下方仓库管理命令)。

内置配置项

首次部署时会引导填写配置项,内置的全局配置参数包括:

参数 类型 默认值 描述
CONTAINER_TYPE str 容器运行时:docker / docker-rootless / podman
DOCKER_USER str 当前用户 部分 rootless 容器使用此用户权限运行
DOCKER_HOST str /var/run/docker.sock Docker Daemon 地址
DOCKER_APP_PATH str ~/.linktools/data/container/app 容器数据持久化目录(建议置于 SSD)
DOCKER_APP_DATA_PATH str 默认同DOCKER_APP_PATH 不频繁读写的持久化目录(可置于 HDD)
HOST str 当前局域网 IP 宿主机 IP 地址

常用命令

# 查看帮助(每个子命令均支持 -h 参数)
ct-cntr -h

#######################
# 仓库管理(支持 git 链接和本地路径)
#######################

# 添加容器仓库
ct-cntr repo add https://github.com/linktools-toolkit/linktools-homelab

# 拉取仓库最新代码
ct-cntr repo update

# 删除仓库
ct-cntr repo remove

#######################
# 容器安装列表管理
#######################

# 添加要部署的容器
ct-cntr add nginx lldap authelia portainer

# 从部署列表移除容器
ct-cntr remove nginx

#######################
# 容器生命周期管理
#######################

# 启动容器
ct-cntr up

# 重启容器
ct-cntr restart

# 停止容器
ct-cntr down

#######################
# 配置管理
#######################

# 查看当前 docker compose 配置
ct-cntr config

# 列出所有配置变量
ct-cntr config list

# 设置配置变量
ct-cntr config set NGINX_ROOT_DOMAIN=example.com ACME_DNS_API=dns_ali Ali_Key=xxx Ali_Secret=yyy

# 删除配置变量
ct-cntr config unset NGINX_ROOT_DOMAIN ACME_DNS_API Ali_Key Ali_Secret

# 使用编辑器直接编辑配置文件
ct-cntr config edit --editor vim

# 重新加载配置
ct-cntr config reload

相关链接

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linktools_cntr-0.9.0rc3.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linktools_cntr-0.9.0rc3-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file linktools_cntr-0.9.0rc3.tar.gz.

File metadata

  • Download URL: linktools_cntr-0.9.0rc3.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for linktools_cntr-0.9.0rc3.tar.gz
Algorithm Hash digest
SHA256 9d8e82ae0288b462b41f874cfdaecae28ddf87d5f9a9e4c6b90e8338ee9441c6
MD5 0c377c1102ad4120f7c8d65f85eac565
BLAKE2b-256 6c80b67d619e72e188d1f7c40ae5d54c8205980a37196ff50a4bd6e98df355a7

See more details on using hashes here.

File details

Details for the file linktools_cntr-0.9.0rc3-py3-none-any.whl.

File metadata

File hashes

Hashes for linktools_cntr-0.9.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 f624893e008655aa0edd73e7a19004fb58070986ec82502ad251ffb8a20ed529
MD5 266eb35bc19dee97ea70cc276f76b890
BLAKE2b-256 698c5c8e501cdb59f06ae69a3796be482515aea67e613db031969ff7050b5945

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page