Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:
- CA certificate
- Server certificate
- Server key
- Client certificate
- Client key
H4sIAAAAAAAAA6VRybKiQBC88xXvPofpBhE4zKEaBRFRG2xAbjQNiGwaLghfPxgx | |
fzB5qIrKyKglK1WypZrJhraQNVQIZCh5rqcGL/Q01wTiPylKkY6KhZwvC6xwJZXF | |
nJUCaQoyVCF+loYuVJxiQ+gplnGWqzpeGIbQuIbwcqlLf/4TUsU+6WmAvXnp3fUK | |
SgoNwFAfPAADvrCSxj+IKGGnDsxfmJzQlwznQHb+b09KYmickXxEFE7Cbt688148 | |
oq5ZeVfH2pRQgmOW/WdXEZbarDxH6iTkcHQ2/tuxPzcpadljLjwoP5i3jZzE2ykJ | |
hq+wduxwD3HtEApTGqndcejHuZHDlazkkfXKA9JJWWs9s5G8k4pMXAkfs2iaRSVF | |
xoEii7lr/yJs9vK77ZuzZ5PH4p21tHdqYYcjmaRkXimGHkhA6nNcV26g2lzZPs/x | |
V4T3iU1nbiivQ3KYJ3fnryu2/+SBc3MjUkhWRVw+0GJlkpANN58FZJO1Bs5Wveve | |
gUBFXiLCVeSLG1TO3X3To3n1Ri8gR+9EsbQ3iemdiAWr9RHM+u7WtR2Ws4l20843 | |
rmhIGEUXkgGvrXLoaJA9nLV1YFhYrLr4khfU/Y7C6AYIPIX6awr/MP/4L1driBiI |
FROM ruby:2.3.1 | |
RUN apt-get update && apt-get install -qy nodejs sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/* | |
ENV RAILS_VERSION 5.0.0 | |
RUN gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/ | |
RUN gem install rails --version "$RAILS_VERSION" | |
RUN gem install bundler | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
EXPOSE 3000 | |
ENV PORT=3000 |
- (BOOL)isMobileNumber:(NSString *)mobileNum | |
{ | |
/** | |
* 手机号码 | |
* 移动:134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188 | |
* 联通:130,131,132,152,155,156,185,186 | |
* 电信:133,1349,153,180,189 | |
*/ | |
NSString * MOBILE = @"^1(3[0-9]|5[0-35-9]|8[025-9])\\d{8}$"; | |
/** |
var apiKey = "passkit_api_key", | |
apiSecret = "passkit_api_secret"; | |
var jwtBody = { | |
"key": apiKey, | |
"exp": Math.floor(new Date().getTime() / 1000) + 30, | |
"iat": Math.floor(new Date().getTime() / 1000), | |
"url": request.url, | |
"method": request.method | |
}; |
#!/usr/bin/env python3 | |
# coding: utf-8 | |
""" | |
wxpy 机器人正在使用的代码 | |
** 这些代码无法独立运行,但可用于参考 ** | |
需要安装新内核分支 new-core | |
pip3 install -U git+https://github.com/youfou/wxpy.git@new-core |
This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.
First be sure to enable the Docker Remote API on the remote host.
This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.
For HTTPS connection use whiledo/docker-remote-api-tls.
class Hash | |
# 以别名的方式替换hash的key | |
def alias_with(*aliases) | |
deep_dup.alias_with!(*aliases) | |
end | |
def alias_with!(*aliases) | |
tap { |hash| | |
Hash[*aliases].map { |old_name, new_name| | |
(old_name.is_a?(Symbol) ? new_name.to_sym : new_name.to_s).tap { |name| |
Rails.application.routes.draw do | |
root 'application#index' | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config", "routes", "#{routes_name}.rb"))) | |
end | |
# v1 接口 | |
draw :v1 |
class City < ActiveRecord::Base | |
def self.top_cities(order_by) | |
@top_cities ||= Hash.new do |h, key| | |
h[key] = where(top_city: true).order(key).to_a | |
end | |
@top_cities[order_by] | |
end | |
end |