Nginx添加白名单
##白名单设置,只允许下面三个来源ip的客户端以及本地能访问该站。
allow 100.110.15.16;
allow 100.110.15.17;
allow 100.110.15.18;
allow 127.0.0.1;
deny all;
##白名单设置,只允许下面三个来源ip的客户端以及本地能访问该站。
allow 100.110.15.16;
allow 100.110.15.17;
allow 100.110.15.18;
allow 127.0.0.1;
deny all;
回退到指定的一个版本
git reset --hard dde8c25694f34acf8971f0782b1a676f39bf0a46
强推到远程
git push origin HEAD --force
Scrum插件与数据库
https://www.redmineplugins.cn/
https://www.redmineplugins.cn/projects/1/plugin_blocks/28?tab=installation_notes
bundle exec rake redmine:plugins:migrate NAME=scrum
chmod 644 /data/redmine/sqlite/*
docker stop redmine && docker rm redmine
docker run --name redmine \
-v /data/redmine/files:/usr/src/redmine/files \
-v /data/redmine/plugins:/usr/src/redmine/plugins \
-v /data/redmine/sqlite:/usr/src/redmine/sqlite \
--restart=always \
--network mynetwork \
-p 8080:3000 \
-d redmine
https://www.macrozheng.com/blog/redis_cluster.html
在搭建Redis集群之前,我们需要修改下Redis的配置文件redis.conf,该文件的下载地址:https://github.com/antirez/redis/blob/5.0/redis.conf
# 开启集群功能
cluster-enabled yes
# 设置运行端口
port 6391
# 设置节点超时时间,单位毫秒
cluster-node-timeout 15000
# 集群内部配置文件
cluster-config-file "nodes-6391.conf"
然后我们需要编写docker-compose.yml文件用于编排6个Redis容器,具体属性的作用可以参考下面的注释;
version: "3"
services:
redis-master1:
image: redis:5.0 # 基础镜像
container_name: redis-master1 # 容器名称
working_dir: /config # 切换工作目录
environment: # 环境变量
- PORT=6391 # 会使用config/nodes-${PORT}.conf这个配置文件
ports: # 映射端口,对外提供服务
- 6391:6391 # redis的服务端口
- 16391:16391 # redis集群监控端口
stdin_open: true # 标准输入打开
tty: true # 后台运行不退出
network_mode: host # 使用host模式
privileged: true # 拥有容器内命令执行的权限
volumes:
- /mydata/redis-cluster/config:/config #配置文件目录映射到宿主机
entrypoint: # 设置服务默认的启动程序
- /bin/bash
- redis.sh
redis-master2:
image: redis:5.0
working_dir: /config
container_name: redis-master2
environment:
- PORT=6392
ports:
- 6392:6392
- 16392:16392
stdin_open: true
network_mode: host
tty: true
privileged: true
volumes:
- /mydata/redis-cluster/config:/config
entrypoint:
- /bin/bash
- redis.sh
redis-master3:
image: redis:5.0
container_name: redis-master3
working_dir: /config
environment:
- PORT=6393
ports:
- 6393:6393
- 16393:16393
stdin_open: true
network_mode: host
tty: true
privileged: true
volumes:
- /mydata/redis-cluster/config:/config
entrypoint:
- /bin/bash
- redis.sh
redis-slave1:
image: redis:5.0
container_name: redis-slave1
working_dir: /config
environment:
- PORT=6394
ports:
- 6394:6394
- 16394:16394
stdin_open: true
network_mode: host
tty: true
privileged: true
volumes:
- /mydata/redis-cluster/config:/config
entrypoint:
- /bin/bash
- redis.sh
redis-slave2:
image: redis:5.0
working_dir: /config
container_name: redis-slave2
environment:
- PORT=6395
ports:
- 6395:6395
- 16395:16395
stdin_open: true
network_mode: host
tty: true
privileged: true
volumes:
- /mydata/redis-cluster/config:/config
entrypoint:
- /bin/bash
- redis.sh
redis-slave3:
image: redis:5.0
container_name: redis-slave3
working_dir: /config
environment:
- PORT=6396
ports:
- 6396:6396
- 16396:16396
stdin_open: true
network_mode: host
tty: true
privileged: true
volumes:
- /mydata/redis-cluster/config:/config
entrypoint:
- /bin/bash
- redis.sh
docker exec -it nexus3 /bin/bash
#进入
java -jar /opt/sonatype/nexus/lib/support/nexus-orient-console.jar
#连接数据库
connect plocal:../sonatype-work/nexus3/db/security admin admin
#查询帐号
select * from user where id = "admin"
#将admin用户密码重置为 admin123
update user SET password="$shiro1$SHA-512$1024$NE+wqQq/TmjZMvfI7ENh/g==$V4yPw8T64UQ6GfJfxYq2hLsVrBY8D1v+bktfOxGdt4b/9BthpWPNUy/CBk6V9iA0nHpzYzJFWO8v/tZFtES8CA==" UPSERT WHERE id="admin"
#重启nexus3
docker restart nexus3
#停止 nexus服务和启动,感觉无用(进数据库前后)
#/opt/sonatype/nexus/bin/nexus stop
#/opt/sonatype/nexus/bin/nexus start