smartcloud 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +21 -0
- data/README.md +79 -0
- data/bin/runner +20 -0
- data/bin/smartcloud +54 -0
- data/lib/smartcloud.rb +16 -0
- data/lib/smartcloud/boot.rb +93 -0
- data/lib/smartcloud/docker.rb +120 -0
- data/lib/smartcloud/grids/grid-mysql/docker-entrypoint-initdb.d/.keep +0 -0
- data/lib/smartcloud/grids/grid-nginx/fastcgi.conf +9 -0
- data/lib/smartcloud/grids/grid-nginx/nginx.tmpl +373 -0
- data/lib/smartcloud/grids/grid-runner/Dockerfile +27 -0
- data/lib/smartcloud/grids/grid-runner/buildpacks/rails/Dockerfile +30 -0
- data/lib/smartcloud/grids/grid-solr/docker-entrypoint-initdb.d/.keep +0 -0
- data/lib/smartcloud/grids/grid-solr/sunspot/conf/schema.xml +278 -0
- data/lib/smartcloud/grids/grid-solr/sunspot/conf/solrconfig.xml +632 -0
- data/lib/smartcloud/grids/mysql.rb +60 -0
- data/lib/smartcloud/grids/nginx.rb +133 -0
- data/lib/smartcloud/grids/runner.rb +373 -0
- data/lib/smartcloud/grids/solr.rb +92 -0
- data/lib/smartcloud/machine.rb +63 -0
- data/lib/smartcloud/templates/dotsmartcloud/config/environment.rb +13 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-mysql/data/.keep +0 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-nginx/certificates/.keep +0 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-nginx/htpasswd/.keep +0 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-nginx/users.yml +1 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-runner/apps/containers/.keep +0 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-runner/apps/repositories/.keep +0 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-runner/buildpacks/rails/gems/.keep +0 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-runner/pre-receive +13 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/.keep +0 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/README.txt +77 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/contractions_ca.txt +8 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/contractions_fr.txt +15 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/contractions_ga.txt +5 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/contractions_it.txt +23 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/hyphenations_ga.txt +5 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stemdict_nl.txt +6 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stoptags_ja.txt +420 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_ar.txt +125 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_bg.txt +193 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_ca.txt +220 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_cz.txt +172 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_da.txt +110 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_de.txt +294 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_el.txt +78 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_en.txt +54 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_es.txt +356 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_eu.txt +99 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_fa.txt +313 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_fi.txt +97 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_fr.txt +186 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_ga.txt +110 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_gl.txt +161 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_hi.txt +235 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_hu.txt +211 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_hy.txt +46 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_id.txt +359 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_it.txt +303 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_ja.txt +127 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_lv.txt +172 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_nl.txt +119 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_no.txt +194 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_pt.txt +253 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_ro.txt +233 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_ru.txt +243 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_sv.txt +133 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_th.txt +119 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/stopwords_tr.txt +212 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/lang/userdict_ja.txt +29 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/managed-schema +1007 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/params.json +20 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/protwords.txt +21 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/solrconfig.xml +1355 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/stopwords.txt +14 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/_default/conf/synonyms.txt +29 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/_rest_managed.json +1 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/_schema_analysis_stopwords_english.json +38 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/_schema_analysis_synonyms_english.json +11 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/clustering/carrot2/README.txt +11 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/clustering/carrot2/kmeans-attributes.xml +19 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/clustering/carrot2/lingo-attributes.xml +24 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/clustering/carrot2/stc-attributes.xml +19 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/currency.xml +67 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/elevate.xml +42 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/contractions_ca.txt +8 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/contractions_fr.txt +15 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/contractions_ga.txt +5 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/contractions_it.txt +23 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/hyphenations_ga.txt +5 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stemdict_nl.txt +6 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stoptags_ja.txt +420 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_ar.txt +125 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_bg.txt +193 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_ca.txt +220 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_ckb.txt +136 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_cz.txt +172 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_da.txt +110 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_de.txt +294 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_el.txt +78 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_en.txt +54 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_es.txt +356 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_eu.txt +99 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_fa.txt +313 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_fi.txt +97 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_fr.txt +186 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_ga.txt +110 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_gl.txt +161 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_hi.txt +235 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_hu.txt +211 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_hy.txt +46 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_id.txt +359 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_it.txt +303 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_ja.txt +127 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_lv.txt +172 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_nl.txt +119 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_no.txt +194 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_pt.txt +253 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_ro.txt +233 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_ru.txt +243 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_sv.txt +133 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_th.txt +119 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/stopwords_tr.txt +212 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/lang/userdict_ja.txt +29 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/managed-schema +1187 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/mapping-FoldToASCII.txt +3813 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/params.json +11 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/protwords.txt +21 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/solrconfig.xml +1616 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/spellings.txt +2 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/stopwords.txt +14 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/synonyms.txt +29 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/update-script.js +53 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/README.txt +101 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/VM_global_library.vm +186 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/browse.vm +33 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/cluster.vm +19 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/cluster_results.vm +31 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/debug.vm +28 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/did_you_mean.vm +11 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/error.vm +11 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm +24 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/facet_pivot.vm +12 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/facet_queries.vm +12 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/facet_ranges.vm +23 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/facets.vm +10 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/footer.vm +43 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/head.vm +37 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/header.vm +7 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/hit.vm +25 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/hit_grouped.vm +43 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/hit_plain.vm +25 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/join_doc.vm +20 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/jquery.autocomplete.css +48 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/jquery.autocomplete.js +763 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/layout.vm +24 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/main.css +231 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/mime_type_lists.vm +68 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/pagination_bottom.vm +22 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/pagination_top.vm +29 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/product_doc.vm +32 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/query.vm +42 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/query_form.vm +64 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/query_group.vm +43 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/query_spatial.vm +75 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/results_list.vm +22 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/richtext_doc.vm +153 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/suggest.vm +8 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/velocity/tabs.vm +50 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/xslt/example.xsl +132 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/xslt/example_atom.xsl +67 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/xslt/example_rss.xsl +66 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/xslt/luke.xsl +337 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sample_techproducts_configs/conf/xslt/updateXml.xsl +70 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/_rest_managed.json +1 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/admin-extra.html +31 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/currency.xml +67 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/elevate.xml +36 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/lang/stopwords_en.txt +54 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/protwords.txt +21 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/schema.xml +278 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/scripts.conf +24 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/solrconfig.xml +632 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/spellings.txt +2 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/configsets/sunspot/conf/synonyms.txt +29 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/lib/.keep +0 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/solr.xml +53 -0
- data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/data/zoo.cfg +31 -0
- data/lib/smartcloud/user.rb +72 -0
- metadata +237 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 982fbbbb8176cc3e83d15e4000cf69ca284802aff03fffa2fc2c62c95d22a6c4
|
4
|
+
data.tar.gz: fd1a7457d386875d511ea14230c2ddf3b478c6e83525a4195f546559f3468963
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 159495e559ed7b9df8ac7da9223a376f1d4d6dffc2ce139277218130c34602cbf593c93dd0c13065f6e1df3e29efa37b52e42fff76dd71d8e4c54de4c5e45ef3
|
7
|
+
data.tar.gz: 77cc97f167f992fd2c9d346744925665bc4c96671c3caefcb694bcb1a5b1eff9819554b544983e7a67e97cadc4b4293a3cc38c618fd1b94da06150dc9ea29157
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2019 Timeboard
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
# SmartCloud
|
2
|
+
Smartcloud is a full-stack deployment framework for Rails optimized for programmer happiness and peaceful administration. It encourages natural simplicity by favoring convention over configuration.
|
3
|
+
|
4
|
+
Deploy your Rails apps to your own server with - git push production master
|
5
|
+
|
6
|
+
## How it Works
|
7
|
+
|
8
|
+
After you run the below commands, you get.
|
9
|
+
1. Setup of basic best practices of setting up and securing a VPS server.
|
10
|
+
2. Setup and installation of Docker.
|
11
|
+
3. Setup and installation of docker based Mysql, Solr, Nginx, App Runner.
|
12
|
+
4. Deployment of your Rails apps to your own server with - git push production master
|
13
|
+
|
14
|
+
## Setup a New Machine - Ubuntu 18.04 LTS
|
15
|
+
1. Getting Started with Linode:
|
16
|
+
```
|
17
|
+
https://www.linode.com/docs/getting-started/
|
18
|
+
```
|
19
|
+
2. How to Secure Your Server:
|
20
|
+
```
|
21
|
+
https://www.linode.com/docs/security/securing-your-server/
|
22
|
+
```
|
23
|
+
|
24
|
+
## Install SmartCloud
|
25
|
+
1. Install Ruby:
|
26
|
+
```
|
27
|
+
$ sudo apt-get install ruby-full
|
28
|
+
```
|
29
|
+
2. Add gem executables to PATH (remember to check ruby version in the path):
|
30
|
+
```
|
31
|
+
$ echo 'export PATH="$PATH:$HOME/.gem/ruby/2.5.0/bin"' >> ~/.bashrc && source ~/.bashrc
|
32
|
+
```
|
33
|
+
3. Install smartcloud for current user:
|
34
|
+
```
|
35
|
+
$ gem install smartcloud --user-install
|
36
|
+
```
|
37
|
+
4. Initialize smartcloud:
|
38
|
+
```
|
39
|
+
$ smartcloud init
|
40
|
+
```
|
41
|
+
|
42
|
+
<!--
|
43
|
+
## TODO - Setup Machine
|
44
|
+
1. Getting Started and Securing your Server:
|
45
|
+
```
|
46
|
+
$ smartcloud machine install
|
47
|
+
```
|
48
|
+
-->
|
49
|
+
|
50
|
+
## Install Docker
|
51
|
+
1. Run docker install command:
|
52
|
+
```
|
53
|
+
$ smartcloud docker install
|
54
|
+
```
|
55
|
+
2. Add UFW rules for Docker as specified at the end of installation.
|
56
|
+
|
57
|
+
## Starting Grids as per Choice
|
58
|
+
1. Start mysql grid:
|
59
|
+
```
|
60
|
+
$ smartcloud grids mysql up
|
61
|
+
```
|
62
|
+
2. Start solr grid:
|
63
|
+
```
|
64
|
+
$ smartcloud grids solr up
|
65
|
+
```
|
66
|
+
3. Start nginx grid:
|
67
|
+
```
|
68
|
+
$ smartcloud grids nginx up
|
69
|
+
```
|
70
|
+
4. Start runner grid:
|
71
|
+
```
|
72
|
+
$ smartcloud grids runner up
|
73
|
+
```
|
74
|
+
|
75
|
+
## TODO - Creating New App
|
76
|
+
1. Creating a new bare app on the server:
|
77
|
+
```
|
78
|
+
$ smartcloud apps create <USERNAME> <APPNAME>
|
79
|
+
```
|
data/bin/runner
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'smartcloud'
|
4
|
+
|
5
|
+
if ARGV[0] == 'prereceive'
|
6
|
+
raise "Please provide appname, username, oldrev, newrev and refname" unless ARGV[1] && ARGV[2] && ARGV[3] && ARGV[4] && ARGV[5]
|
7
|
+
Smartcloud::Grids::Runner.prereceive_app(ARGV[1], ARGV[2], ARGV[3], ARGV[4], ARGV[5])
|
8
|
+
elsif ARGV[0] == 'apps'
|
9
|
+
raise "Please provide appname" unless ARGV[2]
|
10
|
+
if ARGV[1] == 'create'
|
11
|
+
raise "Please provide username" unless ARGV[3]
|
12
|
+
Smartcloud::Grids::Runner.create_app(ARGV[2], ARGV[3])
|
13
|
+
elsif ARGV[1] == 'start'
|
14
|
+
Smartcloud::Grids::Runner.start_app(ARGV[2])
|
15
|
+
elsif ARGV[1] == 'stop'
|
16
|
+
Smartcloud::Grids::Runner.stop_app(ARGV[2])
|
17
|
+
elsif ARGV[1] == 'destroy'
|
18
|
+
Smartcloud::Grids::Runner.destroy_app(ARGV[2])
|
19
|
+
end
|
20
|
+
end
|
data/bin/smartcloud
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'smartcloud'
|
4
|
+
|
5
|
+
if ARGV[0] == 'init'
|
6
|
+
Smartcloud::Boot.init
|
7
|
+
elsif !Smartcloud::Boot.initialized?
|
8
|
+
puts "Smartcloud has not been initialized. Please run command 'smartcloud init'."
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
12
|
+
if ARGV[0] == 'docker'
|
13
|
+
if ARGV[1] == 'install'
|
14
|
+
Smartcloud::Docker.install
|
15
|
+
elsif ARGV[1] == 'uninstall'
|
16
|
+
Smartcloud::Docker.uninstall
|
17
|
+
end
|
18
|
+
elsif ARGV[0] == 'grids'
|
19
|
+
if ARGV[1] == 'runner'
|
20
|
+
if ARGV[2] == 'up'
|
21
|
+
Smartcloud::Grids::Runner.up
|
22
|
+
elsif ARGV[2] == 'down'
|
23
|
+
Smartcloud::Grids::Runner.down
|
24
|
+
end
|
25
|
+
elsif ARGV[1] == 'mysql'
|
26
|
+
if ARGV[2] == 'up'
|
27
|
+
Smartcloud::Grids::Mysql.up(ARGV[3])
|
28
|
+
elsif ARGV[2] == 'down'
|
29
|
+
Smartcloud::Grids::Mysql.down
|
30
|
+
end
|
31
|
+
elsif ARGV[1] == 'nginx'
|
32
|
+
if ARGV[2] == 'up'
|
33
|
+
Smartcloud::Grids::Nginx.up(ARGV[3])
|
34
|
+
elsif ARGV[2] == 'down'
|
35
|
+
Smartcloud::Grids::Nginx.down
|
36
|
+
end
|
37
|
+
elsif ARGV[1] == 'solr'
|
38
|
+
if ARGV[2] == 'up'
|
39
|
+
Smartcloud::Grids::Solr.up(ARGV[3])
|
40
|
+
elsif ARGV[2] == 'down'
|
41
|
+
Smartcloud::Grids::Solr.down
|
42
|
+
elsif ARGV[2] == 'create_core'
|
43
|
+
Smartcloud::Grids::Solr.create_core(ARGV[3])
|
44
|
+
elsif ARGV[2] == 'destroy_core'
|
45
|
+
Smartcloud::Grids::Solr.destroy_core(ARGV[3])
|
46
|
+
end
|
47
|
+
end
|
48
|
+
# elsif ARGV[0] == 'user'
|
49
|
+
# if ARGV[1] == 'create'
|
50
|
+
# Smartcloud::User.create(ARGV[2], ARGV[3], ARGV[4])
|
51
|
+
# elsif ARGV[1] == 'destroy'
|
52
|
+
# Smartcloud::User.destroy(ARGV[2], ARGV[3])
|
53
|
+
# end
|
54
|
+
end
|
data/lib/smartcloud.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "ostruct"
|
2
|
+
|
3
|
+
# The main Smartcloud driver
|
4
|
+
module Smartcloud
|
5
|
+
def self.config
|
6
|
+
@@config ||= OpenStruct.new
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
Smartcloud.config.root_path = File.expand_path('../..', __FILE__)
|
11
|
+
Smartcloud.config.user_home_path = File.expand_path('~')
|
12
|
+
if File.exist?("#{Smartcloud.config.user_home_path}/.smartcloud/config/environment.rb")
|
13
|
+
require "#{Smartcloud.config.user_home_path}/.smartcloud/config/environment"
|
14
|
+
end
|
15
|
+
|
16
|
+
require 'smartcloud/boot'
|
@@ -0,0 +1,93 @@
|
|
1
|
+
require 'securerandom'
|
2
|
+
require "tempfile"
|
3
|
+
|
4
|
+
# The main Smartcloud Boot driver
|
5
|
+
module Smartcloud
|
6
|
+
class Boot
|
7
|
+
def initialize
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.init
|
11
|
+
# Copy Template for dotsmartcloud
|
12
|
+
unless self.initialized?
|
13
|
+
puts "Initializing Smartcloud ...\n\n"
|
14
|
+
|
15
|
+
begin
|
16
|
+
print "Enter top-level apps domain to be used for subdomains of your apps. [Recommended: yourdomain.com]: "
|
17
|
+
config_apps_domain = STDIN.gets.chomp
|
18
|
+
raise if config_apps_domain.empty?
|
19
|
+
rescue
|
20
|
+
retry
|
21
|
+
end
|
22
|
+
|
23
|
+
begin
|
24
|
+
print "Enter sysadmin email id. [Recommended: admin@#{config_apps_domain}]: "
|
25
|
+
config_sysadmin_email = STDIN.gets.chomp
|
26
|
+
raise if config_sysadmin_email.empty?
|
27
|
+
rescue
|
28
|
+
retry
|
29
|
+
end
|
30
|
+
|
31
|
+
begin
|
32
|
+
print "Enter username for your git grid user. [Recommended: git@#{config_apps_domain}]: "
|
33
|
+
username = STDIN.gets.chomp
|
34
|
+
raise if username.empty?
|
35
|
+
rescue
|
36
|
+
retry
|
37
|
+
end
|
38
|
+
|
39
|
+
print "Enter password for your git grid user. (leave blank to generate automatically) [Recommended: Minimum 8 characters with numbers and symbols]: "
|
40
|
+
password = STDIN.gets.chomp
|
41
|
+
if password.empty?
|
42
|
+
password = SecureRandom.base64(8)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Copy dotsmartcloud template to user home directory
|
46
|
+
FileUtils.cp_r("#{Smartcloud.config.root_path}/lib/smartcloud/templates/dotsmartcloud", "#{Smartcloud.config.user_home_path}/.smartcloud")
|
47
|
+
|
48
|
+
# modifying environment.rb file
|
49
|
+
tempFile = Tempfile.new("#{Smartcloud.config.user_home_path}/.smartcloud/config/environmentTemp.rb")
|
50
|
+
File.open("#{Smartcloud.config.user_home_path}/.smartcloud/config/environment.rb", "r").each_line do |line|
|
51
|
+
if line =~ /Smartcloud.config.apps_domain/
|
52
|
+
tempFile.puts "Smartcloud.config.apps_domain = \"#{config_apps_domain}\""
|
53
|
+
elsif line =~ /Smartcloud.config.git_domain/
|
54
|
+
tempFile.puts "Smartcloud.config.git_domain = \"git.#{config_apps_domain}\""
|
55
|
+
elsif line =~ /Smartcloud.config.sysadmin_email/
|
56
|
+
tempFile.puts "Smartcloud.config.sysadmin_email = \"#{config_sysadmin_email}\""
|
57
|
+
else
|
58
|
+
tempFile.puts line
|
59
|
+
end
|
60
|
+
end
|
61
|
+
tempFile.close
|
62
|
+
FileUtils.mv(tempFile.path, "#{Smartcloud.config.user_home_path}/.smartcloud/config/environment.rb")
|
63
|
+
|
64
|
+
# Reload the updated environment.rb file as it is required by methods below
|
65
|
+
require "#{Smartcloud.config.user_home_path}/.smartcloud/config/environment.rb"
|
66
|
+
|
67
|
+
# creating user for git grid at config.git_domain
|
68
|
+
Smartcloud::User.create(Smartcloud.config.git_domain, username, password)
|
69
|
+
|
70
|
+
puts "\nIMPORTANT NOTE: Please ensure that the required top-level apps domain '#{Smartcloud.config.apps_domain}' and git domain '#{Smartcloud.config.git_domain}' is pointing to this server using DNS Records before proceeding."
|
71
|
+
puts "IMPORTANT NOTE: Your git grid password is #{password} for username #{username}"
|
72
|
+
|
73
|
+
puts "\nInitializing Smartcloud ... done"
|
74
|
+
else
|
75
|
+
puts "Already Initialized. Please go to #{Smartcloud.config.user_home_path}/.smartcloud/config to make configuration changes."
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.initialized?
|
80
|
+
Dir.exist? "#{Smartcloud.config.user_home_path}/.smartcloud"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
require 'smartcloud/machine'
|
86
|
+
require 'smartcloud/docker'
|
87
|
+
|
88
|
+
require 'smartcloud/grids/nginx'
|
89
|
+
require 'smartcloud/grids/runner'
|
90
|
+
require 'smartcloud/grids/solr'
|
91
|
+
require 'smartcloud/grids/mysql'
|
92
|
+
|
93
|
+
require 'smartcloud/user'
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# The main Smartcloud Docker driver
|
2
|
+
module Smartcloud
|
3
|
+
class Docker
|
4
|
+
def initialize
|
5
|
+
end
|
6
|
+
|
7
|
+
# Installing Docker!
|
8
|
+
#
|
9
|
+
# Example:
|
10
|
+
# >> Docker.install
|
11
|
+
# => Installation Complete
|
12
|
+
#
|
13
|
+
# Arguments:
|
14
|
+
# none
|
15
|
+
def self.install
|
16
|
+
puts "-----> Installing Docker"
|
17
|
+
system("sudo apt-get update")
|
18
|
+
system("sudo apt-get install apt-transport-https ca-certificates curl software-properties-common")
|
19
|
+
system("curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -")
|
20
|
+
system("sudo apt-key fingerprint 0EBFCD88")
|
21
|
+
system("sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\"")
|
22
|
+
system("sudo apt-get update")
|
23
|
+
system("sudo apt-get install docker-ce")
|
24
|
+
system("sudo usermod -aG docker $USER")
|
25
|
+
system("docker run --rm hello-world")
|
26
|
+
|
27
|
+
puts "-----> Installing Docker Compose"
|
28
|
+
system("sudo curl -L --fail https://github.com/docker/compose/releases/download/1.24.0/run.sh -o /usr/local/bin/docker-compose")
|
29
|
+
system("sudo chmod +x /usr/local/bin/docker-compose")
|
30
|
+
system("docker-compose --version")
|
31
|
+
system("sudo curl -L https://raw.githubusercontent.com/docker/compose/1.24.0/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose")
|
32
|
+
|
33
|
+
self.add_ufw_rules
|
34
|
+
|
35
|
+
puts "-----> Installation Complete"
|
36
|
+
end
|
37
|
+
|
38
|
+
# Uninstalling Docker!
|
39
|
+
#
|
40
|
+
# Example:
|
41
|
+
# >> Docker.uninstall
|
42
|
+
# => Uninstallation Complete
|
43
|
+
#
|
44
|
+
# Arguments:
|
45
|
+
# none
|
46
|
+
def self.uninstall
|
47
|
+
puts "-----> Uninstalling Docker Compose"
|
48
|
+
system("sudo rm /usr/local/bin/docker-compose")
|
49
|
+
|
50
|
+
puts "-----> Uninstalling Docker"
|
51
|
+
system("sudo apt-get purge docker-ce")
|
52
|
+
system("sudo rm -rf /var/lib/docker")
|
53
|
+
|
54
|
+
self.remove_ufw_rules
|
55
|
+
|
56
|
+
puts "-----> Uninstallation Complete"
|
57
|
+
puts "-----> You must delete any edited configuration files manually."
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.running?
|
61
|
+
if system("docker info", [:out, :err] => File::NULL)
|
62
|
+
true
|
63
|
+
else
|
64
|
+
puts "Error: Docker daemon is not running. Have you installed docker? Please ensure docker daemon is running and try again."
|
65
|
+
false
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.add_ufw_rules
|
70
|
+
puts '-----> Add the following rules to the end of the file /etc/ufw/after.rules and reload ufw using - sudo ufw reload'
|
71
|
+
puts '# BEGIN UFW AND DOCKER
|
72
|
+
*filter
|
73
|
+
:ufw-user-forward - [0:0]
|
74
|
+
:DOCKER-USER - [0:0]
|
75
|
+
-A DOCKER-USER -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
76
|
+
-A DOCKER-USER -m conntrack --ctstate INVALID -j DROP
|
77
|
+
-A DOCKER-USER -i eth0 -j ufw-user-forward
|
78
|
+
-A DOCKER-USER -i eth0 -j DROP
|
79
|
+
COMMIT
|
80
|
+
# END UFW AND DOCKER'
|
81
|
+
|
82
|
+
# puts "-----> Adding UFW rules for Docker"
|
83
|
+
# interface_name = system("ip route show | sed -e 's/^default via [0-9.]* dev \(\w\+\).*/\1/'")
|
84
|
+
# puts interface_name
|
85
|
+
|
86
|
+
# system("sed '/^# BEGIN UFW AND DOCKER/,/^# END UFW AND DOCKER/d' '/etc/ufw/after.rules'")
|
87
|
+
# system("sudo tee -a '/etc/ufw/after.rules' > /dev/null <<EOT
|
88
|
+
# # BEGIN UFW AND DOCKER
|
89
|
+
# *filter
|
90
|
+
# :ufw-user-forward - [0:0]
|
91
|
+
# :DOCKER-USER - [0:0]
|
92
|
+
# -A DOCKER-USER -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
93
|
+
# -A DOCKER-USER -m conntrack --ctstate INVALID -j DROP
|
94
|
+
# -A DOCKER-USER -i eth0 -j ufw-user-forward
|
95
|
+
# -A DOCKER-USER -i eth0 -j DROP
|
96
|
+
# COMMIT
|
97
|
+
# # END UFW AND DOCKER
|
98
|
+
# EOT")
|
99
|
+
# system("sudo ufw reload")
|
100
|
+
end
|
101
|
+
|
102
|
+
def self.remove_ufw_rules
|
103
|
+
puts '-----> Remove the following rules at the end of the file /etc/ufw/after.rules and reload ufw using - sudo ufw reload'
|
104
|
+
puts '# BEGIN UFW AND DOCKER
|
105
|
+
*filter
|
106
|
+
:ufw-user-forward - [0:0]
|
107
|
+
:DOCKER-USER - [0:0]
|
108
|
+
-A DOCKER-USER -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
109
|
+
-A DOCKER-USER -m conntrack --ctstate INVALID -j DROP
|
110
|
+
-A DOCKER-USER -i eth0 -j ufw-user-forward
|
111
|
+
-A DOCKER-USER -i eth0 -j DROP
|
112
|
+
COMMIT
|
113
|
+
# END UFW AND DOCKER'
|
114
|
+
|
115
|
+
# puts "-----> Removing UFW rules for Docker"
|
116
|
+
# system("sed '/^# BEGIN UFW AND DOCKER/,/^# END UFW AND DOCKER/d' '/etc/ufw/after.rules'")
|
117
|
+
# system("sudo ufw reload")
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
client_max_body_size 0; # Git pushes can be massive, just to make sure nginx doesn't suddenly cut the connection add this.
|
2
|
+
|
3
|
+
include fastcgi_params; # Include the default fastcgi configs
|
4
|
+
|
5
|
+
fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend; # Tells fastcgi to pass the request to the git http backend executable.
|
6
|
+
fastcgi_param GIT_HTTP_EXPORT_ALL "";
|
7
|
+
fastcgi_param GIT_PROJECT_ROOT /.smartcloud/grids/grid-runner/apps/repositories; # is the location of all of your git repositories.
|
8
|
+
fastcgi_param PATH_INFO $uri; # Takes the capture group from our location directive and gives git that.
|
9
|
+
fastcgi_param REMOTE_USER $remote_user; # Forward REMOTE_USER as we want to know when we are authenticated
|
@@ -0,0 +1,373 @@
|
|
1
|
+
{{ $CurrentContainer := where $ "ID" .Docker.CurrentContainerID | first }}
|
2
|
+
|
3
|
+
{{ define "upstream" }}
|
4
|
+
{{ if .Address }}
|
5
|
+
{{/* If we got the containers from swarm and this container's port is published to host, use host IP:PORT */}}
|
6
|
+
{{ if and .Container.Node.ID .Address.HostPort }}
|
7
|
+
# {{ .Container.Node.Name }}/{{ .Container.Name }}
|
8
|
+
server {{ .Container.Node.Address.IP }}:{{ .Address.HostPort }};
|
9
|
+
{{/* If there is no swarm node or the port is not published on host, use container's IP:PORT */}}
|
10
|
+
{{ else if .Network }}
|
11
|
+
# {{ .Container.Name }}
|
12
|
+
server {{ .Network.IP }}:{{ .Address.Port }};
|
13
|
+
{{ end }}
|
14
|
+
{{ else if .Network }}
|
15
|
+
# {{ .Container.Name }}
|
16
|
+
{{ if .Network.IP }}
|
17
|
+
server {{ .Network.IP }} down;
|
18
|
+
{{ else }}
|
19
|
+
server 127.0.0.1 down;
|
20
|
+
{{ end }}
|
21
|
+
{{ end }}
|
22
|
+
|
23
|
+
{{ end }}
|
24
|
+
|
25
|
+
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
|
26
|
+
# scheme used to connect to this server
|
27
|
+
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
|
28
|
+
default $http_x_forwarded_proto;
|
29
|
+
'' $scheme;
|
30
|
+
}
|
31
|
+
|
32
|
+
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
|
33
|
+
# server port the client connected to
|
34
|
+
map $http_x_forwarded_port $proxy_x_forwarded_port {
|
35
|
+
default $http_x_forwarded_port;
|
36
|
+
'' $server_port;
|
37
|
+
}
|
38
|
+
|
39
|
+
# If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
|
40
|
+
# Connection header that may have been passed to this server
|
41
|
+
map $http_upgrade $proxy_connection {
|
42
|
+
default upgrade;
|
43
|
+
'' close;
|
44
|
+
}
|
45
|
+
|
46
|
+
# Apply fix for very long server names
|
47
|
+
server_names_hash_bucket_size 128;
|
48
|
+
|
49
|
+
# Default dhparam
|
50
|
+
{{ if (exists "/etc/nginx/dhparam/dhparam.pem") }}
|
51
|
+
ssl_dhparam /etc/nginx/dhparam/dhparam.pem;
|
52
|
+
{{ end }}
|
53
|
+
|
54
|
+
# Set appropriate X-Forwarded-Ssl header
|
55
|
+
map $scheme $proxy_x_forwarded_ssl {
|
56
|
+
default off;
|
57
|
+
https on;
|
58
|
+
}
|
59
|
+
|
60
|
+
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
61
|
+
|
62
|
+
log_format vhost '$host $remote_addr - $remote_user [$time_local] '
|
63
|
+
'"$request" $status $body_bytes_sent '
|
64
|
+
'"$http_referer" "$http_user_agent"';
|
65
|
+
|
66
|
+
access_log off;
|
67
|
+
server_tokens off;
|
68
|
+
|
69
|
+
# Default is client_max_body_size 1M
|
70
|
+
client_max_body_size 5M;
|
71
|
+
|
72
|
+
{{ if $.Env.RESOLVERS }}
|
73
|
+
resolver {{ $.Env.RESOLVERS }};
|
74
|
+
{{ end }}
|
75
|
+
|
76
|
+
{{ if (exists "/etc/nginx/proxy.conf") }}
|
77
|
+
include /etc/nginx/proxy.conf;
|
78
|
+
{{ else }}
|
79
|
+
# HTTP 1.1 support
|
80
|
+
proxy_http_version 1.1;
|
81
|
+
proxy_buffering off;
|
82
|
+
proxy_set_header Host $http_host;
|
83
|
+
proxy_set_header Upgrade $http_upgrade;
|
84
|
+
proxy_set_header Connection $proxy_connection;
|
85
|
+
proxy_set_header X-Real-IP $remote_addr;
|
86
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
87
|
+
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
|
88
|
+
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
|
89
|
+
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
|
90
|
+
|
91
|
+
# Mitigate httpoxy attack (see README for details)
|
92
|
+
proxy_set_header Proxy "";
|
93
|
+
{{ end }}
|
94
|
+
|
95
|
+
{{ $enable_ipv6 := eq (or ($.Env.ENABLE_IPV6) "") "true" }}
|
96
|
+
server {
|
97
|
+
server_name _; # This is just an invalid value which will never trigger on a real hostname.
|
98
|
+
listen 80;
|
99
|
+
{{ if $enable_ipv6 }}
|
100
|
+
listen [::]:80;
|
101
|
+
{{ end }}
|
102
|
+
access_log /var/log/nginx/access.log vhost;
|
103
|
+
return 503;
|
104
|
+
}
|
105
|
+
|
106
|
+
{{ if (and (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }}
|
107
|
+
server {
|
108
|
+
server_name _; # This is just an invalid value which will never trigger on a real hostname.
|
109
|
+
listen 443 ssl http2;
|
110
|
+
{{ if $enable_ipv6 }}
|
111
|
+
listen [::]:443 ssl http2;
|
112
|
+
{{ end }}
|
113
|
+
access_log /var/log/nginx/access.log vhost;
|
114
|
+
return 503;
|
115
|
+
|
116
|
+
ssl_session_tickets off;
|
117
|
+
ssl_certificate /etc/nginx/certs/default.crt;
|
118
|
+
ssl_certificate_key /etc/nginx/certs/default.key;
|
119
|
+
}
|
120
|
+
{{ end }}
|
121
|
+
|
122
|
+
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
|
123
|
+
|
124
|
+
{{ $host := trim $host }}
|
125
|
+
{{ $is_regexp := hasPrefix "~" $host }}
|
126
|
+
{{ $upstream_name := when $is_regexp (sha1 $host) $host }}
|
127
|
+
|
128
|
+
# {{ $host }}
|
129
|
+
upstream {{ $upstream_name }} {
|
130
|
+
|
131
|
+
{{ range $container := $containers }}
|
132
|
+
{{ $addrLen := len $container.Addresses }}
|
133
|
+
|
134
|
+
{{ range $knownNetwork := $CurrentContainer.Networks }}
|
135
|
+
{{ range $containerNetwork := $container.Networks }}
|
136
|
+
{{ if (and (ne $containerNetwork.Name "ingress") (or (eq $knownNetwork.Name $containerNetwork.Name) (eq $knownNetwork.Name "host"))) }}
|
137
|
+
## Can be connected with "{{ $containerNetwork.Name }}" network
|
138
|
+
|
139
|
+
{{/* If only 1 port exposed, use that */}}
|
140
|
+
{{ if eq $addrLen 1 }}
|
141
|
+
{{ $address := index $container.Addresses 0 }}
|
142
|
+
{{ template "upstream" (dict "Container" $container "Address" $address "Network" $containerNetwork) }}
|
143
|
+
{{/* If more than one port exposed, use the one matching VIRTUAL_PORT env var, falling back to standard web port 80 */}}
|
144
|
+
{{ else }}
|
145
|
+
{{ $port := coalesce $container.Env.VIRTUAL_PORT "80" }}
|
146
|
+
{{ $address := where $container.Addresses "Port" $port | first }}
|
147
|
+
{{ template "upstream" (dict "Container" $container "Address" $address "Network" $containerNetwork) }}
|
148
|
+
{{ end }}
|
149
|
+
{{ else }}
|
150
|
+
# Cannot connect to network of this container
|
151
|
+
server 127.0.0.1 down;
|
152
|
+
{{ end }}
|
153
|
+
{{ end }}
|
154
|
+
{{ end }}
|
155
|
+
{{ end }}
|
156
|
+
}
|
157
|
+
|
158
|
+
{{ $default_host := or ($.Env.DEFAULT_HOST) "" }}
|
159
|
+
{{ $default_server := index (dict $host "" $default_host "default_server") $host }}
|
160
|
+
|
161
|
+
{{/* Get the VIRTUAL_PROTO defined by containers w/ the same vhost, falling back to "http" */}}
|
162
|
+
{{ $proto := trim (or (first (groupByKeys $containers "Env.VIRTUAL_PROTO")) "http") }}
|
163
|
+
|
164
|
+
{{/* Get the NETWORK_ACCESS defined by containers w/ the same vhost, falling back to "external" */}}
|
165
|
+
{{ $network_tag := or (first (groupByKeys $containers "Env.NETWORK_ACCESS")) "external" }}
|
166
|
+
|
167
|
+
{{/* Get the HTTPS_METHOD defined by containers w/ the same vhost, falling back to "redirect" */}}
|
168
|
+
{{ $https_method := or (first (groupByKeys $containers "Env.HTTPS_METHOD")) "redirect" }}
|
169
|
+
|
170
|
+
{{/* Get the SSL_POLICY defined by containers w/ the same vhost, falling back to "Mozilla-Intermediate" */}}
|
171
|
+
{{ $ssl_policy := or (first (groupByKeys $containers "Env.SSL_POLICY")) "Mozilla-Intermediate" }}
|
172
|
+
|
173
|
+
{{/* Get the HSTS defined by containers w/ the same vhost, falling back to "max-age=31536000" */}}
|
174
|
+
{{ $hsts := or (first (groupByKeys $containers "Env.HSTS")) "max-age=31536000" }}
|
175
|
+
|
176
|
+
{{/* Get the VIRTUAL_ROOT By containers w/ use fastcgi root */}}
|
177
|
+
{{ $vhost_root := or (first (groupByKeys $containers "Env.VIRTUAL_ROOT")) "/var/www/public" }}
|
178
|
+
|
179
|
+
|
180
|
+
{{/* Get the first cert name defined by containers w/ the same vhost */}}
|
181
|
+
{{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }}
|
182
|
+
|
183
|
+
{{/* Get the best matching cert by name for the vhost. */}}
|
184
|
+
{{ $vhostCert := (closest (dir "/etc/nginx/certs") (printf "%s.crt" $host))}}
|
185
|
+
|
186
|
+
{{/* vhostCert is actually a filename so remove any suffixes since they are added later */}}
|
187
|
+
{{ $vhostCert := trimSuffix ".crt" $vhostCert }}
|
188
|
+
{{ $vhostCert := trimSuffix ".key" $vhostCert }}
|
189
|
+
|
190
|
+
{{/* Use the cert specified on the container or fallback to the best vhost match */}}
|
191
|
+
{{ $cert := (coalesce $certName $vhostCert) }}
|
192
|
+
|
193
|
+
{{ $is_https := (and (ne $https_method "nohttps") (ne $cert "") (exists (printf "/etc/nginx/certs/%s.crt" $cert)) (exists (printf "/etc/nginx/certs/%s.key" $cert))) }}
|
194
|
+
|
195
|
+
{{ if $is_https }}
|
196
|
+
|
197
|
+
{{ if eq $https_method "redirect" }}
|
198
|
+
server {
|
199
|
+
server_name {{ $host }};
|
200
|
+
listen 80 {{ $default_server }};
|
201
|
+
{{ if $enable_ipv6 }}
|
202
|
+
listen [::]:80 {{ $default_server }};
|
203
|
+
{{ end }}
|
204
|
+
access_log /var/log/nginx/access.log vhost;
|
205
|
+
return 301 https://$host$request_uri;
|
206
|
+
}
|
207
|
+
{{ end }}
|
208
|
+
|
209
|
+
server {
|
210
|
+
server_name {{ $host }};
|
211
|
+
listen 443 ssl http2 {{ $default_server }};
|
212
|
+
{{ if $enable_ipv6 }}
|
213
|
+
listen [::]:443 ssl http2 {{ $default_server }};
|
214
|
+
{{ end }}
|
215
|
+
access_log /var/log/nginx/access.log vhost;
|
216
|
+
|
217
|
+
{{ if eq $network_tag "internal" }}
|
218
|
+
# Only allow traffic from internal clients
|
219
|
+
include /etc/nginx/network_internal.conf;
|
220
|
+
{{ end }}
|
221
|
+
|
222
|
+
{{ if eq $ssl_policy "Mozilla-Modern" }}
|
223
|
+
ssl_protocols TLSv1.2 TLSv1.3;
|
224
|
+
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
|
225
|
+
{{ else if eq $ssl_policy "Mozilla-Intermediate" }}
|
226
|
+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
227
|
+
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS';
|
228
|
+
{{ else if eq $ssl_policy "Mozilla-Old" }}
|
229
|
+
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
230
|
+
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:DES-CBC3-SHA:HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP';
|
231
|
+
{{ else if eq $ssl_policy "AWS-TLS-1-2-2017-01" }}
|
232
|
+
ssl_protocols TLSv1.2 TLSv1.3;
|
233
|
+
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:AES128-GCM-SHA256:AES128-SHA256:AES256-GCM-SHA384:AES256-SHA256';
|
234
|
+
{{ else if eq $ssl_policy "AWS-TLS-1-1-2017-01" }}
|
235
|
+
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
|
236
|
+
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA';
|
237
|
+
{{ else if eq $ssl_policy "AWS-2016-08" }}
|
238
|
+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
239
|
+
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA';
|
240
|
+
{{ else if eq $ssl_policy "AWS-2015-05" }}
|
241
|
+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
242
|
+
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:DES-CBC3-SHA';
|
243
|
+
{{ else if eq $ssl_policy "AWS-2015-03" }}
|
244
|
+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
245
|
+
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:DHE-DSS-AES128-SHA:DES-CBC3-SHA';
|
246
|
+
{{ else if eq $ssl_policy "AWS-2015-02" }}
|
247
|
+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
248
|
+
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:DHE-DSS-AES128-SHA';
|
249
|
+
{{ end }}
|
250
|
+
|
251
|
+
ssl_prefer_server_ciphers on;
|
252
|
+
ssl_session_timeout 5m;
|
253
|
+
ssl_session_cache shared:SSL:50m;
|
254
|
+
ssl_session_tickets off;
|
255
|
+
|
256
|
+
ssl_certificate /etc/nginx/certs/{{ (printf "%s.crt" $cert) }};
|
257
|
+
ssl_certificate_key /etc/nginx/certs/{{ (printf "%s.key" $cert) }};
|
258
|
+
|
259
|
+
{{ if (exists (printf "/etc/nginx/certs/%s.dhparam.pem" $cert)) }}
|
260
|
+
ssl_dhparam {{ printf "/etc/nginx/certs/%s.dhparam.pem" $cert }};
|
261
|
+
{{ end }}
|
262
|
+
|
263
|
+
{{ if (exists (printf "/etc/nginx/certs/%s.chain.pem" $cert)) }}
|
264
|
+
ssl_stapling on;
|
265
|
+
ssl_stapling_verify on;
|
266
|
+
ssl_trusted_certificate {{ printf "/etc/nginx/certs/%s.chain.pem" $cert }};
|
267
|
+
{{ end }}
|
268
|
+
|
269
|
+
{{ if (and (ne $https_method "noredirect") (ne $hsts "off")) }}
|
270
|
+
add_header Strict-Transport-Security "{{ trim $hsts }}" always;
|
271
|
+
{{ end }}
|
272
|
+
|
273
|
+
{{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }}
|
274
|
+
include {{ printf "/etc/nginx/vhost.d/%s" $host }};
|
275
|
+
{{ else if (exists "/etc/nginx/vhost.d/default") }}
|
276
|
+
include /etc/nginx/vhost.d/default;
|
277
|
+
{{ end }}
|
278
|
+
|
279
|
+
location / {
|
280
|
+
{{ if eq $proto "uwsgi" }}
|
281
|
+
include uwsgi_params;
|
282
|
+
uwsgi_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
283
|
+
{{ else if eq $proto "fastcgi" }}
|
284
|
+
root {{ trim $vhost_root }};
|
285
|
+
include fastcgi.conf;
|
286
|
+
fastcgi_pass {{ trim $upstream_name }};
|
287
|
+
{{ else }}
|
288
|
+
set {{`$proxy_pass_url`}} {{ trim $proto }}://{{ trim $upstream_name }};
|
289
|
+
if ({{`$cookie_appenv`}}) {
|
290
|
+
set {{`$proxy_pass_url`}} {{ trim $proto }}://{{`$cookie_appenv`}}.{{ trim $upstream_name }};
|
291
|
+
}
|
292
|
+
proxy_pass {{`$proxy_pass_url`}};
|
293
|
+
{{ end }}
|
294
|
+
|
295
|
+
{{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }}
|
296
|
+
auth_basic "Restricted {{ $host }}";
|
297
|
+
auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }};
|
298
|
+
{{ end }}
|
299
|
+
{{ if (exists (printf "/etc/nginx/vhost.d/%s_location" $host)) }}
|
300
|
+
include {{ printf "/etc/nginx/vhost.d/%s_location" $host}};
|
301
|
+
{{ else if (exists "/etc/nginx/vhost.d/default_location") }}
|
302
|
+
include /etc/nginx/vhost.d/default_location;
|
303
|
+
{{ end }}
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
307
|
+
{{ end }}
|
308
|
+
|
309
|
+
{{ if or (not $is_https) (eq $https_method "noredirect") }}
|
310
|
+
|
311
|
+
server {
|
312
|
+
server_name {{ $host }};
|
313
|
+
listen 80 {{ $default_server }};
|
314
|
+
{{ if $enable_ipv6 }}
|
315
|
+
listen [::]:80 {{ $default_server }};
|
316
|
+
{{ end }}
|
317
|
+
access_log /var/log/nginx/access.log vhost;
|
318
|
+
|
319
|
+
{{ if eq $network_tag "internal" }}
|
320
|
+
# Only allow traffic from internal clients
|
321
|
+
include /etc/nginx/network_internal.conf;
|
322
|
+
{{ end }}
|
323
|
+
|
324
|
+
{{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }}
|
325
|
+
include {{ printf "/etc/nginx/vhost.d/%s" $host }};
|
326
|
+
{{ else if (exists "/etc/nginx/vhost.d/default") }}
|
327
|
+
include /etc/nginx/vhost.d/default;
|
328
|
+
{{ end }}
|
329
|
+
|
330
|
+
location / {
|
331
|
+
{{ if eq $proto "uwsgi" }}
|
332
|
+
include uwsgi_params;
|
333
|
+
uwsgi_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
334
|
+
{{ else if eq $proto "fastcgi" }}
|
335
|
+
root {{ trim $vhost_root }};
|
336
|
+
include fastcgi.conf;
|
337
|
+
fastcgi_pass {{ trim $upstream_name }};
|
338
|
+
{{ else }}
|
339
|
+
set {{`$proxy_pass_url`}} {{ trim $proto }}://{{ trim $upstream_name }};
|
340
|
+
if ({{`$cookie_appenv`}}) {
|
341
|
+
set {{`$proxy_pass_url`}} {{ trim $proto }}://{{`$cookie_appenv`}}.{{ trim $upstream_name }};
|
342
|
+
}
|
343
|
+
proxy_pass {{`$proxy_pass_url`}};
|
344
|
+
{{ end }}
|
345
|
+
{{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }}
|
346
|
+
auth_basic "Restricted {{ $host }}";
|
347
|
+
auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }};
|
348
|
+
{{ end }}
|
349
|
+
{{ if (exists (printf "/etc/nginx/vhost.d/%s_location" $host)) }}
|
350
|
+
include {{ printf "/etc/nginx/vhost.d/%s_location" $host}};
|
351
|
+
{{ else if (exists "/etc/nginx/vhost.d/default_location") }}
|
352
|
+
include /etc/nginx/vhost.d/default_location;
|
353
|
+
{{ end }}
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
357
|
+
{{ if (and (not $is_https) (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }}
|
358
|
+
server {
|
359
|
+
server_name {{ $host }};
|
360
|
+
listen 443 ssl http2 {{ $default_server }};
|
361
|
+
{{ if $enable_ipv6 }}
|
362
|
+
listen [::]:443 ssl http2 {{ $default_server }};
|
363
|
+
{{ end }}
|
364
|
+
access_log /var/log/nginx/access.log vhost;
|
365
|
+
return 500;
|
366
|
+
|
367
|
+
ssl_certificate /etc/nginx/certs/default.crt;
|
368
|
+
ssl_certificate_key /etc/nginx/certs/default.key;
|
369
|
+
}
|
370
|
+
{{ end }}
|
371
|
+
|
372
|
+
{{ end }}
|
373
|
+
{{ end }}
|