首次创建用户配置后, 登录 web 填写 API 和 API URL 保存,老是提示没权限 CSRF token 错误。

[flask_seasurf.py:344] WARNING - Forbidden (CSRF token missing or incorrect.): /admin/setting/pdns

# [Installing PowerDNS – ForestRacks]
# ( https://help.forestracks.com/cloud/docker-compose/install-powerdns)

services:
  db:
    image: mariadb:11.6.2-noble
    container_name: pdns-db
    restart: always
    networks:
      macvlan_network:
        ipv4_address: 192.168.10.17
    environment:
      - TZ=Asia/Shanghai
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
      - MYSQL_DATABASE=powerdnsadmin
      - MYSQL_USER=pdns
      - MYSQL_PASSWORD=H46beg4Bryhsf34g
    # ports:
    #   - 127.0.0.1:3306:3306
    volumes:
      - ./pda-mysql:/var/lib/mysql

  pdns:
    image: pschiffe/pdns-mysql:4.9
    container_name: pdns
    hostname: pdns
    domainname: dns.example.com
    restart: always
    networks:
      macvlan_network:
        ipv4_address: 192.168.10.18
    depends_on:
      - db
    links:
      - "db:mysql"
    # ports:
    #   - "192.168.53.72:53:53"
    #   - "192.168.53.72:53:53/udp"
    #   - "8081:8081"
    environment:
      - TZ=Asia/Shanghai
      - PDNS_gmysql_host=192.168.10.17
      - PDNS_gmysql_port=3306
      - PDNS_gmysql_user=pdns
      - PDNS_gmysql_dbname=powerdnsadmin
      - PDNS_gmysql_password=H46beg4Bryhsf34g
      - PDNS_primary=yes
      - PDNS_api=yes
      - PDNS_api_key=secret 
      - PDNSCONF_API_KEY=secret 
      - PDNS_webserver=yes
      - PDNS_webserver-allow-from=127.0.0.1,10.0.0.0/8,172.0.0.0/8,192.168.10.0/24
      - PDNS_webserver_address=0.0.0.0
      - PDNS_webserver_password=VEs546EyM_mj8rtu
      - PDNS_version_string=anonymous
      - PDNS_default_ttl=1500
      - PDNS_allow_notify_from=0.0.0.0
      - PDNS_allow_axfr_ips=192.168.10.18
      # - PDNS_default_soa_content=ns1.example.net hostmaster.@ 0 10800 3600 604800 3600
 
  web_app:
    image: powerdnsadmin/pda-legacy:0.4.2
    container_name: pdns-web
    restart: always
    networks:
      macvlan_network:
        ipv4_address: 192.168.10.19
    # ports:
    #   - 127.0.0.1:8080:80
    depends_on:
      - db
    links:
      - db:mysql
      - pdns:pdns
    environment:
      - TZ=Asia/Shanghai
      # - CSRF_COOKIE_SECURE=false
      # - SESSION_COOKIE_SECURE=false
      - LOG_LEVEL=DEBUG
      - SQLALCHEMY_DATABASE_URI=mysql://pdns:H46beg4Bryhsf34g@192.168.10.17/powerdnsadmin

      # 如下命令生成 key
      #  sudo docker exec pdns-web python -c 'import secrets; print(secrets.token_hex())'
      - SECRET_KEY=885efe3bada4f874cf43320f04877d357de4d6ae7fe6104a22a88245dbc4d0c8

networks:
  macvlan_network:
    external: true
举报· 309 次点击
登录 注册 站外分享
2 条回复  
suifengdang666 小成 昨天 11:23
标题纠正:powerdns-admin (pda) 是第三方 dashboard ,非官方
kyonn 楼主 初学 昨天 11:32
@suifengdang666 有官方的 web ui 吗?我看网上大部分用的这个, 现在就是这个死活配置有问题、。
返回顶部