j1-template 2020.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (921) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +79 -0
  4. data/_includes/themes/j1/blocks/footer/boxes/about_box.proc +46 -0
  5. data/_includes/themes/j1/blocks/footer/boxes/about_box.proc.org +40 -0
  6. data/_includes/themes/j1/blocks/footer/boxes/contacts_box.proc +55 -0
  7. data/_includes/themes/j1/blocks/footer/boxes/issue.proc +38 -0
  8. data/_includes/themes/j1/blocks/footer/boxes/legal_statements.proc +63 -0
  9. data/_includes/themes/j1/blocks/footer/boxes/links_box.proc +50 -0
  10. data/_includes/themes/j1/blocks/footer/boxes/news_box.proc +61 -0
  11. data/_includes/themes/j1/blocks/footer/boxes/social_media_icons.proc +37 -0
  12. data/_includes/themes/j1/blocks/footer/generator.html +145 -0
  13. data/_includes/themes/j1/layouts/content_generator_app.html +32 -0
  14. data/_includes/themes/j1/layouts/content_generator_blog_archive.html +242 -0
  15. data/_includes/themes/j1/layouts/content_generator_collection.html +131 -0
  16. data/_includes/themes/j1/layouts/content_generator_page.html +138 -0
  17. data/_includes/themes/j1/layouts/content_generator_post.html +228 -0
  18. data/_includes/themes/j1/layouts/content_generator_raw.html +33 -0
  19. data/_includes/themes/j1/layouts/layout_metadata_generator.html +118 -0
  20. data/_includes/themes/j1/layouts/layout_module_generator.html +46 -0
  21. data/_includes/themes/j1/layouts/layout_resource_generator.html +49 -0
  22. data/_includes/themes/j1/modules/attics/generator.html +153 -0
  23. data/_includes/themes/j1/modules/boards/news_pin_board.html +183 -0
  24. data/_includes/themes/j1/modules/connectors/ad/custom-provider.html +33 -0
  25. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +38 -0
  26. data/_includes/themes/j1/modules/connectors/ads +50 -0
  27. data/_includes/themes/j1/modules/connectors/analytic/custom-provider.html +32 -0
  28. data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +38 -0
  29. data/_includes/themes/j1/modules/connectors/analytics +45 -0
  30. data/_includes/themes/j1/modules/connectors/comment/custom-provider.html +31 -0
  31. data/_includes/themes/j1/modules/connectors/comment/disqus.html +61 -0
  32. data/_includes/themes/j1/modules/connectors/comment/facebook.html +31 -0
  33. data/_includes/themes/j1/modules/connectors/comments +46 -0
  34. data/_includes/themes/j1/modules/connectors/sharing +29 -0
  35. data/_includes/themes/j1/modules/connectors/translator +45 -0
  36. data/_includes/themes/j1/modules/connectors/translators/custom-translator.html +32 -0
  37. data/_includes/themes/j1/modules/connectors/translators/google-translator.html +49 -0
  38. data/_includes/themes/j1/modules/navigator/generator.html +202 -0
  39. data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +114 -0
  40. data/_includes/themes/j1/modules/search/algolia.html +181 -0
  41. data/_includes/themes/j1/modules/search/docsearch.html +42 -0
  42. data/_includes/themes/j1/procedures/collections/create_collection_article_preview.proc +69 -0
  43. data/_includes/themes/j1/procedures/global/collect_frontmatter_options.proc +60 -0
  44. data/_includes/themes/j1/procedures/global/collect_page_options.proc +66 -0
  45. data/_includes/themes/j1/procedures/global/create_bs_button.proc +129 -0
  46. data/_includes/themes/j1/procedures/global/create_word_cloud.proc +95 -0
  47. data/_includes/themes/j1/procedures/global/get_category.proc +60 -0
  48. data/_includes/themes/j1/procedures/global/get_category_item.proc +80 -0
  49. data/_includes/themes/j1/procedures/global/get_documents_dir.proc +67 -0
  50. data/_includes/themes/j1/procedures/global/get_page_path.proc +69 -0
  51. data/_includes/themes/j1/procedures/global/get_page_url.proc +55 -0
  52. data/_includes/themes/j1/procedures/global/pager.proc +79 -0
  53. data/_includes/themes/j1/procedures/global/select_color.proc +69 -0
  54. data/_includes/themes/j1/procedures/global/select_font_size.proc +86 -0
  55. data/_includes/themes/j1/procedures/global/select_icon_size.proc +82 -0
  56. data/_includes/themes/j1/procedures/global/select_location.proc +119 -0
  57. data/_includes/themes/j1/procedures/global/set_base_vars_folders.proc +37 -0
  58. data/_includes/themes/j1/procedures/global/set_env_entry_document.proc +94 -0
  59. data/_includes/themes/j1/procedures/global/set_image_block.proc +50 -0
  60. data/_includes/themes/j1/procedures/global/setup.proc +53 -0
  61. data/_includes/themes/j1/procedures/layouts/content_writer.proc +112 -0
  62. data/_includes/themes/j1/procedures/layouts/default_writer.proc +162 -0
  63. data/_includes/themes/j1/procedures/layouts/module_writer.proc +270 -0
  64. data/_includes/themes/j1/procedures/layouts/resource_writer.proc +194 -0
  65. data/_includes/themes/j1/procedures/posts/collate_calendar.proc +221 -0
  66. data/_includes/themes/j1/procedures/posts/collate_list.proc +96 -0
  67. data/_includes/themes/j1/procedures/posts/collate_timeline.proc +226 -0
  68. data/_includes/themes/j1/procedures/posts/create_ad_block.proc +56 -0
  69. data/_includes/themes/j1/procedures/posts/create_series_header.proc +96 -0
  70. data/_layouts/app.html +68 -0
  71. data/_layouts/blog_archive.html +60 -0
  72. data/_layouts/collection.html +68 -0
  73. data/_layouts/compress.html +52 -0
  74. data/_layouts/default.html +348 -0
  75. data/_layouts/home.html +90 -0
  76. data/_layouts/page.html +68 -0
  77. data/_layouts/paginator/autopage_category.html +79 -0
  78. data/_layouts/paginator/autopage_collection.html +159 -0
  79. data/_layouts/paginator/autopage_collections_tags.html +87 -0
  80. data/_layouts/paginator/autopage_tags.html +79 -0
  81. data/_layouts/post.html +68 -0
  82. data/_layouts/raw.html +71 -0
  83. data/assets/README.md +0 -0
  84. data/assets/data/authclient.html +373 -0
  85. data/assets/data/banner.html +432 -0
  86. data/assets/data/carousel.json +109 -0
  87. data/assets/data/colors.json +42 -0
  88. data/assets/data/cookie_consent.html +223 -0
  89. data/assets/data/font_sizes.json +42 -0
  90. data/assets/data/footer.html +238 -0
  91. data/assets/data/galleries.json +127 -0
  92. data/assets/data/gallery_customizer.html +150 -0
  93. data/assets/data/jupyter/notebooks/_html/template.full.head.html +75 -0
  94. data/assets/data/jupyter/notebooks/_html/visualisation.html +968 -0
  95. data/assets/data/jupyter/notebooks/html/template.html +50 -0
  96. data/assets/data/jupyter/notebooks/html/visualisation.ok.html +949 -0
  97. data/assets/data/jupyter/notebooks/tutorial.ipynb +169 -0
  98. data/assets/data/jupyter/notebooks/visualisation.ipynb +9413 -0
  99. data/assets/data/mdi_icons.json +14641 -0
  100. data/assets/data/menu.html +469 -0
  101. data/assets/data/messages.yml +131 -0
  102. data/assets/data/panel.html +518 -0
  103. data/assets/data/quicklinks.html +225 -0
  104. data/assets/data/search.yml +131 -0
  105. data/assets/data/sidebar.html +261 -0
  106. data/assets/data/themes.json +59 -0
  107. data/assets/data/twa_v1.json +6978 -0
  108. data/assets/error_pages/HTTP204.html +70 -0
  109. data/assets/error_pages/HTTP400.html +66 -0
  110. data/assets/error_pages/HTTP401.html +67 -0
  111. data/assets/error_pages/HTTP403.html +66 -0
  112. data/assets/error_pages/HTTP404.html +66 -0
  113. data/assets/error_pages/HTTP500.html +66 -0
  114. data/assets/error_pages/HTTP501.html +66 -0
  115. data/assets/error_pages/HTTP502.html +66 -0
  116. data/assets/error_pages/HTTP503.html +67 -0
  117. data/assets/error_pages/HTTP520.html +66 -0
  118. data/assets/error_pages/HTTP521.html +66 -0
  119. data/assets/error_pages/HTTP533.html +66 -0
  120. data/assets/themes/j1/core/css/bootstrap.css +7139 -0
  121. data/assets/themes/j1/core/css/bootstrap.min.css +6 -0
  122. data/assets/themes/j1/core/css/custom.scss +28 -0
  123. data/assets/themes/j1/core/css/globals.css +14523 -0
  124. data/assets/themes/j1/core/css/globals.min.css +1 -0
  125. data/assets/themes/j1/core/css/globals.scss +28 -0
  126. data/assets/themes/j1/core/css/theme_extensions.css +11565 -0
  127. data/assets/themes/j1/core/css/theme_extensions.min.css +1 -0
  128. data/assets/themes/j1/core/css/uno.css +11830 -0
  129. data/assets/themes/j1/core/css/uno.min.css +1 -0
  130. data/assets/themes/j1/core/css/uno.scss +28 -0
  131. data/assets/themes/j1/core/css/vendor.css +46751 -0
  132. data/assets/themes/j1/core/css/vendor.min.css +14 -0
  133. data/assets/themes/j1/core/css/vendor.scss +28 -0
  134. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-brands-400.eot +0 -0
  135. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-brands-400.svg +3459 -0
  136. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-brands-400.ttf +0 -0
  137. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-brands-400.woff +0 -0
  138. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-brands-400.woff2 +0 -0
  139. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-regular-400.eot +0 -0
  140. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-regular-400.svg +803 -0
  141. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-regular-400.ttf +0 -0
  142. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-regular-400.woff +0 -0
  143. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-regular-400.woff2 +0 -0
  144. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-solid-900.eot +0 -0
  145. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-solid-900.svg +4527 -0
  146. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-solid-900.ttf +0 -0
  147. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-solid-900.woff +0 -0
  148. data/assets/themes/j1/core/fonts/fontawesome_5/fonts/fa-solid-900.woff2 +0 -0
  149. data/assets/themes/j1/core/fonts/fontawesome_5/metadata/icons.json +26790 -0
  150. data/assets/themes/j1/core/fonts/fontawesome_5/metadata/icons.yml +9088 -0
  151. data/assets/themes/j1/core/fonts/fontawesome_5/metadata/shims.json +2302 -0
  152. data/assets/themes/j1/core/fonts/fontawesome_5/metadata/shims.yml +292 -0
  153. data/assets/themes/j1/core/fonts/materialdesign_icons/fonts/materialdesignicons-webfont.eot +0 -0
  154. data/assets/themes/j1/core/fonts/materialdesign_icons/fonts/materialdesignicons-webfont.svg +10188 -0
  155. data/assets/themes/j1/core/fonts/materialdesign_icons/fonts/materialdesignicons-webfont.ttf +0 -0
  156. data/assets/themes/j1/core/fonts/materialdesign_icons/fonts/materialdesignicons-webfont.woff +0 -0
  157. data/assets/themes/j1/core/fonts/materialdesign_icons/fonts/materialdesignicons-webfont.woff2 +0 -0
  158. data/assets/themes/j1/core/fonts/materialdesign_icons/license.md +97 -0
  159. data/assets/themes/j1/core/fonts/materialdesign_icons/metadata/icons.json +8186 -0
  160. data/assets/themes/j1/core/fonts/materialdesign_icons/metadata/icons.yml +5857 -0
  161. data/assets/themes/j1/core/fonts/roboto/fonts/OpenSansEmoji.ttf +0 -0
  162. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Black.ttf +0 -0
  163. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-BlackItalic.ttf +0 -0
  164. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Bold.eot +0 -0
  165. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Bold.ttf +0 -0
  166. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Bold.woff +0 -0
  167. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Bold.woff2 +0 -0
  168. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-BoldItalic.ttf +0 -0
  169. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Italic.ttf +0 -0
  170. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Light.eot +0 -0
  171. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Light.ttf +0 -0
  172. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Light.woff +0 -0
  173. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Light.woff2 +0 -0
  174. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-LightItalic.ttf +0 -0
  175. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Medium.eot +0 -0
  176. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Medium.ttf +0 -0
  177. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Medium.woff +0 -0
  178. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Medium.woff2 +0 -0
  179. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-MediumItalic.ttf +0 -0
  180. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Regular.eot +0 -0
  181. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Regular.ttf +0 -0
  182. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Regular.woff +0 -0
  183. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Regular.woff2 +0 -0
  184. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Thin.eot +0 -0
  185. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Thin.ttf +0 -0
  186. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Thin.woff +0 -0
  187. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-Thin.woff2 +0 -0
  188. data/assets/themes/j1/core/fonts/roboto/fonts/Roboto-ThinItalic.ttf +0 -0
  189. data/assets/themes/j1/core/fonts/roboto/fonts/mplus1mn-bold-ascii.ttf +0 -0
  190. data/assets/themes/j1/core/fonts/roboto/fonts/mplus1mn-bold_italic-ascii.ttf +0 -0
  191. data/assets/themes/j1/core/fonts/roboto/fonts/mplus1mn-italic-ascii.ttf +0 -0
  192. data/assets/themes/j1/core/fonts/roboto/fonts/mplus1mn-regular-ascii-conums.ttf +0 -0
  193. data/assets/themes/j1/core/fonts/roboto/fonts/mplus1p-regular-fallback.ttf +0 -0
  194. data/assets/themes/j1/core/fonts/roboto/fonts/notoserif-bold-subset.ttf +0 -0
  195. data/assets/themes/j1/core/fonts/roboto/fonts/notoserif-bold_italic-subset.ttf +0 -0
  196. data/assets/themes/j1/core/fonts/roboto/fonts/notoserif-italic-subset.ttf +0 -0
  197. data/assets/themes/j1/core/fonts/roboto/fonts/notoserif-regular-subset.ttf +0 -0
  198. data/assets/themes/j1/core/js/template.js +143 -0
  199. data/assets/themes/j1/core/js/template.js.map +1 -0
  200. data/assets/themes/j1/core/js/template.min.js +1 -0
  201. data/exe/j1 +26 -0
  202. data/lib/j1.rb +130 -0
  203. data/lib/j1/command.rb +23 -0
  204. data/lib/j1/commands/generate.rb +154 -0
  205. data/lib/j1/commands/help.rb +32 -0
  206. data/lib/j1/commands/module.rb +69 -0
  207. data/lib/j1/external.rb +59 -0
  208. data/lib/j1/log_adapter.rb +115 -0
  209. data/lib/j1/log_helper.rb +61 -0
  210. data/lib/j1/templates/posts/0000-00-00-welcome-to-j1-template.adoc.erb +72 -0
  211. data/lib/j1/utils.rb +330 -0
  212. data/lib/j1/utils/ansi.rb +59 -0
  213. data/lib/j1/utils/exec.rb +25 -0
  214. data/lib/j1/utils/platforms.rb +80 -0
  215. data/lib/j1/utils/win_tz.rb +73 -0
  216. data/lib/j1/version.rb +3 -0
  217. data/lib/j1_app.rb +105 -0
  218. data/lib/j1_app/j1_auth_manager/auth_manager.rb +1367 -0
  219. data/lib/j1_app/j1_auth_manager/commands.rb +18 -0
  220. data/lib/j1_app/j1_auth_manager/config.rb +238 -0
  221. data/lib/j1_app/j1_auth_manager/error_pages.rb +44 -0
  222. data/lib/j1_app/j1_auth_manager/helpers.rb +166 -0
  223. data/lib/j1_app/j1_auth_manager/helpers_disqus.rb +29 -0
  224. data/lib/j1_app/j1_auth_manager/helpers_facebook.rb +29 -0
  225. data/lib/j1_app/j1_auth_manager/helpers_github.rb +112 -0
  226. data/lib/j1_app/j1_auth_manager/helpers_patreon.rb +29 -0
  227. data/lib/j1_app/j1_auth_manager/helpers_twitter.rb +30 -0
  228. data/lib/j1_app/j1_auth_manager/views/auth_manager_ui.erb +389 -0
  229. data/lib/j1_app/j1_auth_manager/views/auth_manager_ui.erb.kapott +234 -0
  230. data/lib/j1_app/j1_auth_manager/views/auth_manager_ui.new.erb +297 -0
  231. data/lib/j1_app/j1_auth_manager/warden_omniauth.rb +153 -0
  232. data/lib/j1_app/j1_site_manager/static_site.rb +94 -0
  233. data/lib/j1_app/log4r/yamlconfigurator.rb +195 -0
  234. data/lib/j1_app/omniauth/facebook/signed_request.rb +52 -0
  235. data/lib/j1_app/omniauth/strategies/disqus.rb +113 -0
  236. data/lib/j1_app/omniauth/strategies/facebook.rb +212 -0
  237. data/lib/j1_app/omniauth/strategies/github.rb +141 -0
  238. data/lib/j1_app/omniauth/strategies/patreon.rb +129 -0
  239. data/lib/j1_app/omniauth/strategies/twitter.rb +156 -0
  240. data/lib/j1_app/sinatra/extras/cookies.rb +282 -0
  241. data/lib/j1_app/sinatra/extras/index.rb +33 -0
  242. data/lib/starter_web/Gemfile +213 -0
  243. data/lib/starter_web/_config.yml +978 -0
  244. data/lib/starter_web/_data/_defaults/categories.yml +36 -0
  245. data/lib/starter_web/_data/_defaults/colors.yml +612 -0
  246. data/lib/starter_web/_data/_defaults/font_sizes.yml +29 -0
  247. data/lib/starter_web/_data/_defaults/j1_light_gallery.yml +110 -0
  248. data/lib/starter_web/_data/_defaults/resources.yml +942 -0
  249. data/lib/starter_web/_data/_defaults/template_settings.yml +258 -0
  250. data/lib/starter_web/_data/apps/carousel.yml +515 -0
  251. data/lib/starter_web/_data/apps/defaults/carousel.yml +223 -0
  252. data/lib/starter_web/_data/apps/defaults/gallery_customizer.yml +50 -0
  253. data/lib/starter_web/_data/apps/defaults/justified_gallery.yml +72 -0
  254. data/lib/starter_web/_data/apps/defaults/light_gallery.yml +115 -0
  255. data/lib/starter_web/_data/apps/defaults/lightbox.yml +181 -0
  256. data/lib/starter_web/_data/apps/gallery_customizer.yml +47 -0
  257. data/lib/starter_web/_data/apps/justified_gallery.yml +317 -0
  258. data/lib/starter_web/_data/apps/light_gallery.yml +114 -0
  259. data/lib/starter_web/_data/apps/lightbox.yml +181 -0
  260. data/lib/starter_web/_data/blocks/banner.yml +366 -0
  261. data/lib/starter_web/_data/blocks/defaults/banner.yml +253 -0
  262. data/lib/starter_web/_data/blocks/defaults/footer.yml +180 -0
  263. data/lib/starter_web/_data/blocks/defaults/panel.yml +256 -0
  264. data/lib/starter_web/_data/blocks/footer.yml +189 -0
  265. data/lib/starter_web/_data/blocks/panel.yml +348 -0
  266. data/lib/starter_web/_data/builder/blog_navigator.yml +211 -0
  267. data/lib/starter_web/_data/categories.yml +36 -0
  268. data/lib/starter_web/_data/colors.yml +612 -0
  269. data/lib/starter_web/_data/font_sizes.yml +30 -0
  270. data/lib/starter_web/_data/layouts/app.yml +160 -0
  271. data/lib/starter_web/_data/layouts/blog_archive.yml +160 -0
  272. data/lib/starter_web/_data/layouts/collection.yml +187 -0
  273. data/lib/starter_web/_data/layouts/default.yml +232 -0
  274. data/lib/starter_web/_data/layouts/home.yml +270 -0
  275. data/lib/starter_web/_data/layouts/page.yml +186 -0
  276. data/lib/starter_web/_data/layouts/post.yml +187 -0
  277. data/lib/starter_web/_data/layouts/raw.yml +160 -0
  278. data/lib/starter_web/_data/modules/attics.yml +220 -0
  279. data/lib/starter_web/_data/modules/authentication.yml +254 -0
  280. data/lib/starter_web/_data/modules/back2top.yml +40 -0
  281. data/lib/starter_web/_data/modules/cookie_consent.yml +128 -0
  282. data/lib/starter_web/_data/modules/cookiebar.yml +32 -0
  283. data/lib/starter_web/_data/modules/defaults/attics.yml +220 -0
  284. data/lib/starter_web/_data/modules/defaults/authentication.yml +263 -0
  285. data/lib/starter_web/_data/modules/defaults/back2top.yml +147 -0
  286. data/lib/starter_web/_data/modules/defaults/cookie_consent.yml +69 -0
  287. data/lib/starter_web/_data/modules/defaults/cookiebar.yml +79 -0
  288. data/lib/starter_web/_data/modules/defaults/framer.yml +274 -0
  289. data/lib/starter_web/_data/modules/defaults/jekyll_search.yml +149 -0
  290. data/lib/starter_web/_data/modules/defaults/log4javascript.yml +131 -0
  291. data/lib/starter_web/_data/modules/defaults/log4r.yml +171 -0
  292. data/lib/starter_web/_data/modules/defaults/navigator.yml +174 -0
  293. data/lib/starter_web/_data/modules/defaults/smooth_scroll.yml +169 -0
  294. data/lib/starter_web/_data/modules/defaults/stickybits.yml +37 -0
  295. data/lib/starter_web/_data/modules/defaults/themer.yml +168 -0
  296. data/lib/starter_web/_data/modules/defaults/toccer.yml +172 -0
  297. data/lib/starter_web/_data/modules/framer.yml +52 -0
  298. data/lib/starter_web/_data/modules/jekyll_search.yml +51 -0
  299. data/lib/starter_web/_data/modules/log4javascript.yml +131 -0
  300. data/lib/starter_web/_data/modules/log4r.yml +171 -0
  301. data/lib/starter_web/_data/modules/navigator.yml +162 -0
  302. data/lib/starter_web/_data/modules/navigator_menu.yml +276 -0
  303. data/lib/starter_web/_data/modules/smooth_scroll.yml +169 -0
  304. data/lib/starter_web/_data/modules/themer.yml +147 -0
  305. data/lib/starter_web/_data/modules/toccer.yml +172 -0
  306. data/lib/starter_web/_data/pages/builder.yml +87 -0
  307. data/lib/starter_web/_data/plugins/defaults/notebooks.yml +61 -0
  308. data/lib/starter_web/_data/plugins/defaults/paginator.yml +92 -0
  309. data/lib/starter_web/_data/plugins/notebooks.yml +70 -0
  310. data/lib/starter_web/_data/plugins/paginator.yml +52 -0
  311. data/lib/starter_web/_data/private.yml +231 -0
  312. data/lib/starter_web/_data/resources.yml +861 -0
  313. data/lib/starter_web/_data/template_settings.yml +294 -0
  314. data/lib/starter_web/_data/utilities/defaults/util_srv.yml +41 -0
  315. data/lib/starter_web/_data/utilities/util_srv.yml +97 -0
  316. data/lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-answer.rb +48 -0
  317. data/lib/starter_web/_plugins/asciidoctor-extensions/admonition-block-question.rb +48 -0
  318. data/lib/starter_web/_plugins/asciidoctor-extensions/callout.rb +9 -0
  319. data/lib/starter_web/_plugins/asciidoctor-extensions/carousel-block.rb +46 -0
  320. data/lib/starter_web/_plugins/asciidoctor-extensions/conum.rb +9 -0
  321. data/lib/starter_web/_plugins/asciidoctor-extensions/fab-icon-inline.rb +33 -0
  322. data/lib/starter_web/_plugins/asciidoctor-extensions/fas-icon-inline.rb +33 -0
  323. data/lib/starter_web/_plugins/asciidoctor-extensions/gallery-block.rb +44 -0
  324. data/lib/starter_web/_plugins/asciidoctor-extensions/gist-block.rb +52 -0
  325. data/lib/starter_web/_plugins/asciidoctor-extensions/iconify-icon-inline.rb +33 -0
  326. data/lib/starter_web/_plugins/asciidoctor-extensions/lightbox-block.rb +85 -0
  327. data/lib/starter_web/_plugins/asciidoctor-extensions/lorem-inline.rb +65 -0
  328. data/lib/starter_web/_plugins/asciidoctor-extensions/mdi-icon-inline.rb +33 -0
  329. data/lib/starter_web/_plugins/asciidoctor-extensions/shout-block.rb +47 -0
  330. data/lib/starter_web/_plugins/asciidoctor-extensions/twitter-emoji-inline.rb +37 -0
  331. data/lib/starter_web/_plugins/debug.rb +63 -0
  332. data/lib/starter_web/_plugins/filters.rb +320 -0
  333. data/lib/starter_web/_plugins/prettify.rb +45 -0
  334. data/lib/starter_web/_plugins/simple_search_filter.rb +33 -0
  335. data/lib/starter_web/_plugins/symlink_watcher.rb +52 -0
  336. data/lib/starter_web/apps/public/cc +1650 -0
  337. data/lib/starter_web/assets/images/collections/blog/featured/jekyll.1200x400.png +0 -0
  338. data/lib/starter_web/assets/images/collections/blog/featured/jekyll.png +0 -0
  339. data/lib/starter_web/assets/images/collections/blog/featured/staticgen.jpg +0 -0
  340. data/lib/starter_web/assets/images/collections/blog/featured/welcome-to-j1-template.jpg +0 -0
  341. data/lib/starter_web/assets/images/collections/blog/featured/what-is-a-baseurl.jpg +0 -0
  342. data/lib/starter_web/assets/images/collections/blog/series/j1_using_docker/j1_docker_banner.1280x500.png +0 -0
  343. data/lib/starter_web/assets/images/collections/blog/series/j1_using_docker/kinematic_alpha.1280x600.png +0 -0
  344. data/lib/starter_web/assets/images/collections/blog/series/j1_using_docker/kinematic_j1.1280x300.png +0 -0
  345. data/lib/starter_web/assets/images/collections/blog/series/j1_using_docker/windows_docker_banner.1280x500.png +0 -0
  346. data/lib/starter_web/assets/images/collections/blog/wikipedia/columbia-river.1200x400.jpg +0 -0
  347. data/lib/starter_web/assets/images/collections/blog/wikipedia/minneapolis.1200x400.jpg +0 -0
  348. data/lib/starter_web/assets/images/collections/blog/wikipedia/narcise-snake-pits.1200x400.jpg +0 -0
  349. data/lib/starter_web/assets/images/modules/attics/aditya-joshi-1920x1280.jpg +0 -0
  350. data/lib/starter_web/assets/images/modules/attics/admin-dashboard-bootstrap-1280x600.png +0 -0
  351. data/lib/starter_web/assets/images/modules/attics/alex-holyoake-1920x1280.jpg +0 -0
  352. data/lib/starter_web/assets/images/modules/attics/anaya-katlego-1920x1280.jpg +0 -0
  353. data/lib/starter_web/assets/images/modules/attics/antonella-lombardi-1920x1280.jpg +0 -0
  354. data/lib/starter_web/assets/images/modules/attics/antonino-visalli-1920x1280.jpg +0 -0
  355. data/lib/starter_web/assets/images/modules/attics/banner/admin-dashboard-bootstrap-1280x800-bw.jpg +0 -0
  356. data/lib/starter_web/assets/images/modules/attics/banner/docker-1280x600-bw.jpg +0 -0
  357. data/lib/starter_web/assets/images/modules/attics/banner/jekyll.1200x600-bw.jpg +0 -0
  358. data/lib/starter_web/assets/images/modules/attics/banner/library-1920x800-bw.jpg +0 -0
  359. data/lib/starter_web/assets/images/modules/attics/banner/signpost-1920x800-bw.jpg +0 -0
  360. data/lib/starter_web/assets/images/modules/attics/banner/water-journal-1280x600.jpg +0 -0
  361. data/lib/starter_web/assets/images/modules/attics/banner/write-1280x600-bw.jpg +0 -0
  362. data/lib/starter_web/assets/images/modules/attics/brandon-mowinkel-1920x1280.jpg +0 -0
  363. data/lib/starter_web/assets/images/modules/attics/building-blocks-1920x1280-bw.jpg +0 -0
  364. data/lib/starter_web/assets/images/modules/attics/cookies-1920x1200-bw.jpg +0 -0
  365. data/lib/starter_web/assets/images/modules/attics/daniel-jensen-1920x1280.jpg +0 -0
  366. data/lib/starter_web/assets/images/modules/attics/giammarco-boscaro-1920x1280.jpg +0 -0
  367. data/lib/starter_web/assets/images/modules/attics/go-up-1920x1280-bw.jpg +0 -0
  368. data/lib/starter_web/assets/images/modules/attics/ian-schneider-1920x1280.jpg +0 -0
  369. data/lib/starter_web/assets/images/modules/attics/ideas-start-here-1920x1280-bw.jpg +0 -0
  370. data/lib/starter_web/assets/images/modules/attics/jason-rosewell-1920x1280.jpg +0 -0
  371. data/lib/starter_web/assets/images/modules/attics/jessica-ruscello-1920x1280.jpg +0 -0
  372. data/lib/starter_web/assets/images/modules/attics/lianhao-1920x1280.jpg +0 -0
  373. data/lib/starter_web/assets/images/modules/attics/library-1920x1280-bw.jpg +0 -0
  374. data/lib/starter_web/assets/images/modules/attics/mae-mu-Vf9gbsLZyf0-unsplash.jpg +0 -0
  375. data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280-v.jpg +0 -0
  376. data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280.jpg +0 -0
  377. data/lib/starter_web/assets/images/modules/attics/matthaeus-1920x1280.jpg +0 -0
  378. data/lib/starter_web/assets/images/modules/attics/nousnou-iwasaki-1920x1280.jpg +0 -0
  379. data/lib/starter_web/assets/images/modules/attics/premium-1920x1280-bw.jpg +0 -0
  380. data/lib/starter_web/assets/images/modules/attics/robert-v-ruggiero-1920x1280.jpg +0 -0
  381. data/lib/starter_web/assets/images/modules/attics/romain-vignes-1920x1280.jpg +0 -0
  382. data/lib/starter_web/assets/images/modules/attics/runner-1920x1200-bw.jpg +0 -0
  383. data/lib/starter_web/assets/images/modules/attics/spider-web-1920x1200-bw.jpg +0 -0
  384. data/lib/starter_web/assets/images/modules/attics/the-place-1920x1280-bw.jpg +0 -0
  385. data/lib/starter_web/assets/images/modules/attics/welcome-1920x1280-bw.jpg +0 -0
  386. data/lib/starter_web/assets/images/modules/carousel/cats/cat-1.jpg +0 -0
  387. data/lib/starter_web/assets/images/modules/carousel/cats/cat-2.jpg +0 -0
  388. data/lib/starter_web/assets/images/modules/carousel/cats/cat-3.jpg +0 -0
  389. data/lib/starter_web/assets/images/modules/carousel/cats/cat-4.jpg +0 -0
  390. data/lib/starter_web/assets/images/modules/carousel/cats/cat-5.jpg +0 -0
  391. data/lib/starter_web/assets/images/modules/carousel/cats/cat-6.jpg +0 -0
  392. data/lib/starter_web/assets/images/modules/carousel/cats/cat-7.jpg +0 -0
  393. data/lib/starter_web/assets/images/modules/carousel/cats/cat-8.jpg +0 -0
  394. data/lib/starter_web/assets/images/modules/carousel/mega_cities/andreas-brucker_b.jpg +0 -0
  395. data/lib/starter_web/assets/images/modules/carousel/mega_cities/denys-nevozhai-1_b.jpg +0 -0
  396. data/lib/starter_web/assets/images/modules/carousel/mega_cities/denys-nevozhai-2_b.jpg +0 -0
  397. data/lib/starter_web/assets/images/modules/carousel/mega_cities/luca-bravo_b.jpg +0 -0
  398. data/lib/starter_web/assets/images/modules/carousel/mega_cities/thomas-tucker_b.jpg +0 -0
  399. data/lib/starter_web/assets/images/modules/gallery/mega_cities/andreas-brucker_b.jpg +0 -0
  400. data/lib/starter_web/assets/images/modules/gallery/mega_cities/banter-snaps_b.jpg +0 -0
  401. data/lib/starter_web/assets/images/modules/gallery/mega_cities/denys-nevozhai-1_b.jpg +0 -0
  402. data/lib/starter_web/assets/images/modules/gallery/mega_cities/denys-nevozhai-2-bw.jpg +0 -0
  403. data/lib/starter_web/assets/images/modules/gallery/mega_cities/denys-nevozhai-2_b.jpg +0 -0
  404. data/lib/starter_web/assets/images/modules/gallery/mega_cities/emmad-mazhari_b.jpg +0 -0
  405. data/lib/starter_web/assets/images/modules/gallery/mega_cities/ethan-brooke_b.jpg +0 -0
  406. data/lib/starter_web/assets/images/modules/gallery/mega_cities/federico-rizzarelli_b.jpg +0 -0
  407. data/lib/starter_web/assets/images/modules/gallery/mega_cities/gints-gailis_b.jpg +0 -0
  408. data/lib/starter_web/assets/images/modules/gallery/mega_cities/johan-mouchet_b.jpg +0 -0
  409. data/lib/starter_web/assets/images/modules/gallery/mega_cities/luca-bravo_b.jpg +0 -0
  410. data/lib/starter_web/assets/images/modules/gallery/mega_cities/oskars-sylwan_b.jpg +0 -0
  411. data/lib/starter_web/assets/images/modules/gallery/mega_cities/steven-diaz_b.jpg +0 -0
  412. data/lib/starter_web/assets/images/modules/gallery/mega_cities/thomas-tucker-bw.jpg +0 -0
  413. data/lib/starter_web/assets/images/modules/gallery/mega_cities/thomas-tucker_b.jpg +0 -0
  414. data/lib/starter_web/assets/images/modules/icons/algolia/search-by-algolia.png +0 -0
  415. data/lib/starter_web/assets/images/modules/icons/asciidoc/logo-512x512.png +0 -0
  416. data/lib/starter_web/assets/images/modules/icons/bootstrap/bootstrap-solid-32x32.png +0 -0
  417. data/lib/starter_web/assets/images/modules/icons/bootstrap/bs-docs-masthead-pattern.png +0 -0
  418. data/lib/starter_web/assets/images/modules/icons/bootstrap/scalable/bootstrap-outline.svg +20 -0
  419. data/lib/starter_web/assets/images/modules/icons/bootstrap/scalable/bootstrap-punchout.svg +18 -0
  420. data/lib/starter_web/assets/images/modules/icons/bootstrap/scalable/bootstrap-solid.svg +17 -0
  421. data/lib/starter_web/assets/images/modules/icons/components/angular.ui.png +0 -0
  422. data/lib/starter_web/assets/images/modules/icons/components/angularjs.png +0 -0
  423. data/lib/starter_web/assets/images/modules/icons/components/aws.png +0 -0
  424. data/lib/starter_web/assets/images/modules/icons/components/bootstrap.png +0 -0
  425. data/lib/starter_web/assets/images/modules/icons/components/c9.png +0 -0
  426. data/lib/starter_web/assets/images/modules/icons/components/chai.png +0 -0
  427. data/lib/starter_web/assets/images/modules/icons/components/emmet.png +0 -0
  428. data/lib/starter_web/assets/images/modules/icons/components/express.png +0 -0
  429. data/lib/starter_web/assets/images/modules/icons/components/git.png +0 -0
  430. data/lib/starter_web/assets/images/modules/icons/components/github.png +0 -0
  431. data/lib/starter_web/assets/images/modules/icons/components/gulp.png +0 -0
  432. data/lib/starter_web/assets/images/modules/icons/components/heroku.png +0 -0
  433. data/lib/starter_web/assets/images/modules/icons/components/htmlcss-1.png +0 -0
  434. data/lib/starter_web/assets/images/modules/icons/components/htmlcss-2.png +0 -0
  435. data/lib/starter_web/assets/images/modules/icons/components/jasmine.png +0 -0
  436. data/lib/starter_web/assets/images/modules/icons/components/javascript.png +0 -0
  437. data/lib/starter_web/assets/images/modules/icons/components/jquery.png +0 -0
  438. data/lib/starter_web/assets/images/modules/icons/components/kanban.png +0 -0
  439. data/lib/starter_web/assets/images/modules/icons/components/leanux.png +0 -0
  440. data/lib/starter_web/assets/images/modules/icons/components/linkedin.png +0 -0
  441. data/lib/starter_web/assets/images/modules/icons/components/mean.png +0 -0
  442. data/lib/starter_web/assets/images/modules/icons/components/mongodb.png +0 -0
  443. data/lib/starter_web/assets/images/modules/icons/components/node.png +0 -0
  444. data/lib/starter_web/assets/images/modules/icons/components/postgresql.png +0 -0
  445. data/lib/starter_web/assets/images/modules/icons/components/protractor.png +0 -0
  446. data/lib/starter_web/assets/images/modules/icons/components/rails.png +0 -0
  447. data/lib/starter_web/assets/images/modules/icons/components/ruby.png +0 -0
  448. data/lib/starter_web/assets/images/modules/icons/components/sass.png +0 -0
  449. data/lib/starter_web/assets/images/modules/icons/components/scrum.png +0 -0
  450. data/lib/starter_web/assets/images/modules/icons/components/twitter.png +0 -0
  451. data/lib/starter_web/assets/images/modules/icons/d1/d1-256x256.png +0 -0
  452. data/lib/starter_web/assets/images/modules/icons/d1/d1-32x32.ico +0 -0
  453. data/lib/starter_web/assets/images/modules/icons/d1/d1-512x512.png +0 -0
  454. data/lib/starter_web/assets/images/modules/icons/d1/d1-64x64.png +0 -0
  455. data/lib/starter_web/assets/images/modules/icons/d1/d1.ico +0 -0
  456. data/lib/starter_web/assets/images/modules/icons/d1/favicon.ico +0 -0
  457. data/lib/starter_web/assets/images/modules/icons/d1/scalable/d1.svg +2020 -0
  458. data/lib/starter_web/assets/images/modules/icons/j1/favicon.ico +0 -0
  459. data/lib/starter_web/assets/images/modules/icons/j1/j1-256x256.png +0 -0
  460. data/lib/starter_web/assets/images/modules/icons/j1/j1-32x32.ico +0 -0
  461. data/lib/starter_web/assets/images/modules/icons/j1/j1-512x512.png +0 -0
  462. data/lib/starter_web/assets/images/modules/icons/j1/j1-64x64.png +0 -0
  463. data/lib/starter_web/assets/images/modules/icons/j1/j1..ico +0 -0
  464. data/lib/starter_web/assets/images/modules/icons/j1/scalable/j1.svg +2027 -0
  465. data/lib/starter_web/assets/images/modules/icons/netlify/nf-logo.png +0 -0
  466. data/lib/starter_web/assets/images/modules/icons/p1/favicon.ico +0 -0
  467. data/lib/starter_web/assets/images/modules/icons/p1/p1-256x256.png +0 -0
  468. data/lib/starter_web/assets/images/modules/icons/p1/p1-32x32.ico +0 -0
  469. data/lib/starter_web/assets/images/modules/icons/p1/p1-512x512.png +0 -0
  470. data/lib/starter_web/assets/images/modules/icons/p1/p1-64x64.png +0 -0
  471. data/lib/starter_web/assets/images/modules/icons/p1/p1.ico +0 -0
  472. data/lib/starter_web/assets/images/modules/icons/p1/scalable/p1.svg +2020 -0
  473. data/lib/starter_web/assets/images/modules/icons/patreon/favicon-16x16.png +0 -0
  474. data/lib/starter_web/assets/images/modules/icons/patreon/favicon-32x32.png +0 -0
  475. data/lib/starter_web/assets/images/modules/icons/social/amazon.png +0 -0
  476. data/lib/starter_web/assets/images/modules/icons/social/behance.png +0 -0
  477. data/lib/starter_web/assets/images/modules/icons/social/blogger.png +0 -0
  478. data/lib/starter_web/assets/images/modules/icons/social/deviantart.png +0 -0
  479. data/lib/starter_web/assets/images/modules/icons/social/dribbble.png +0 -0
  480. data/lib/starter_web/assets/images/modules/icons/social/dropbox.png +0 -0
  481. data/lib/starter_web/assets/images/modules/icons/social/evernote.png +0 -0
  482. data/lib/starter_web/assets/images/modules/icons/social/facebook.png +0 -0
  483. data/lib/starter_web/assets/images/modules/icons/social/forrst.png +0 -0
  484. data/lib/starter_web/assets/images/modules/icons/social/github.png +0 -0
  485. data/lib/starter_web/assets/images/modules/icons/social/googleplus.png +0 -0
  486. data/lib/starter_web/assets/images/modules/icons/social/instagram.png +0 -0
  487. data/lib/starter_web/assets/images/modules/icons/social/jolicloud.png +0 -0
  488. data/lib/starter_web/assets/images/modules/icons/social/last-fm.png +0 -0
  489. data/lib/starter_web/assets/images/modules/icons/social/linkedin.png +0 -0
  490. data/lib/starter_web/assets/images/modules/icons/social/picasa.png +0 -0
  491. data/lib/starter_web/assets/images/modules/icons/social/pintrest.png +0 -0
  492. data/lib/starter_web/assets/images/modules/icons/social/rss.png +0 -0
  493. data/lib/starter_web/assets/images/modules/icons/social/skype.png +0 -0
  494. data/lib/starter_web/assets/images/modules/icons/social/spotify.png +0 -0
  495. data/lib/starter_web/assets/images/modules/icons/social/stumbleupon.png +0 -0
  496. data/lib/starter_web/assets/images/modules/icons/social/tumblr.png +0 -0
  497. data/lib/starter_web/assets/images/modules/icons/social/twitter.png +0 -0
  498. data/lib/starter_web/assets/images/modules/icons/social/vimeo.png +0 -0
  499. data/lib/starter_web/assets/images/modules/icons/social/vk.png +0 -0
  500. data/lib/starter_web/assets/images/modules/icons/social/wordpress.png +0 -0
  501. data/lib/starter_web/assets/images/modules/icons/social/xing.png +0 -0
  502. data/lib/starter_web/assets/images/modules/icons/social/yahoo.png +0 -0
  503. data/lib/starter_web/assets/images/modules/icons/social/youtube.png +0 -0
  504. data/lib/starter_web/assets/images/modules/lightbox/close.png +0 -0
  505. data/lib/starter_web/assets/images/modules/lightbox/loading.gif +0 -0
  506. data/lib/starter_web/assets/images/modules/lightbox/next.png +0 -0
  507. data/lib/starter_web/assets/images/modules/lightbox/prev.png +0 -0
  508. data/lib/starter_web/assets/images/modules/patterns/1x1.png +0 -0
  509. data/lib/starter_web/assets/images/modules/patterns/gridtile.png +0 -0
  510. data/lib/starter_web/assets/images/pages/j1_webhooks/000_browser_console-1280x600.jpg +0 -0
  511. data/lib/starter_web/assets/images/pages/j1_webhooks/001_smee_channel-1280x400.jpg +0 -0
  512. data/lib/starter_web/assets/images/pages/j1_webhooks/002_gh_repo_settings-1280x800.jpg +0 -0
  513. data/lib/starter_web/assets/images/pages/j1_webhooks/003_gh_webhook_settings-1280x1000.jpg +0 -0
  514. data/lib/starter_web/assets/images/pages/j1_webhooks/004_gh_webhook_settings-post-1280x600.jpg +0 -0
  515. data/lib/starter_web/assets/images/pages/j1_webhooks/005_smee_channel_ping_receive-1280x800.jpg +0 -0
  516. data/lib/starter_web/assets/images/pages/j1_webhooks/006_gh_redeliver_payload-1280x900.jpg +0 -0
  517. data/lib/starter_web/assets/images/pages/j1_webhooks/007_receive_redelivered_payload-1280x800.jpg +0 -0
  518. data/lib/starter_web/assets/images/pages/j1_webhooks/base/000_browser_console.jpg +0 -0
  519. data/lib/starter_web/assets/images/pages/j1_webhooks/base/000_smee_channel.jpg +0 -0
  520. data/lib/starter_web/assets/images/pages/j1_webhooks/base/002_gh_repo-settings.jpg +0 -0
  521. data/lib/starter_web/assets/images/pages/j1_webhooks/base/003_gh_webhook_settings.jpg +0 -0
  522. data/lib/starter_web/assets/images/pages/j1_webhooks/base/004_gh_webhook_settings-post.jpg +0 -0
  523. data/lib/starter_web/assets/images/pages/j1_webhooks/base/005_smee_channel_ping_received.jpg +0 -0
  524. data/lib/starter_web/assets/images/pages/j1_webhooks/base/006_gh_redeliver_payload.jpg +0 -0
  525. data/lib/starter_web/assets/images/pages/j1_webhooks/base/007_receive_redelivered_payload.jpg +0 -0
  526. data/lib/starter_web/assets/images/pages/j1_webhooks/base/webhook_flow.jpg +0 -0
  527. data/lib/starter_web/assets/images/pages/j1_webhooks/flows/webhook_flow-1920x1280.jpg +0 -0
  528. data/lib/starter_web/assets/images/pages/j1_webhooks/scaleable/webhook_flow.svg +432 -0
  529. data/lib/starter_web/assets/images/pages/j1_webhooks/uml/auth_mgmr_signin_request_flow.uxf +632 -0
  530. data/lib/starter_web/assets/images/pages/j1_webhooks/uml/webhook_flow.uxf +648 -0
  531. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/get-started-1920x1280-bw.jpg +0 -0
  532. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/130_layout_inheritance.png +0 -0
  533. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/content_inheritance.png +0 -0
  534. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/content_inheritance_thumb.png +0 -0
  535. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/html_layout.png +0 -0
  536. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/j1-quickstart-windows.png +0 -0
  537. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/j1-template-theme.jpg +0 -0
  538. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/j1_layout.png +0 -0
  539. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/jekyll-minima-theme.png +0 -0
  540. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/lane_inheritance.png +0 -0
  541. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/layout_inheritance.png +0 -0
  542. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/preparations/msys_installation.jpg +0 -0
  543. data/lib/starter_web/assets/images/pages/log4j/apache-log4j-logo.png +0 -0
  544. data/lib/starter_web/assets/images/pages/log4r/code-1920x600.jpg +0 -0
  545. data/lib/starter_web/assets/images/pages/log4r/log4r-logo.png +0 -0
  546. data/lib/starter_web/assets/images/pages/log_expert/image_000.png +0 -0
  547. data/lib/starter_web/assets/images/pages/log_expert/image_001.png +0 -0
  548. data/lib/starter_web/assets/images/pages/log_expert/image_002.png +0 -0
  549. data/lib/starter_web/assets/images/pages/log_expert/image_003.png +0 -0
  550. data/lib/starter_web/assets/images/pages/log_expert/image_004.png +0 -0
  551. data/lib/starter_web/assets/images/pages/log_expert/image_005.png +0 -0
  552. data/lib/starter_web/assets/images/pages/log_expert/image_006.png +0 -0
  553. data/lib/starter_web/assets/images/pages/log_expert/image_007.png +0 -0
  554. data/lib/starter_web/assets/images/pages/log_expert/image_008.png +0 -0
  555. data/lib/starter_web/assets/images/pages/log_expert/image_009.png +0 -0
  556. data/lib/starter_web/assets/images/pages/log_expert/image_010.png +0 -0
  557. data/lib/starter_web/assets/images/pages/log_expert/image_011.png +0 -0
  558. data/lib/starter_web/assets/images/pages/log_expert/image_012.png +0 -0
  559. data/lib/starter_web/assets/images/pages/log_expert/image_013.png +0 -0
  560. data/lib/starter_web/assets/images/pages/log_expert/image_014.png +0 -0
  561. data/lib/starter_web/assets/images/pages/log_expert/image_015.png +0 -0
  562. data/lib/starter_web/assets/images/pages/log_expert/image_016.png +0 -0
  563. data/lib/starter_web/assets/images/pages/log_expert/image_017.png +0 -0
  564. data/lib/starter_web/assets/images/pages/log_expert/image_018.png +0 -0
  565. data/lib/starter_web/assets/images/pages/log_expert/image_019.png +0 -0
  566. data/lib/starter_web/assets/images/pages/log_expert/image_020.png +0 -0
  567. data/lib/starter_web/assets/images/pages/log_expert/image_021.png +0 -0
  568. data/lib/starter_web/assets/images/pages/log_expert/image_022.png +0 -0
  569. data/lib/starter_web/assets/images/pages/log_expert/image_023.png +0 -0
  570. data/lib/starter_web/assets/images/pages/log_expert/image_024.png +0 -0
  571. data/lib/starter_web/assets/images/pages/log_expert/image_025.png +0 -0
  572. data/lib/starter_web/assets/images/pages/log_expert/image_026.png +0 -0
  573. data/lib/starter_web/assets/images/pages/log_expert/image_027.png +0 -0
  574. data/lib/starter_web/assets/images/pages/log_expert/image_028.png +0 -0
  575. data/lib/starter_web/assets/images/pages/log_expert/image_029.png +0 -0
  576. data/lib/starter_web/assets/images/pages/log_expert/image_030.png +0 -0
  577. data/lib/starter_web/assets/images/pages/log_expert/image_031.png +0 -0
  578. data/lib/starter_web/assets/images/pages/log_expert/image_032.png +0 -0
  579. data/lib/starter_web/assets/images/pages/log_expert/image_033.png +0 -0
  580. data/lib/starter_web/assets/images/pages/log_expert/image_034.png +0 -0
  581. data/lib/starter_web/assets/images/pages/log_expert/image_035.png +0 -0
  582. data/lib/starter_web/assets/images/pages/log_expert/image_036.png +0 -0
  583. data/lib/starter_web/assets/images/pages/log_expert/image_037.png +0 -0
  584. data/lib/starter_web/assets/images/pages/log_expert/image_038.png +0 -0
  585. data/lib/starter_web/assets/images/pages/log_expert/image_039.png +0 -0
  586. data/lib/starter_web/assets/images/pages/log_expert/image_040.png +0 -0
  587. data/lib/starter_web/assets/images/pages/log_expert/image_041.png +0 -0
  588. data/lib/starter_web/assets/images/pages/log_expert/image_042.png +0 -0
  589. data/lib/starter_web/assets/images/pages/log_expert/image_043.png +0 -0
  590. data/lib/starter_web/assets/images/pages/log_expert/image_044.png +0 -0
  591. data/lib/starter_web/assets/images/pages/log_expert/image_045.png +0 -0
  592. data/lib/starter_web/assets/images/pages/log_expert/image_046.png +0 -0
  593. data/lib/starter_web/assets/images/pages/log_expert/image_047.png +0 -0
  594. data/lib/starter_web/assets/images/pages/log_expert/image_048.png +0 -0
  595. data/lib/starter_web/assets/images/pages/log_expert/image_049.png +0 -0
  596. data/lib/starter_web/assets/images/pages/log_expert/image_050.png +0 -0
  597. data/lib/starter_web/assets/images/pages/log_expert/image_051.png +0 -0
  598. data/lib/starter_web/assets/images/pages/log_expert/image_052.png +0 -0
  599. data/lib/starter_web/assets/images/pages/log_expert/image_053.png +0 -0
  600. data/lib/starter_web/assets/images/pages/log_expert/image_054.png +0 -0
  601. data/lib/starter_web/assets/images/pages/log_expert/image_055.png +0 -0
  602. data/lib/starter_web/assets/images/pages/log_expert/image_056.png +0 -0
  603. data/lib/starter_web/assets/images/pages/log_expert/image_057.png +0 -0
  604. data/lib/starter_web/assets/images/pages/modals/01_frame_modal.jpg +0 -0
  605. data/lib/starter_web/assets/images/pages/modals/02_site_modal.jpg +0 -0
  606. data/lib/starter_web/assets/images/pages/modals/03_central_modal.jpg +0 -0
  607. data/lib/starter_web/assets/images/pages/modals/04_fluid_modal.jpg +0 -0
  608. data/lib/starter_web/assets/images/pages/pen/jquery/jQuery-logo.png +0 -0
  609. data/lib/starter_web/assets/images/pages/pen/jquery/jquery-banner-1280x600.jpg +0 -0
  610. data/lib/starter_web/assets/images/pages/pen/jquery/jquery-banner-1920x800.jpg +0 -0
  611. data/lib/starter_web/assets/images/pages/pen/jquery/src/JQuery-Logo.svg +122 -0
  612. data/lib/starter_web/assets/images/pages/pen/jquery/src/banner.psd +0 -0
  613. data/lib/starter_web/assets/images/pages/previewer/bs-color-palette.png +0 -0
  614. data/lib/starter_web/assets/images/pages/previewer/material-design-color-palette.jpg +0 -0
  615. data/lib/starter_web/assets/images/pages/previewer/material-design-color-palette.png +0 -0
  616. data/lib/starter_web/assets/images/pages/roundtrip/100_present_images/lightbox-image-1.jpg +0 -0
  617. data/lib/starter_web/assets/images/pages/roundtrip/100_present_images/lightbox-image-2.jpg +0 -0
  618. data/lib/starter_web/assets/images/pages/roundtrip/100_present_images/lightbox-image-3.jpg +0 -0
  619. data/lib/starter_web/assets/images/pages/roundtrip/100_present_images/lightbox-thumb-1.jpg +0 -0
  620. data/lib/starter_web/assets/images/pages/roundtrip/100_present_images/lightbox-thumb-2.jpg +0 -0
  621. data/lib/starter_web/assets/images/pages/roundtrip/100_present_images/lightbox-thumb-3.jpg +0 -0
  622. data/lib/starter_web/assets/images/pages/roundtrip/410_bs_modals_extentions/avatar.jpg +0 -0
  623. data/lib/starter_web/assets/images/pages/roundtrip/410_bs_modals_extentions/marc.jpg +0 -0
  624. data/lib/starter_web/assets/images/pages/roundtrip/bootstrap-1920x1000-bw.jpg +0 -0
  625. data/lib/starter_web/assets/images/pages/roundtrip/cards-1920x1280-bw.jpg +0 -0
  626. data/lib/starter_web/assets/images/pages/roundtrip/emojies-1920x1280-bw.jpg +0 -0
  627. data/lib/starter_web/assets/images/pages/roundtrip/icon-fonts-1920x1280-bw.jpg +0 -0
  628. data/lib/starter_web/assets/images/pages/roundtrip/images-1920x1280-bw.jpg +0 -0
  629. data/lib/starter_web/assets/images/pages/roundtrip/puzzle-1920x1280-bw.jpg +0 -0
  630. data/lib/starter_web/assets/images/pages/roundtrip/tables-1920x1280-bw.jpg +0 -0
  631. data/lib/starter_web/assets/images/pages/roundtrip/themes-1920x1280-bw.jpg +0 -0
  632. data/lib/starter_web/assets/images/pages/roundtrip/typography-1920x1280-bw.jpg +0 -0
  633. data/lib/starter_web/assets/images/quotes/default.png +0 -0
  634. data/lib/starter_web/assets/images/quotes/people.png +0 -0
  635. data/lib/starter_web/assets/themes/j1/adapter/js/attic.js +563 -0
  636. data/lib/starter_web/assets/themes/j1/adapter/js/back2top.js +227 -0
  637. data/lib/starter_web/assets/themes/j1/adapter/js/carousel.js +313 -0
  638. data/lib/starter_web/assets/themes/j1/adapter/js/cookie_consent.js +259 -0
  639. data/lib/starter_web/assets/themes/j1/adapter/js/framer.js +208 -0
  640. data/lib/starter_web/assets/themes/j1/adapter/js/gallery_customizer.js +427 -0
  641. data/lib/starter_web/assets/themes/j1/adapter/js/j1.js +2034 -0
  642. data/lib/starter_web/assets/themes/j1/adapter/js/justified_gallery.js +403 -0
  643. data/lib/starter_web/assets/themes/j1/adapter/js/lightbox.js +181 -0
  644. data/lib/starter_web/assets/themes/j1/adapter/js/logger.js +316 -0
  645. data/lib/starter_web/assets/themes/j1/adapter/js/navigator.js +782 -0
  646. data/lib/starter_web/assets/themes/j1/adapter/js/scroller.js +177 -0
  647. data/lib/starter_web/assets/themes/j1/adapter/js/searcher.js +193 -0
  648. data/lib/starter_web/assets/themes/j1/adapter/js/themer.js +357 -0
  649. data/lib/starter_web/assets/themes/j1/adapter/js/toccer.js +353 -0
  650. data/lib/starter_web/assets/themes/j1/extensions/carousel/css/carousel.css +81 -0
  651. data/lib/starter_web/assets/themes/j1/extensions/carousel/css/carousel.min.css +17 -0
  652. data/lib/starter_web/assets/themes/j1/extensions/carousel/css/carousel_transitions.css +184 -0
  653. data/lib/starter_web/assets/themes/j1/extensions/carousel/css/carousel_transitions.min.css +17 -0
  654. data/lib/starter_web/assets/themes/j1/extensions/carousel/css/theme/uno.css +191 -0
  655. data/lib/starter_web/assets/themes/j1/extensions/carousel/css/theme/uno.min.css +16 -0
  656. data/lib/starter_web/assets/themes/j1/extensions/carousel/images/ajax-loader.gif +0 -0
  657. data/lib/starter_web/assets/themes/j1/extensions/carousel/images/grabbing.png +0 -0
  658. data/lib/starter_web/assets/themes/j1/extensions/carousel/images/owl-logo.png +0 -0
  659. data/lib/starter_web/assets/themes/j1/extensions/carousel/images/owl.video.play.png +0 -0
  660. data/lib/starter_web/assets/themes/j1/extensions/carousel/js/carousel.js +1517 -0
  661. data/lib/starter_web/assets/themes/j1/extensions/carousel/js/carousel.min.js +57 -0
  662. data/lib/starter_web/assets/themes/j1/extensions/iconify/js/iconify.min.js +13 -0
  663. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/examples/frame.absolute.html +86 -0
  664. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/examples/frame.content.html +58 -0
  665. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/examples/frame.hover.html +51 -0
  666. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/examples/frame.nested.html +68 -0
  667. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/examples/frame.textarea.html +46 -0
  668. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/examples/frame.tolerance.html +79 -0
  669. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/examples/index.html +70 -0
  670. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/examples/two.html +71 -0
  671. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.js +1104 -0
  672. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.map +1 -0
  673. data/lib/starter_web/assets/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.min.js +10 -0
  674. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/LICENSE +22 -0
  675. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/README.md +273 -0
  676. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v3.7.0/css/justifiedGallery.css +110 -0
  677. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v3.7.0/css/justifiedGallery.min.css +110 -0
  678. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v3.7.0/css/theme/uno.css +23 -0
  679. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v3.7.0/js/justifiedGallery.3.7.0.js +1229 -0
  680. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v3.7.0/js/justifiedGallery.js +1229 -0
  681. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v3.7.0/js/justifiedGallery.min.js +8 -0
  682. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v3.7.0/less/.csslintrc +20 -0
  683. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v3.7.0/less/justifiedGallery.less +113 -0
  684. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v4.0.0/css/justifiedGallery.css +110 -0
  685. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v4.0.0/css/justifiedGallery.min.css +110 -0
  686. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v4.0.0/css/theme/uno.css +23 -0
  687. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v4.0.0/js/jquery.justifiedGallery.js +1229 -0
  688. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/_versions/v4.0.0/js/jquery.justifiedGallery.min.js +8 -0
  689. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/css/justifiedGallery.css +110 -0
  690. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/css/justifiedGallery.min.css +110 -0
  691. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/css/theme/uno.css +38 -0
  692. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/css/theme/uno.min.css +38 -0
  693. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/js/justifiedGallery.js +1229 -0
  694. data/lib/starter_web/assets/themes/j1/extensions/justified_gallery/js/justifiedGallery.min.js +8 -0
  695. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/core/lg-fb-comment-box.css +58 -0
  696. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/core/lg-fb-comment-box.min.css +5 -0
  697. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/core/lg-transitions.css +778 -0
  698. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/core/lg-transitions.min.css +5 -0
  699. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/core/lightgallery.css +981 -0
  700. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/core/lightgallery.min.css +5 -0
  701. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/fonts/lg.eot +0 -0
  702. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/fonts/lg.svg +47 -0
  703. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/fonts/lg.ttf +0 -0
  704. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/fonts/lg.woff +0 -0
  705. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/img/loading.gif +0 -0
  706. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/img/video-play.png +0 -0
  707. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/img/vimeo-play.png +0 -0
  708. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/img/youtube-play.png +0 -0
  709. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/animation-w.png +0 -0
  710. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/customize-w.png +0 -0
  711. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/dynamic-w.png +0 -0
  712. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/facebook-icon.svg +10 -0
  713. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/googleplus-icon.svg +30 -0
  714. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/html5-w.png +0 -0
  715. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/linked-in.png +0 -0
  716. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/module-w.png +0 -0
  717. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/play-button.png +0 -0
  718. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/responsive-w.png +0 -0
  719. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/thumb-w.png +0 -0
  720. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/touch-w.png +0 -0
  721. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/twitter-icon.svg +15 -0
  722. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/twitter.png +0 -0
  723. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/video1-w.png +0 -0
  724. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/zoom-w.png +0 -0
  725. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/icons/zoom.png +0 -0
  726. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/uno.css +263 -0
  727. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/css/themes/uno.min.css +17 -0
  728. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/core/lightgallery.js +1362 -0
  729. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/core/lightgallery.min.js +5 -0
  730. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/j1/j1-video.js +402 -0
  731. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/j1/j1-video.min.js +8 -0
  732. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-autoplay.js +206 -0
  733. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-autoplay.min.js +5 -0
  734. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-fullscreen.js +126 -0
  735. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-fullscreen.min.js +5 -0
  736. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-hash.js +101 -0
  737. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-hash.min.js +5 -0
  738. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-pager.js +105 -0
  739. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-pager.min.js +5 -0
  740. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-share.js +107 -0
  741. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-share.min.js +5 -0
  742. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-thumbnail.js +478 -0
  743. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-thumbnail.min.js +5 -0
  744. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-video.js +342 -0
  745. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-video.min.js +5 -0
  746. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-zoom.js +527 -0
  747. data/lib/starter_web/assets/themes/j1/extensions/light_gallery/js/modules/lg-zoom.min.js +5 -0
  748. data/lib/starter_web/assets/themes/j1/extensions/log4javascript/log4javascript.js +5826 -0
  749. data/lib/starter_web/assets/themes/j1/extensions/log4javascript/log4javascript.min.js +266 -0
  750. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/base16.dark/theme.css +78 -0
  751. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/base16.light/theme.css +77 -0
  752. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/base16.monokai.dark/theme.css +78 -0
  753. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/base16.monokai.light/theme.css +77 -0
  754. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/base16.monokai/theme.css +78 -0
  755. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/base16.solarized.dark/theme.css +78 -0
  756. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/base16.solarized.light/theme.css +77 -0
  757. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/base16.solarized/theme.css +77 -0
  758. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/base16/theme.css +77 -0
  759. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/colorful/theme.css +170 -0
  760. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/github/theme.css +209 -0
  761. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/gruvbox.dark/theme.css +84 -0
  762. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/gruvbox.light/theme.css +84 -0
  763. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/gruvbox/theme.css +84 -0
  764. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/igorpro/theme.css +32 -0
  765. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/molokai/theme.css +208 -0
  766. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/monokai.sublime/theme.css +187 -0
  767. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/monokai/theme.css +210 -0
  768. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/pastie/theme.css +146 -0
  769. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/thankful_eyes/theme.css +173 -0
  770. data/lib/starter_web/assets/themes/j1/extensions/rouge/css/tulip/theme.css +164 -0
  771. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/themes/city.css +147 -0
  772. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/themes/city.min.css +6 -0
  773. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/themes/fantasy.css +113 -0
  774. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/themes/fantasy.min.css +6 -0
  775. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/themes/forest.css +165 -0
  776. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/themes/forest.min.css +6 -0
  777. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/themes/sea.css +72 -0
  778. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/themes/sea.min.css +6 -0
  779. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/video-js.css +1663 -0
  780. data/lib/starter_web/assets/themes/j1/extensions/videojs/css/video-js.min.css +1 -0
  781. data/lib/starter_web/assets/themes/j1/extensions/videojs/js/video.js +55690 -0
  782. data/lib/starter_web/assets/themes/j1/extensions/videojs/js/video.min.js +28 -0
  783. data/lib/starter_web/assets/themes/j1/extensions/vimeo/froogaloop/js/froogaloop2.min.js +4 -0
  784. data/lib/starter_web/assets/themes/j1/extensions/vimeo/player/js/player.js +2138 -0
  785. data/lib/starter_web/assets/themes/j1/extensions/vimeo/player/js/player.js.map +1 -0
  786. data/lib/starter_web/assets/themes/j1/extensions/vimeo/player/js/player.min.js +2 -0
  787. data/lib/starter_web/assets/themes/j1/extensions/vimeo/player/js/player.min.js.map +1 -0
  788. data/lib/starter_web/assets/videos/gallery/adriana-lima-poster.jpg +0 -0
  789. data/lib/starter_web/assets/videos/gallery/kick-it-old-school-poster.jpg +0 -0
  790. data/lib/starter_web/assets/videos/gallery/video1-poster.jpg +0 -0
  791. data/lib/starter_web/assets/videos/gallery/video1-thumb.jpg +0 -0
  792. data/lib/starter_web/assets/videos/gallery/video2-poster.jpg +0 -0
  793. data/lib/starter_web/assets/videos/gallery/video2-thumb.jpg +0 -0
  794. data/lib/starter_web/assets/videos/gallery/video_adele-poster.jpg +0 -0
  795. data/lib/starter_web/assets/videos/gallery/video_gaga-poster.jpg +0 -0
  796. data/lib/starter_web/assets/videos/gallery/video_gwen-poster.jpg +0 -0
  797. data/lib/starter_web/assets/videos/gallery/video_michelle-poster.jpg +0 -0
  798. data/lib/starter_web/assets/videos/headers/still/underground-broadway.png +0 -0
  799. data/lib/starter_web/assets/videos/headers/still/victoria-oskolovich-on-vimeo.png +0 -0
  800. data/lib/starter_web/collections/posts/private/readme +0 -0
  801. data/lib/starter_web/collections/posts/protected/readme +0 -0
  802. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1-template.adoc.erb +160 -0
  803. data/lib/starter_web/collections/posts/public/featured/_posts/000_includes/attributes.asciidoc +47 -0
  804. data/lib/starter_web/collections/posts/public/featured/_posts/000_includes/unsplash-badge.asciidoc +31 -0
  805. data/lib/starter_web/collections/posts/public/featured/_posts/2019-05-01-top-open-source-static-site-generators.adoc +97 -0
  806. data/lib/starter_web/collections/posts/public/featured/_posts/2019-06-01-about-cookies.adoc +197 -0
  807. data/lib/starter_web/collections/posts/public/jekyll/_posts/2018-05-01-confusion-about-base-url.adoc +105 -0
  808. data/lib/starter_web/collections/posts/public/series/_posts/000_includes/attributes.asciidoc +66 -0
  809. data/lib/starter_web/collections/posts/public/series/_posts/000_includes/documents/100-docker-using-shared-folders.asciidoc +430 -0
  810. data/lib/starter_web/collections/posts/public/series/_posts/000_includes/documents/loop.sh +28 -0
  811. data/lib/starter_web/collections/posts/public/series/_posts/000_includes/tables/debug_variables.asciidoc +48 -0
  812. data/lib/starter_web/collections/posts/public/series/_posts/2018-11-01-docker-using-shared-folders.adoc +504 -0
  813. data/lib/starter_web/collections/posts/public/wikipedia/_posts/000_includes/attributes.asciidoc +46 -0
  814. data/lib/starter_web/collections/posts/public/wikipedia/_posts/000_includes/tables/debug_variables.asciidoc +48 -0
  815. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +126 -0
  816. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +88 -0
  817. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +86 -0
  818. data/lib/starter_web/config.ru +24 -0
  819. data/lib/starter_web/dot.gitattributes +31 -0
  820. data/lib/starter_web/dot.gitignore +55 -0
  821. data/lib/starter_web/dot.nojekyll +19 -0
  822. data/lib/starter_web/favicon.ico +0 -0
  823. data/lib/starter_web/index.html +68 -0
  824. data/lib/starter_web/package.json +136 -0
  825. data/lib/starter_web/pages/private/readme +0 -0
  826. data/lib/starter_web/pages/protected/readme +0 -0
  827. data/lib/starter_web/pages/public/about/about_site.adoc +40 -0
  828. data/lib/starter_web/pages/public/about/become_a_patron.adoc +50 -0
  829. data/lib/starter_web/pages/public/blog/navigator/archive.html +111 -0
  830. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +153 -0
  831. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +133 -0
  832. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +187 -0
  833. data/lib/starter_web/pages/public/blog/navigator/index.html +47 -0
  834. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/000_includes/attributes.asciidoc +174 -0
  835. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/000_includes/documents/100_meet_and_greet_jekyll.asciidoc +31 -0
  836. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/000_includes/documents/200_preparations.asciidoc +14 -0
  837. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/000_includes/documents/300_first_awesome_web.asciidoc +12 -0
  838. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/000_includes/parts.asciidoc +193 -0
  839. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/100_meet_and_greet_jekyll.adoc +79 -0
  840. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/200_preparations.adoc +72 -0
  841. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/300_first_awesome_web.adoc +70 -0
  842. data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour.1.asciidoc +121 -0
  843. data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour.adoc +145 -0
  844. data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour_api.adoc +644 -0
  845. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/attributes.asciidoc +117 -0
  846. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/100_gistblock.asciidoc +27 -0
  847. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_bottom_info.asciidoc +11 -0
  848. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_bottom_left_warning.asciidoc +11 -0
  849. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_bottom_right_danger.asciidoc +11 -0
  850. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_central_success.asciidoc +11 -0
  851. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_full_height_left_info.asciidoc +11 -0
  852. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_full_height_right_success.asciidoc +11 -0
  853. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_table_3_column.asciidoc +47 -0
  854. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_top_info.asciidoc +11 -0
  855. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_top_left_info.asciidoc +11 -0
  856. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/410_top_right_success.asciidoc +11 -0
  857. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/419_advanced_modals_html.asciidoc +928 -0
  858. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +304 -0
  859. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +152 -0
  860. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +524 -0
  861. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +435 -0
  862. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +536 -0
  863. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +128 -0
  864. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +281 -0
  865. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +138 -0
  866. data/lib/starter_web/pages/public/learn/roundtrip/bs_tour.js +98 -0
  867. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/attributes.asciidoc +117 -0
  868. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/100_gistblock.asciidoc +27 -0
  869. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_bottom_info.asciidoc +11 -0
  870. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_bottom_left_warning.asciidoc +11 -0
  871. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_bottom_right_danger.asciidoc +11 -0
  872. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_central_success.asciidoc +11 -0
  873. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_full_height_left_info.asciidoc +11 -0
  874. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_full_height_right_success.asciidoc +11 -0
  875. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_table_3_column.asciidoc +47 -0
  876. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_top_info.asciidoc +11 -0
  877. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_top_left_info.asciidoc +11 -0
  878. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/410_top_right_success.asciidoc +11 -0
  879. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/419_advanced_modals_html.asciidoc +928 -0
  880. data/lib/starter_web/pages/public/learn/vtutorials/000_test_youtube_video.adoc +141 -0
  881. data/lib/starter_web/pages/public/learn/vtutorials/100_basic_video.adoc +109 -0
  882. data/lib/starter_web/pages/public/learn/whats_up.adoc +117 -0
  883. data/lib/starter_web/pages/public/legal/de/100_impress.adoc +97 -0
  884. data/lib/starter_web/pages/public/legal/de/200_terms_of_use.adoc +54 -0
  885. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +300 -0
  886. data/lib/starter_web/pages/public/legal/de/400_license_agreement.adoc +394 -0
  887. data/lib/starter_web/pages/public/legal/de/500_support.adoc +19 -0
  888. data/lib/starter_web/pages/public/legal/en/000_copyright.adoc +89 -0
  889. data/lib/starter_web/pages/public/legal/en/100_impress.adoc +51 -0
  890. data/lib/starter_web/pages/public/legal/en/200_terms_of_use.adoc +48 -0
  891. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +394 -0
  892. data/lib/starter_web/pages/public/legal/en/400_license_agreement.adoc +432 -0
  893. data/lib/starter_web/pages/public/legal/en/500_support.adoc +19 -0
  894. data/lib/starter_web/pages/public/legal/en/eu/cookie.policy.asciidoc +55 -0
  895. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +158 -0
  896. data/lib/starter_web/pages/public/previewer/000_includes/attributes.asciidoc +116 -0
  897. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/100_absolute_sizes.asciidoc +39 -0
  898. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/110_bs_grid_sizes.asciidoc +47 -0
  899. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/120_relative_sizes.asciidoc +87 -0
  900. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/200_rotate.asciidoc +71 -0
  901. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/300_flip.asciidoc +31 -0
  902. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/400_spin_pulsed.asciidoc +39 -0
  903. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/500_bw_color_palette.asciidoc +61 -0
  904. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/510_bs_color_palette.asciidoc +55 -0
  905. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/600_md_color_palette.asciidoc +95 -0
  906. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/601_md_color_palette_indigo.asciidoc +95 -0
  907. data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/602_md_color_palette_pink.asciidoc +95 -0
  908. data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/100_bs_sizes.asciidoc +47 -0
  909. data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/100_relative_sizes.asciidoc +47 -0
  910. data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/200_rotate.asciidoc +71 -0
  911. data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/300_flip.asciidoc +30 -0
  912. data/lib/starter_web/pages/public/previewer/000_includes/tables/twitter_emoji/400_spin_pulsed.asciidoc +31 -0
  913. data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +1858 -0
  914. data/lib/starter_web/pages/public/previewer/iframer.adoc +83 -0
  915. data/lib/starter_web/pages/public/previewer/justified_gallery.html +33 -0
  916. data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +295 -0
  917. data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +195 -0
  918. data/lib/starter_web/utilsrv/_defaults/package.json +52 -0
  919. data/lib/starter_web/utilsrv/package.json +52 -0
  920. data/lib/starter_web/utilsrv/server.js +601 -0
  921. metadata +1213 -0
