Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit ed97cf6

Browse files
committed
Merge branch 'template' of https://github.com/sivaprasadsudhir/peloton into template
2 parents 4143a86 + c9ec04d commit ed97cf6

File tree

124 files changed

+6353
-2891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+6353
-2891
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ script:
133133
# create build directory
134134
- mkdir build
135135
- cd build
136-
# run cmake
136+
# run cmake. NOTE: the PATH is made explicit to avoid automatic selection of the preinstalled llvm version in the Travis trusty image
137137
- PATH=/usr/lib/llvm-3.7/bin:/usr/bin:$PATH cmake -DCOVERALLS=$COVERALLS -DCMAKE_PREFIX_PATH=`llvm-config-3.7 --prefix` -DCMAKE_BUILD_TYPE=$PELOTON_BUILD_TYPE -DUSE_SANITIZER=Address ..
138138
# build
139139
- make -j4

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ if (COVERALLS)
126126
coveralls_setup("${COVERAGE_SRCS}" ON)
127127
endif()
128128

129+
# data directory for SSL
130+
set(DATA_DIR "${PROJECT_SOURCE_DIR}/data")
131+
129132
# ---[ Config generation
130133
configure_file(cmake/Templates/peloton_config.h.in "${PROJECT_BINARY_DIR}/peloton_config.h")
131134

Jenkinsfile

Lines changed: 237 additions & 36 deletions
Large diffs are not rendered by default.

cmake/ConfigGen.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function(peloton_generate_export_configs)
5555
configure_file("cmake/Templates/PelotonConfig.cmake.in" "${PROJECT_BINARY_DIR}/PelotonConfig.cmake" @ONLY)
5656

5757
# Add targets to the build-tree export set
58-
export(TARGETS peloton peloton-proto FILE "${PROJECT_BINARY_DIR}/PelotonTargets.cmake")
58+
export(TARGETS peloton peloton-proto pg_query FILE "${PROJECT_BINARY_DIR}/PelotonTargets.cmake")
5959
if (TARGET peloton-capnp)
6060
export(TARGETS peloton-capnp APPEND FILE "${PROJECT_BINARY_DIR}/PelotonTargets.cmake")
6161
endif()

cmake/Dependencies.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ include_directories(SYSTEM ${PQXX_INCLUDE_DIRECTORIES})
5959
list(APPEND Peloton_LINKER_LIBS ${PQXX_LIBRARIES})
6060

6161
# --[ Open SSL
62-
list(APPEND Peloton_LINKER_LIBS "-lssl")
62+
list(APPEND Peloton_LINKER_LIBS "-lssl -lcrypto")
6363

6464
# --[ LLVM 3.7+
6565
find_package(LLVM REQUIRED CONFIG)

cmake/External/capnproto.cmake

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,6 @@ if (NOT __CAPNP_INCLUDED) # guard against multiple includes
4444
LOG_INSTALL 1
4545
)
4646

47-
set(CAPNP_FOUND TRUE)
48-
set(CAPNP_EXECUTABLE ${capnp_INSTALL}/bin/capnp)
49-
set(CAPNPC_CXX_EXECUTABLE ${capnp_INSTALL}/bin/capnpc-c++)
50-
set(CAPNP_INCLUDE_DIRS ${capnp_INSTALL}/include)
51-
set(CAPNP_INCLUDE_DIRECTORY ${capnp_INSTALL}/include)
52-
set(CAPNP_LIBRARIES
53-
${capnp_INSTALL}/lib/libcapnp-rpc.a
54-
${capnp_INSTALL}/lib/libcapnp.a
55-
${capnp_INSTALL}/lib/libkj-async.a
56-
${capnp_INSTALL}/lib/libkj.a
57-
${CMAKE_THREAD_LIBS_INIT}
58-
)
59-
set(CAPNP_LIBRARY_DIRS ${capnp_INSTALL}/lib)
60-
set(CAPNP_EXTERNAL TRUE)
61-
6247
list(APPEND external_project_dependencies capnp)
6348

6449
endif()

