0
点赞
收藏
分享

微信扫一扫

配置 Self service passwordreset 服务

最近把一个旧的服务需要迁移到EKS上。这个服务是用于给AD的用户自己重设密码用的。之前是部署在AWS的EC2上,现在需要容器化 然后部署在EKS上。
简单的记录一下过程

官方的文档在这里
https://self-service-password.readthedocs.io/en/latest/installation.html

几个注意要点:

  1. 安装的时候需要注意的一点就是,他是通过ldaps的方式绑定AD的,因此必须在AD的域里安装CA,并激活LDAPS。参考下面的方式
    https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_ldap_server_side.html

  2. 因为涉及修改用户的属性,所以需要创建单独的AD 用户,并授权
  3. 官方提供了一个docker 镜像,但是经我测试,这个镜像有问题,php template 需要的smarty3包没有安装,而且我也无法安装,于是干脆自己重新写了个Dockerfile。写的比较粗糙,可以优化的layer很多,但是工作的。
FROM nginx
RUN  apt-get update && \
     apt install  -y software-properties-common ca-certificates lsb-release apt-transport-https && \
     sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' && \
     apt install -y wget gnupg && \
     wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -  && \
     apt-get update && \
     apt -y install php7.4 && \
     apt-get install -y php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-ldap php7.4-fpm
RUN  apt-get install -y smarty3 && \
     sh -c 'echo "deb [arch=amd64] https://ltb-project.org/debian/stable stable main" > /etc/apt/sources.list.d/ltbproject.list' && \
     wget -O - https://ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project | apt-key add -  && \
     apt update && \
     apt install self-service-password
RUN  echo "postfix postfix/mailname string example.com" | debconf-set-selections && \
     echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections && \
     apt install -y postfix && \
     apt install -y mailutils

COPY nginx.conf /etc/nginx/nginx.conf
COPY default.conf /etc/nginx/conf.d/default.conf
COPY *.php /usr/share/self-service-password/conf/
COPY main.cf /etc/postfix/main.cf
RUN apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
    rm /var/log/lastlog /var/log/faillog
CMD /etc/init.d/php7.4-fpm start && /etc/init.d/postfix start && nginx -g "daemon off;"
  1. 发送邮件我是用的mailx+postfix,指定了一个公司的一个smtp relay的服务器发给外网

  2. 最后就是写 k8s 的 manifest文件了,标准的ingress+service+ deployment。secret文件需要加密才能上传到git repo,用之前解密。

最后的效果

image.png

举报

相关推荐

0 条评论