@@ -0,0 +1,59 @@
1
+ # Frozen-string-literal: true
2
+ # Copyright: 2015 Jekyll - MIT License
3
+ # Encoding: utf-8
4
+
5
+ module J1
6
+ module Utils
7
+ module Ansi
8
+ extend self
9
+
10
+ ESCAPE = format("%c", 27)
11
+ MATCH = %r!#{ESCAPE}\[(?:\d+)(?:;\d+)*(j|k|m|s|u|A|B|G)|\e\(B\e\[m!ix
12
+ COLORS = {
13
+ :red => 31,
14
+ :green => 32,
15
+ :black => 30,
16
+ :magenta => 35,
17
+ :yellow => 33,
18
+ :white => 37,
19
+ :blue => 34,
20
+ :cyan => 36,
21
+ }.freeze
22
+
23
+ # Strip ANSI from the current string. It also strips cursor stuff,
24
+ # well some of it, and it also strips some other stuff that a lot of
25
+ # the other ANSI strippers don't.
26
+
27
+ def strip(str)
28
+ str.gsub MATCH, ""
29
+ end
30
+
31
+ #
32
+
33
+ def has?(str)
34
+ !!(str =~ MATCH)
35
+ end
36
+
37
+ # Reset the color back to the default color so that you do not leak any
38
+ # colors when you move onto the next line. This is probably normally
39
+ # used as part of a wrapper so that we don't leak colors.
40
+
41
+ def reset(str = "")
42
+ @ansi_reset ||= format("%c[0m", 27)
43
+ "#{@ansi_reset}#{str}"
44
+ end
45
+
46
+ # SEE: `self::COLORS` for a list of methods. They are mostly
47
+ # standard base colors supported by pretty much any xterm-color, we do
48
+ # not need more than the base colors so we do not include them.
49
+ # Actually... if I'm honest we don't even need most of the
50
+ # base colors.
51
+
52
+ COLORS.each do |color, num|
53
+ define_method color do |str|
54
+ "#{format("%c", 27)}[#{num}m#{str}#{reset}"
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,25 @@
1
+ require "open3"
2
+
3
+ module J1
4
+ module Utils
5
+ module Exec
6
+ extend self
7
+
8
+ # Runs a program in a sub-shell.
9
+ #
10
+ # *args - a list of strings containing the program name and arguments
11
+ #
12
+ # Returns a Process::Status and a String of output in an array in
13
+ # that order.
14
+ def run(*args)
15
+ stdin, stdout, stderr, process = Open3.popen3(*args)
16
+ out = stdout.read.strip
17
+ err = stderr.read.strip
18
+
19
+ [stdin, stdout, stderr].each(&:close)
20
+ [process.value, out + err]
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,80 @@
1
+ module J1
2
+ module Utils
3
+ module Platforms
4
+ extend self
5
+
6
+ # Provides jruby? and mri? which respectively detect these two types of
7
+ # tested Engines we support, in the future we might probably support the
8
+ # other one that everyone used to talk about.
9
+
10
+ { :jruby? => "jruby", :mri? => "ruby" }.each do |k, v|
11
+ define_method k do
12
+ ::RUBY_ENGINE == v
13
+ end
14
+ end
15
+
16
+ # --
17
+ # Allows you to detect "real" Windows, or what we would consider
18
+ # "real" Windows. That is, that we can pass the basic test and the
19
+ # /proc/version returns nothing to us.
20
+ # --
21
+
22
+ def vanilla_windows?
23
+ RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \
24
+ !proc_version
25
+ end
26
+
27
+ # --
28
+ # XXX: Remove in 4.0
29
+ # --
30
+
31
+ alias_method :really_windows?, \
32
+ :vanilla_windows?
33
+
34
+ #
35
+
36
+ def bash_on_windows?
37
+ RbConfig::CONFIG["host_os"] =~ %r!linux! && \
38
+ proc_version =~ %r!microsoft!i
39
+ end
40
+
41
+ #
42
+
43
+ def windows?
44
+ vanilla_windows? || bash_on_windows?
45
+ end
46
+
47
+ #
48
+
49
+ def linux?
50
+ RbConfig::CONFIG["host_os"] =~ %r!linux! && \
51
+ proc_version !~ %r!microsoft!i
52
+ end
53
+
54
+ # Provides windows?, linux?, osx?, unix? so that we can detect
55
+ # platforms. This is mostly useful for `jekyll doctor` and for testing
56
+ # where we kick off certain tests based on the platform.
57
+
58
+ { :osx? => %r!darwin|mac os!, :unix? => %r!solaris|bsd! }.each do |k, v|
59
+ define_method k do
60
+ !!(
61
+ RbConfig::CONFIG["host_os"] =~ v
62
+ )
63
+ end
64
+ end
65
+
66
+ #
67
+
68
+ private
69
+ def proc_version
70
+ @cached_proc_version ||= begin
71
+ Pathutil.new(
72
+ "/proc/version"
73
+ ).read
74
+ rescue Errno::ENOENT
75
+ nil
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,73 @@
1
+ module J1
2
+ module Utils
3
+ module WinTZ
4
+ extend self
5
+
6
+ # Public: Calculate the Timezone for Windows when the config file has a defined
7
+ # 'timezone' key.
8
+ #
9
+ # timezone - the IANA Time Zone specified in "_config.yml"
10
+ #
11
+ # Returns a string that ultimately re-defines ENV["TZ"] in Windows
12
+ def calculate(timezone)
13
+ External.require_with_graceful_fail("tzinfo")
14
+ tz = TZInfo::Timezone.get(timezone)
15
+ difference = Time.now.to_i - tz.now.to_i
16
+ #
17
+ # POSIX style definition reverses the offset sign.
18
+ # e.g. Eastern Standard Time (EST) that is 5Hrs. to the 'west' of Prime Meridian
19
+ # is denoted as:
20
+ # EST+5 (or) EST+05:00
21
+ # Reference: http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
22
+ sign = difference < 0 ? "-" : "+"
23
+ offset = sign == "-" ? "+" : "-" unless difference.zero?
24
+ #
25
+ # convert the difference (in seconds) to hours, as a rational number, and perform
26
+ # a modulo operation on it.
27
+ modulo = modulo_of(rational_hour(difference))
28
+ #
29
+ # Format the hour as a two-digit number.
30
+ # Establish the minutes based on modulo expression.
31
+ hh = format("%02d", absolute_hour(difference).ceil)
32
+ mm = modulo.zero? ? "00" : "30"
33
+
34
+ J1l.logger.debug "Timezone:", "#{timezone} #{offset}#{hh}:#{mm}"
35
+ #
36
+ # Note: The 3-letter-word below doesn't have a particular significance.
37
+ "WTZ#{sign}#{hh}:#{mm}"
38
+ end
39
+
40
+ private
41
+
42
+ # Private: Convert given seconds to an hour as a rational number.
43
+ #
44
+ # seconds - supplied as an integer, it is converted to a rational number.
45
+ # 3600 - no. of seconds in an hour.
46
+ #
47
+ # Returns a rational number.
48
+ def rational_hour(seconds)
49
+ seconds.to_r/3600
50
+ end
51
+
52
+ # Private: Convert given seconds to an hour as an absolute number.
53
+ #
54
+ # seconds - supplied as an integer, it is converted to its absolute.
55
+ # 3600 - no. of seconds in an hour.
56
+ #
57
+ # Returns an integer.
58
+ def absolute_hour(seconds)
59
+ seconds.abs/3600
60
+ end
61
+
62
+ # Private: Perform a modulo operation on a given fraction.
63
+ #
64
+ # fraction - supplied as a rational number, its numerator is divided
65
+ # by its denominator and the remainder returned.
66
+ #
67
+ # Returns an integer.
68
+ def modulo_of(fraction)
69
+ fraction.numerator % fraction.denominator
70
+ end
71
+ end
72
+ end
73
+ end
data/lib/j1/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module J1
2
+ VERSION = '2020.0.0'
3
+ end
data/lib/j1_app.rb ADDED
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ # NOTES
4
+ # ------------------------------------------------------------------------------
5
+ # frozen_string_literal
6
+ #
7
+ # frozen_string_literal implies that all string literals in the file
8
+ # are implicitly frozen, as if #freeze had been called on each of them.
9
+ # That is, if a string literal is defined in a file with this comment, and
10
+ # you call a method on that string which modifies it, such as <<, you'll
11
+ # get RuntimeError: can't modify frozen String.
12
+
13
+ # Require RubyGems
14
+ # ------------------------------------------------------------------------------
15
+ require 'active_support'
16
+ require 'active_support/core_ext'
17
+
18
+ require 'uuid'
19
+ require 'date'
20
+
21
+ require 'json'
22
+ # require 'yaml'
23
+ require 'safe_yaml'
24
+ require 'rest-client'
25
+
26
+ require 'rack'
27
+ require 'rack/protection'
28
+ require 'omniauth'
29
+ require 'omniauth-oauth2'
30
+ require 'sinatra'
31
+ # require 'sinatra/cross_origin'
32
+ require 'warden'
33
+
34
+ require 'log4r'
35
+ # require 'log4r/yamlconfigurator'
36
+ require_relative 'j1_app/log4r/yamlconfigurator'
37
+ require 'log4r/outputter/datefileoutputter'
38
+ require 'log4r/outputter/emailoutputter'
39
+ include Log4r
40
+
41
+ # Require local Rubies
42
+ # ------------------------------------------------------------------------------
43
+ require_relative 'j1_app/sinatra/extras/cookies'
44
+ require_relative 'j1_app/sinatra/extras/index'
45
+
46
+ require_relative 'j1_app/omniauth/strategies/patreon'
47
+ require_relative 'j1_app/omniauth/strategies/disqus'
48
+ require_relative 'j1_app/omniauth/strategies/facebook'
49
+ require_relative 'j1_app/omniauth/strategies/github'
50
+ require_relative 'j1_app/omniauth/strategies/twitter'
51
+
52
+ require_relative 'j1_app/j1_auth_manager/commands'
53
+ require_relative 'j1_app/j1_auth_manager/config'
54
+ require_relative 'j1_app/j1_auth_manager/helpers'
55
+ require_relative 'j1_app/j1_auth_manager/helpers_disqus'
56
+ require_relative 'j1_app/j1_auth_manager/helpers_facebook'
57
+ require_relative 'j1_app/j1_auth_manager/helpers_github'
58
+ require_relative 'j1_app/j1_auth_manager/helpers_patreon'
59
+ require_relative 'j1_app/j1_auth_manager/helpers_twitter'
60
+ require_relative 'j1_app/j1_auth_manager/warden_omniauth'
61
+
62
+ require_relative 'j1_app/j1_auth_manager/auth_manager'
63
+ require_relative 'j1_app/j1_site_manager/static_site'
64
+
65
+ # Main
66
+ # ------------------------------------------------------------------------------
67
+
68
+ # App in production mode
69
+ #
70
+ module J1App
71
+ def self.site
72
+ Rack::Builder.new do
73
+ use Rack::ShowExceptions # Middleware. Generate web-based error pages (for Rack)
74
+ use Rack::Deflater # Middleware. Enable gzip compression for ALL web servers out of Rack
75
+ use J1App::AuthManager # Middleware. Support authentication methods using OmniAuth
76
+ run J1App::SiteManager # Run J1App Manager to manage the (static) site as an (Rack-based) Web Application:
77
+ end
78
+ end
79
+ end
80
+
81
+ # App in production mode
82
+ #
83
+ module J1AppCompress
84
+ def self.site
85
+ Rack::Builder.new do
86
+ use Rack::ShowExceptions # Middleware. Generate web-based error pages (for Rack)
87
+ use Rack::Deflater # Middleware. Enable gzip compression for ALL web servers out of Rack
88
+ use J1App::AuthManager # Middleware. Support authentication methods using OmniAuth
89
+ run J1App::SiteManager # Run J1App Manager to manage the (static) site as an (Rack-based) Web Application:
90
+ end
91
+ end
92
+ end
93
+
94
+ # App in development mode
95
+ #
96
+ module J1AppTest
97
+ def self.site
98
+ Rack::Builder.new do
99
+ use Rack::LiveReload # Middleware. Support Livereload
100
+ use Rack::ShowExceptions # Middleware. Generate web-based error pages (for Rack)
101
+ use J1App::AuthManager # Middleware. Support authentication methods using OmniAuth
102
+ run J1App::SiteManager # Run J1App Manager to manage the (static) site as an (Rack-based) Web Application:
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,1367 @@
1
+ # RuboCops - Documentation
2
+ # ------------------------------------------------------------------------------
3
+ # See: https://rubocop.readthedocs.io/en/latest/
4
+
5
+ # RuboCops - Disabled Cops
6
+ # ------------------------------------------------------------------------------
7
+ # rubocop:disable Metrics/BlockLength
8
+ # rubocop:disable Metrics/ClassLength
9
+ # rubocop:disable Metrics/LineLength
10
+ # rubocop:disable Style/StringLiterals
11
+ # rubocop:disable Style/Documentation
12
+ # rubocop:disable Metrics/BlockNesting
13
+ # rubocop:disable Layout/ClosingParenthesisIndentation
14
+ # rubocop:disable Layout/LeadingCommentSpace
15
+ # rubocop:disable Layout/EmptyLines
16
+ # rubocop:disable Layout/EmptyLinesAroundBlockBody
17
+ # rubocop:disable Layout/FirstParameterIndentation
18
+ # rubocop:disable Layout/CommentIndentation
19
+ # rubocop:disable Layout/AlignParameters
20
+ # rubocop:disable Layout/AlignHash
21
+ # rubocop:disable Layout/TrailingWhitespace
22
+ # rubocop:disable Layout/IndentHash
23
+ # rubocop:disable Layout/SpaceAroundOperators
24
+ # rubocop:disable Layout/ExtraSpacing
25
+ # rubocop:disable Style/UnlessElse
26
+ # rubocop:disable Style/HashSyntax
27
+ #
28
+ # rubocop:disable RubyLocalVariableNamingConvention
29
+
30
+ # ------------------------------------------------------------------------------
31
+ # ~/lib/j1_auth_manager/auth_manager/.rb
32
+ #
33
+ # Provides authentication services based on Warden|OmniAuth
34
+ #
35
+ # Product/Info:
36
+ # https://jekyll.one
37
+ #
38
+ # Copyright (C) 2020 Juergen Adams
39
+ #
40
+ # J1 Template is licensed under the MIT License.
41
+ # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE
42
+ #
43
+ # ------------------------------------------------------------------------------
44
+ # NOTES
45
+ #
46
+ # ------------------------------------------------------------------------------
47
+ # frozen_string_literal: true
48
+
49
+ module J1App
50
+ class AuthManager < Sinatra::Base
51
+
52
+ include J1App::Helpers
53
+ include J1App::GithubHelpers
54
+
55
+ # ==========================================================================
56
+ # SET project base
57
+ # ==========================================================================
58
+ # set project path to folder where 'config.ru' is located
59
+ #
60
+ #
61
+ puts "FickDich: #{ARGV.join(':')}"
62
+
63
+ project_path = J1App.work_dir
64
+ puu = File.dirname(Dir.pwd)
65
+
66
+ # ==========================================================================
67
+ # Initialize middleware resources
68
+ # test data
69
+ # disqus_client_id = J1App.oauth_data['disqus']['client_id']
70
+ # ==========================================================================
71
+ oauth_data = J1App.oauth_data
72
+
73
+ # ==========================================================================
74
+ # SETUP (log4r) logger
75
+ # ==========================================================================
76
+ log4r_cfg = YamlConfigurator
77
+ log4r_cfg.load_yaml_file(project_path + '/_data/modules/log4r.yml')
78
+
79
+ # ==========================================================================
80
+ # ??????????????????
81
+ # ==========================================================================
82
+ oauth_requester = ''
83
+
84
+ # ==========================================================================
85
+ # Initialize J1 logger settings
86
+ # ==========================================================================
87
+ uuid = UUID.new.generate
88
+ page_id = uuid[25, 37]
89
+ MDC.put('pageID', page_id)
90
+ MDC.put('path', '/')
91
+
92
+ j1_mw = Log4r::Logger['j1.mw']
93
+ j1_mw_auth_mgr = Log4r::Logger['j1.mw.auth_mgr']
94
+ j1_mw_auth_mgr_auth = Log4r::Logger['j1.mw.auth_mgr.auth']
95
+ j1_mw_auth_mgr_preflight = Log4r::Logger['j1.mw.auth_mgr.preflight']
96
+ j1_mw_auth_mgr_api_auth = Log4r::Logger['j1.mw.auth_mgr.api.auth']
97
+ j1_mw_auth_mgr_api_post_auth = Log4r::Logger['j1.mw.auth_mgr.api.post_auth']
98
+ j1_mw_auth_mgr_api_state = Log4r::Logger['j1.mw.auth_mgr.api.state']
99
+ j1_mw_auth_mgr_api_log2disk = Log4r::Logger['j1.mw.auth_mgr.api.log2disk']
100
+ j1_mw_auth_mgr_api_validate = Log4r::Logger['j1.mw.auth_mgr.api.validate']
101
+
102
+ j1_mw_auth_mgr.info 'middleware is being initialized'
103
+ j1_mw_auth_mgr.info 'state: stated'
104
+ j1_mw_auth_mgr.info "project path set to: #{project_path}"
105
+
106
+ # ==========================================================================
107
+ # Base App and Warden Framework settings
108
+ # ==========================================================================
109
+ j1_mw_auth_mgr.info 'setup base data'
110
+
111
+ provider_site_url_default = J1App.user_settings['provider_site_url']
112
+ provider_home_url_default = J1App.user_settings['provider_home_url']
113
+ provider_blog_url_default = J1App.user_settings['provider_blog_url']
114
+ provider_member_url_default = J1App.user_settings['provider_member_url']
115
+ provider_privacy_url_default = J1App.user_settings['provider_privacy_url']
116
+
117
+ app_session_data = {}
118
+ user_session_data = {
119
+ :authenticated => 'false',
120
+ :requested_page => '/',
121
+ :user_name => 'visitor',
122
+ :users_allowed => 'all',
123
+ :user_id => 'unknown',
124
+ :provider => 'j1',
125
+ :provider_membership => 'guest',
126
+ :provider_site_url => "#{provider_site_url_default}",
127
+ :provider_home_url => "#{provider_home_url_default}",
128
+ :provider_blog_url => "#{provider_blog_url_default}",
129
+ :provider_member_url => "#{provider_member_url_default}",
130
+ :provider_privacy_url => "#{provider_privacy_url_default}",
131
+ :payment_info => 'unknown',
132
+ :provider_permissions => ['public'],
133
+ :creator => 'middleware',
134
+ :writer => 'middleware',
135
+ :mode => 'app'
136
+ }
137
+
138
+ # Enable SSL for the rack session if configured
139
+ # --------------------------------------------------------------------------
140
+ require 'rack-ssl-enforcer' if J1App.ssl?
141
+ j1_mw_auth_mgr.info 'enforce ssl encryption' if J1App.ssl?
142
+ use Rack::SslEnforcer if J1App.ssl?
143
+
144
+ # Set the session cookie used by Rack to track all relevant data
145
+ # for the authentication service
146
+ # --------------------------------------------------------------------------
147
+ j1_mw_auth_mgr.info 'initialize web session cookie'
148
+ use Rack::Session::Cookie,
149
+ http_only: true, # if set to 'true', make session cookie visible to the browser (document) for HTTP
150
+ key: 'j1.app.session',
151
+ secret: ENV['J1_SESSION_SECRET'] || SecureRandom.hex
152
+
153
+ # use Rack::Cache do |config|
154
+ # #
155
+ # # ----------------------------------------------------------------------
156
+ # config.middleware.delete(Rack::Cache)
157
+ # end
158
+
159
+ # ==========================================================================
160
+ # Warden Framework initialisation
161
+ # ==========================================================================
162
+ j1_mw_auth_mgr.info 'initialize web session (warden)'
163
+
164
+ # Define what (user) data should be put (serialized) into the session
165
+ # on requests and responses from Rack environment into the warden
166
+ # environment (env['warden']).
167
+ # --------------------------------------------------------------------------
168
+ Warden::Manager.serialize_into_session do |user|
169
+ user
170
+ end
171
+ Warden::Manager.serialize_from_session do |user|
172
+ user
173
+ end
174
+
175
+ # ==========================================================================
176
+ # Middleware that protects against typical web attacks like CSRF and others.
177
+ # Use of all protections provided. For details, see:
178
+ # https://github.com/sinatra/sinatra/tree/master/rack-protection
179
+ # ==========================================================================
180
+ j1_mw_auth_mgr.info 'initialize web attack protection strategies'
181
+ use Rack::Protection
182
+
183
+ # ==========================================================================
184
+ # OmniAuth|Warden Framework initialisation
185
+ # ==========================================================================
186
+
187
+ # Set the 'default' authentication strategy and exception handler
188
+ # (for warden) if the user was not explicitly signed in (signin dialog).
189
+ # If 'signin' fails, the default exception 'signin_failure' is thrown
190
+ # (used for all OmniAuth strategies registered).
191
+ # --------------------------------------------------------------------------
192
+ j1_mw_auth_mgr.info "initialize default authentication strategy as: omni_#{J1App.default_provider}"
193
+ signin_failure = ->(_e) { Rack::Response.new("Can't login", 401).finish }
194
+ use Warden::Manager do |config|
195
+ # OmniAuth strategies are name-spaced by 'omni' (see: warden_omniauth.rb)
196
+ # ------------------------------------------------------------------------
197
+ config.default_strategies :"omni_#{J1App.default_provider}"
198
+ config.failure_app = signin_failure
199
+ end
200
+
201
+ j1_mw_auth_mgr.info 'detect and initialize configured authentication strategies (omniauth)'
202
+ j1_mw_auth_mgr.info 'initialize oauth authentication strategy: patreon' if J1App.active_providers.include? 'patreon'
203
+ j1_mw_auth_mgr.info 'initialize oauth authentication strategy: disqus' if J1App.active_providers.include? 'disqus'
204
+ j1_mw_auth_mgr.info 'initialize oauth authentication strategy: facebook' if J1App.active_providers.include? 'facebook'
205
+ j1_mw_auth_mgr.info 'initialize oauth authentication strategy: github' if J1App.active_providers.include? 'github'
206
+ j1_mw_auth_mgr.info 'initialize oauth authentication strategy: twitter' if J1App.active_providers.include? 'twitter'
207
+
208
+ use OmniAuth::Builder do |config|
209
+ # Rescue OmniAuth::Strategies::OAuth2::CallbackError
210
+ # ------------------------------------------------------------------------
211
+ config.on_failure do
212
+ new_path = '/redirect_on_failure'
213
+ Rack::Response.new(['302 Moved'], 302, 'Location' => new_path).finish
214
+ end
215
+
216
+ # Detect and set supported authentication strategies for OmniAuth
217
+ # ------------------------------------------------------------------------
218
+
219
+ # Additional (strategy) option skip_extra, default: true
220
+ #
221
+ # If true, skips the collection of raw data (extra) to NOT blow
222
+ # up the session cookie (as it is limited to 4K)
223
+ skip_extra = true
224
+
225
+ if J1App.active_providers.include? 'disqus'
226
+ scope = J1App.auth_config['providers']['disqus']['scope'].join(',')
227
+ data_collection = J1App.auth_config['providers']['disqus']['data_fields'].join(',')
228
+ skip_extra = false if data_collection =~ /raw/i
229
+ provider :disqus,
230
+ J1App.oauth_data['disqus']['client_id'],
231
+ J1App.oauth_data['disqus']['client_secret'],
232
+ scope: "#{scope}",
233
+ skip_extra: skip_extra
234
+ end
235
+
236
+ if J1App.active_providers.include? 'github'
237
+ scope = J1App.auth_config['providers']['github']['scope'].join(',')
238
+ data_collection = J1App.auth_config['providers']['github']['data_fields'].join(',')
239
+ skip_extra = false if data_collection =~ /raw/i
240
+ provider :github,
241
+ J1App.oauth_data['github']['client_id'],
242
+ J1App.oauth_data['github']['client_secret'],
243
+ scope: "#{scope}",
244
+ skip_extra: skip_extra
245
+ end
246
+
247
+ if J1App.active_providers.include? 'patreon'
248
+ scope = J1App.auth_config['providers']['patreon']['scope'].join(',')
249
+ data_collection = J1App.auth_config['providers']['patreon']['data_fields'].join(',')
250
+ skip_extra = false if data_collection =~ /raw/i
251
+ provider :patreon,
252
+ J1App.oauth_data['patreon']['client_id'],
253
+ J1App.oauth_data['patreon']['client_secret'],
254
+ scope: "#{scope}",
255
+ skip_extra: skip_extra
256
+ end
257
+
258
+ # if J1App.active_providers.include? 'facebook'
259
+ # scope = J1App.auth_config['providers']['facebook']['scope'].join(',')
260
+ # data_collection = J1App.auth_config['providers']['facebook']['data_fields'].join(',')
261
+ # skip_extra = false if data_collection =~ /raw/i
262
+ # provider :facebook,
263
+ # J1App.oauth_data['facebook']['client_id'],
264
+ # J1App.oauth_data['facebook']['client_secret'],
265
+ # scope: "#{scope}",
266
+ # skip_extra: skip_extra
267
+ # end
268
+
269
+ # if J1App.active_providers.include? 'twitter'
270
+ # scope = J1App.auth_config['providers']['twitter']['scope'].join(',')
271
+ # data_collection = J1App.auth_config['providers']['twitter']['data_fields'].join(',')
272
+ # skip_extra = false if data_collection =~ /raw/i
273
+ # provider :twitter,
274
+ # J1App.oauth_data['twitter']['client_id'],
275
+ # J1App.oauth_data['twitter']['client_secret'],
276
+ # scope: "#{scope}",
277
+ # skip_extra: skip_extra
278
+ # end
279
+
280
+ end
281
+
282
+ j1_mw_auth_mgr.info 'register oauth authentication callback on: /post_authentication'
283
+ # Set the (internal) endpoint if a user is successfully authenticated
284
+ # --------------------------------------------------------------------------
285
+ use J1WardenOmniAuth do |config|
286
+ config.redirect_after_callback = '/post_authentication?verify=oauth_callback'
287
+ end
288
+
289
+ # Add the internal logger from Rack to the middleware's of the stack
290
+ # --------------------------------------------------------------------------
291
+ j1_mw_auth_mgr.info 'register rack internal logger to the middleware|s'
292
+ use Rack::Logger
293
+
294
+ # Load user profiles, permissions, conditions and strategies
295
+ # --------------------------------------------------------------------------
296
+ j1_mw_auth_mgr.info 'load user profiles, permissions, conditions and strategies'
297
+ providers = J1App.auth_config['providers']
298
+ permissions = J1App.permissions
299
+
300
+ j1_mw_auth_mgr.info 'middleware initialized successfully'
301
+ j1_mw_auth_mgr.info 'state: finished'
302
+
303
+ # ==========================================================================
304
+ # Sinatra (before) FILTER to preprocess all page requests
305
+ # ==========================================================================
306
+
307
+ # before do
308
+ # response.headers['Access-Control-Allow-Origin'] = '*'
309
+ # end
310
+
311
+ # Prepare root (index) page for app detection
312
+ # --------------------------------------------------------------------------
313
+ before '/' do
314
+
315
+ MDC.put('path', env['REQUEST_URI'])
316
+ j1_mw_auth_mgr.info 'prepare page access'
317
+
318
+ # read existing/current cookie 'j1.user.ession' to update all data
319
+ # of user_session_data (hash) otherwise set initial data
320
+ # ------------------------------------------------------------------------
321
+ unless env['HTTP_COOKIE'] == nil
322
+ j1_mw_auth_mgr.info 'read current user state data from cookie'
323
+ user_session_data = readCookie('j1.user.session')
324
+ else
325
+ requested_page = env['REQUEST_URI']
326
+ app_session_data['requested_page'] = "#{env['REQUEST_URI']}"
327
+ end
328
+
329
+ # Create|Initialize the J1 web session cookie
330
+ # ------------------------------------------------------------------------
331
+ if warden.authenticated?
332
+ user = warden.user
333
+
334
+ j1_mw_auth_mgr_auth.info 'user detected: ' + "#{user[:provider]}"
335
+ j1_mw_auth_mgr_auth.info 'user detected as signed in'
336
+
337
+ app_session_data['authenticated'] = 'true'
338
+ app_session_data['user_name'] = user[:info]['nickname']
339
+ app_session_data['users_allowed'] = providers["#{user[:provider]}"]['users']
340
+ app_session_data['user_id'] = user[:uid]
341
+ app_session_data['provider'] = user[:provider]
342
+ app_session_data['provider_membership'] = 'member'
343
+ app_session_data['provider_site_url'] = providers["#{user[:provider]}"]['provider_url']
344
+ app_session_data['provider_permissions'] = providers["#{user[:provider]}"]['permissions']
345
+ app_session_data['payment_status'] = user[:info][:payment_status]
346
+ else
347
+ j1_mw_auth_mgr_auth.info 'user detected as signed out'
348
+
349
+ app_session_data['authenticated'] = 'false'
350
+ app_session_data['users_allowed'] = 'all'
351
+ app_session_data['user_name'] = 'visitor'
352
+ app_session_data['user_id'] = 'unknown'
353
+ app_session_data['payment_status'] = 'unknown'
354
+ app_session_data['provider'] = 'j1'
355
+ app_session_data['provider_membership'] = 'guest'
356
+ app_session_data['provider_site_url'] = "#{provider_site_url_default}"
357
+ app_session_data['provider_permissions'] = ['public']
358
+ end
359
+ end
360
+
361
+ user_session_cookie = 'j1.user.session'
362
+ user_state_cookie = 'j1.user.state'
363
+
364
+
365
+ # General content (type) detection (auth pre-flight)
366
+ # --------------------------------------------------------------------------
367
+ before '/(apps|pages|posts)/*' do
368
+
369
+ MDC.put('path', env['REQUEST_URI'])
370
+ j1_mw_auth_mgr_preflight.info 'initial checks initiated'
371
+
372
+ # Read current J1 user SESSION cookie ???
373
+ # ------------------------------------------------------------------------
374
+ if existsCookie? user_session_cookie
375
+ user_session_data = readCookie(user_session_cookie)
376
+ j1_mw_auth_mgr_preflight.info 'read user session cookie' #, "#{session_decoded}"
377
+ else
378
+ requested_page = env['REQUEST_URI']
379
+ app_session_data['requested_page'] = "#{requested_page}"
380
+ end
381
+
382
+ # Create|Initialize the J1 web session cookie
383
+ # ------------------------------------------------------------------------
384
+ j1_mw_auth_mgr_preflight.info 'check authentication state'
385
+ if warden.authenticated?
386
+ user = warden.user
387
+ app_session_data['authenticated'] = 'true'
388
+ app_session_data['user_name'] = user[:info]['nickname']
389
+ app_session_data['user_id'] = user[:uid]
390
+ app_session_data['provider'] = user[:provider]
391
+ app_session_data['provider_site_url'] = providers["#{user[:provider]}"]['provider_url']
392
+ app_session_data['users_allowed'] = providers["#{user[:provider]}"]['users']#
393
+ app_session_data['provider_permissions'] = providers["#{user[:provider]}"]['permissions']
394
+ app_session_data['provider_membership'] = 'member'
395
+ app_session_data['payment_status'] = user[:info][:payment_status]
396
+ app_session_data['writer'] = 'middleware'
397
+
398
+ user_session_data = merge( user_session_data, app_session_data )
399
+ j1_mw_auth_mgr_preflight.info 'user authenticated: ' + "#{user[:info]['nickname']}"
400
+ else
401
+ j1_mw_auth_mgr_preflight.info 'user authenticated: false'
402
+ end
403
+
404
+ # User state|content detection for implicit authentication
405
+ # ------------------------------------------------------------------------
406
+ j1_mw_auth_mgr_preflight.info 'check config, found authentication: disabled' if authentication_enabled? == false
407
+ j1_mw_auth_mgr_preflight.info 'pass for all pages' if authentication_enabled? == false
408
+
409
+ pass if authentication_enabled? == false
410
+ j1_mw_auth_mgr_preflight.info 'check config, authentication: enabled'
411
+ j1_mw_auth_mgr_preflight.info 'check content, content detected of category: public' if public_content?
412
+ j1_mw_auth_mgr_preflight.info 'check content, pass all content of category: public' if public_content?
413
+
414
+ pass if public_content?
415
+
416
+ # user_state_data = readCookie(user_state_cookie)
417
+
418
+ # Read current J1 user STATE cookie
419
+ # --------------------------------------------------------------------
420
+ if existsCookie? user_state_cookie
421
+ user_state_data = readCookie(user_state_cookie)
422
+ j1_mw_auth_mgr_preflight.info 'read user state cookie' #, "#{session_decoded}"
423
+ j1_mw_auth_mgr_preflight.info 'cookie consent: ' + "#{user_state_data['cookies_accepted']}"
424
+ else
425
+ j1_mw_auth_mgr_preflight.error 'user session cookie missing: ' + "#{user_state_cookie}"
426
+ end
427
+ j1_mw_auth_mgr_preflight.info 'check content type'
428
+
429
+ requested_page = env['REQUEST_URI']
430
+ requested_page.scan(/(protected|private)/) do |match|
431
+
432
+ category = match[0]
433
+ j1_mw_auth_mgr_preflight.info 'content type detected: ' + "#{category}"
434
+ j1_mw_auth_mgr_preflight.info 'check authorisation status'
435
+ if warden.authenticated?
436
+ j1_mw_auth_mgr_preflight.info 'user detected as: authenticated'
437
+ user_name = user[:info]['nickname']
438
+ j1_mw_auth_mgr_preflight.info 'user detected: ' + "#{user_name}"
439
+
440
+ current_provider = warden.user[:provider]
441
+ strategy = providers["#{current_provider}"]['strategy']
442
+ provider_strategy = :"#{strategy}"
443
+
444
+ user_session_data['user_name'] = user_name
445
+ user_session_data['provider_url'] = providers["#{current_provider}"]['provider_url']
446
+ user_session_data['users_allowed'] = providers["#{current_provider}"]['users']
447
+ user_session_data['provider_permissions'] = providers["#{user[:provider]}"]['permissions']
448
+ user_session_data['requested_page'] = requested_page
449
+
450
+ j1_mw_auth_mgr_preflight.info 'check permissions'
451
+
452
+ if permissions[:"#{category}"].include? current_provider
453
+ j1_mw_auth_mgr_preflight.info 'provider detected: ' + "#{current_provider}"
454
+ j1_mw_auth_mgr_preflight.info 'category detected: ' + "#{category}"
455
+ j1_mw_auth_mgr_preflight.info 'category support: enabled'
456
+
457
+ # Check permissions
458
+ #
459
+ #log_info! 'Authorisation', 'ConditionCheck', 'Check permissions for provider', "#{current_provider}"
460
+ #conditions = J1App.conditions current_provider
461
+ # if conditions["#{category}"]
462
+ # log_info! 'Authorisation', 'ConditionCheck', 'Conditions detected', "#{category}"
463
+ # conditions["#{category}"].each do |k, v|
464
+ # case k
465
+ # when 'enabled'
466
+ # log_info! 'Authorisation', 'ConditionCheck', "#{k}", "#{v}"
467
+ # when 'users'
468
+ # log_info! 'Authorisation', 'ConditionCheck', 'users'
469
+ # v.each do |k, v|
470
+ # log_info! 'Authorisation', 'ConditionCheck', "users - #{k}", "#{v}"
471
+ # end
472
+ # when 'payment'
473
+ # log_info! 'Authorisation', 'ConditionCheck', 'payment'
474
+ # v.each do |k, v|
475
+ # case k
476
+ # when 'tiers'
477
+ # log_info! 'Authorisation', 'ConditionCheck', "payment - #{k}", "#{v}"
478
+ # when 'tier'
479
+ # v.each do |k, v|
480
+ # log_info! 'Authorisation', 'ConditionCheck', 'payment - tiers - tier : ' "#{k}", "#{v}"
481
+ # end
482
+ # end
483
+ # end
484
+ # end
485
+ # end
486
+ # end
487
+ else
488
+ provider = permissions[:"#{category}"][0]
489
+
490
+ j1_mw_auth_mgr_preflight.info 'provider detected: ' + "#{current_provider}"
491
+ j1_mw_auth_mgr_preflight.info 'category detected: ' + "#{category}"
492
+ j1_mw_auth_mgr_preflight.info 'category support: disabled'
493
+ j1_mw_auth_mgr_preflight.info 'authorisation failed for user: ' + "#{user_name}"
494
+
495
+ # Update user session cookie for 'requested_page'
496
+ # ------------------------------------------------------------------
497
+ session_json = user_session_data.to_json
498
+
499
+ # jadams, 2019-08-08: writeCookie of 'j1.user.session' is needed to
500
+ # track the requested_page. This cause the potential risk to
501
+ # corrupt the cookie (now, for unknown reason)
502
+ # ------------------------------------------------------------------
503
+ writeCookie(user_session_cookie, session_json)
504
+ j1_mw_auth_mgr_preflight.info 'write user session data: ' + "#{session_json}"
505
+ j1_mw_auth_mgr_preflight.info 'pass to error page: access_denied'
506
+
507
+ description_title = "Access Denied"
508
+ redirect "/access_denied?provider=#{current_provider}&user=#{user_name}&category=#{category}&title=#{description_title}"
509
+ end
510
+
511
+ timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
512
+ j1_mw_auth_mgr_preflight.info 'pass to requested page: ' + "#{requested_page}"
513
+ pass
514
+ else
515
+ j1_mw_auth_mgr_preflight.info 'user state detected: signed out'
516
+ default_provider = permissions[:"#{category}"][0]
517
+ j1_mw_auth_mgr_preflight.info 'set default provider: ' + "#{default_provider}"
518
+
519
+ strategy = providers["#{default_provider}"]['strategy']
520
+ provider_strategy = :"#{strategy}"
521
+
522
+ j1_mw_auth_mgr_preflight.info 'start processing provider: ' + "#{default_provider}"
523
+ j1_mw_auth_mgr_preflight.info 'provider authentication strategy found: ' + "#{strategy}"
524
+
525
+ case provider_strategy
526
+
527
+ when :org
528
+ warden.authenticate!
529
+ github_organization_authenticate! ENV['GITHUB_ORG_NAME']
530
+ j1_mw_auth_mgr_preflight.info "Hi There, #{user_session_data[:user_name]}! You have access to the #{params['id']} organization"
531
+
532
+ when :team
533
+ warden.authenticate!
534
+ github_team_authenticate! ENV['GITHUB_TEAM_ID']
535
+ j1_mw_auth_mgr_preflight.info "Hi There, #{user_session_data[:user_name]}! You have access to the #{params['id']} team"
536
+
537
+ when :teams
538
+ warden.authenticate!
539
+ github_teams_authenticate! ENV['GITHUB_TEAM_IDS'].split(',')
540
+ j1_mw_auth_mgr_preflight.info "Hi There, #{user_session_data[:user_name]}! You have access to the #{params['id']} team"
541
+
542
+ when :member
543
+ j1_mw_auth_mgr_preflight.info 'process authentication strategy'
544
+
545
+ if env['HTTP_COOKIE'].include? 'j1.user.session'
546
+ session_encoded = request.cookies['j1.user.session']
547
+ session_decoded = Base64.decode64(session_encoded)
548
+ user_session_data = JSON.parse(session_decoded)
549
+ j1_mw_auth_mgr_preflight.info 'read user session data from cookie' # "#{session_decoded}"
550
+ end
551
+
552
+ # Update user session cookie for 'requested_page'
553
+ # ------------------------------------------------------------------
554
+ user_session_data['requested_page'] = env['REQUEST_URI']
555
+ user_session_data['writer'] = 'middleware'
556
+ session_json = user_session_data.to_json
557
+
558
+ # jadams, 2019-08-08: writeCookie of 'j1.user.session' is needed to
559
+ # track the requested_page. This cause the potential risk to
560
+ # corrupt the cookie (now, for unknown reason)
561
+ # ------------------------------------------------------------------
562
+ j1_mw_auth_mgr_preflight.info 'write user session data to cookie: ' + "#{session_decoded}"
563
+ writeCookie(user_session_cookie, session_json)
564
+
565
+ j1_mw_auth_mgr_preflight.info 'call api request for: ' + "/page_validation?page=#{user_session_data['requested_page']}"
566
+ redirect "/page_validation?page=#{user_session_data['requested_page']}"
567
+ else
568
+ raise J1App::ConfigError
569
+ end
570
+ end
571
+ end
572
+ end
573
+
574
+
575
+ # ==========================================================================
576
+ # API ENDPOINTS (Sinatra HANDLERS)
577
+ # ==========================================================================
578
+
579
+ # ENDPOINT auth (called from Netlify CMS as an external oauth client)
580
+ # --------------------------------------------------------------------------
581
+ get '/auth' do
582
+ provider = 'github'
583
+ oauth_requester = 'cc'
584
+
585
+ MDC.put('path', env['REQUEST_URI'])
586
+
587
+ j1_mw_auth_mgr_api_auth.info "authentication request received from: #{oauth_requester}"
588
+ j1_mw_auth_mgr_api_auth.info 'check authentication status'
589
+
590
+ if warden.authenticated?
591
+ # process users only if authenticated at 'github'
592
+ if warden.user[:provider] == provider
593
+ nickname = warden.user[:info]['nickname']
594
+ token = warden.user[:credentials]['token']
595
+
596
+ j1_mw_auth_mgr_api_auth.info "user detected as signed in: github, #{nickname}"
597
+ j1_mw_auth_mgr_api_auth.info "pass authentication message to Netlify CMS for provider: #{provider}"
598
+
599
+ signin_client = <<IIF
600
+ <!DOCTYPE html>
601
+ <html lang="en">
602
+ <head>
603
+ <!-- Simple HttpErrorPages | MIT License | https://github.com/AndiDittrich/HttpErrorPages -->
604
+ <meta charset="utf-8" />
605
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
606
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
607
+ <title>J1 Control Center | SignIn to Github</title>
608
+ <style type="text/css">/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}/*! Simple HttpErrorPages | MIT X11 License | https://github.com/AndiDittrich/HttpErrorPages */body,html{width:100%;height:100%;background-color:#21232a}body{color:#fff;text-align:center;text-shadow:0 2px 4px rgba(0,0,0,.5);padding:0;min-height:100%;-webkit-box-shadow:inset 0 0 100px rgba(0,0,0,.8);box-shadow:inset 0 0 100px rgba(0,0,0,.8);display:table;font-family:"Open Sans",Arial,sans-serif}h1{font-family:inherit;font-weight:500;line-height:1.1;color:inherit;font-size:36px}h1 small{font-size:68%;font-weight:400;line-height:1;color:#777}a{text-decoration:none;color:#fff;font-size:inherit;border-bottom:dotted 1px #707070}.lead{color:silver;font-size:21px;line-height:1.4}.cover{display:table-cell;vertical-align:middle;padding:0 20px}footer{position:fixed;width:100%;height:40px;left:0;bottom:0;color:#a0a0a0;font-size:14px}</style>
609
+ </head>
610
+ <body>
611
+ <div class="cover">
612
+ <h1>Control Center <small>sign in</small></h1>
613
+ <p class="lead">
614
+ The Control Center is accessing #{provider} for user #{nickname}.<br>
615
+ Providing authentication data ..</p>
616
+ </div>
617
+
618
+ <script>
619
+ (function() {
620
+ // Register an event handler to listen for messages of the child window
621
+ window.addEventListener("message", receiveMessage, false);
622
+
623
+ // Post a authorizing message to the parent window (Netlify CMS App)
624
+ // as a handshake with the parent window
625
+ window.opener.postMessage("authorizing:#{provider}", "*");
626
+
627
+ function receiveMessage() {
628
+ // send message to main (parent) window (Netlify CMS App)
629
+ window.opener.postMessage(
630
+ 'authorization:#{provider}:success:{"token":"#{token}","provider":"#{provider}"}'
631
+ )
632
+ } // end receiveMessage
633
+ })()
634
+ </script>
635
+
636
+ </body>
637
+ </html>
638
+ IIF
639
+ else
640
+ provider = 'github'
641
+ nickname = warden.user[:info]['nickname']
642
+ current_provider = warden.user[:provider]
643
+
644
+ j1_mw_auth_mgr_api_auth.info "user detected as signed in: #{nickname}"
645
+ j1_mw_auth_mgr_api_auth.info "invalid provider detected: #{current_provider}"
646
+
647
+ # Destroy current session to initiate a clean oauth authentication
648
+ # ----------------------------------------------------------------
649
+ j1_mw_auth_mgr_api_auth.info "sign out user from provider: #{current_provider}"
650
+ j1_mw_auth_mgr_api_auth.info "initiate oauth authentication at provider: #{provider}"
651
+ warden.logout
652
+ session.clear
653
+ warden.authenticate! :"omni_#{provider}"
654
+ end
655
+ else
656
+ j1_mw_auth_mgr_api_auth.info 'user detected as signed out'
657
+ j1_mw_auth_mgr_api_auth.info "initiate oauth authentication at provider: #{provider}"
658
+
659
+ # Destroy current session to initiate a clean oauth authentication
660
+ # ----------------------------------------------------------------
661
+ warden.logout
662
+ session.clear
663
+ warden.authenticate! :"omni_#{provider}"
664
+ end
665
+ end
666
+
667
+
668
+ # ENDPOINT authentication (called from WEB by auth client)
669
+ # --------------------------------------------------------------------------
670
+ get '/authentication' do
671
+ request = params.fetch('request')
672
+ provider = params.fetch('provider')
673
+ oauth_requester = 'app'
674
+
675
+ MDC.put('path', env['REQUEST_URI'])
676
+ j1_mw_auth_mgr_api_auth.info "authentication request received from: #{oauth_requester}"
677
+
678
+ # SignIn
679
+ # ------------------------------------------------------------------------
680
+ if request === 'signin'
681
+ j1_mw_auth_mgr_api_auth.info 'sign in called for provider: ' + "#{provider}"
682
+
683
+ # collect (additional) GET parameter|s
684
+ # ----------------------------------------------------------------------
685
+ allowed_users = params.fetch('allowed_users')
686
+
687
+ if warden.authenticated?
688
+ j1_mw_auth_mgr_api_auth.info 'sign in called but user already signed: ' + "#{warden.user[:info]['nickname']}"
689
+ requested_page = user_session_data['requested_page']
690
+ j1_mw_auth_mgr_api_auth.info 'pass user to requested page: ' + "#{requested_page}"
691
+ redirect "#{requested_page}"
692
+ else
693
+ j1_mw_auth_mgr_api_auth.info 'initiate oauth authentication to sign in'
694
+
695
+ # Make (really) sure that old session is cleared before login
696
+ # --------------------------------------------------------------------
697
+ warden.logout
698
+ session.clear
699
+ warden.authenticate! :"omni_#{provider}"
700
+ end
701
+ # SignOut
702
+ # ------------------------------------------------------------------------
703
+ elsif request === 'signout'
704
+ # collect (additional) GET parameter|s
705
+ provider_signout = params.fetch('provider_signout')
706
+ j1_mw_auth_mgr_api_auth.info 'sign out called for provider: ' + "#{provider}"
707
+
708
+ if warden.authenticated?
709
+ user = warden.user[:info]['nickname']
710
+ provider = warden.user[:provider]
711
+ provider_url = user_session_data['provider_url']
712
+ j1_mw_auth_mgr_api_auth.info 'sign out user: ' + "#{user}"
713
+ warden.logout
714
+ session.clear
715
+
716
+ # Read current J1 user SESSION cookie
717
+ # --------------------------------------------------------------------
718
+ if existsCookie? user_session_cookie
719
+ user_session_data = readCookie(user_session_cookie)
720
+ j1_mw_auth_mgr_api_auth.info 'read user session cookie' #, "#{session_decoded}"
721
+ else
722
+ j1_mw_auth_mgr_api_auth.error 'user session cookie missing: ' + "#{user_session_cookie}"
723
+ end
724
+
725
+ if provider_signout === 'true'
726
+ j1_mw_auth_mgr_api_auth.info 'sign out user: ' + "#{user}"
727
+ j1_mw_auth_mgr_api_auth.info 'sign out from: ' + "#{provider}"
728
+ j1_mw_auth_mgr_api_auth.info 'pass to provider for sign out: ' + "#{provider_url}"
729
+ redirect "#{provider_url}"
730
+ else
731
+ j1_mw_auth_mgr_api_auth.info 'sign out user: ' + "#{user}"
732
+ j1_mw_auth_mgr_api_auth.info 'sign out from: session'
733
+
734
+ # If signed out, redirect ONLY for PUBLIC pages
735
+ # ------------------------------------------------------------------
736
+ if redirect_whitelisted?user_session_data['requested_page']
737
+ j1_mw_auth_mgr_api_auth.info 'check page permissions: access allowed'
738
+ j1_mw_auth_mgr_api_auth.info 'pass to page: ' + "#{user_session_data['requested_page']}"
739
+ redirect user_session_data['requested_page']
740
+ else
741
+ j1_mw_auth_mgr_api_auth.info 'check page permissions: access denied'
742
+ j1_mw_auth_mgr_api_auth.info 'pass to page: /'
743
+ redirect '/'
744
+ end
745
+ end
746
+ else
747
+ # THIS condition should NEVER REACHED because NO logout dialog
748
+ # (modal) is provided by the auth client if a user isn't signed in.
749
+ # Kept this alternative for cases something went wrong.
750
+ # --------------------------------------------------------------------
751
+ j1_mw_auth_mgr_api_auth.warn 'DEAD PATH - called for sign out but user state is: signed out'
752
+
753
+ # Read current J1 SESSION cookie
754
+ # --------------------------------------------------------------------
755
+ if existsCookie? user_session_cookie
756
+ user_session_data = readCookie(user_session_cookie)
757
+ j1_mw_auth_mgr_api_auth.warn 'DEAD PATH - read user session cookie' #, "#{session_decoded}"
758
+ else
759
+ j1_mw_auth_mgr_api_auth.error 'DEAD PATH - user session cookie missing: ' + "#{user_session_cookie}"
760
+ end
761
+
762
+ j1_mw_auth_mgr_api_auth.warn 'DEAD PATH - pass to requested page: ' + "#{user_session_data['requested_page']}"
763
+ redirect user_session_data['requested_page']
764
+ end
765
+ else
766
+ raise J1App::ConfigError
767
+ end
768
+ end
769
+ # --------------------------------------------------------------------------
770
+ # END: get '/authentication'
771
+
772
+ # ENDPOINT post_authentication (called after a user is back from OAuth Provider)
773
+ # --------------------------------------------------------------------------
774
+ get '/post_authentication' do
775
+ MDC.put('path', env['REQUEST_URI'])
776
+
777
+ nickname = warden.user[:info]['nickname']
778
+ provider = warden.user[:provider]
779
+ token = warden.user[:credentials]['token']
780
+
781
+ j1_mw_auth_mgr_api_post_auth.info "user successfully authenticated: #{provider}, #{nickname}"
782
+ j1_mw_auth_mgr_api_post_auth.info "authentication requester deteced as: #{oauth_requester}"
783
+
784
+ if oauth_requester.include? 'cc'
785
+ j1_mw_auth_mgr_api_post_auth.info 'auth request was requested by Netlify CMS'
786
+ j1_mw_auth_mgr_api_post_auth.info 'prepare signin for Netlify CMS'
787
+
788
+ signin_client = <<IIF
789
+ <!DOCTYPE html>
790
+ <html lang="en">
791
+ <head>
792
+ <!-- Simple HttpErrorPages | MIT License | https://github.com/AndiDittrich/HttpErrorPages -->
793
+ <meta charset="utf-8" />
794
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
795
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
796
+ <title>J1 Control Center | SignIn to Github</title>
797
+ <style type="text/css">/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}/*! Simple HttpErrorPages | MIT X11 License | https://github.com/AndiDittrich/HttpErrorPages */body,html{width:100%;height:100%;background-color:#21232a}body{color:#fff;text-align:center;text-shadow:0 2px 4px rgba(0,0,0,.5);padding:0;min-height:100%;-webkit-box-shadow:inset 0 0 100px rgba(0,0,0,.8);box-shadow:inset 0 0 100px rgba(0,0,0,.8);display:table;font-family:"Open Sans",Arial,sans-serif}h1{font-family:inherit;font-weight:500;line-height:1.1;color:inherit;font-size:36px}h1 small{font-size:68%;font-weight:400;line-height:1;color:#777}a{text-decoration:none;color:#fff;font-size:inherit;border-bottom:dotted 1px #707070}.lead{color:silver;font-size:21px;line-height:1.4}.cover{display:table-cell;vertical-align:middle;padding:0 20px}footer{position:fixed;width:100%;height:40px;left:0;bottom:0;color:#a0a0a0;font-size:14px}</style>
798
+ </head>
799
+ <body>
800
+ <div class="cover">
801
+ <h1>Control Center <small>sign in</small></h1>
802
+ <p class="lead">
803
+ The Control Center is accessing #{provider} for user #{nickname}.<br>
804
+ Providing authentication data ..</p>
805
+ </div>
806
+
807
+ <script>
808
+ (function() {
809
+ // Register an event handler to listen for messages of the child window
810
+ window.addEventListener("message", receiveMessage, false);
811
+
812
+ // Post a authorizing message to the parent window (Netlify CMS App)
813
+ // as a handshake with the parent window
814
+ window.opener.postMessage("authorizing:#{provider}", "*");
815
+
816
+ function receiveMessage() {
817
+ // send message to main (parent) window (Netlify CMS App)
818
+ window.opener.postMessage(
819
+ 'authorization:#{provider}:success:{"token":"#{token}","provider":"#{provider}"}'
820
+ )
821
+ } // end receiveMessage
822
+ })()
823
+ </script>
824
+
825
+ </body>
826
+ </html>
827
+ IIF
828
+
829
+ j1_mw_auth_mgr_api_post_auth.info "pass authentication message to Netlify CMS for provider: #{provider}"
830
+ # noinspection RubyJumpError
831
+ return signin_client
832
+ end
833
+
834
+ reward = {
835
+ :id => 'unknown',
836
+ :name => 'unknown',
837
+ :link => '#'
838
+ }
839
+ campaign = {
840
+ :id => 'unknown',
841
+ :link => '#'
842
+ }
843
+
844
+ MDC.put('path', env['REQUEST_URI'])
845
+ j1_mw_auth_mgr_api_post_auth.info 'identification request received'
846
+
847
+ # Read current J1 SESSION cookie
848
+ # ------------------------------------------------------------------------
849
+ if existsCookie? user_session_cookie
850
+ user_session_data = readCookie(user_session_cookie)
851
+ j1_mw_auth_mgr_api_post_auth.info 'read user session cookie'
852
+ j1_mw_auth_mgr_api_post_auth.info 'requested page found as: ' + "#{user_session_data['requested_page']}"
853
+ else
854
+ j1_mw_auth_mgr_api_post_auth.error 'user session cookie missing: ' + "#{user_session_cookie}"
855
+ end
856
+
857
+ user = warden.user
858
+ user_json = user.to_json
859
+
860
+ if user[:provider] === 'disqus'
861
+ user[:info][:urls][:site] = "https://disqus.com"
862
+ user[:info][:urls][:home] = user[:info]['urls']['profileUrl']
863
+ user[:info][:urls][:blog] = "https://disqus.com/by/juergen_adams/"
864
+ user[:info][:urls][:member] = user[:info]['urls']['profileUrl']
865
+ end
866
+
867
+ if user[:provider] === 'github'
868
+ user[:info][:urls][:site] = "https://github.com"
869
+ user[:info][:urls][:home] = user[:info]['urls']['GitHub']
870
+ user[:info][:urls][:blog] = "https://github.com/jekyll-one"
871
+ user[:info][:urls][:member] = user[:info]['urls']['Blog']
872
+ end
873
+
874
+ if user[:provider] === 'patreon'
875
+
876
+ user[:info][:urls][:site] = "https://patreon.com"
877
+ user[:info][:urls][:home] = "https://patreon.com/home"
878
+ user[:info][:urls][:blog] = "https://patreon.com/jekyll_one"
879
+
880
+ unless user[:info]['payment_info'].empty?
881
+ reward_url = user[:info]['payment_info']['relationships']['reward']['links']['related']
882
+ reward_json = RestClient.get "#{reward_url}", {:content_type => :json, :accept => :json}
883
+ reward_data = JSON.parse(reward_json)
884
+ user[:info][:urls][:member] = "https://patreon.com" + reward_data['data']['attributes']['url']
885
+ user[:info][:payment_status] = user[:info]['payment_info']['attributes']['declined_since'].nil? ? 'true' : 'false'
886
+ else
887
+ reward_url = ""
888
+ reward_json = ""
889
+ reward_data = ""
890
+ user[:info][:payment_status] = 'false'
891
+ end
892
+
893
+ unless reward_data.empty?
894
+ reward[:id] = reward_data['data']['id']
895
+ reward[:name] = reward_data['data']['attributes']['title']
896
+ reward[:link] = "https://patreon.com" + reward_data['data']['attributes']['url']
897
+ campaign[:id] = reward_data['data']['relationships']['campaign']['data']['id']
898
+ campaign[:link] = reward_data['data']['relationships']['campaign']['links']['related']
899
+ else
900
+ reward[:id] = ""
901
+ reward[:name] = "no tiers"
902
+ reward[:link] = ""
903
+ campaign[:id] = ""
904
+ campaign[:link] = ""
905
+ end
906
+ end
907
+
908
+ user[:extra][:reward] = reward
909
+ user[:extra][:campaign] = campaign
910
+
911
+ # EXCEPTION: collection of session data failed (e.g cookie > 4K)
912
+ # ------------------------------------------------------------------------
913
+ if user.nil?
914
+ j1_mw_auth_mgr_api_post_auth.error 'internal error: user identification failed'
915
+ j1_mw_auth_mgr_api_post_auth.error 'check user session cookie for consistency'
916
+ warden.logout
917
+ session.clear
918
+ j1_mw_auth_mgr_api_post_auth.info 'pass to error page: access denied'
919
+ description_title = "Access Denied"
920
+ redirect "/access_denied?provider=unknown&user=unknown&category=unknown&title=#{description_title}"
921
+ else
922
+ j1_mw_auth_mgr_api_post_auth.info 'user identified successfully'
923
+
924
+ user_session_data['user_name'] = user[:info]['nickname']
925
+ user_session_data['user_id'] = user[:uid]
926
+ user_session_data['provider'] = user[:provider]
927
+ user_session_data['provider_membership'] = 'member'
928
+ user_session_data['provider_permissions'] = providers["#{user[:provider]}"]['permissions']
929
+ user_session_data['users_allowed'] = providers["#{user[:provider]}"]['users']
930
+ user_session_data['authenticated'] = 'true'
931
+ user_session_data['payment_status'] = user[:info][:payment_status]
932
+ user_session_data['writer'] = 'middleware'
933
+
934
+ current_user = user[:info]['nickname']
935
+ current_provider = user[:provider]
936
+
937
+ user_session_data['requested_page'].scan(/(protected|private)/) do |match|
938
+
939
+ # Set category from requested page
940
+ # --------------------------------------------------------------------
941
+ category = match[0]
942
+ j1_mw_auth_mgr_api_post_auth.info 'Processing content category: ' + "#{category}"
943
+
944
+ # Check if user is allowed to access protected content in GENERAL
945
+ # --------------------------------------------------------------------
946
+ j1_mw_auth_mgr_api_post_auth.info 'check for users allowed'
947
+ unless user_session_data['users_allowed'].include? 'all'
948
+ unless user_session_data['users_allowed'].include? "#{current_user}"
949
+ j1_mw_auth_mgr_api_post_auth.info 'user not allowed: ' + "#{current_user}"
950
+ j1_mw_auth_mgr_api_post_auth.info 'allowed users: ' + "#{user_session_data['users_allowed']}"
951
+ j1_mw_auth_mgr_api_post_auth.info 'pass to error page: access_denied'
952
+ description_title = "Access Denied"
953
+ redirect "/access_denied?provider=#{current_provider}&user=#{current_user}&category=#{category}&title=#{description_title}"
954
+ end
955
+ end
956
+ j1_mw_auth_mgr_api_post_auth.info 'allowed users found: ' + "#{user_session_data['users_allowed']}"
957
+
958
+ # Check conditions to access protected content (if any)
959
+ #
960
+ j1_mw_auth_mgr_api_post_auth.info 'check conditions for provider: ' + "#{current_provider}"
961
+ check_conditions = providers["#{user[:provider]}"]['conditions'][category]['enabled']
962
+ if check_conditions
963
+
964
+ if providers["#{user[:provider]}"]['conditions'][category]['users']['whitelist'].nil?
965
+ category_whitelist = 'all'
966
+ else
967
+ category_whitelist = providers["#{user[:provider]}"]['conditions'][category]['users']['whitelist']
968
+ end
969
+
970
+ # Check if user is BLACKLISTED
971
+ #
972
+ blacklist = providers["#{user[:provider]}"]['conditions'][category]['users']['blacklist']
973
+ if blacklist.include? "#{current_user}"
974
+ j1_mw_auth_mgr_api_post_auth.info 'check blacklisting'
975
+ j1_mw_auth_mgr_api_post_auth.info 'found user blacklisted: ' + "#{current_user}"
976
+
977
+ user[:info][:blacklisted] = 'true'
978
+ j1_mw_auth_mgr_api_post_auth.info 'logout user from current session: ' + "#{current_user}"
979
+ warden.logout
980
+ session.clear
981
+ j1_mw_auth_mgr_api_post_auth.info 'pass to error page: access_denied'
982
+ description_title = "User blacklisted"
983
+ redirect "/access_denied?provider=#{current_provider}&user=#{current_user}&category=#{category}&title=#{description_title}"
984
+ end
985
+
986
+ j1_mw_auth_mgr_api_post_auth.info 'check whitelisting'
987
+ if category_whitelisted? category_whitelist, current_user
988
+ user[:info][:whitelisted] = 'true'
989
+ reward[:name] = 'whitelisted'
990
+ j1_mw_auth_mgr_api_post_auth.info 'found user whitelisted: ' + "#{current_user}"
991
+ j1_mw_auth_mgr_api_post_auth.info 'set user rewards to: whitelisted'
992
+ else
993
+ j1_mw_auth_mgr_api_post_auth.info 'no whitelisting found for user: ' + "#{current_user}"
994
+ end
995
+ j1_mw_auth_mgr_api_post_auth.info 'check provider conditions'
996
+ unless category_whitelisted? category_whitelist, current_user
997
+ j1_mw_auth_mgr_api_post_auth.info 'check rewards for user: ' + "#{current_user}"
998
+ payment_tiers = providers["#{user[:provider]}"]['conditions'][category]['payment']['activated']
999
+ if payment_activated? payment_tiers
1000
+ j1_mw_auth_mgr_api_post_auth.info 'rewards found : ' + "#{reward[:name]}"
1001
+
1002
+ # Check if any payment exists
1003
+ # --------------------------------------------------------------
1004
+ j1_mw_auth_mgr_api_post_auth.info 'check payment status'
1005
+ if user[:info]['payment_info'].empty?
1006
+ j1_mw_auth_mgr_api_post_auth.info 'payment status not available for user: ' + "#{current_user}"
1007
+ j1_mw_auth_mgr_api_post_auth.info 'logout user from current session'
1008
+ warden.logout
1009
+ session.clear
1010
+ j1_mw_auth_mgr_api_post_auth.info 'pass to error page: access denied'
1011
+ description_title = "Invalid funds"
1012
+ redirect "/access_denied?provider=#{current_provider}&user=#{current_user}&category=#{category}&title=#{description_title}"
1013
+ end
1014
+
1015
+ # Check for VALID payments (scope: pledge-to-me)
1016
+ # --------------------------------------------------------------
1017
+ payment_status = user[:info]['payment_info']['attributes']['declined_since']
1018
+ unless payment_valid? payment_status
1019
+ j1_mw_auth_mgr_api_post_auth.info 'payment status invalid for user: ' + "#{current_user}"
1020
+ j1_mw_auth_mgr_api_post_auth.info 'logout user from current session'
1021
+ warden.logout
1022
+ session.clear
1023
+ j1_mw_auth_mgr_api_post_auth.info 'pass to error page: access denied'
1024
+ description_title = "Invalid funds"
1025
+ redirect "/access_denied?provider=#{current_provider}&user=#{current_user}&category=#{category}&title=#{description_title}"
1026
+ else
1027
+ j1_mw_auth_mgr_api_post_auth.info 'payment status valid for user: ' + "#{current_user}"
1028
+ end
1029
+ end
1030
+
1031
+ end
1032
+ # end category_whitelisted
1033
+ else
1034
+ category_condition_state = providers["#{user[:provider]}"]['conditions'][category]['enabled']
1035
+
1036
+ j1_mw_auth_mgr_api_post_auth.info 'category check failed for provider: ' + "#{current_provider}"
1037
+ j1_mw_auth_mgr_api_post_auth.info 'category check failed for category: ' + "#{category}"
1038
+ j1_mw_auth_mgr_api_post_auth.info 'category support found as: ' + "#{category_condition_state}"
1039
+ j1_mw_auth_mgr_api_post_auth.info 'pass to error page: access denied'
1040
+
1041
+ description_title = "Access Denied"
1042
+ redirect "/access_denied?provider=#{current_provider}&user=#{current_user}&category=#{category}&title=#{description_title}"
1043
+ end
1044
+ # end check conditions
1045
+
1046
+ end
1047
+ # end protected content
1048
+ end
1049
+ # end user.nil?
1050
+
1051
+ # jadams, 2019-08-08: writeCookie of 'j1.user.session' is needed to
1052
+ # track the requested_page. This cause the potential risk to
1053
+ # corrupt the cookie (now, for unknown reason)
1054
+ # ------------------------------------------------------------------
1055
+ timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
1056
+ user_session_data['timestamp'] = timestamp
1057
+ user_session_data['writer'] = 'middleware'
1058
+ session_json = user_session_data.to_json
1059
+
1060
+ j1_mw_auth_mgr_preflight.info 'write user session data to cookie: ' + "#{session_json}"
1061
+ writeCookie(user_session_cookie, session_json)
1062
+
1063
+ j1_mw_auth_mgr_api_post_auth.info 'provider detected: ' + "#{user[:provider]}"
1064
+ j1_mw_auth_mgr_api_post_auth.info 'user detected: ' + "#{user[:info]['nickname']}"
1065
+ j1_mw_auth_mgr_api_post_auth.info 'pass to requested page: ' + "#{user_session_data['requested_page']}"
1066
+
1067
+ redirect user_session_data['requested_page']
1068
+ end
1069
+ # --------------------------------------------------------------------------
1070
+ # END: get /post_authentication
1071
+
1072
+ # ENDPOINT status (called from WEB to get current state of an user)
1073
+ # --------------------------------------------------------------------------
1074
+ get '/status' do
1075
+ requested_page = params.fetch('page')
1076
+ category = 'public'
1077
+
1078
+ requested_page.scan(/(public|protected|private)/) do |match|
1079
+ category = match[0]
1080
+ end
1081
+
1082
+ # MDC.put('path', requested_page)
1083
+ MDC.put('path', env['REQUEST_URI'])
1084
+ j1_mw_auth_mgr_api_state.info 'status request received'
1085
+ j1_mw_auth_mgr_api_state.info 'page requested: ' + "#{requested_page}"
1086
+ j1_mw_auth_mgr_api_state.info 'content category found: ' + "#{category}"
1087
+
1088
+ # if request.warden.user.respond_to?(:info)
1089
+ #
1090
+ if warden.authenticated?
1091
+ user_name = warden.user[:info]['nickname']
1092
+ user_id = warden.user[:uid]
1093
+ users_allowed = providers[warden.user[:provider]]['users']
1094
+ provider = warden.user[:provider]
1095
+ provider_membership = 'member'
1096
+ provider_permissions = user_session_data['provider_permissions']
1097
+
1098
+ if provider == 'github'
1099
+ provider_site_url = warden.user[:info][:urls][:site]
1100
+ provider_home_url = warden.user[:info][:urls][:blog]
1101
+ provider_blog_url = warden.user[:info][:urls][:blog]
1102
+ provider_member_url = warden.user[:info][:urls][:blog]
1103
+ end
1104
+
1105
+ if provider == 'disqus'
1106
+ provider_site_url = warden.user[:info][:urls][:site]
1107
+ provider_home_url = warden.user[:info][:urls][:blog]
1108
+ provider_blog_url = warden.user[:info][:urls][:blog]
1109
+ provider_member_url = warden.user[:info][:urls][:blog]
1110
+ end
1111
+
1112
+ if provider == 'patreon'
1113
+ provider_membership = warden.user[:extra][:reward][:name]
1114
+ provider_site_url = warden.user[:info][:urls][:site]
1115
+ provider_home_url = warden.user[:info][:urls][:home]
1116
+ provider_blog_url = warden.user[:info][:urls][:blog]
1117
+ provider_member_url = warden.user[:extra][:reward][:link]
1118
+ end
1119
+
1120
+ j1_mw_auth_mgr_api_state.info 'user detected as: ' + "#{user_name}"
1121
+ j1_mw_auth_mgr_api_state.info 'user state detected as: signed in'
1122
+ else
1123
+ user_name = 'unknown'
1124
+ j1_mw_auth_mgr_api_state.info 'user state detected as: signed out'
1125
+ end
1126
+
1127
+ timestamp = Time.now.strftime("%Y-%m-%d %H:%M:%S")
1128
+
1129
+ # if request.warden.authenticated?
1130
+ #
1131
+ if user_name != 'unknown'
1132
+ j1_mw_auth_mgr_api_state.info 'send data for: signed in'
1133
+ content_type 'application/json'
1134
+ {
1135
+ user_name: user_name,
1136
+ user_id: user_id,
1137
+ users_allowed: users_allowed,
1138
+ provider: provider,
1139
+ provider_membership: provider_membership,
1140
+ provider_permissions: provider_permissions,
1141
+ provider_site_url: provider_site_url,
1142
+ provider_home_url: provider_home_url,
1143
+ provider_blog_url: provider_blog_url,
1144
+ provider_member_url: provider_member_url,
1145
+ provider_privacy_url: provider_privacy_url_default,
1146
+ page_permission: category,
1147
+ requested_page: requested_page,
1148
+ authenticated: 'true',
1149
+ timestamp: timestamp
1150
+ }.to_json
1151
+ else
1152
+ j1_mw_auth_mgr_api_state.info 'send data for: signed out'
1153
+ content_type 'application/json'
1154
+ {
1155
+ user_name: 'visitor',
1156
+ user_id: 'unknown',
1157
+ users_allowed: 'all',
1158
+ provider: 'j1',
1159
+ provider_membership: 'guest',
1160
+ provider_permissions: ['public'],
1161
+ provider_site_url: provider_site_url_default,
1162
+ provider_home_url: provider_home_url_default,
1163
+ provider_blog_url: provider_blog_url_default,
1164
+ provider_member_url: provider_member_url_default,
1165
+ provider_privacy_url: provider_privacy_url_default,
1166
+ page_permission: category,
1167
+ requested_page: requested_page,
1168
+ authenticated: 'false',
1169
+ timestamp: timestamp
1170
+ }.to_json
1171
+ end
1172
+ end
1173
+ # --------------------------------------------------------------------------
1174
+ # END: get /status
1175
+
1176
+ # ENDPOINT access_denied (exception, called from the app|auth manager)
1177
+ # --------------------------------------------------------------------------
1178
+ get '/access_denied' do
1179
+ provider = params.fetch('provider')
1180
+ category = params.fetch('category')
1181
+ user = params.fetch('user')
1182
+ description_title = params.fetch('title')
1183
+
1184
+ MDC.put('path', env['REQUEST_URI'])
1185
+ j1_mw_auth_mgr_api_auth.info 'request received'
1186
+ j1_mw_auth_mgr_api_auth.warn 'access denied'
1187
+
1188
+ # Read current J1 SESSION cookie
1189
+ # ------------------------------------------------------------------------
1190
+ if existsCookie? user_session_cookie
1191
+ j1_mw_auth_mgr_api_auth.info 'read user session cookie'
1192
+ user_session_data = readCookie(user_session_cookie)
1193
+ else
1194
+ j1_mw_auth_mgr_api_auth.error 'user session cookie missing: ' + "#{user_session_cookie}"
1195
+ end
1196
+
1197
+ j1_mw_auth_mgr_api_auth.info 'pass to error page: access denied'
1198
+
1199
+ # Capitalize first char
1200
+ provider = provider.sub(/^./, &:upcase)
1201
+ route = '/'
1202
+
1203
+ @route = route
1204
+ @provider = provider
1205
+ @modal = "centralModalInfo"
1206
+ @info_type = "danger"
1207
+ @modal_icon = "account-off"
1208
+ @modal_ok_text = "Ok, understood"
1209
+ @modal_title = "Authentication Manager"
1210
+ @modal_description = "<h4>#{description_title}</h4></br></br> User <b>#{user}</b> from provider <b>#{provider}</b> is not allowed to access <b>#{category}</b> pages."
1211
+
1212
+ erb :auth_manager_ui
1213
+ end
1214
+ # --------------------------------------------------------------------------
1215
+ # END: get '/access_denied'
1216
+
1217
+ # /page_validation ENDPOINT
1218
+ # --------------------------------------------------------------------------
1219
+ get '/page_validation' do
1220
+ requested_page = params.fetch('page')
1221
+ category = ''
1222
+ provider = ''
1223
+ allowed_users = ''
1224
+
1225
+ # MDC.put('path', requested_page)
1226
+ MDC.put('path', env['REQUEST_URI'])
1227
+ j1_mw_auth_mgr_api_validate.info 'validate request received for page: ' + "#{requested_page}"
1228
+
1229
+ requested_page.scan(/(protected|private)/) do |match|
1230
+ category = match[0]
1231
+ provider = permissions[:"#{category}"][0]
1232
+ allowed_users = providers["#{provider}"]['users'].join(',')
1233
+ end
1234
+
1235
+ j1_mw_auth_mgr_api_validate.info 'category detected: ' + "#{category}"
1236
+ j1_mw_auth_mgr_api_validate.info 'provider detected: ' + "#{provider}"
1237
+ j1_mw_auth_mgr_api_validate.info 'users allowed detected: ' + "#{allowed_users}"
1238
+
1239
+
1240
+ if warden.authenticated?
1241
+ j1_mw_auth_mgr_api_validate.info 'validation: successful'
1242
+ j1_mw_auth_mgr_api_validate.info 'pass user to requested page: ' + "#{requested_page}"
1243
+ route = requested_page
1244
+ else
1245
+ j1_mw_auth_mgr_api_validate.info 'validation: failed: user not authenticated'
1246
+ j1_mw_auth_mgr_api_validate.info 'pass user to authentication: ' + "/authentication?request=signin&provider=#{provider}&allowed_users=#{allowed_users}"
1247
+ route = "/authentication?request=signin&provider=#{provider}&allowed_users=#{allowed_users}"
1248
+ end
1249
+
1250
+ # Capitalize first char
1251
+ provider = provider.sub(/^./, &:upcase)
1252
+
1253
+ @provider = provider
1254
+ @route = route
1255
+ @modal = "signInProtectedContent"
1256
+ @modal_icon = "login"
1257
+ @modal_agreed_text = "Yes, please"
1258
+ @modal_disagreed_text = "No, thanks"
1259
+ @modal_title = "SignIn"
1260
+ @modal_image = "/assets/images/modules/attics/banner/admin-dashboard-bootstrap-1280x600.png"
1261
+ @modal_description = "The page <b>#{requested_page}</b> you requested belongs to <b>#{category}</b> content. You'll be redirected to authenticate with the provider <b>#{provider}</b>. If signed in successfully, you get access to all <b>#{category} pages</b>."
1262
+
1263
+ erb :auth_manager_ui
1264
+ end
1265
+ # --------------------------------------------------------------------------
1266
+ # END: get '/page_validation
1267
+
1268
+ # Rescue OmniAuth::Strategies::OAuth2::CallbackError
1269
+ # ------------------------------------------------------------------------
1270
+ get '/redirect_on_failure' do
1271
+
1272
+ MDC.put('path', env['REQUEST_URI'])
1273
+ j1_mw_auth_mgr_api_auth .error 'callback error on oauth redirect'
1274
+ j1_mw_auth_mgr_api_auth.info 'pass user to page: /'
1275
+
1276
+ redirect '/'
1277
+ end
1278
+
1279
+ post '/log2disk' do
1280
+ # payload = params
1281
+ # request = params.fetch('request')
1282
+ logger = params.fetch('logger')
1283
+ epoch = params.fetch('timestamp').to_i
1284
+ level = params.fetch('level')
1285
+ url = params.fetch('url')
1286
+ message = params.fetch('message')
1287
+ # layout = params.fetch('layout')
1288
+ timestamp = Time.at(epoch/1000.0).strftime('%Y-%m-%d %H:%M:%S.%3N')
1289
+ path = ''
1290
+
1291
+ # additional response header to allow 'log2disk' requests
1292
+ # from several origins
1293
+ # NOTE: See response header control for 'Sinatra'
1294
+ # with j1_site_manager
1295
+ # ------------------------------------------------------------------------
1296
+ response.headers['Access-Control-Allow-Origin'] = '*'
1297
+
1298
+ url.scan(/((?:file|https?):.*?):(\d+)(.*)/) do |match|
1299
+ path = match[2]
1300
+ end
1301
+
1302
+ if logger.include? 'j1.mw'
1303
+ MDC.put('id', page_id)
1304
+ else
1305
+ MDC.put('id', env['HTTP_X_PAGE_ID'])
1306
+ end
1307
+
1308
+ MDC.put('path', path)
1309
+ MDC.put('level', level)
1310
+ MDC.put('timestamp', timestamp)
1311
+ MDC.put('message', message)
1312
+ MDC.put('logger', logger)
1313
+
1314
+ j1_mw_auth_mgr_api_log2disk.info 'pass data'
1315
+
1316
+ # return HTTP 200
1317
+ "finished"
1318
+ end
1319
+ # --------------------------------------------------------------------------
1320
+ # END: get /redirect_on_failure
1321
+
1322
+ # ENDPOINT invalid_funds (exception, called from the app|auth manager)
1323
+ # --------------------------------------------------------------------------
1324
+ # get '/invalid_funds' do
1325
+ # provider = params.fetch('provider')
1326
+ # category = params.fetch('category')
1327
+ # user = params.fetch('user')
1328
+ # description_title = params.fetch('title')
1329
+ #
1330
+ # log_info! 'API', 'ExceptionHandler', 'Request received'
1331
+ # log_info! 'ExceptionHandler', 'ERROR', 'Invalid Funds'
1332
+ #
1333
+ # session_encoded = request.cookies['j1.user.session']
1334
+ # session_decoded = Base64.decode64(session_encoded)
1335
+ # user_session_data = JSON.parse(session_decoded)
1336
+ #
1337
+ # log_info! 'ExceptionHandler', 'Redirect', 'Pass to error page', 'Invalid Funds'
1338
+ #
1339
+ # # Capitalize first char
1340
+ # provider = provider.sub(/^./, &:upcase)
1341
+ # route = '/'
1342
+ #
1343
+ # @route = route
1344
+ # @provider = provider
1345
+ # @modal = "centralModalInfo"
1346
+ # @info_type = "danger"
1347
+ # @modal_icon = "account-off"
1348
+ # @modal_ok_text = "Ok, understood"
1349
+ # @modal_title = "Authentication Manager"
1350
+ # @modal_description = "<h4>#{description_title}</h4></br></br> User <b>#{user}</b> from provider <b>#{provider}</b> is not allowed to access <b>#{category}</b> pages."
1351
+ #
1352
+ # erb :auth_manager_ui
1353
+ # end
1354
+ # END: get /invalid_funds
1355
+ # --------------------------------------------------------------------------
1356
+
1357
+ # ENDPOINT iframe
1358
+ # --------------------------------------------------------------------------
1359
+ # get '/iframe' do
1360
+ # @website_url = "https://jekyll-one.github.io/"
1361
+ # erb :iframe
1362
+ # end
1363
+ # END: get /iframe
1364
+ # --------------------------------------------------------------------------
1365
+
1366
+ end
1367
+ end