cmake/Modules/CoverallsGenerateGcov.cmake

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -252,22 +252,27 @@ foreach (GCOV_FILE ${ALL_GCOV_FILES})
252252
# ->
253253
# /path/to/project/root/subdir/the_file.c
254254
get_source_path_from_gcov_filename(GCOV_SRC_PATH ${GCOV_FILE})
255-
file(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${GCOV_SRC_PATH}")
256255

257-
# Is this in the list of source files?
258-
# TODO: We want to match against relative path filenames from the source file root...
259-
list(FIND COVERAGE_SRCS ${GCOV_SRC_PATH} WAS_FOUND)
256+
# skip if full path is not present
257+
# can happen if files are generated for external libraries
258+
if(IS_ABSOLUTE ${GCOV_SRC_PATH})
259+
file(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${GCOV_SRC_PATH}")
260+
261+
# Is this in the list of source files?
262+
# TODO: We want to match against relative path filenames from the source file root...
263+
list(FIND COVERAGE_SRCS ${GCOV_SRC_PATH} WAS_FOUND)
260264

261-
if (NOT WAS_FOUND EQUAL -1)
262-
message("YES: ${GCOV_FILE}")
263-
list(APPEND GCOV_FILES ${GCOV_FILE})
265+
if (NOT WAS_FOUND EQUAL -1)
266+
message("YES: ${GCOV_FILE}")
267+
list(APPEND GCOV_FILES ${GCOV_FILE})
264268

265-
# We remove it from the list, so we don't bother searching for it again.
266-
# Also files left in COVERAGE_SRCS_REMAINING after this loop ends should
267-
# have coverage data generated from them (no lines are covered).
268-
list(REMOVE_ITEM COVERAGE_SRCS_REMAINING ${GCOV_SRC_PATH})
269-
else()
270-
message("NO: ${GCOV_FILE}")
269+
# We remove it from the list, so we don't bother searching for it again.
270+
# Also files left in COVERAGE_SRCS_REMAINING after this loop ends should
271+
# have coverage data generated from them (no lines are covered).
272+
list(REMOVE_ITEM COVERAGE_SRCS_REMAINING ${GCOV_SRC_PATH})
273+
else()
274+
message("NO: ${GCOV_FILE}")
275+
endif()
271276
endif()
272277
endforeach()
273278

cmake/Templates/peloton_config.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
/* Binaries directory */
55
#define BINARY_FOLDER "${PROJECT_BINARY_DIR}"
66

7+
#define DATA_DIR "${DATA_DIR}/"
8+
79
/* Temporary (TODO: remove) */
810
#if 1
911
#define CMAKE_SOURCE_DIR SOURCE_FOLDER "/src/"

data/intermediate_openssl.cnf

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# OpenSSL root CA configuration file.
2+
# Copy to `/root/ca/openssl.cnf`.
3+
4+
[ ca ]
5+
# `man ca`
6+
default_ca = CA_default
7+
8+
[ CA_default ]
9+
# Directory and file locations.
10+
dir = .
11+
certs = $dir/certs
12+
crl_dir = $dir/crl
13+
new_certs_dir = $dir/newcerts
14+
database = $dir/index.txt
15+
serial = $dir/serial
16+
RANDFILE = $dir/private/.rand
17+
18+
# The root key and root certificate.
19+
private_key = $dir/private/intermediate.key.pem
20+
certificate = $dir/certs/intermediate.cert.pem
21+
22+
# For certificate revocation lists.
23+
crlnumber = $dir/crlnumber
24+
crl = $dir/crl/intermediate.crl.pem
25+
crl_extensions = crl_ext
26+
default_crl_days = 30
27+
28+
# SHA-1 is deprecated, so use SHA-2 instead.
29+
default_md = sha256
30+
31+
name_opt = ca_default
32+
cert_opt = ca_default
33+
default_days = 375
34+
preserve = no
35+
policy = policy_loose
36+
37+
[ policy_strict ]
38+
# The root CA should only sign intermediate certificates that match.
39+
# See the POLICY FORMAT section of `man ca`.
40+
countryName = match
41+
stateOrProvinceName = match
42+
organizationName = match
43+
organizationalUnitName = optional
44+
commonName = supplied
45+
emailAddress = optional
46+
47+
[ policy_loose ]
48+
# Allow the intermediate CA to sign a more diverse range of certificates.
49+
# See the POLICY FORMAT section of the `ca` man page.
50+
countryName = optional
51+
stateOrProvinceName = optional
52+
localityName = optional
53+
organizationName = optional
54+
organizationalUnitName = optional
55+
commonName = supplied
56+
emailAddress = optional
57+
58+
[ req ]
59+
# Options for the `req` tool (`man req`).
60+
default_bits = 2048
61+
distinguished_name = req_distinguished_name
62+
string_mask = utf8only
63+
64+
# SHA-1 is deprecated, so use SHA-2 instead.
65+
default_md = sha256
66+
67+
# Extension to add when the -x509 option is used.
68+
x509_extensions = v3_ca
69+
70+
[ req_distinguished_name ]
71+
# See <https://en.wikipedia.org/wiki/Certificate_signing_request>.
72+
countryName = Country Name (2 letter code)
73+
stateOrProvinceName = State or Province Name
74+
localityName = Locality Name
75+
0.organizationName = Organization Name
76+
organizationalUnitName = Organizational Unit Name
77+
commonName = Common Name
78+
emailAddress = Email Address
79+
80+
# Optionally, specify some defaults.
81+
countryName_default = US
82+
stateOrProvinceName_default = PA
83+
localityName_default = Pittsburgh
84+
0.organizationName_default =
85+
organizationalUnitName_default =
86+
emailAddress_default =
87+
88+
[ v3_ca ]
89+
# Extensions for a typical CA (`man x509v3_config`).
90+
subjectKeyIdentifier = hash
91+
authorityKeyIdentifier = keyid:always,issuer
92+
basicConstraints = critical, CA:true
93+
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
94+
95+
[ v3_intermediate_ca ]
96+
# Extensions for a typical intermediate CA (`man x509v3_config`).
97+
subjectKeyIdentifier = hash
98+
authorityKeyIdentifier = keyid:always,issuer
99+
basicConstraints = critical, CA:true, pathlen:0
100+
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
101+
102+
[ usr_cert ]
103+
# Extensions for client certificates (`man x509v3_config`).
104+
basicConstraints = CA:FALSE
105+
nsCertType = client, email
106+
nsComment = "OpenSSL Generated Client Certificate"
107+
subjectKeyIdentifier = hash
108+
authorityKeyIdentifier = keyid,issuer
109+
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment
110+
extendedKeyUsage = clientAuth, emailProtection
111+
112+
[ server_cert ]
113+
# Extensions for server certificates (`man x509v3_config`).
114+
basicConstraints = CA:FALSE
115+
nsCertType = server
116+
nsComment = "OpenSSL Generated Server Certificate"
117+
subjectKeyIdentifier = hash
118+
authorityKeyIdentifier = keyid,issuer:always
119+
keyUsage = critical, digitalSignature, keyEncipherment
120+
extendedKeyUsage = serverAuth
121+
122+
[ crl_ext ]
123+
# Extension for CRLs (`man x509v3_config`).
124+
authorityKeyIdentifier=keyid:always
125+
126+
[ ocsp ]
127+
# Extension for OCSP signing certificates (`man ocsp`).
128+
basicConstraints = CA:FALSE
129+
subjectKeyIdentifier = hash
130+
authorityKeyIdentifier = keyid,issuer
131+
keyUsage = critical, digitalSignature
132+
extendedKeyUsage = critical, OCSPSigning
133+

data/openssl.cnf

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# OpenSSL root CA configuration file.
2+
# Copy to `/root/ca/openssl.cnf`.
3+
4+
[ ca ]
5+
# `man ca`
6+
default_ca = CA_default
7+
8+
[ CA_default ]
9+
# Directory and file locations.
10+
dir = .
11+
certs = $dir/certs
12+
crl_dir = $dir/crl
13+
new_certs_dir = $dir/newcerts
14+
database = $dir/index.txt
15+
serial = $dir/serial
16+
RANDFILE = $dir/private/.rand
17+
18+
# The root key and root certificate.
19+
private_key = $dir/private/ca.key.pem
20+
certificate = $dir/certs/ca.cert.pem
21+
22+
# For certificate revocation lists.
23+
crlnumber = $dir/crlnumber
24+
crl = $dir/crl/ca.crl.pem
25+
crl_extensions = crl_ext
26+
default_crl_days = 30
27+
28+
# SHA-1 is deprecated, so use SHA-2 instead.
29+
default_md = sha256
30+
31+
name_opt = ca_default
32+
cert_opt = ca_default
33+
default_days = 375
34+
preserve = no
35+
policy = policy_strict
36+
37+
[ policy_strict ]
38+
# The root CA should only sign intermediate certificates that match.
39+
# See the POLICY FORMAT section of `man ca`.
40+
countryName = optional
41+
stateOrProvinceName = optional
42+
organizationName = optional
43+
organizationalUnitName = optional
44+
commonName = supplied
45+
emailAddress = optional
46+
47+
[ policy_loose ]
48+
# Allow the intermediate CA to sign a more diverse range of certificates.
49+
# See the POLICY FORMAT section of the `ca` man page.
50+
countryName = optional
51+
stateOrProvinceName = optional
52+
localityName = optional
53+
organizationName = optional
54+
organizationalUnitName = optional
55+
commonName = supplied
56+
emailAddress = optional
57+
58+
[ req ]
59+
# Options for the `req` tool (`man req`).
60+
default_bits = 2048
61+
distinguished_name = req_distinguished_name
62+
string_mask = utf8only
63+
64+
# SHA-1 is deprecated, so use SHA-2 instead.
65+
default_md = sha256
66+
67+
# Extension to add when the -x509 option is used.
68+
x509_extensions = v3_ca
69+
70+
[ req_distinguished_name ]
71+
# See <https://en.wikipedia.org/wiki/Certificate_signing_request>.
72+
countryName = Country Name (2 letter code)
73+
stateOrProvinceName = State or Province Name
74+
localityName = Locality Name
75+
0.organizationName = Organization Name
76+
organizationalUnitName = Organizational Unit Name
77+
commonName = Common Name
78+
emailAddress = Email Address
79+
80+
# Optionally, specify some defaults.
81+
countryName_default = US
82+
stateOrProvinceName_default = PA
83+
localityName_default = Pittsburgh
84+
0.organizationName_default =
85+
organizationalUnitName_default =
86+
emailAddress_default =
87+
88+
[ v3_ca ]
89+
# Extensions for a typical CA (`man x509v3_config`).
90+
subjectKeyIdentifier = hash
91+
authorityKeyIdentifier = keyid:always,issuer
92+
basicConstraints = critical, CA:true
93+
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
94+
95+
[ v3_intermediate_ca ]
96+
# Extensions for a typical intermediate CA (`man x509v3_config`).
97+
subjectKeyIdentifier = hash
98+
authorityKeyIdentifier = keyid:always,issuer
99+
basicConstraints = critical, CA:true, pathlen:0
100+
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
101+
102+
[ usr_cert ]
103+
# Extensions for client certificates (`man x509v3_config`).
104+
basicConstraints = CA:FALSE
105+
nsCertType = client, email
106+
nsComment = "OpenSSL Generated Client Certificate"
107+
subjectKeyIdentifier = hash
108+
authorityKeyIdentifier = keyid,issuer
109+
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment
110+
extendedKeyUsage = clientAuth, emailProtection
111+
112+
[ server_cert ]
113+
# Extensions for server certificates (`man x509v3_config`).
114+
basicConstraints = CA:FALSE
115+
nsCertType = server
116+
nsComment = "OpenSSL Generated Server Certificate"
117+
subjectKeyIdentifier = hash
118+
authorityKeyIdentifier = keyid,issuer:always
119+
keyUsage = critical, digitalSignature, keyEncipherment
120+
extendedKeyUsage = serverAuth
121+
122+
[ crl_ext ]
123+
# Extension for CRLs (`man x509v3_config`).
124+
authorityKeyIdentifier=keyid:always
125+
126+
[ ocsp ]
127+
# Extension for OCSP signing certificates (`man ocsp`).
128+
basicConstraints = CA:FALSE
129+
subjectKeyIdentifier = hash
130+
authorityKeyIdentifier = keyid,issuer
131+
keyUsage = critical, digitalSignature
132+
extendedKeyUsage = critical, OCSPSigning

0 commit comments

Comments
 (0)