mailu 一个 docker化的邮局系统 docker-compose配置

首先,去 https://setup.mailu.io/ 获取你对应的docker-compose和 mailu.env

详细设置 在 https://mailu.io/1.7/compose/setup.html#tls-certificates

Step 1 – 下载配置文件

Docker Compose expects a project file, named docker-compose.yml in a project directory. First create your project directory.
mkdir /mailu
Then download the project file. A side configuration file makes it easier to read and check the configuration variables generated by the wizard.
cd /mailu
wget http://setup.mailu.io/1.7/file/xxxxxxxxxxxxxxxxxxxxxxxxxxx/docker-compose.yml
wget http://setup.mailu.io/1.7/file/xxxxxxxxxxxxxxxxxxxxxxxxxxx/mailu.env 

Step 2 – Review the configuration

We did not insert any malicious code on purpose in the configurations we distribute, but your download could have been intercepted, or our wizard website could have been compromised, so make sure you check the configuration files before going any further. When you are done checking them, check them one last time.

Step 3 – Start the Compose project

To start your compose project, simply run the Docker Compose up command using -p mailu flag for project name.
cd /mailu
docker-compose -p mailu up -d
Before you can use Mailu, you must create the primary administrator user account. This should be [email protected]. Use the following command, changing PASSWORD to your liking:
docker-compose -p mailu exec admin flask mailu admin admin 你的根域名 PASSWORD
Login to the admin interface to change the password for a safe one, at one of the hostnames 你的域名/admin. Also, choose the “Update password” option in the left menu.

关于汉化和证书优化:

1、将docker-compose.yml中的admin的镜像替换成 scjtqs/mailu-admin:latest 可以完成后台管理的汉化。 2、将docker-compose.yml中的front服务的镜像 替换成 scjtqs/mailu-nginx:latest 即可替换成dnspod接口的dns方式验证获取和更新证书。 当然,想要使用dnspod的dns验证,需要提供dnspod的一些账号信息。并将其挂载到front的容器中去 挂载路径:”./cetbot-dns-dnspod-credentials.ini:/etc/cetbot-dns-dnspod-credentials.ini” 例如在docker-compose.yml中:
volumes:
  - "./mailu/certs:/certs"
  - "./mailu/overrides/nginx:/overrides"
  - "./cetbot-dns-dnspod-credentials.ini:/etc/cetbot-dns-dnspod-credentials.ini"
    cetbot-dns-dnspod-credentials.ini中的配置信息:
certbot_dns_dnspod:dns_dnspod_email = "DNSPod 账户的 Email"
certbot_dns_dnspod:dns_dnspod_api_token = "api_id,api_token"
 

windows wsl 中使用 docker 的解决方案

前言:

由于某些原因,无法使用docker for win desktop,系统同样是win10,因此打上了wsl的主意。

我这边开发pc升级到win10 了。。监控软件(ioa) 不支持多网卡,用docker for win 会启用hyper-v ,会默认启动一个nat网卡,导致断网。。。。就研究了下wsl中跑docker

步骤:

1、安装windows子系统。这里不做详细叙述了。本文以ubuntu 18.04为例

2、安装`cgroupfs-mount`

sudo apt-get install cgroupfs-mount
sudo usermod -aG docker $USER

3、安装docker

#可以直接用apt源的老版本。
sudo apt-get install docker.io
#如果需要使用最新版本.使用如下代码
sudo apt-get remove docker docker-engine docker.io containerd runc
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

浏览全部

简化式 ddns 动态域名 服务

一、前言:

随着时代的发展,越来越多的人学会了折腾各类数码产品,比如nas。因此就有了外网访问设备的需求。

访问方法有很多,对于有公网Ip的朋友们,这是一种福利,对于没有公网ip的,也不要气磊,因为Ipv6的公网已经来啦~!

二、购买域名

域名是一定要有的。国内服务商有很多,例如腾讯、阿里。有很多活动域名。例如xyz域名,腾讯这边经常有活动,首年相当便宜。当让,如果你实在不想花钱,也有很多免费的顶级域名可以注册,例如tk域名。。当然,本文就不再说明如何注册了。

三、配置dns解析商

域名是需要解析才会生效的,因此需要配置dns解析商。国内的话,腾讯/dnspod、阿里 都是比较常见的解析服务提供商。本文提到的ddns服务 支持的是 腾讯云、dnspod.cn、阿里云 这3中 api的解析服务。

四、使用ddns解析工具/服务,使域名能够实时更新你的动态ip。

