-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Eoghan Kelleher <[email protected]>
- Loading branch information
Showing
8 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# workspace file | ||
.idea/ | ||
.vscode/ | ||
|
||
# OS files | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Cloud Foundry OpenSSL Buildpack | ||
|
||
A Cloud Foundry [buildpack](http://docs.cloudfoundry.org/buildpacks/) for using OpenSSL 1.1 on cflinuxfs4. | ||
|
||
This supply buildpack is meant to be used with the .NET buildpack as the final buildpack. This buildpack sets the | ||
the `LD_LIBRARY_PATH` and the `CLR_OPENSSL_VERSION_OVERRIDE` environment variables needed by .NET apps to be able | ||
to use the non-default OpenSSL version. This buildpack may work with other final buildpacks, but is currently | ||
untested. | ||
|
||
### Usage | ||
|
||
Just add this buildpack to your app's list of existing buildpacks. For example: | ||
|
||
```yaml | ||
--- | ||
applications: | ||
- name: cf-dotnet-webapp | ||
buildpacks: | ||
- openssl_buildpack | ||
- dotnet_core_buildpack | ||
memory: 1G | ||
stack: cflinuxfs4 | ||
``` | ||
### Building the Buildpack | ||
Since this buildpack is nothing more than a bash script, just run the `create_buildpack.sh` script to package and upload the buildpack to CF. This will increment the version, delete the old version of the buildpack from CF, then create a new version of it. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#! /bin/sh | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# Variables passed to the supply script | ||
BUILD_DIR=$1 # Application build directory | ||
CACHE_DIR=$2 # Buildpack's cache directory | ||
DEPS_DIR=$3 # Root directory for all buildpack dependencies | ||
DEPS_IDX=$4 # Index for this buildpack's dependencies | ||
|
||
# Calculate the current buildpack's dependency directory | ||
DEP_DIR="$DEPS_DIR/$DEPS_IDX" | ||
|
||
# Get the buildpack's base directory | ||
BUILDPACK_DIR=$(dirname "$0")/.. | ||
|
||
# Buildpack banner | ||
VERSION=$(cat "$BUILDPACK_DIR/VERSION") | ||
echo "-----> OpenSSL Buildpack version $VERSION" | ||
echo "-----> Supplying OpenSSL 1.1" | ||
|
||
# Create the necessary directories in the dependencies folder | ||
echo "Creating openssl folder" | ||
mkdir -p "$DEP_DIR/openssl" | ||
|
||
echo "Extracting openssl files" | ||
tar -xzvf "$BUILDPACK_DIR/dependencies/openssl1.1.1.tar.gz" -C "$DEP_DIR/openssl/" | ||
|
||
# Add runtime environment variables to .profile.d/ | ||
mkdir -p "$BUILD_DIR/.profile.d" | ||
cat <<EOF > "$BUILD_DIR/.profile.d/set_ssl_path.sh" | ||
#!/bin/bash | ||
export LD_LIBRARY_PATH="/home/vcap/deps/$DEPS_IDX/openssl/openssl-1.1.1;\$LD_LIBRARY_PATH" | ||
export CLR_OPENSSL_VERSION_OVERRIDE='1.1' | ||
EOF | ||
|
||
chmod a+x "$BUILD_DIR/.profile.d/set_ssl_path.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#! /usr/bin/env bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
VERSION=$(cat "$SCRIPT_DIR/VERSION") | ||
IFS='.' read -r MAJOR MINOR <<< "$VERSION" | ||
MINOR=$((MINOR + 1)) | ||
NEXTVERSION="$MAJOR.$MINOR" | ||
|
||
pushd "$SCRIPT_DIR" | ||
zip -r "/tmp/openssl_buildpack-v$NEXTVERSION.zip" . -x .DS_Store | ||
popd | ||
cf delete-buildpack openssl_buildpack -f | ||
cf create-buildpack openssl_buildpack "/tmp/openssl_buildpack-v$NEXTVERSION.zip" 99 | ||
|
||
echo "$NEXTVERSION" > "$SCRIPT_DIR/VERSION" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
default_versions: [] | ||
dependencies: [] | ||
dependency_deprecation_dates: [] | ||
include_files: | ||
- README.md | ||
- VERSION | ||
- bin/supply | ||
- bin/detect | ||
- manifest.yml | ||
- dependencies/openssl1.1.1.tar.gz | ||
language: openssl | ||
stack: cflinuxfs4 |