突然登不上NPM的管理后台提示密码错误。
链接:
NPM官网:https://nginxproxymanager.com/
官网没有一些重置密码的指导,找到了Github的仓库查看issue 果然发现不少关于重置面板密码的问题。
由于白兔从没接触过SQLite,所以略微学习了一下。
白兔的 Nginx Proxy Manager docker-compose文件如下
version: '3.8'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
# These ports are in format <host-port>:<container-port>
- '80:80' # Public HTTP Port
- '443:443' # Public HTTPS Port
- '81:81' # Admin Web Port
# Add any other Stream port you want to expose
# - '21:21' # FTP
# Uncomment the next line if you uncomment anything in the section
# environment:
# Uncomment this if you want to change the location of
# the SQLite DB file within the container
# DB_SQLITE_FILE: "/data/database.sqlite"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
由于资源有限没上Mysql,采用了默认的SQLite存储数据。
因为database.sqlite 文件挂载到宿主机了,所以直接装了个SQLite。
wget -N https://www.sqlite.org/2022/sqlite-tools-linux-x86-3390400.zip
unzip
sqlite3 ./data/database.sqlite
#因为域名不通,所以把代理主机地址设为 IP。
UPDATE proxy_host set domain_names='["public_ip"]';
#设置用户为被删除的状态。重启容器后可以通过默认面板用户和密码进入。
#Email: admin@example.com Password: changeme 需要重置邮箱密码。
UPDATE user set is_deleted = 1;
#将之前用户创建的代理和SSL证书的所属权更新为刚刚创建的新管理员的ID。
UPDATE proxy_host SET owner_user_id = 2;
UPDATE certificate SET owner_user_id = 2 where owner_user_id = 1;