diff --git a/.gitignore b/.gitignore index 8711758bb196..74930dcfc059 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ dev_guide/builds/images/chained-build.png dev_guide/builds/images/chained-build.png.cache .DS_Store .venv +.gem +bin +commercial_package diff --git a/.s2i/bin/assemble b/.s2i/bin/assemble new file mode 100644 index 000000000000..c685fb122ab9 --- /dev/null +++ b/.s2i/bin/assemble @@ -0,0 +1,65 @@ +#!/bin/bash -e +# The assemble script builds the application artifacts from source and +# places them into appropriate directories inside the image. + +# `gem install` is required because `bundle install` does not properly place `asciibinder` into $PATH +echo "---> Installing AsciiBinder ..." +gem install ascii_binder + +# Move git repository to local working directory +shopt -s dotglob +echo "---> Installing application source ..." +mv /tmp/src/* ./ + +# Fetch and locally add all remote branches to ensure AsciiBinder is able to build the necessary branches +echo "---> Fetching remote branches" +# Because the s2i builder only makes the remote branch applicable to the specified branch, +# it's necessary to enforce a * ref so that all branches are referenced +sed -i 's%fetch = +refs.*%fetch = +refs/heads/*:refs/remotes/origin/*%' .git/config +git fetch --all --quiet +for remote in $(git branch -r | egrep -v "(>|$(git rev-parse --abbrev-ref HEAD))|master"); do git checkout --track $remote; done +git checkout master + +# Fixes incompatible character encodings: US-ASCII and UTF-8 error +export LANG="en_US.UTF-8" + +echo "---> AsciiBinder packaging commercial content ..." +# AsciiBinder uses git to some extent and requires `user.email` to be properly set +git config user.email "devel@openshift.com" +# Properly package assets +asciibinder package --site=commercial +mkdir commercial_package +mv _package/commercial commercial_package +git checkout master +mkdir commercial_package/commercial/httpd-cfg +mv .s2i/httpd-cfg/01-commercial.conf commercial_package/commercial/httpd-cfg +mv 404-commercial.html commercial_package/commercial/404.html + +echo "---> Installing Minishift content ..." +mkdir minishift +cd minishift +if wget http://artifacts.ci.centos.org/minishift/minishift/docs/latest/minishift-adoc.tar ; then + tar -xvf minishift-adoc.tar --strip 1 + cat _topic_map.yml >> ../_topic_map.yml + rm minishift-adoc.tar + cd .. + git add . + git commit -am "Minishift build-time commit" +else + echo "WARNING: Could not retrieve minishift-adoc.tar" + cd .. + rmdir minishift +fi + +echo "---> AsciiBinder packaging community content ..." +asciibinder package --site=community +mkdir community_package +mv _package/community community_package +git checkout master +mkdir community_package/community/httpd-cfg +mv .s2i/httpd-cfg/01-community.conf community_package/community/httpd-cfg +mv 404-community.html community_package/community/404.html + +# Fix source directory permissions +echo "---> Fixing permissions ..." +fix-permissions ./ diff --git a/.s2i/httpd-cfg/01-commercial.conf b/.s2i/httpd-cfg/01-commercial.conf new file mode 100644 index 000000000000..2f7dc6759614 --- /dev/null +++ b/.s2i/httpd-cfg/01-commercial.conf @@ -0,0 +1,270 @@ +# ---------------------------------------------------------------------- +# Better website experience for IE users +# ---------------------------------------------------------------------- + +# Force the latest IE version, in various cases when it may fall back to IE7 mode +# github.com/rails/rails/commit/123eb25#commitcomment-118920 +# Use ChromeFrame if it's installed for a better experience for the poor IE folk + + + Header set X-UA-Compatible "IE=Edge,chrome=1" + # mod_headers can't match by content-type, but we don't want to send this header on *everything*... + + Header unset X-UA-Compatible + + + +# ---------------------------------------------------------------------- +# Proper MIME type for all files +# ---------------------------------------------------------------------- + +# JavaScript +# Normalize to standard type (it's sniffed in IE anyways) +# tools.ietf.org/html/rfc4329#section-7.2 +AddType application/javascript js jsonp +AddType application/json json + +# Audio +AddType audio/ogg oga ogg +AddType audio/mp4 m4a f4a f4b + +# Video +AddType video/ogg ogv +AddType video/mp4 mp4 m4v f4v f4p +AddType video/webm webm +AddType video/x-flv flv + +# SVG +# Required for svg webfonts on iPad +# twitter.com/FontSquirrel/status/14855840545 +AddType image/svg+xml svg svgz +AddEncoding gzip svgz + +# Webfonts +AddType application/vnd.ms-fontobject eot +AddType application/x-font-ttf ttf ttc +AddType font/opentype otf +AddType application/x-font-woff woff +AddType application/font-woff2 woff2 + +# Assorted types +AddType image/x-icon ico +AddType image/webp webp +AddType text/cache-manifest appcache manifest +AddType text/x-component htc +AddType application/xml rss atom xml rdf +AddType application/x-chrome-extension crx +AddType application/x-opera-extension oex +AddType application/x-xpinstall xpi +AddType application/octet-stream safariextz +AddType application/x-web-app-manifest+json webapp +AddType text/x-vcard vcf +AddType application/x-shockwave-flash swf +AddType text/vtt vtt + + +# ---------------------------------------------------------------------- +# Gzip compression +# ---------------------------------------------------------------------- + + + # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ + + + SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding + RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding + + + + # Compress all output labeled with one of the following MIME-types + + AddOutputFilterByType DEFLATE application/atom+xml \ + application/javascript \ + application/json \ + application/rss+xml \ + application/vnd.ms-fontobject \ + application/x-font-ttf \ + application/xhtml+xml \ + application/xml \ + font/opentype \ + image/svg+xml \ + image/x-icon \ + text/css \ + text/html \ + text/plain \ + text/x-component \ + text/xml + + + +# ---------------------------------------------------------------------- +# Start rewrite engine +# ---------------------------------------------------------------------- + +# Turning on the rewrite engine is necessary for the following rules and +# features. FollowSymLinks must be enabled for this to work. + +# Some cloud hosting services require RewriteBase to be set: goo.gl/HOcPN +# If using the h5bp in a subdirectory, use `RewriteBase /foo` instead where +# 'foo' is your directory. + +# If your web host doesn't allow the FollowSymlinks option, you may need to +# comment it out and use `Options +SymLinksOfOwnerMatch`, but be aware of the +# performance impact: http://goo.gl/Mluzd + + + + + Options Indexes FollowSymLinks + AllowOverride All + Order Allow,Deny + Allow from All + + RewriteEngine On + RewriteBase / + + # Redirects for "latest" version + RewriteRule ^(container-platform|enterprise)/?(.[^/])$ /container-platform/3.7/$2 [R=301] + RewriteRule ^(container-platform|enterprise)/latest/?(.[^/])$ /container-platform/3.7/$2 [R=301] + RewriteRule ^(dedicated|online)/(3\.0|3\.1|3\.2|3\.3|3\.4|3\.5|3\.6|3\.7|latest)/?(.*)$ /$1/$3 [R=301] + + # Welcome page redirects + RewriteRule ^(online|dedicated)/?$ /$1/welcome/index.html [L,R=301] + RewriteRule ^enterprise/(3\.0|3\.1|3\.2)/?$ /enterprise/$1/welcome/index.html [L,R=301] + RewriteRule ^enterprise/3\.3/?$ /container-platform/3.3/welcome/index.html [L,R=301] + RewriteRule ^container-platform/(3\.3|3\.4|3\.5|3\.6|3\.7)/?$ /container-platform/$1/welcome/index.html [L,R=301] + + # Overview page has moved to Index page + RewriteRule ^(.*)/overview\.html(.*)$ /$1/index.html$2 [L,R=301] + + # OCP redirects for 3.7 + # Page currently missing - RewriteRule ^container-platform/3\.7/install_config/deploying_cfme\.html(.*)$ container-platform/3.7/install_config/cfme/index.html [L,R=301] + RewriteRule ^container-platform/3\.7/rest_api/(openshift|kubernetes)_v1\.html(.*)$ /container-platform/3.7/rest_api/index.html [L,R=301] + RewriteRule ^container-platform/3\.7/admin_guide/manage_authorization_policy\.html(.*)$ /container-platform/3.7/admin_guide/manage_rbac.html [L,R=301] + + # Online/Dedicated/OCP redirects for 3.6 + RewriteRule ^(online|dedicated|container-platform/3\.6)/architecture/additional_concepts/port_forwarding\.html(.*)$ /$1/architecture/networking/port_forwarding.html$2 [L,R=301] + RewriteRule ^(online|dedicated|container-platform/3\.6)/architecture/additional_concepts/remote_commands\.html(.*)$ /$1/architecture/networking/remote_commands.html$2 [L,R=301] + RewriteRule ^(online|dedicated|container-platform/3\.6)/architecture/additional_concepts/sdn\.html(.*)$ /$1/architecture/networking/sdn.html$2 [L,R=301] + RewriteRule ^(online|dedicated|container-platform/3\.6)/architecture/additional_concepts/networking\.html(.*)$ /$1/architecture/networking/networking.html$2 [L,R=301] + RewriteRule ^(online|dedicated|container-platform/3\.6)/architecture/core_concepts/haproxy-router\.html(.*)$ /$1/architecture/networking/haproxy-router.html$2 [L,R=301] + RewriteRule ^(online|dedicated|container-platform/3\.6)/architecture/core_concepts/routes\.html(.*)$ /$1/architecture/networking/routes.html$2 [L,R=301] + # Exempt for dedicated due to redirect later + RewriteRule ^(online|container-platform/3\.6)/architecture/additional_concepts/f5_big_ip\.html(.*)$ /$1/architecture/networking/network_plugins.html#architecture-additional-concepts-f5-big-ip [L,R=301] + RewriteRule ^(online|container-platform/3\.6)/architecture/additional_concepts/flannel\.html(.*)$ /$1/architecture/networking/network_plugins.html#flannel-sdn [L,R=301] + + # Developers console redirect + RewriteRule ^online/getting_started/developers/developers_console\.html(.*)$ /online/getting_started/index.html$1 [L,R=301] + RewriteRule ^dedicated/getting_started/developers/developers_console\.html(.*)$ /dedicated/getting_started/developers_console.html$1 [L,R=301] + RewriteRule ^(container-platform|enterprise)/(3\.2|3\.3|3\.4|3\.5|3\.6|3\.7)/getting_started/developers/developers_console\.html(.*)$ $1/$2/getting_started/developers_console.html$3 [L,R=301] + + # Deployments redirect + RewriteRule ^(online|dedicated)/dev_guide/deployments\.html(.*)$ /$1/dev_guide/deployments/how_deployments_work.html$2 [L,R=301] + RewriteRule ^container-platform/(3\.3|3\.4|3\.5|3\.6|3\.7)/dev_guide/deployments\.html(.*)$ /container-platform/$1/dev_guide/deployments/how_deployments_work.html$2 [L,R=301] + + # New App redirect + RewriteRule ^(online|dedicated)/dev_guide/new_app\.html(.*)$ /$1/dev_guide/application_lifecycle/new_app.html$2 [L,R=301] + RewriteRule ^container-platform/(3\.3|3\.4|3\.5|3\.6|3\.7)/dev_guide/new_app\.html(.*)$ /container-platform/$1/dev_guide/application_lifecycle/new_app.html$2 [L,R=301] + + # Cron Job redirect + RewriteRule ^(online|dedicated)/dev_guide/cron_jobs\.html(.*)$ /$1/dev_guide/scheduled_jobs.html$2 [L,R=301] + RewriteRule ^container-platform/(3\.4|3\.5|3\.6|3\.7)/dev_guide/cron_jobs\.html(.*)$ /container-platform/$1/dev_guide/scheduled_jobs.html$2 [L,R=301] + + # Builds redirect + RewriteRule ^(online|dedicated)/dev_guide/builds\.html(.*)$ /$1/dev_guide/builds/index.html$2 [L,R=301] + RewriteRule ^(online|dedicated)/dev_guide/builds\.html#build-hooks$ /$1/dev_guide/builds/build_hooks.html$2 [L,R=301] + RewriteRule ^container-platform/(3\.4|3\.5|3\.6|3\.7)/dev_guide/builds\.html(.*)$ /container-platform/$1/dev_guide/builds/index.html$2 [L,R=301] + RewriteRule ^container-platform/(3\.4|3\.5|3\.6|3\.7)/dev_guide/builds\.html#build-hooks$ /container-platform/$1/dev_guide/builds/build_hooks.html$2 [L,R=301] + + # XPaaS redirect + RewriteRule ^(online|dedicated)/using_images/xpaas_images/eap\.html(.*)$ https://access.redhat.com/documentation/en/red-hat-xpaas/version-0/red-hat-xpaas-eap-image/ [L,R=301] + # Page currently missing - RewriteRule ^(online|dedicated)/using_images/xpaas_images/a_mq\.html(.*)$ https://access.redhat.com/documentation/en/red-hat-xpaas/version-0/red-hat-xpaas-a-mq-image/ [L,R=301] + RewriteRule ^(online|dedicated)/using_images/xpaas_images/jws\.html(.*)$ https://access.redhat.com/documentation/en/red-hat-xpaas/version-0/red-hat-xpaas-jboss-web-server-image/ [L,R=301] + RewriteRule ^(online|dedicated)/using_images/xpaas_images/fuse\.html(.*)$ https://access.redhat.com/documentation/en/red-hat-xpaas/version-0/red-hat-xpaas-fuse-integration-services-image/ [L,R=301] + RewriteRule ^(online|dedicated)/using_images/xpaas_images/decision_server\.html(.*)$ https://access.redhat.com/documentation/en/red-hat-xpaas/version-0/red-hat-xpaas-decision-server-image/ [L,R=301] + RewriteRule ^(online|dedicated)/using_images/xpaas_images/data_grid\.html(.*)$ https://access.redhat.com/documentation/en/red-hat-xpaas/version-0/red-hat-xpaas-data-grid-image/ [L,R=301] + RewriteRule ^(online|dedicated)/using_images/xpaas_images/sso\.html(.*)$ https://access.redhat.com/documentation/en/red-hat-xpaas/version-0/red-hat-xpaas-sso-image/ [L,R=301] + + # Online specific redirects + RewriteRule ^online/creating_images/custom\.html(.*)$ /online/welcome/index.html [L,R=301] + RewriteRule ^online/getting_started/devpreview_faq\.html(.*)$ https://www.openshift.com/pricing/index.html [L,R=301] + RewriteRule ^online/dev_guide/daemonsets\.html(.*)$ /online/welcome/index.html [L,R=301] + RewriteRule ^online/dev_guide/event_notifications\.html(.*)$ /online/dev_guide/notifications.html$1 [L,R=301] + + # Dedicated specific redirects + RewriteRule ^dedicated/admin_guide/osd_imagestreams_templates\.html(.*) /dedicated/admin_guide/index.html$1 [L,R=301] + RewriteRule ^dedicated/dev_guide/getting_traffic_into_cluster\.html(.*) /dedicated/welcome/index.html$1 [L,R=301] + RewriteRule ^dedicated/architecture/additional_concepts/f5_big_ip\.html(.*) /dedicated/welcome/index.html$1 [L,R=301] + RewriteRule ^dedicated/architecture/additional_concepts/flannel\.html(.*) /dedicated/welcome/index.html$1 [L,R=301] + + # OCP specific redirects + RewriteRule ^(container-platform|enterprise)/(3\.2|3\.3|3\.4|3\.5|3\.6|3\.7)/architecture/additional_concepts/throttling\.html(.*)$ /$1/$2/admin_guide/overcommit.html$3 [L,R=301] + RewriteRule ^(container-platform|enterprise)/(.[^/])/admin_guide/install/(advanced_install|deploy_router|docker_registry|first_steps|overview|prerequisites|quick_install|upgrades)\.html(.*)$ /$1/$2/install_config/install/$3.html$4 [R=301] + RewriteRule ^(container-platform|enterprise)/(.[^/])/admin_guide/upgrades\.html(.*) /$1/$2/install_config/upgrades.html$3 [R=301] + RewriteRule ^(container-platform|enterprise)/(3\.1|3\.2|3\.3|3\.4|3\.5|3\.6|3\.7)/admin_guide/(aggregate_logging|cluster_metrics|configuring_authentication|configuring_aws|configuring_gce|configuring_openstack|http_proxies|master_node_configuration|native_container_routing|routing_from_edge_lb|syncing_groups_with_ldap|web_console_customization)\.html(.*)$ /$1/$2/install_config/$3.html$4 [R=301] + RewriteRule ^(container-platform|enterprise)/(3\.1|3\.2|3\.3|3\.4|3\.5|3\.6|3\.7)/admin_guide/selfprovisioned_projects\.html(.*)$ /$1/$2/admin_guide/managing_projects.html$3 [R=301] + RewriteRule ^(container-platform|enterprise)/(3\.1|3\.2|3\.3|3\.4|3\.5|3\.6|3\.7)/install_config/upgrades\.html(.*)$ /$1/$2/install_config/upgrading/index.html$3 [R=301] + + + + +# ---------------------------------------------------------------------- +# Prevent 404 errors for non-existing redirected folders +# ---------------------------------------------------------------------- + +# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the +# same name does not exist. +# webmasterworld.com/apache/3808792.htm + +Options -MultiViews + +# ---------------------------------------------------------------------- +# Custom 404 page +# ---------------------------------------------------------------------- + +# You can add custom pages to handle 500 or 403 pretty easily, if you like. +# If you are hosting your site in subdirectory, adjust this accordingly +# e.g. ErrorDocument 404 /subdir/404.html +ErrorDocument 404 /404.html + + +# ---------------------------------------------------------------------- +# UTF-8 encoding +# ---------------------------------------------------------------------- + +# Use UTF-8 encoding for anything served text/plain or text/html +AddDefaultCharset utf-8 + +# Force UTF-8 for a number of file formats +AddCharset utf-8 .atom .css .js .json .rss .vtt .xml + + +# ---------------------------------------------------------------------- +# A little more security +# ---------------------------------------------------------------------- + +# "-Indexes" will have Apache block users from browsing folders without a +# default document Usually you should leave this activated, because you +# shouldn't allow everybody to surf through every folder on your server (which +# includes rather private places like CMS system folders). + + Options -Indexes + + +# Block access to "hidden" directories or files whose names begin with a +# period. This includes directories used by version control systems such as +# Subversion or Git. + + RewriteCond %{SCRIPT_FILENAME} -d [OR] + RewriteCond %{SCRIPT_FILENAME} -f + RewriteRule "(^|/)\." - [F] + + +# Block access to backup and source files. These files may be left by some +# text/html editors and pose a great security danger, when anyone can access +# them. + + Order allow,deny + Deny from all + Satisfy All + diff --git a/.s2i/httpd-cfg/01-community.conf b/.s2i/httpd-cfg/01-community.conf new file mode 100644 index 000000000000..2c3e87c251ee --- /dev/null +++ b/.s2i/httpd-cfg/01-community.conf @@ -0,0 +1,215 @@ +# ---------------------------------------------------------------------- +# Better website experience for IE users +# ---------------------------------------------------------------------- + +# Force the latest IE version, in various cases when it may fall back to IE7 mode +# github.com/rails/rails/commit/123eb25#commitcomment-118920 +# Use ChromeFrame if it's installed for a better experience for the poor IE folk + + + Header set X-UA-Compatible "IE=Edge,chrome=1" + # mod_headers can't match by content-type, but we don't want to send this header on *everything*... + + Header unset X-UA-Compatible + + + +# ---------------------------------------------------------------------- +# Proper MIME type for all files +# ---------------------------------------------------------------------- + +# JavaScript +# Normalize to standard type (it's sniffed in IE anyways) +# tools.ietf.org/html/rfc4329#section-7.2 +AddType application/javascript js jsonp +AddType application/json json + +# Audio +AddType audio/ogg oga ogg +AddType audio/mp4 m4a f4a f4b + +# Video +AddType video/ogg ogv +AddType video/mp4 mp4 m4v f4v f4p +AddType video/webm webm +AddType video/x-flv flv + +# SVG +# Required for svg webfonts on iPad +# twitter.com/FontSquirrel/status/14855840545 +AddType image/svg+xml svg svgz +AddEncoding gzip svgz + +# Webfonts +AddType application/vnd.ms-fontobject eot +AddType application/x-font-ttf ttf ttc +AddType font/opentype otf +AddType application/x-font-woff woff +AddType application/font-woff2 woff2 + +# Assorted types +AddType image/x-icon ico +AddType image/webp webp +AddType text/cache-manifest appcache manifest +AddType text/x-component htc +AddType application/xml rss atom xml rdf +AddType application/x-chrome-extension crx +AddType application/x-opera-extension oex +AddType application/x-xpinstall xpi +AddType application/octet-stream safariextz +AddType application/x-web-app-manifest+json webapp +AddType text/x-vcard vcf +AddType application/x-shockwave-flash swf +AddType text/vtt vtt + + +# ---------------------------------------------------------------------- +# Gzip compression +# ---------------------------------------------------------------------- + + + # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ + + + SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding + RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding + + + + # Compress all output labeled with one of the following MIME-types + + AddOutputFilterByType DEFLATE application/atom+xml \ + application/javascript \ + application/json \ + application/rss+xml \ + application/vnd.ms-fontobject \ + application/x-font-ttf \ + application/xhtml+xml \ + application/xml \ + font/opentype \ + image/svg+xml \ + image/x-icon \ + text/css \ + text/html \ + text/plain \ + text/x-component \ + text/xml + + + +# ---------------------------------------------------------------------- +# Start rewrite engine +# ---------------------------------------------------------------------- + +# Turning on the rewrite engine is necessary for the following rules and +# features. FollowSymLinks must be enabled for this to work. + +# Some cloud hosting services require RewriteBase to be set: goo.gl/HOcPN +# If using the h5bp in a subdirectory, use `RewriteBase /foo` instead where +# 'foo' is your directory. + +# If your web host doesn't allow the FollowSymlinks option, you may need to +# comment it out and use `Options +SymLinksOfOwnerMatch`, but be aware of the +# performance impact: http://goo.gl/Mluzd + + + + + Options Indexes FollowSymLinks + AllowOverride All + Order Allow,Deny + Allow from All + + RewriteEngine On + RewriteBase / + + # Redirects for "latest" version + RewriteRule ^origin-m4/?$ /latest/ [R=301] + + # Welcome page redirects + RewriteRule ^(latest|[0-9.]+)/?$ /$1/welcome/index.html [L,R=301] + + # Overview page has moved to Index page + RewriteRule ^(.*)/overview\.html(.*)$ /$1/index.html$2 [L,R=301] + + # Developers console redirect + RewriteRule ^(latest|[0-9.]+)/getting_started/developers/developers_console\.html(.*)$ /$1/getting_started/developers_console.html$2 [L,R=301] + + # Deployments redirect + RewriteRule ^(latest|[0-9.]+)/dev_guide/deployments\.html(.*)$ /$1/dev_guide/deployments/how_deployments_work.html$2 [L,R=301] + + # Builds redirect + RewriteRule ^(latest|[0-9.]+)/dev_guide/builds\.html(.*)$ /$1/dev_guide/builds/index.html$2 [L,R=301] + + # Other specific redirects + RewriteRule ^latest/admin_guide/build_defaults_overrides\.html(.*)$ /latest/install_config/build_defaults_overrides.html$1 [L,R=301] + RewriteRule ^latest/admin_guide/install/(advanced_install|deploy_router|docker_registry|first_steps|overview|prerequisites|quick_install|upgrades)\.html(.*)$ /latest/install_config/install/$1.html$2 [R=301] + RewriteRule ^(latest|[0-9.]+)/admin_guide/upgrades\.html(.*) /$1/install_config/upgrades.html$2 [R=301] + RewriteRule ^(latest|[0-9.]+)/admin_guide/(aggregate_logging|cluster_metrics|configuring_authentication|configuring_aws|configuring_gce|configuring_openstack|http_proxies|master_node_configuration|native_container_routing|routing_from_edge_lb|syncing_groups_with_ldap|web_console_customization)\.html(.*)$ /$1/install_config/$2.html$3 [R=301] + RewriteRule ^(latest|[0-9.]+)/admin_guide/persistent_storage/(persistent_storage_aws|persistent_storage_cinder|persistent_storage_gce|persistent_storage_glusterfs|persistent_storage_nfs)\.html(.*)$ /$1/install_config/persistent_storage/$2.html$3 [R=301] + RewriteRule ^latest/admin_guide/selfprovisioned_projects\.html(.*)$ /$1/$2/admin_guide/managing_projects.html$3 [R=301] + RewriteRule ^latest/install_config/upgrades\.html(.*)$ /latest/install_config/upgrading/index.html$1 [R=301] + + + + +# ---------------------------------------------------------------------- +# Prevent 404 errors for non-existing redirected folders +# ---------------------------------------------------------------------- + +# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the +# same name does not exist. +# webmasterworld.com/apache/3808792.htm + +Options -MultiViews + +# ---------------------------------------------------------------------- +# Custom 404 page +# ---------------------------------------------------------------------- + +# You can add custom pages to handle 500 or 403 pretty easily, if you like. +# If you are hosting your site in subdirectory, adjust this accordingly +# e.g. ErrorDocument 404 /subdir/404.html +ErrorDocument 404 /404.html + + +# ---------------------------------------------------------------------- +# UTF-8 encoding +# ---------------------------------------------------------------------- + +# Use UTF-8 encoding for anything served text/plain or text/html +AddDefaultCharset utf-8 + +# Force UTF-8 for a number of file formats +AddCharset utf-8 .atom .css .js .json .rss .vtt .xml + + +# ---------------------------------------------------------------------- +# A little more security +# ---------------------------------------------------------------------- + +# "-Indexes" will have Apache block users from browsing folders without a +# default document Usually you should leave this activated, because you +# shouldn't allow everybody to surf through every folder on your server (which +# includes rather private places like CMS system folders). + + Options -Indexes + + +# Block access to "hidden" directories or files whose names begin with a +# period. This includes directories used by version control systems such as +# Subversion or Git. + + RewriteCond %{SCRIPT_FILENAME} -d [OR] + RewriteCond %{SCRIPT_FILENAME} -f + RewriteRule "(^|/)\." - [F] + + +# Block access to backup and source files. These files may be left by some +# text/html editors and pose a great security danger, when anyone can access +# them. + + Order allow,deny + Deny from all + Satisfy All + diff --git a/404-commercial.html b/404-commercial.html new file mode 100644 index 000000000000..e71687146b9b --- /dev/null +++ b/404-commercial.html @@ -0,0 +1,418 @@ + + + + + + + + + + + + 404 | Red Hat OpenShift Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Not found

+

Sorry, but the page you were trying to view does not exist.

+

It looks like this was the result of either:

+ +

Docs

+ + +
+
+ + + + + + + + diff --git a/404-community.html b/404-community.html new file mode 100644 index 000000000000..864fc6bdefbb --- /dev/null +++ b/404-community.html @@ -0,0 +1,69 @@ + + + + + + + + + + + + 404 | OpenShift Origin Documentation + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Not found

+

Sorry, but the page you were trying to view does not exist.

+

It looks like this was the result of either:

+ +

Docs

+ + +
+
+ + + diff --git a/_openshift/docs-template.yaml b/_openshift/docs-template.yaml deleted file mode 100644 index b3a755b30195..000000000000 --- a/_openshift/docs-template.yaml +++ /dev/null @@ -1,161 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: openshift-docs -parameters: -- name: GIT_URI - displayName: Git Uri - value: https://github.com/openshift/openshift-docs.git -- name: GIT_REF - displayName: Git Reference - value: master -- description: A secret string used to configure the GitHub webhook. - displayName: GitHub Webhook Secret - from: '[a-zA-Z0-9]{40}' - generate: expression - name: GITHUB_WEBHOOK_SECRET -objects: -- apiVersion: v1 - kind: ImageStream - metadata: - labels: - app: openshift-docs - name: openshift-docs - spec: {} -- apiVersion: v1 - kind: ImageStream - metadata: - labels: - build: openshift-docs-s2i - name: openshift-docs-s2i - spec: - tags: - - from: - kind: DockerImage - name: docker.io/cewong/asciibinder-018-centos7:latest - name: latest -- apiVersion: v1 - kind: BuildConfig - metadata: - annotations: - labels: - app: openshift-docs - name: openshift-docs - spec: - output: - to: - kind: ImageStreamTag - name: openshift-docs:latest - runPolicy: Serial - source: - git: - uri: ${GIT_URI} - ref: ${GIT_REF} - type: Git - strategy: - sourceStrategy: - from: - kind: ImageStreamTag - name: openshift-docs-s2i:latest - type: Source - triggers: - - type: ImageChange - - type: ConfigChange - - github: - secret: ${GITHUB_WEBHOOK_SECRET} - type: GitHub -- apiVersion: v1 - kind: DeploymentConfig - metadata: - labels: - app: openshift-docs - name: openshift-docs - spec: - replicas: 1 - selector: - app: openshift-docs - deploymentconfig: openshift-docs - strategy: - resources: {} - recreateParams: {} - type: Recreate - template: - metadata: - labels: - app: openshift-docs - deploymentconfig: openshift-docs - spec: - containers: - - image: " " - imagePullPolicy: IfNotPresent - name: openshift-docs - ports: - - containerPort: 8080 - protocol: TCP - resources: {} - livenessProbe: - httpGet: - path: / - port: 8080 - scheme: HTTP - initialDelaySeconds: 5 - timeoutSeconds: 1 - periodSeconds: 5 - successThreshold: 1 - failureThreshold: 3 - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 3 - timeoutSeconds: 1 - periodSeconds: 10 - successThreshold: 1 - failureThreshold: 3 - terminationMessagePath: /dev/termination-log - dnsPolicy: ClusterFirst - restartPolicy: Always - securityContext: {} - terminationGracePeriodSeconds: 30 - test: false - triggers: - - type: ConfigChange - - imageChangeParams: - automatic: true - containerNames: - - openshift-docs - from: - kind: ImageStreamTag - name: openshift-docs:latest - type: ImageChange - status: {} -- apiVersion: v1 - kind: Service - metadata: - labels: - app: openshift-docs - name: openshift-docs - spec: - ports: - - name: 8080-tcp - port: 8080 - protocol: TCP - targetPort: 8080 - selector: - app: openshift-docs - deploymentconfig: openshift-docs - sessionAffinity: None - type: ClusterIP -- apiVersion: v1 - kind: Route - metadata: - labels: - app: openshift-docs - name: openshift-docs - spec: - port: - targetPort: 8080-tcp - to: - kind: Service - name: openshift-docs - weight: 100 - wildcardPolicy: None diff --git a/_stylesheets/commercial-home.css b/_stylesheets/commercial-home.css index 3cc60aa81038..ffd55e7d2fb0 100644 --- a/_stylesheets/commercial-home.css +++ b/_stylesheets/commercial-home.css @@ -8,6 +8,10 @@ font-size: 45px; margin-bottom: 60px; color: #333; } +.footer-openshift .powered-by { + margin-top: -22px; +} + .docs-home h2 { color: #cc0000; } @@ -330,4 +334,4 @@ background-color: #337ab7; border-color: #337ab7; cursor: default -} \ No newline at end of file +} diff --git a/_templates/_footer_origin.html.erb b/_templates/_footer_origin.html.erb index 2f431ea0015f..64709cb0bbbd 100644 --- a/_templates/_footer_origin.html.erb +++ b/_templates/_footer_origin.html.erb @@ -33,7 +33,7 @@
- + Powered by OpenShift Online
diff --git a/asciibinder-template.yml b/asciibinder-template.yml new file mode 100644 index 000000000000..1b3399606176 --- /dev/null +++ b/asciibinder-template.yml @@ -0,0 +1,475 @@ +--- +kind: "Template" +apiVersion: "v1" +metadata: + name: "public-asciibinder-website" + annotations: + openshift.io/display-name: "Public AsciiBinder Static Website" + description: "Takes files created for static site generator AsciiBinder (http://asciibinder.org/) from a public source repo, builds them in Ruby, and deploys them in a PHP container." + tags: "ruby,asciibinder" + iconClass: "icon-shadowman" + template.openshift.io/long-description: "This template defines resources needed to develop an AsciiBinder application, including a build configuration and application deployment configuration." + template.openshift.io/provider-display-name: "Red Hat, Inc." +message: "The following service(s) have been created in your project: ${NAME}." +labels: + template: "asciibinder-website" +objects: + - kind: "Service" + apiVersion: "v1" + metadata: + name: "commercial-${NAME}" + annotations: + description: "Exposes and load balances the frontend application pods for the commercial deployment" + labels: + app: "${NAME}" + spec: + ports: + - name: "https" + port: 8443 + targetPort: 8080 + selector: + name: "commercial-${NAME}" + + - kind: "Service" + apiVersion: "v1" + metadata: + name: "community-${NAME}" + annotations: + description: "Exposes and load balances the frontend application pods for the community deployment" + labels: + app: "${NAME}" + spec: + ports: + - name: "https" + port: 8443 + targetPort: 8080 + selector: + name: "community-${NAME}" + + - kind: "Route" + apiVersion: "v1" + metadata: + name: "commercial-${NAME}" + labels: + app: "${NAME}" + spec: + host: "${COMMERCIAL_APPLICATION_DOMAIN}" + to: + kind: "Service" + name: "commercial-${NAME}" + weight: 1 + tls: + termination: "edge" + insecureEdgeTerminationPolicy: "Redirect" + + - kind: "Route" + apiVersion: "v1" + metadata: + name: "community-${NAME}" + labels: + app: "${NAME}" + spec: + host: "${COMMUNITY_APPLICATION_DOMAIN}" + to: + kind: "Service" + name: "community-${NAME}" + weight: 1 + tls: + termination: "edge" + insecureEdgeTerminationPolicy: "Redirect" + + - kind: "ImageStream" + apiVersion: "v1" + metadata: + name: "stg1-${NAME}" + annotations: + description: "Keeps track of changes in the stg1-${NAME} application image" + labels: + app: "${NAME}" + + - kind: "ImageStream" + apiVersion: "v1" + metadata: + name: "final-commercial-${NAME}" + annotations: + description: "Keeps track of changes in the final-commercial-${NAME} application image" + labels: + app: "${NAME}" + + - kind: "ImageStream" + apiVersion: "v1" + metadata: + name: "final-community-${NAME}" + annotations: + description: "Keeps track of changes in the final-community-${NAME} application image" + labels: + app: "${NAME}" + + - kind: "ImageStream" + apiVersion: "v1" + metadata: + name: "httpd-24-rhel7" + annotations: + description: "Upstream httpd 2.4 s2i image" + labels: + app: "${NAME}" + spec: + lookupPolicy: + local: false + tags: + - annotations: null + from: + kind: "DockerImage" + name: "registry.access.redhat.com/rhscl/httpd-24-rhel7" + generation: 0 + importPolicy: + scheduled: true + name: "latest" + referencePolicy: + type: "Source" + + - kind: "BuildConfig" + apiVersion: "v1" + metadata: + name: "stg1-${NAME}" + annotations: + description: "Defines how to perform stage 1 build for ${NAME}" + labels: + app: "${NAME}" + spec: + nodeSelector: + source: + type: "Git" + git: + uri: "${SOURCE_REPOSITORY_URL}" + ref: "${SOURCE_REPOSITORY_REF}" + contextDir: "${CONTEXT_DIR}" + strategy: + type: "Source" + sourceStrategy: + from: + kind: "ImageStreamTag" + namespace: "${NAMESPACE}" + name: "ruby:2.3" + output: + to: + kind: "ImageStreamTag" + name: "stg1-${NAME}:latest" + triggers: + - type: "ImageChange" + - type: "ConfigChange" + - type: "GitHub" + github: + secret: "${GITHUB_WEBHOOK_SECRET}" + + - kind: "BuildConfig" + apiVersion: "v1" + metadata: + name: "final-commercial-${NAME}" + annotations: + description: "Defines how to perform final commercial build for ${NAME} before deployment" + labels: + app: "${NAME}" + spec: + nodeSelector: + source: + type: "Images" + images: + - from: + kind: "ImageStreamTag" + name: "stg1-${NAME}:latest" + paths: + - sourcePath: "/opt/app-root/src/commercial_package/commercial/." + destinationDir: "." + strategy: + type: "Source" + sourceStrategy: + from: + kind: "ImageStreamTag" + name: "httpd-24-rhel7:latest" + output: + to: + kind: "ImageStreamTag" + name: "final-commercial-${NAME}:latest" + triggers: + - imageChange: + from: + kind: ImageStreamTag + name: 'stg1-${NAME}:latest' + type: "ImageChange" + - type: "ConfigChange" + + - kind: "BuildConfig" + apiVersion: "v1" + metadata: + name: "final-community-${NAME}" + annotations: + description: "Defines how to perform final community build for ${NAME} before deployment" + labels: + app: "${NAME}" + spec: + nodeSelector: + source: + type: "Images" + images: + - from: + kind: "ImageStreamTag" + name: "stg1-${NAME}:latest" + paths: + - sourcePath: "/opt/app-root/src/community_package/community/." + destinationDir: "." + strategy: + type: "Source" + sourceStrategy: + from: + kind: "ImageStreamTag" + name: "httpd-24-rhel7:latest" + output: + to: + kind: "ImageStreamTag" + name: "final-community-${NAME}:latest" + triggers: + - imageChange: + from: + kind: ImageStreamTag + name: 'stg1-${NAME}:latest' + type: "ImageChange" + - type: "ConfigChange" + + - kind: "DeploymentConfig" + apiVersion: "v1" + metadata: + name: "commercial-${NAME}" + annotations: + description: "Defines how to deploy the ${COMMERCIAL_APPLICATION_DOMAIN} domain" + labels: + app: "${NAME}" + spec: + strategy: + type: "Rolling" + triggers: + - type: "ImageChange" + imageChangeParams: + automatic: true + containerNames: + - "commercial-${NAME}" + from: + kind: "ImageStreamTag" + name: "final-commercial-${NAME}:latest" + - type: "ConfigChange" + replicas: 1 + test: false + selector: + name: "commercial-${NAME}" + template: + metadata: + name: "commercial-${NAME}" + labels: + name: "commercial-${NAME}" + app: "${NAME}" + spec: + containers: + - name: "commercial-${NAME}" + ports: + - containerPort: 8080 + readinessProbe: + timeoutSeconds: 5 + initialDelaySeconds: 10 + httpGet: + path: "/${HEALTHCHECK_PATH}" + port: 8080 + livenessProbe: + timeoutSeconds: 5 + initialDelaySeconds: 10 + periodSeconds: 30 + httpGet: + path: "/${HEALTHCHECK_PATH}" + port: 8080 + resources: + requests: + cpu: "${CPU_REQUEST}" + memory: "${MEMORY_REQUEST}" + limits: + cpu: "${CPU_LIMIT}" + memory: "${MEMORY_LIMIT}" + + - kind: "DeploymentConfig" + apiVersion: "v1" + metadata: + name: "community-${NAME}" + annotations: + description: "Defines how to deploy the ${COMMUNITY_APPLICATION_DOMAIN} domain" + labels: + app: "${NAME}" + spec: + strategy: + type: "Rolling" + triggers: + - type: "ImageChange" + imageChangeParams: + automatic: true + containerNames: + - "community-${NAME}" + from: + kind: "ImageStreamTag" + name: "final-community-${NAME}:latest" + - type: "ConfigChange" + replicas: 1 + test: false + selector: + name: "community-${NAME}" + template: + metadata: + name: "community-${NAME}" + labels: + name: "community-${NAME}" + app: "${NAME}" + spec: + containers: + - name: "community-${NAME}" + ports: + - containerPort: 8080 + readinessProbe: + timeoutSeconds: 5 + initialDelaySeconds: 10 + httpGet: + path: "/${HEALTHCHECK_PATH}" + port: 8080 + livenessProbe: + timeoutSeconds: 5 + initialDelaySeconds: 10 + periodSeconds: 30 + httpGet: + path: "/${HEALTHCHECK_PATH}" + port: 8080 + resources: + requests: + cpu: "${CPU_REQUEST}" + memory: "${MEMORY_REQUEST}" + limits: + cpu: "${CPU_LIMIT}" + memory: "${MEMORY_LIMIT}" + + - kind: "HorizontalPodAutoscaler" + apiVersion: "extensions/v1beta1" + metadata: + name: "commercial-${NAME}" + labels: + app: "${NAME}" + spec: + scaleRef: + kind: DeploymentConfig + name: "commercial-${NAME}" + apiVersion: "v1" + subresource: "scale" + minReplicas: ${MIN_REPLICAS} + maxReplicas: ${MAX_REPLICAS} + cpuUtilization: + targetPercentage: ${TARGET_PERCENTAGE} + + - kind: "HorizontalPodAutoscaler" + apiVersion: "extensions/v1beta1" + metadata: + name: "community-${NAME}" + labels: + app: "${NAME}" + spec: + scaleRef: + kind: DeploymentConfig + name: "community-${NAME}" + apiVersion: "v1" + subresource: "scale" + minReplicas: ${MIN_REPLICAS} + maxReplicas: ${MAX_REPLICAS} + cpuUtilization: + targetPercentage: ${TARGET_PERCENTAGE} + +parameters: + - name: "NAME" + displayName: "Application name" + description: "The name assigned to all of the application components defined in this template." + required: true + + - name: "COMMERCIAL_APPLICATION_DOMAIN" + displayName: "Commercial Application Hostname" + description: "The exposed hostname that will route to the httpd service for commercial content." + value: "" + + - name: "COMMUNITY_APPLICATION_DOMAIN" + displayName: "Community Application Hostname" + description: "The exposed hostname that will route to the httpd service for community content." + value: "" + + - name: "HEALTHCHECK_PATH" + displayName: "URI path to a known, working web page." + description: "The URI path to a known, working web page for testing liveness and readiness probes. Exclude leading '/'" + required: true + value: "index.html" + + - name: "SOURCE_REPOSITORY_URL" + displayName: "Git Repository URL" + description: "The URL of the repository with your application source code." + required: true + value: "https://github.com/openshift/openshift-docs.git" + + - name: "SOURCE_REPOSITORY_REF" + displayName: "Git Reference" + description: "Set this to a branch name, tag or other ref of your repository if you are not using the default branch." + + - name: "CONTEXT_DIR" + displayName: "Context Directory" + description: "Set this to the relative path to your project if it is not in the root of your repository." + + - name: "CPU_REQUEST" + displayName: "CPU Request" + description: "Requested amount of CPU the httpd container will use." + required: true + value: "200m" + + - name: "CPU_LIMIT" + displayName: "CPU Limit" + description: "Maximum amount of CPU the httpd container can use." + required: true + value: "2" + + - name: "MEMORY_REQUEST" + displayName: "Memory Request" + description: "Requested amount of memory the httpd container will use." + required: true + value: "1Gi" + + - name: "MEMORY_LIMIT" + displayName: "Memory Limit" + description: "Maximum amount of memory the httpd container can use." + required: true + value: "2Gi" + + - name: "MIN_REPLICAS" + displayName: "Minimum pod replicas" + description: "The minimum number of replicas to run in autoscaling." + required: true + value: "2" + + - name: "MAX_REPLICAS" + displayName: "Maximum pod replicas" + description: "The maximum number of replicas to run in autoscaling." + required: true + value: "10" + + - name: "TARGET_PERCENTAGE" + displayName: "Autoscaling target CPU percentage (as an integer)." + description: "The percentage of the requested CPU that each pod should ideally be using." + required: true + value: "80" + + - name: "NAMESPACE" + displayName: "Namespace" + description: "The OpenShift Namespace where the Ruby s2i builder ImageStream resides." + required: true + value: "openshift" + + - name: "GITHUB_WEBHOOK_SECRET" + displayName: "GitHub Webhook Secret" + description: "A secret string used to configure the GitHub webhook." + generate: "expression" + from: "[a-zA-Z0-9]{40}" diff --git a/contributing_to_docs/tools_and_setup.adoc b/contributing_to_docs/tools_and_setup.adoc index 6aa6738063c0..70174fffda1b 100644 --- a/contributing_to_docs/tools_and_setup.adoc +++ b/contributing_to_docs/tools_and_setup.adoc @@ -150,3 +150,32 @@ edit existing content or create new topics. some basic guidelines to keep things consistent across our content. * link:create_or_edit_content.adoc[Create a local working branch] on your workstation to edit existing topics or create new topics. + +=== How to deploy to OpenShift +You can deploy to OpenShift for development by running + +[source, bash] +--- +oc process -f asciibinder-template.yml -p NAME=docs \ + -p SOURCE_REPOSITORY_URL=(git remote get-url origin) \ + -p SOURCE_REPOSITORY_REF=(git rev-parse --abbrev-ref HEAD) \ + -p MEMORY_LIMIT=512Mi -p MEMORY_REQUEST=256Mi \ + | oc create -f - +--- + +[NOTE] +==== +If the build fails with "Fetch source failed" status, you can +delete all the created objects and re-run above with an HTTP uri +as the `SOURCE_REPOSITORY_URL`, or you can +link:https://docs.openshift.org/latest/dev_guide/builds/build_inputs.html#source-secrets-combinations[create a source secret] +and add it to the stg1 build, `oc set build-secret --source bc/stg1-docs `. +==== + + +You can delete all created objects by running + +[source, bash] +--- +oc delete all -l app=docs +--- diff --git a/index-commercial.html b/index-commercial.html index 6852e7c23c3a..318564a756d0 100644 --- a/index-commercial.html +++ b/index-commercial.html @@ -342,12 +342,10 @@ -
  • + + My Account +
  • @@ -366,12 +364,7 @@ @@ -409,49 +402,43 @@

    OpenShift Documentation

    OpenShift Online

    -

    Red Hat's public cloud application deployment and hosting platform.

    -
    - - -
    +

    Red Hat's public cloud application deployment and hosting platform.

    +

    Online

    OpenShift Container Platform

    -

    Red Hat's private, on-premise cloud application deployment and hosting platform.

    - +

    Red Hat's private, on-premise cloud application deployment and hosting platform.

    +

    OpenShift Dedicated

    -

    Red Hat's managed public cloud application deployment and hosting service.

    -

    Dedicated

    +

    Red Hat's managed public cloud application deployment and hosting service.

    +

    Dedicated

    -

    OpenShift Origin

    -
    -

    OpenShift's open source, upstream project.

    -

    Origin Documentation

    -
    -
    +

    OpenShift Origin

    +
    +

    OpenShift's open source, upstream project.

    +

    Origin Documentation

    +
    + @@ -461,10 +448,15 @@

    OpenShift Origin