本文讲述的是我自己写的ddns服务,哈哈。目标就是简化客户端的配置和代码量,主要是方便我以前的路由器能实时更新ddns,那是多年前的事情了,那时候各类插件并不全,因此就自己写了个。 1、scjtqs服务站的ddns功能:

a、ipv4的ddns批量更新

b、ipv6的ddns更新

c、ip变化之后会收到qq通知

d、部署简单,只要你的路由器/设备支持 wget 或者 curl之类的url访问工具,并支持定时任务 (例如crontab )就行。

e、支持docker化。

g、支持dnspod.cn、阿里云dns服务,腾讯云dns服务。有其他解析服务需求的,欢迎联系我,我添加支持。

浏览全部

docker版的docker-compose 使用 包含 arm/arm64等其他平台

首先,从docker-compose 1.25开始,docker-compose 开始使用了docker版本了,另外还有部分机器不支持docker-compose的直接安装(例如群晖),因此docker版的docker-compose出现了。而且,1.25版本是最后一个python2的版本了

注意:1.25版本的docker版的docker-compose只有amd64版本,所以,如果你是arm或其他的硬件,只能等官方支持了

1、安装

此处我以1.25.4版本为例:

sudo curl -L --fail https://github.com/docker/compose/releases/download/1.25.4/run.sh -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

具体版本可以去github上查看 : https://github.com/docker/compose/releases

浏览全部

windows server 2016 安装 docker-compose

如果要在具有Docker Engine-Enterprise的 Microsoft Windows Server上直接运行Docker守护程序和客户端,并要安装Docker Compose,请遵循以下说明。

  1. 启动PowerShell(以管理员身份运行)。搜索PowerShell,右键单击,然后选择 “以管理员身份运行”。当询问是否要允许该应用程序对设备进行更改时,请点击
  2. 在PowerShell中,由于GitHub现在需要TLS1.2,请运行以下命令:
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
     
  3. 然后运行以下命令以下载当前稳定的Compose版本(v1.25.4):
    Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\Docker\docker-compose.exe
    注意:在Windows Server 2019上,您可以将Compose可执行文件添加到中$Env:ProgramFiles\Docker。由于此目录已在系统中注册,因此PATH您可以docker-compose --version在后续步骤中运行该命令,而无需进行其他配置。
  4. 测试安装:
    docker-compose --version
     

windows server(2016\2019) 安装docker

win server 安装docker 需要安装企业版,社区版只支持win10

过程如下:

首先安装oneget PowerShell模块

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

再使用oneget 安装最新版本docker

Install-Package -Name docker -ProviderName DockerMsftProvider

powershell中询问你是否确实要安装来自“DockerDefault”的软件,选择“A”全是。

PS C:\> Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
PS C:\> Install-Package -Name docker -ProviderName DockerMsftProvider

程序包来自未标记为“受信任”的程序包源。
是否确实要安装来自“DockerDefault”的软件?
[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S) [?] 帮助 (默认值为“N”): A
警告: A restart is required to start docker service. Please restart your machine.
警告: After the restart please start the docker service.

Name       Version   Source   Summary
----       -------   ------   -------
Docker       1.12.2-cs2-ws... DockerDefault Contains the CS Docker Engine for use with Windows ...

浏览全部

自建密码管理服务器 bitwarden

这里提供一个docker-compose模板,方便使用。

注意:目前只支持x64的系统,x86和arm目前无法部署。

mkdir docker-bitwarden
cd docker-bitwarden
cat << EOF>> docker-compose.yml
version: '3'
services:
  bitwarden:
    container_name: bitwarden
    image: bitwardenrs/server:latest
    restart: always
    ports:
    - '8754:80'
    volumes:
      - ./bitwarden/data:/data
EOF

docker-compose up -d

到此docker容易服务已经创建成功

如果要关闭docker,就运行 docker-compose down

更新docker镜像版本 运行 docker-compose pull

可以访问 http://youIp:8754 自行注册账号。

如果想要使用https,请自行使用Nginx进行反向代理。

bitwarden客户端的话,有安卓、ios、windows、mas等等 都有。可以放心使用。

下载地址:https://bitwarden.com/#download

docker amd64老版本上build 其他平台的镜像

首先,需要一套环境,目前已有指定的镜像

要在 Docker 中运行 ARM 镜像,我们要先在计算机上注册 qemu-user-static 虚拟机:

docker run --rm --privileged multiarch/qemu-user-static:register --reset

另外,Docker 镜像内必须也含有对应的 qemu-user-static 虚拟机。不过,Docker Hub 上已经有了添加 qemu-user-static 的系统镜像,可以在 https://hub.docker.com/u/multiarch/ 获取: 浏览全部