grim/containers/trac-bootstrap
Add the initial version I created years ago.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dockerfile Tue Feb 23 04:05:54 2021 -0600
@@ -0,0 +1,15 @@
+MAINTAINER Gary Kramlich <grim@reaperworld.com> + apt-get install -y --no-install-recommends gettext xz-utils && \ + rm -rf /var/lib/apt/lists +COPY bootstrap /usr/local/bin/ +ENTRYPOINT ["/usr/local/bin/bootstrap"] --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README.md Tue Feb 23 04:05:54 2021 -0600
@@ -0,0 +1,6 @@
+trac-bootstrap is meant to be used an in initContainer in kubernetes to +initialize a trac instead from a backup that's stored in an s3 compatible --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bootstrap Tue Feb 23 04:05:54 2021 -0600
@@ -0,0 +1,47 @@
+OUTPUT_FILENAME="/tmp/bootstrap.tar.xz" +export S3CMD_SIGNATURE_V2="${S3CMD_SIGNATURE_V2:-False}" +export S3CMD_BUCKET_LOCATION="${S3CMD_BUCKET_LOCATION:-US}" +export S3CMD_HOST_BASE="${S3CMD_HOST_BASE:-s3.amazonaws.com}" +export S3CMD_HOST_BUCKET="${S3CMD_HOST_BUCKET:-%(bucket)s.s3.amazonaws.com}" +# make sure our required environment variables are set +if [ -z "${AWS_ACCESS_KEY_ID}" ] ; then + echo "AWS_ACCESS_KEY_ID environment variable must be set" >&2 +if [ -z "${AWS_SECRET_ACCESS_KEY}" ] ; then + echo "AWS_SECRET_ACCESS_KEY environment variable must be set" >&2 +if [ -z "${S3_URL}" ] ; then + echo "S3_URL environment variable must be set" >&2 +if [ -z "${OUTPUT}" ] ; then + echo "OUTPUT environment variable must be set" >&2 +# Make sure we're not already bootstrapped +if [ -f "${OUTPUT}/conf/trac.ini" ] ; then + echo "Already boot strapped" +cat /root/s3cfg.in | envsubst > /root/.s3cfg +s3cmd get "${S3_URL}" "${OUTPUT_FILENAME}" +tar Jxf "${OUTPUT_FILENAME}" --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/convey.yml Tue Feb 23 04:05:54 2021 -0600
@@ -0,0 +1,36 @@
+ - REPO=rwgrim/pidgin-trac-bootstrap + tag: ${REGISTRY}/${REPO}:${TAG} + username: ${REGISTRY_USERNAME} + password: ${REGISTRY_PASSWORD} + image: ${REGISTRY}/${REPO}:${TAG} + - tasks: [import, build] + - tasks: [login, import, build, push] --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/s3cfg Tue Feb 23 04:05:54 2021 -0600
@@ -0,0 +1,82 @@
+access_key = ${AWS_ACCESS_KEY_ID} +check_ssl_certificate = True +check_ssl_hostname = True +cloudfront_host = cloudfront.amazonaws.com +default_mime_type = binary/octet-stream +delete_after_fetch = False +gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s +gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s +host_base = data.imfreedom.org +host_bucket = data.imfreedom.org/%(bucket)s/ +human_readable_sizes = False +invalidate_default_index_on_cf = False +invalidate_default_index_root_on_cf = True +invalidate_on_cf = False +multipart_chunk_size_mb = 15 +multipart_max_chunks = 10000 +reduced_redundancy = False +restore_priority = Standard +secret_key = ${AWS_SECRET_ACCESS_KEY} +server_side_encryption = False +signurl_use_https = False +simpledb_host = sdb.amazonaws.com +urlencoding_mode = normal +website_endpoint = http://%(bucket)s.s3-website-%(location)s.amazonaws.com/ +website_index = index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/s3cfg.in Tue Feb 23 04:05:54 2021 -0600
@@ -0,0 +1,82 @@
+access_key = ${AWS_ACCESS_KEY_ID} +bucket_location = ${S3CMD_BUCKET_LOCATION} +check_ssl_certificate = True +check_ssl_hostname = True +cloudfront_host = cloudfront.amazonaws.com +default_mime_type = binary/octet-stream +delete_after_fetch = False +gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s +gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s +host_base = ${S3CMD_HOST_BASE} +host_bucket = ${S3CMD_HOST_BUCKET} +human_readable_sizes = False +invalidate_default_index_on_cf = False +invalidate_default_index_root_on_cf = True +invalidate_on_cf = False +multipart_chunk_size_mb = 15 +multipart_max_chunks = 10000 +reduced_redundancy = False +restore_priority = Standard +secret_key = ${AWS_SECRET_ACCESS_KEY} +server_side_encryption = False +signature_v2 = ${S3CMD_SIGNATURE_V2} +signurl_use_https = False +simpledb_host = sdb.amazonaws.com +urlencoding_mode = normal +website_endpoint = http://%(bucket)s.s3-website-%(location)s.amazonaws.com/ +website_index = index.html