AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-148624

exore's questions

Martin Hope
exore
Asked: 2025-03-12 22:49:06 +0800 CST

如何设置 traefik 仪表板服务名称

  • 5

因为我正在努力将真实 IP 转发到 docker 应用程序,所以我现在在主机网络模式下运行 docker traefik。

traefik 和服务正常运行。这是我的配置

docker-compose.yaml:

---
services:
  traefik:
    image: traefik:latest
    container_name: traefik
    network_mode: host
    volumes:
      - ./traefik.yaml:/traefik.yaml
      - ./letsencrypt/:/letsencrypt/
      - /run/docker.sock:/var/run/docker.sock:ro
    labels:
      - traefik.enable=true
      - traefik.http.routers.traefik.rule=Host(`frontal.cestpasla.norhere.net`)
      - traefik.http.routers.traefik.entrypoints=websecure
      - traefik.http.routers.traefik.service=api@internal
      - traefik.http.services.traefik-0000traefik.loadbalancer.server.port=8080
      - traefik.http.routers.traefik.tls.certresolver=myresolver
      - traefik.http.routers.traefik.middlewares=traefik-auth
      - traefik.http.middlewares.traefik-auth.basicauth.users=me:encryptedpassword

静态 traefik yaml 文件:

---
api:
  dashboard:
providers:
  docker:
    exposedByDefault: false
entrypoints:
  web:
    address: 10.20.0.2:80
  websecure:
    address: 10.20.0.2:443
certificatesresolvers:
  myresolver:
    acme:
      tlschallenge: true
      email: [email protected]
      storage: /letsencrypt/acme.json
#log:
#  level: DEBUG

有问题的行是:

      - traefik.http.services.traefik-0000traefik.loadbalancer.server.port=8080

仪表板服务名称为traefik-0000traefik,可能是因为 docker-compose 文件位于名为 的文件夹中0000.traefik。我不记得在测试的哪个阶段我突然必须添加此行,但是截至目前,在网络主机模式下,如果我不使用此行,我可以在 docker 日志中看到此错误:

2025-03-12T11:25:38Z ERR error="service \"traefik-0000traefik\" error: port is missing" container=traefik-0000traefik-09ccfe569180f81f22b135fd75082ed017ce95a7dc0ade1ab5a7e2bfbd960886 providerName=docker

问题是:
如果我必须对仪表板服务使用配置行,我至少可以选择服务名称,traefik_dashboard或者类似名称吗?以及如何选择?

docker
  • 1 个回答
  • 43 Views
Martin Hope
exore
Asked: 2025-02-25 17:47:17 +0800 CST

根据 cloud-init 日志,用户定义错误,但用户还是被创建了。用户定义有什么错误?

  • 8

lui因此,我使用 cloud-init 启动 debian 12 bookworm,并创建如下所示的用户。

users:
  - name: lui
    ssh_authorized_keys:
      - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH7tTbt9XLZ0bGRcD+btgRh5qcuM7/TphfnCPl4fw8q3 la mienne
    sudo: ["ALL=(ALL) ALL"]
    shell: /bin/bash
    gecos: C'est pas moi !,,,
    lock_passwd: false
    plain_text_passwd: elle

但是,在 cloud-init 日志中我可以看到这个

Cloud config schema errors: users.0: {'gecos': "C'est pas moi !,,,",
'lock_passwd': False, 'name': 'lui', 'plain_text_passwd': 'elle',
'shell': '/bin/bash', 'ssh_authorized_keys': ['ssh-ed25519
AAAAC3NzaC1lZDI1NTE5AAAAIH7tTbt9XLZ0bGRcD+byrFUv8cuM7/TphfnCJ6WXwkIq
la mienne'], 'sudo': ['ALL=(ALL) ALL']} is not valid under
any of the given schemas

与用户一起连接到机器后lui,我运行sudo cloud-init schema --system并有效得到相同的错误,但没有解释什么是错误或缺失的......

所以我想我很幸运,因为 cloud-init 无论如何都不会放弃并创建用户。总有一天,我的运气会耗尽。所以我宁愿现在就解决这个问题。

我检查了cloud-init 参考但未能发现我的错误。

这个 cloud-init 用户定义有什么问题?

cloud-init
  • 1 个回答
  • 129 Views
Martin Hope
exore
Asked: 2024-10-23 18:24:54 +0800 CST

当 squid 监听 2 个端口时如何仅验证一个端口

  • 5

我想让 squid 监听端口 3128 和 3129。我想在 3129 上进行身份验证,在 3128 上不进行身份验证。目前我有以下配置

# auth_param not shown but working

http_port 3128
http_port 3129
acl input_3128 myportname 3128
acl input_3129 myportname 3129
acl authenticated proxy_auth REQUIRED

http_access allow authenticated input_3129
http_access deny input_3129
http_access allow input_3128
http_access deny all

不幸的是,这根本不起作用。Squid 总是需要身份验证。

示例请求:

curl -v --proxy http://myproxy.example.com:3128 http://debian.org/

鱿鱼反应:

* processing: http://debian.org/
10.1.2.3:3128...
* Connected to myproxy.example.com (10.1.2.3) port 3128
> GET http://debian.org/ HTTP/1.1
> Host: debian.org
> User-Agent: curl/8.2.1
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 407 Proxy Authentication Required
< Server: squid/5.9
< Mime-Version: 1.0
< Date: Wed, 23 Oct 2024 10:15:01 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 3511
< X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0
< Vary: Accept-Language
< Content-Language: en
< Proxy-Authenticate: Basic realm="Squid proxy-caching web server"
< X-Cache: MISS from myproxy
< X-Cache-Lookup: NONE from myproxy:3129
< Via: 1.1 myproxy (squid/5.9)
< Connection: keep-alive
<

问题

如何让 squid 仅在端口 3129 上需要身份验证?

proxy
  • 2 个回答
  • 47 Views
Martin Hope
exore
Asked: 2018-06-24 05:57:10 +0800 CST

如何从 xfs 项目配额中删除项目 ID?

  • 0

我成功使用了 xfs 项目(或目录)配额。但是我刚刚发现,一旦不再需要配额信息,我就无法删除它。比如我有3个项目id为1、2、3的项目,我删除了id为2的项目目录,现在xfs_quota继续告诉我有一个id为2的项目,并且有配额。报告的已用空间为 0,这是正确的,因为该目录已被删除。这不是一个真正的问题。每当我重用项目 id 2 时,我都会设置新的配额,但我仍然想从文件系统中删除这些无用的信息。

/etc/项目

1:/web/perso/usera
3:/web/perso/userc

/etc/projid

usera:1
userc:3

这是 xfs_quota 报告的内容。

root@server # xfs_quota -xc "report -a -p -h" 
Project quota on /web (/dev/vdb1)
                        Blocks              
Project ID   Used   Soft   Hard Warn/Grace   
---------- --------------------------------- 
#0         588.3M      0      0  00 [------]
usera        5.5M    14G    14G  00 [------]
#2              0   980M     1G  00 [------]
userc      574.6M    14G    14G  00 [------]

我如何告诉 xfs 它不再需要跟踪项目 id 2 ?

disk-space-utilization
  • 3 个回答
  • 4128 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve