├── .gitignore ├── Gemfile ├── Gemfile.lock ├── README.md ├── Rakefile ├── app.json ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ ├── .keep │ │ ├── cloudflare.svg │ │ ├── heroku.svg │ │ ├── letsencrypt.svg │ │ └── refresh.svg │ ├── javascripts │ │ └── application.js │ └── stylesheets │ │ ├── application.scss │ │ ├── milligram │ │ ├── alert.scss │ │ ├── button.scss │ │ ├── grid.scss │ │ ├── typography.scss │ │ └── variables.scss │ │ └── styles.scss ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── controllers │ ├── application_controller.rb │ ├── certificates_controller.rb │ ├── concerns │ │ └── .keep │ ├── sessions_controller.rb │ └── users_controller.rb ├── helpers │ └── application_helper.rb ├── jobs │ └── application_job.rb ├── mailers │ └── application_mailer.rb ├── models │ ├── application_record.rb │ ├── certificate.rb │ ├── concerns │ │ ├── .keep │ │ └── assignable.rb │ └── user.rb ├── services │ ├── application_service.rb │ ├── create_certificates.rb │ ├── get_certificate_status.rb │ ├── get_heroku_apps.rb │ └── send_request.rb └── views │ ├── certificates │ ├── _certificate.html.slim │ ├── index.html.slim │ ├── new.html.slim │ └── show.html.slim │ ├── layouts │ ├── application.html.slim │ ├── mailer.html.erb │ └── mailer.text.erb │ ├── sessions │ └── new.html.slim │ ├── shared │ ├── _flashes.html.slim │ └── _header.html.slim │ └── users │ └── new.html.slim ├── bin ├── bundle ├── rails ├── rake ├── setup ├── spring └── update ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cable.yml ├── database.yml ├── database.yml.example ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── cookies_serializer.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── new_framework_defaults.rb │ ├── session_store.rb │ ├── simple_form.rb │ └── wrap_parameters.rb ├── locales │ ├── en.yml │ └── simple_form.en.yml ├── puma.rb ├── routes.rb ├── secrets.yml └── spring.rb ├── db ├── migrate │ ├── 20161118091701_create_certificates.rb │ ├── 20161118094110_change_debug_type_in_certificates.rb │ ├── 20161118104931_add_status_path_to_certificates.rb │ ├── 20161118154903_add_status_errors_to_certificates.rb │ ├── 20161118154957_add_message_to_certificates.rb │ ├── 20161121084342_create_users.rb │ ├── 20161121100855_add_auth_token_to_users.rb │ ├── 20161124160747_add_user_to_certificates.rb │ └── 20170119105330_rename_domain_to_zone_in_certificates.rb ├── schema.rb └── seeds.rb ├── lib ├── assets │ └── .keep ├── tasks │ └── .keep └── templates │ └── slim │ └── scaffold │ └── _form.html.slim ├── public ├── 404.html ├── 422.html ├── 500.html ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── favicon.ico └── robots.txt ├── test ├── controllers │ └── .keep ├── fixtures │ ├── .keep │ ├── files │ │ └── .keep │ └── users.yml ├── helpers │ └── .keep ├── integration │ └── .keep ├── mailers │ └── .keep ├── models │ ├── .keep │ └── user_test.rb └── test_helper.rb └── vendor └── assets └── stylesheets ├── .keep └── milligram ├── _Base.sass ├── _Blockquote.sass ├── _Button.sass ├── _Code.sass ├── _Color.sass ├── _Divider.sass ├── _Form.sass ├── _Grid.sass ├── _Image.sass ├── _Link.sass ├── _List.sass ├── _Spacing.sass ├── _Table.sass ├── _Typography.sass ├── _Utility.sass └── milligram.sass /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore all logfiles and tempfiles. 11 | /log/* 12 | /tmp/* 13 | !/log/.keep 14 | !/tmp/.keep 15 | 16 | # Ignore Byebug command history file. 17 | .byebug_history 18 | 19 | # Ignore database.yml conf file 20 | /config/database.yml 21 | 22 | .vscode 23 | 24 | # Created by https://www.gitignore.io/api/ruby,rubymine,rails,macos,node 25 | 26 | ### Ruby ### 27 | *.gem 28 | *.rbc 29 | /.config 30 | /coverage/ 31 | /InstalledFiles 32 | /pkg/ 33 | /spec/reports/ 34 | /spec/examples.txt 35 | /test/tmp/ 36 | /test/version_tmp/ 37 | /tmp/ 38 | 39 | # Used by dotenv library to load environment variables. 40 | # .env 41 | 42 | ## Specific to RubyMotion: 43 | .dat* 44 | .repl_history 45 | build/ 46 | *.bridgesupport 47 | build-iPhoneOS/ 48 | build-iPhoneSimulator/ 49 | 50 | ## Specific to RubyMotion (use of CocoaPods): 51 | # 52 | # We recommend against adding the Pods directory to your .gitignore. However 53 | # you should judge for yourself, the pros and cons are mentioned at: 54 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 55 | # 56 | # vendor/Pods/ 57 | 58 | ## Documentation cache and generated files: 59 | /.yardoc/ 60 | /_yardoc/ 61 | /doc/ 62 | /rdoc/ 63 | 64 | ## Environment normalization: 65 | /.bundle/ 66 | /vendor/bundle 67 | /lib/bundler/man/ 68 | 69 | # for a library or gem, you might want to ignore these files since the code is 70 | # intended to run in multiple environments; otherwise, check them in: 71 | # Gemfile.lock 72 | # .ruby-version 73 | # .ruby-gemset 74 | 75 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 76 | .rvmrc 77 | 78 | 79 | ### RubyMine ### 80 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 81 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 82 | 83 | # User-specific stuff: 84 | .idea/workspace.xml 85 | .idea/tasks.xml 86 | 87 | # Sensitive or high-churn files: 88 | .idea/dataSources/ 89 | .idea/dataSources.ids 90 | .idea/dataSources.xml 91 | .idea/dataSources.local.xml 92 | .idea/sqlDataSources.xml 93 | .idea/dynamic.xml 94 | .idea/uiDesigner.xml 95 | 96 | # Gradle: 97 | .idea/gradle.xml 98 | .idea/libraries 99 | 100 | # Mongo Explorer plugin: 101 | .idea/mongoSettings.xml 102 | 103 | ## File-based project format: 104 | *.iws 105 | 106 | ## Plugin-specific files: 107 | 108 | # IntelliJ 109 | /out/ 110 | 111 | # mpeltonen/sbt-idea plugin 112 | .idea_modules/ 113 | 114 | # JIRA plugin 115 | atlassian-ide-plugin.xml 116 | 117 | # Crashlytics plugin (for Android Studio and IntelliJ) 118 | com_crashlytics_export_strings.xml 119 | crashlytics.properties 120 | crashlytics-build.properties 121 | fabric.properties 122 | 123 | ### RubyMine Patch ### 124 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 125 | 126 | # *.iml 127 | # modules.xml 128 | # .idea/misc.xml 129 | # *.ipr 130 | 131 | 132 | ### Rails ### 133 | capybara-*.html 134 | .rspec 135 | /log 136 | /tmp 137 | /db/*.sqlite3 138 | /db/*.sqlite3-journal 139 | /public/system 140 | /spec/tmp 141 | **.orig 142 | rerun.txt 143 | pickle-email-*.html 144 | 145 | # TODO Comment out this rule if you are OK with secrets being uploaded to the repo 146 | config/initializers/secret_token.rb 147 | 148 | # Only include if you have production secrets in this file, which is no longer a Rails default 149 | # config/secrets.yml 150 | 151 | # dotenv 152 | # TODO Comment out this rule if environment variables can be committed 153 | .env 154 | 155 | ## Environment normalization: 156 | /.bundle 157 | 158 | # these should all be checked in to normalize the environment: 159 | # Gemfile.lock, .ruby-version, .ruby-gemset 160 | 161 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 162 | 163 | # if using bower-rails ignore default bower_components path bower.json files 164 | /vendor/assets/bower_components 165 | *.bowerrc 166 | bower.json 167 | 168 | # Ignore pow environment settings 169 | .powenv 170 | 171 | # Ignore Byebug command history file. 172 | .byebug_history 173 | 174 | 175 | ### macOS ### 176 | *.DS_Store 177 | .AppleDouble 178 | .LSOverride 179 | 180 | # Icon must end with two \r 181 | Icon 182 | # Thumbnails 183 | ._* 184 | # Files that might appear in the root of a volume 185 | .DocumentRevisions-V100 186 | .fseventsd 187 | .Spotlight-V100 188 | .TemporaryItems 189 | .Trashes 190 | .VolumeIcon.icns 191 | .com.apple.timemachine.donotpresent 192 | # Directories potentially created on remote AFP share 193 | .AppleDB 194 | .AppleDesktop 195 | Network Trash Folder 196 | Temporary Items 197 | .apdisk 198 | 199 | 200 | ### Node ### 201 | # Logs 202 | logs 203 | *.log 204 | npm-debug.log* 205 | 206 | # Runtime data 207 | pids 208 | *.pid 209 | *.seed 210 | *.pid.lock 211 | 212 | # Directory for instrumented libs generated by jscoverage/JSCover 213 | lib-cov 214 | 215 | # Coverage directory used by tools like istanbul 216 | coverage 217 | 218 | # nyc test coverage 219 | .nyc_output 220 | 221 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 222 | .grunt 223 | 224 | # node-waf configuration 225 | .lock-wscript 226 | 227 | # Compiled binary addons (http://nodejs.org/api/addons.html) 228 | build/Release 229 | 230 | # Dependency directories 231 | node_modules 232 | jspm_packages 233 | 234 | # Optional npm cache directory 235 | .npm 236 | 237 | # Optional eslint cache 238 | .eslintcache 239 | 240 | # Optional REPL history 241 | .node_repl_history 242 | 243 | # Output of 'npm pack' 244 | *.tgz 245 | 246 | # Yarn Integrity file 247 | .yarn-integrity 248 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rails', '~> 5.0.1' 4 | gem 'pg', '~> 0.18' 5 | gem 'puma', '~> 3.0' 6 | gem 'sass-rails', '~> 5.0' 7 | gem 'vanilla-ujs' 8 | gem 'uglifier', '>= 1.3.0' 9 | gem 'jbuilder', '~> 2.5' 10 | gem 'httparty', '~> 0.14.0' 11 | 12 | gem 'slim-rails', '~> 3.1', '>= 3.1.1' 13 | gem 'simple_form', '~> 3.3', '>= 3.3.1' 14 | gem 'dotenv-rails', '~> 2.1', '>= 2.1.1' 15 | gem 'bcrypt', '~> 3.1', '>= 3.1.11' 16 | gem 'inline_svg' 17 | 18 | 19 | group :development, :test do 20 | gem 'byebug', platform: :mri 21 | end 22 | 23 | group :development do 24 | gem 'web-console' 25 | gem 'listen', '~> 3.0.5' 26 | gem 'spring' 27 | gem 'spring-watcher-listen', '~> 2.0.0' 28 | end 29 | 30 | gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 31 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (5.0.1) 5 | actionpack (= 5.0.1) 6 | nio4r (~> 1.2) 7 | websocket-driver (~> 0.6.1) 8 | actionmailer (5.0.1) 9 | actionpack (= 5.0.1) 10 | actionview (= 5.0.1) 11 | activejob (= 5.0.1) 12 | mail (~> 2.5, >= 2.5.4) 13 | rails-dom-testing (~> 2.0) 14 | actionpack (5.0.1) 15 | actionview (= 5.0.1) 16 | activesupport (= 5.0.1) 17 | rack (~> 2.0) 18 | rack-test (~> 0.6.3) 19 | rails-dom-testing (~> 2.0) 20 | rails-html-sanitizer (~> 1.0, >= 1.0.2) 21 | actionview (5.0.1) 22 | activesupport (= 5.0.1) 23 | builder (~> 3.1) 24 | erubis (~> 2.7.0) 25 | rails-dom-testing (~> 2.0) 26 | rails-html-sanitizer (~> 1.0, >= 1.0.2) 27 | activejob (5.0.1) 28 | activesupport (= 5.0.1) 29 | globalid (>= 0.3.6) 30 | activemodel (5.0.1) 31 | activesupport (= 5.0.1) 32 | activerecord (5.0.1) 33 | activemodel (= 5.0.1) 34 | activesupport (= 5.0.1) 35 | arel (~> 7.0) 36 | activesupport (5.0.1) 37 | concurrent-ruby (~> 1.0, >= 1.0.2) 38 | i18n (~> 0.7) 39 | minitest (~> 5.1) 40 | tzinfo (~> 1.1) 41 | arel (7.1.4) 42 | bcrypt (3.1.11) 43 | builder (3.2.3) 44 | byebug (9.0.6) 45 | concurrent-ruby (1.0.4) 46 | debug_inspector (0.0.2) 47 | dotenv (2.1.1) 48 | dotenv-rails (2.1.1) 49 | dotenv (= 2.1.1) 50 | railties (>= 4.0, < 5.1) 51 | erubis (2.7.0) 52 | execjs (2.7.0) 53 | ffi (1.9.14) 54 | globalid (0.3.7) 55 | activesupport (>= 4.1.0) 56 | httparty (0.14.0) 57 | multi_xml (>= 0.5.2) 58 | i18n (0.7.0) 59 | inline_svg (0.11.0) 60 | activesupport (>= 4.0) 61 | loofah (>= 2.0) 62 | nokogiri (~> 1.6) 63 | jbuilder (2.6.0) 64 | activesupport (>= 3.0.0, < 5.1) 65 | multi_json (~> 1.2) 66 | listen (3.0.8) 67 | rb-fsevent (~> 0.9, >= 0.9.4) 68 | rb-inotify (~> 0.9, >= 0.9.7) 69 | loofah (2.0.3) 70 | nokogiri (>= 1.5.9) 71 | mail (2.6.4) 72 | mime-types (>= 1.16, < 4) 73 | method_source (0.8.2) 74 | mime-types (3.1) 75 | mime-types-data (~> 3.2015) 76 | mime-types-data (3.2016.0521) 77 | mini_portile2 (2.1.0) 78 | minitest (5.10.1) 79 | multi_json (1.12.1) 80 | multi_xml (0.5.5) 81 | nio4r (1.2.1) 82 | nokogiri (1.7.0.1) 83 | mini_portile2 (~> 2.1.0) 84 | pg (0.19.0) 85 | puma (3.6.0) 86 | rack (2.0.1) 87 | rack-test (0.6.3) 88 | rack (>= 1.0) 89 | rails (5.0.1) 90 | actioncable (= 5.0.1) 91 | actionmailer (= 5.0.1) 92 | actionpack (= 5.0.1) 93 | actionview (= 5.0.1) 94 | activejob (= 5.0.1) 95 | activemodel (= 5.0.1) 96 | activerecord (= 5.0.1) 97 | activesupport (= 5.0.1) 98 | bundler (>= 1.3.0, < 2.0) 99 | railties (= 5.0.1) 100 | sprockets-rails (>= 2.0.0) 101 | rails-dom-testing (2.0.2) 102 | activesupport (>= 4.2.0, < 6.0) 103 | nokogiri (~> 1.6) 104 | rails-html-sanitizer (1.0.3) 105 | loofah (~> 2.0) 106 | railties (5.0.1) 107 | actionpack (= 5.0.1) 108 | activesupport (= 5.0.1) 109 | method_source 110 | rake (>= 0.8.7) 111 | thor (>= 0.18.1, < 2.0) 112 | rake (12.0.0) 113 | rb-fsevent (0.9.8) 114 | rb-inotify (0.9.7) 115 | ffi (>= 0.5.0) 116 | sass (3.4.22) 117 | sass-rails (5.0.6) 118 | railties (>= 4.0.0, < 6) 119 | sass (~> 3.1) 120 | sprockets (>= 2.8, < 4.0) 121 | sprockets-rails (>= 2.0, < 4.0) 122 | tilt (>= 1.1, < 3) 123 | simple_form (3.3.1) 124 | actionpack (> 4, < 5.1) 125 | activemodel (> 4, < 5.1) 126 | slim (3.0.7) 127 | temple (~> 0.7.6) 128 | tilt (>= 1.3.3, < 2.1) 129 | slim-rails (3.1.1) 130 | actionpack (>= 3.1) 131 | railties (>= 3.1) 132 | slim (~> 3.0) 133 | spring (2.0.0) 134 | activesupport (>= 4.2) 135 | spring-watcher-listen (2.0.1) 136 | listen (>= 2.7, < 4.0) 137 | spring (>= 1.2, < 3.0) 138 | sprockets (3.7.1) 139 | concurrent-ruby (~> 1.0) 140 | rack (> 1, < 3) 141 | sprockets-rails (3.2.0) 142 | actionpack (>= 4.0) 143 | activesupport (>= 4.0) 144 | sprockets (>= 3.0.0) 145 | temple (0.7.7) 146 | thor (0.19.4) 147 | thread_safe (0.3.5) 148 | tilt (2.0.5) 149 | tzinfo (1.2.2) 150 | thread_safe (~> 0.1) 151 | uglifier (3.0.3) 152 | execjs (>= 0.3.0, < 3) 153 | vanilla-ujs (1.3.0) 154 | railties (>= 4.2.0) 155 | web-console (3.4.0) 156 | actionview (>= 5.0) 157 | activemodel (>= 5.0) 158 | debug_inspector 159 | railties (>= 5.0) 160 | websocket-driver (0.6.4) 161 | websocket-extensions (>= 0.1.0) 162 | websocket-extensions (0.1.2) 163 | 164 | PLATFORMS 165 | ruby 166 | 167 | DEPENDENCIES 168 | bcrypt (~> 3.1, >= 3.1.11) 169 | byebug 170 | dotenv-rails (~> 2.1, >= 2.1.1) 171 | httparty (~> 0.14.0) 172 | inline_svg 173 | jbuilder (~> 2.5) 174 | listen (~> 3.0.5) 175 | pg (~> 0.18) 176 | puma (~> 3.0) 177 | rails (~> 5.0.1) 178 | sass-rails (~> 5.0) 179 | simple_form (~> 3.3, >= 3.3.1) 180 | slim-rails (~> 3.1, >= 3.1.1) 181 | spring 182 | spring-watcher-listen (~> 2.0.0) 183 | tzinfo-data 184 | uglifier (>= 1.3.0) 185 | vanilla-ujs 186 | web-console 187 | 188 | BUNDLED WITH 189 | 1.13.7 190 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # letsencrypt-heroku-dashboard 2 | 3 | ## Disclaimer 4 | 5 | This project is to use as-is, and should only be used if you understand what you're doing. 6 | 7 | ## But, why ? 8 | 9 | We found a way to make the SSL certificate generation great again a few weeks ago, thanks to the awesome work by the substrakt team ([they blogged about it](https://substrakt.com/heroku-ssl-me-weve-come-a-long-way/)). 10 | 11 | Thanks to [letsencrypt-heroku](https://github.com/substrakt/letsencrypt-heroku/), it's now easy as a `GET` to an API to 12 | - Generate an SSL cert on [Let's Encrypt](https://letsencrypt.org/) 13 | - Verify it through DNS on [Cloudflare](https://www.cloudflare.com/) 14 | - Add it to [Heroku](https://heroku.com) 15 | 16 | ## Introducing `letsencrypt-heroku-dashboard` 17 | 18 | ### New certificate 19 | ![Certificate](http://i.imgur.com/gNp2aSi.png) 20 | 21 | -- 22 | 23 | ### Certificates index 24 | ![Certificates](http://i.imgur.com/rxyF0Hi.png) 25 | 26 | -- 27 | 28 | ### Certificate show 29 | ![Certificate](http://i.imgur.com/X87J7ol.png) 30 | 31 | ## How it works ? 32 | 33 | 1. Follow the instructions & deploy the API at [substrakt's repo letsencrypt-heroku](https://github.com/substrakt/letsencrypt-heroku/) 34 | 2. Save the `auth_token`, you'll need it when you sign up to the dashboard 35 | 3. Deploy the dashboard [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) 36 | 4. The `API_PATH` is the URL on which your API is reachable, like `test-api-app.herokuapp.com` (note that you shouldn't put a `/` after the `.com` 37 | 5. It's deployed ! Sign up with your name, email, password & `auth_token`, which is gonna be linked to your user account 38 | 39 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "letsencrypt-heroku-dashboard", 3 | "description": "An UI to generate your TLS certificates & make your Heroku apps secure.", 4 | "keywords": [ 5 | "ssl", 6 | "security", 7 | "dashboard" 8 | ], 9 | "scripts": { 10 | "postdeploy": "bundle exec rake db:migrate" 11 | }, 12 | "website": "https://drawbotics.com/", 13 | "repository": "https://github.com/drawbotics/letsencrypt-heroku-dashboard", 14 | "env": { 15 | "API_PATH": { 16 | "description": "The path to your letsencrypt-heroku API, finishing by '.herokuapp.com'." 17 | } 18 | }, 19 | "formation": { 20 | "web": { 21 | "quantity": 1, 22 | "size": "Free" 23 | } 24 | }, 25 | "image": "heroku/ruby", 26 | "buildpacks": [ 27 | { 28 | "url": "heroku/ruby" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/images/cloudflare.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/heroku.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/assets/images/letsencrypt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 10 | 15 | 17 | 20 | 22 | 23 | 24 | 27 | 28 | 29 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/assets/images/refresh.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | //= require vanilla-ujs -------------------------------------------------------------------------------- /app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | /* Milligram surcharge */ 2 | @import 'milligram/variables'; 3 | @import 'milligram/milligram'; 4 | @import 'milligram/grid'; 5 | @import 'milligram/typography'; 6 | @import 'milligram/button'; 7 | @import 'milligram/alert'; 8 | 9 | 10 | /* Custom styles */ 11 | @import 'styles'; 12 | -------------------------------------------------------------------------------- /app/assets/stylesheets/milligram/alert.scss: -------------------------------------------------------------------------------- 1 | .alert { 2 | 3 | padding: 10px; 4 | border-radius: 3px; 5 | border: 1px solid; 6 | text-align: center; 7 | 8 | &.alert-error { 9 | background: #E57373; 10 | border-color: #B71C1C; 11 | color: white; 12 | font-weight: 500; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /app/assets/stylesheets/milligram/button.scss: -------------------------------------------------------------------------------- 1 | .button-small { 2 | font-size: .8rem; 3 | height: 2.8rem; 4 | line-height: 2.8rem; 5 | padding: 0 1.5rem; 6 | } 7 | 8 | .button-large { 9 | font-size: 1.4rem; 10 | height: 4.5rem; 11 | line-height: 4.5rem; 12 | padding: 0 2rem; 13 | } 14 | -------------------------------------------------------------------------------- /app/assets/stylesheets/milligram/grid.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 162.0rem; 3 | padding-top: 50px; 4 | } 5 | -------------------------------------------------------------------------------- /app/assets/stylesheets/milligram/typography.scss: -------------------------------------------------------------------------------- 1 | .small { 2 | font-size: 0.8em; 3 | color: #666; 4 | } 5 | -------------------------------------------------------------------------------- /app/assets/stylesheets/milligram/variables.scss: -------------------------------------------------------------------------------- 1 | $red: #E57373; 2 | $darkred: #B71C1C; 3 | -------------------------------------------------------------------------------- /app/assets/stylesheets/styles.scss: -------------------------------------------------------------------------------- 1 | header { 2 | span { 3 | margin: auto 5px; 4 | } 5 | .services { 6 | display: inline-block; 7 | .service-logo { 8 | height: 50px; 9 | width: 50px; 10 | &.heroku, &.letsencrypt { 11 | max-height: 40px; 12 | vertical-align: top; 13 | } 14 | } 15 | } 16 | } 17 | 18 | .certificate-identifier { 19 | font-size: 3rem; 20 | padding: 5px; 21 | background-color: #eee; 22 | border-radius: 5px; 23 | vertical-align: middle; 24 | font-weight: 200; 25 | } 26 | 27 | .refresh-icon { 28 | height: 3rem; 29 | width: 3rem; 30 | margin-left: 15px; 31 | } 32 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery with: :exception 3 | include Assignable 4 | 5 | def current_user 6 | @current_user ||= User.find(session[:user_id]) if session[:user_id] 7 | end 8 | helper_method :current_user 9 | 10 | def auth_token 11 | current_user.auth_token 12 | end 13 | assign :auth_token 14 | 15 | def authorize 16 | redirect_to '/login' unless current_user 17 | end 18 | 19 | end 20 | -------------------------------------------------------------------------------- /app/controllers/certificates_controller.rb: -------------------------------------------------------------------------------- 1 | class CertificatesController < ApplicationController 2 | before_filter :authorize 3 | 4 | include Assignable 5 | assign :certificate 6 | 7 | def show 8 | raw_certificate = Certificate.find(params[:id]) 9 | @certificate = raw_certificate.status_path ? update_certificate(raw_certificate) : raw_certificate 10 | end 11 | 12 | def new 13 | response = GetHerokuApps.call 14 | @app_names = response.map{ |app| app['name'] } 15 | @certificate = Certificate.new 16 | end 17 | 18 | def create 19 | 20 | app_name = certificate_params[:app_name] 21 | zone = certificate_params[:zone] 22 | domains = certificate_params[:domains].split(", ").flat_map{ |l| l.split(",")} 23 | debug = certificate_params[:debug] 24 | 25 | service = CreateCertificates.call(current_user, app_name, zone, domains, debug) 26 | 27 | if service.success? 28 | flash[:success] = service.message 29 | redirect_to service.certificate 30 | else 31 | flash[:error] = service.message 32 | # If there a certificate already exist, then redirect to this one, otherwise a new one 33 | redirect_to service.certificate ? service.certificate : new_certificate_path 34 | end 35 | 36 | end 37 | 38 | assign :certificates 39 | def index 40 | @certificates = Certificate.all.order(:id) 41 | end 42 | 43 | def destroy 44 | certificate = Certificate.find(params[:id]) 45 | if certificate.destroy! 46 | flash[:success] = "Certificate destroyed" 47 | redirect_to certificates_path 48 | else 49 | flash[:error] = "Certificate not destroyed" 50 | redirect_to certificate_path(certificate) 51 | end 52 | end 53 | 54 | private 55 | 56 | def certificate_params 57 | params.require(:certificate).permit(:zone, :domains, :app_name, :debug) 58 | end 59 | 60 | def update_certificate(certificate) 61 | service = GetCertificateStatus.call(certificate, current_user.auth_token) 62 | service.certificate 63 | end 64 | 65 | end 66 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/sessions_controller.rb: -------------------------------------------------------------------------------- 1 | class SessionsController < ApplicationController 2 | 3 | def new 4 | end 5 | 6 | def create 7 | user = User.find_by_email(login_params[:email]) 8 | # If the user exists AND the password entered is correct. 9 | if user && user.authenticate(login_params[:password]) 10 | # Save the user id inside the browser cookie. This is how we keep the user 11 | # logged in when they navigate around our website. 12 | session[:user_id] = user.id 13 | redirect_to certificates_path 14 | else 15 | # If user's login doesn't work, send them back to the login form. 16 | redirect_to '/login' 17 | end 18 | end 19 | 20 | def destroy 21 | session[:user_id] = nil 22 | redirect_to '/login' 23 | end 24 | 25 | private 26 | 27 | def login_params 28 | params.require(:user).permit(:email, :password) 29 | end 30 | 31 | end 32 | -------------------------------------------------------------------------------- /app/controllers/users_controller.rb: -------------------------------------------------------------------------------- 1 | class UsersController < ApplicationController 2 | 3 | def new 4 | end 5 | 6 | def create 7 | user = User.new(user_params) 8 | if user.save 9 | session[:user_id] = user.id 10 | redirect_to '/' 11 | else 12 | redirect_to '/signup' 13 | end 14 | end 15 | 16 | private 17 | 18 | def user_params 19 | params.require(:user).permit(:name, :email, :password, :password_confirmation, :auth_token) 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: 'from@example.com' 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/certificate.rb: -------------------------------------------------------------------------------- 1 | class Certificate < ApplicationRecord 2 | 3 | validates :zone, presence: true 4 | validates :app_name, presence: true 5 | 6 | belongs_to :user 7 | 8 | end 9 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/concerns/assignable.rb: -------------------------------------------------------------------------------- 1 | module Assignable 2 | extend ActiveSupport::Concern 3 | 4 | module ClassMethods 5 | def assign(*properties) 6 | properties.each do |p| 7 | attr_reader p 8 | end 9 | helper_method properties 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ApplicationRecord 2 | has_secure_password 3 | has_many :certificates 4 | 5 | end 6 | -------------------------------------------------------------------------------- /app/services/application_service.rb: -------------------------------------------------------------------------------- 1 | class ApplicationService 2 | attr_accessor :success, :message 3 | 4 | def self.call(*params) 5 | new(*params).call 6 | end 7 | 8 | def success? 9 | success 10 | end 11 | 12 | def failure? 13 | !success? 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /app/services/create_certificates.rb: -------------------------------------------------------------------------------- 1 | class CreateCertificates < ApplicationService 2 | attr_accessor :certificate 3 | 4 | def initialize(user, app_name, zone, domains, debug) 5 | self.success = false 6 | 7 | @user = user 8 | @app_name = app_name 9 | @zone = zone 10 | @domains = domains 11 | @debug = debug == "1" ? 1 : 0 12 | end 13 | 14 | def call 15 | 16 | if certificate = user_cert_for_app(@app_name) 17 | self.message = "You already have a certificate for this app." 18 | self.success = false 19 | self.certificate = certificate 20 | return self 21 | end 22 | 23 | response = send_api_call(@app_name, @zone, @domains, @debug) 24 | 25 | if response.code != '200' 26 | self.message = "Request to API failed." 27 | self.success = false 28 | return self 29 | end 30 | 31 | response_body = JSON.parse(response.body) 32 | certificate = @user.certificates.build(user: @user, app_name: @app_name, zone: @zone, domains: @domains, debug: @debug) 33 | certificate.status_path = response_body['url'] 34 | certificate.identifier = response_body['uuid'] 35 | if certificate.save 36 | self.message = 'Certificate saved!' 37 | self.success = true 38 | self.certificate = certificate 39 | return self 40 | else 41 | self.message = certificate.errors.full_messages.to_sentence 42 | self.success = false 43 | return self 44 | end 45 | 46 | end 47 | 48 | private 49 | 50 | API_PATH = ENV['API_PATH'] 51 | 52 | def send_api_call(app_name, zone, domains, debug) 53 | params = { 54 | zone: zone, 55 | domains: domains, 56 | debug: debug, 57 | auth_token: auth_token, 58 | heroku_app_name: app_name, 59 | auth_token: ENV['AUTH_TOKEN'], 60 | cloudflare_email: ENV['CLOUDFLARE_EMAIL'], 61 | cloudflare_api_key: ENV['CLOUDFLARE_API_KEY'], 62 | heroku_oauth_token: ENV['HEROKU_OAUTH_KEY'] 63 | } 64 | raw_uri = "#{API_PATH}/certificate_request" 65 | Rails.logger.info "POST to #{raw_uri}" 66 | Rails.logger.info "POST for #{params}" 67 | SendRequest.new(raw_uri, "POST", params).call 68 | end 69 | 70 | def user_cert_for_app(app_name) 71 | @user.certificates.find_by(app_name: app_name) 72 | end 73 | 74 | def auth_token 75 | @user.auth_token 76 | end 77 | 78 | end 79 | -------------------------------------------------------------------------------- /app/services/get_certificate_status.rb: -------------------------------------------------------------------------------- 1 | class GetCertificateStatus < ApplicationService 2 | attr_accessor :certificate 3 | 4 | def initialize(certificate, auth_token) 5 | @certificate = certificate 6 | @auth_token = auth_token 7 | end 8 | 9 | API_PATH = ENV['API_PATH'] 10 | def call 11 | raw_uri = @certificate.status_path 12 | response = SendRequest.new(raw_uri, "GET").call 13 | response_body = JSON.parse(response) 14 | @certificate.status = response_body['status'] 15 | @certificate.status_errors = response_body['error'] 16 | @certificate.message = response_body['message'] 17 | @certificate.save 18 | 19 | self.certificate = @certificate 20 | return self 21 | end 22 | 23 | end 24 | -------------------------------------------------------------------------------- /app/services/get_heroku_apps.rb: -------------------------------------------------------------------------------- 1 | class GetHerokuApps < ApplicationService 2 | 3 | HEROKU_BASE_URL = "https://api.heroku.com".freeze 4 | 5 | def initialize 6 | @headers = { 7 | "Accept" => 'application/vnd.heroku+json; version=3', 8 | "Authorization" => "Bearer #{ENV['HEROKU_OAUTH_KEY']}", 9 | "Content-Type" => "application/json" 10 | } 11 | @query = { enabled: true }.to_json 12 | end 13 | 14 | def call 15 | HTTParty.get("#{HEROKU_BASE_URL}/apps", headers: @headers, body: @query) 16 | end 17 | 18 | end 19 | -------------------------------------------------------------------------------- /app/services/send_request.rb: -------------------------------------------------------------------------------- 1 | class SendRequest 2 | 3 | def initialize(raw_uri, verb, params = nil) 4 | @raw_uri = raw_uri 5 | @verb = verb 6 | @params = params 7 | end 8 | 9 | def call 10 | uri = URI.parse(@raw_uri) 11 | http = Net::HTTP.new(uri.host, uri.port) 12 | response = make_request_from_http_verb(@verb, uri) 13 | end 14 | 15 | private 16 | 17 | def make_request_from_http_verb(verb, uri) 18 | case verb 19 | when 'GET' then request = make_get_request(uri) 20 | when 'POST' then request = make_post_request(uri) 21 | else request = make_get_request(uri) 22 | end 23 | return request 24 | end 25 | 26 | def make_get_request(uri) 27 | uri.query = URI.encode_www_form(@params) if @params 28 | Net::HTTP.get(uri) 29 | end 30 | 31 | def make_post_request(uri) 32 | http = Net::HTTP.new(uri.host, uri.port) 33 | header = {'Content-Type': 'text/json'} 34 | request = Net::HTTP::Post.new(uri.request_uri, header) 35 | request.body = @params.to_json 36 | http.request(request) 37 | end 38 | 39 | end 40 | -------------------------------------------------------------------------------- /app/views/certificates/_certificate.html.slim: -------------------------------------------------------------------------------- 1 | td.small = certificate.zone 2 | td.small = certificate.domains 3 | td.small = certificate.app_name 4 | td.small = certificate.debug 5 | td.small = certificate.message 6 | td.small = certificate.status 7 | td.small = certificate.status_errors 8 | td.small 9 | = link_to '[show]', certificate_path(certificate) 10 | '   11 | = link_to '[delete]', certificate_path(certificate), method: :delete, data: { confirm: "Are you sure?" } -------------------------------------------------------------------------------- /app/views/certificates/index.html.slim: -------------------------------------------------------------------------------- 1 | .row 2 | .column 3 | h2 Your certificates 4 | table 5 | thead 6 | tr 7 | th zone 8 | th domains 9 | th app_name 10 | th debug 11 | th message 12 | th status 13 | th status_errors 14 | th 15 | tbody 16 | - certificates.each do |certificate| 17 | = link_to certificate_path(certificate) do 18 | tr 19 | = render 'certificates/certificate', certificate: certificate 20 | 21 | .float-right 22 | = link_to 'New certificate', new_certificate_path, class: 'button' 23 | -------------------------------------------------------------------------------- /app/views/certificates/new.html.slim: -------------------------------------------------------------------------------- 1 | .row 2 | .column.column-50.column-offset-25 3 | h1 Generate a new certificate 4 | = simple_form_for certificate do |f| 5 | = f.input :zone 6 | = f.input :domains 7 | = f.input :app_name, collection: @app_names 8 | = f.input :debug 9 | = f.submit 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/views/certificates/show.html.slim: -------------------------------------------------------------------------------- 1 | .row 2 | .column.column-50.column-offset-25 3 | h1 4 | ' Certificate 5 | small.certificate-identifier = certificate.identifier 6 | = link_to certificate_path(certificate) do 7 | = inline_svg('refresh.svg', class: 'refresh-icon') 8 | 9 | .row 10 | .column 11 | table 12 | thead 13 | tr 14 | th zone 15 | th subdomains 16 | th app_name 17 | th debug 18 | th message 19 | th status 20 | th status_errors 21 | th 22 | tbody 23 | tr 24 | = render 'certificates/certificate', certificate: certificate 25 | 26 | .float-right 27 | = link_to 'New certificate', new_certificate_path, class: 'button' 28 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.slim: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | meta content=("text/html; charset=UTF-8") http-equiv="Content-Type" / 5 | title LetsencryptHerokuDashboard 6 | = csrf_meta_tags 7 | = stylesheet_link_tag 'application', media: 'all' 8 | body 9 | 10 | = render 'shared/header' 11 | = render 'shared/flashes' 12 | 13 | .container 14 | = yield 15 | 16 | = javascript_include_tag 'application' -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/views/sessions/new.html.slim: -------------------------------------------------------------------------------- 1 | .row 2 | .column.column-50.column-offset-25 3 | h2 Login 4 | 5 | 6 | = simple_form_for :user, url: '/login' do |f| 7 | 8 | = f.input :email 9 | = f.input :password 10 | = f.submit "Submit" 11 | 12 | 13 | /= form_tag '/login' do 14 | 15 | span 16 | ' Email: 17 | = text_field_tag :email 18 | span 19 | ' Password: 20 | = password_field_tag :password 21 | 22 | = submit_tag "Submit" 23 | -------------------------------------------------------------------------------- /app/views/shared/_flashes.html.slim: -------------------------------------------------------------------------------- 1 | .container 2 | .row 3 | .column.column-50.column-offset-25 4 | - flash.each do |key, value| 5 | .alert class="alert-#{key}" 6 | = value 7 | -------------------------------------------------------------------------------- /app/views/shared/_header.html.slim: -------------------------------------------------------------------------------- 1 | header 2 | .container 3 | .row 4 | .column 5 | .services.float-left 6 | = inline_svg 'heroku.svg', class: 'service-logo heroku' 7 | = inline_svg 'letsencrypt.svg', class: 'service-logo letsencrypt' 8 | = inline_svg 'cloudflare.svg', class: 'service-logo cloudflare' 9 | .column 10 | .float-right 11 | - if current_user 12 | span.logged-in = "Logged in as #{current_user.name}" 13 | span.logout = link_to "Logout", '/logout', class: 'button button-small button-outline' 14 | - else 15 | span.login = link_to 'Login', '/login', class: 'button button-small button-outline' 16 | span.signup = link_to 'Signup', '/signup', class: 'button button-small button-outline' 17 | -------------------------------------------------------------------------------- /app/views/users/new.html.slim: -------------------------------------------------------------------------------- 1 | .row 2 | .column.column-50.column-offset-25 3 | h2 Signup 4 | 5 | = simple_form_for :user, url: '/users' do |f| 6 | 7 | = f.input :name 8 | = f.input :email 9 | = f.input :auth_token 10 | = f.input :password 11 | = f.input :password_confirmation 12 | = f.submit "Submit" 13 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | require 'fileutils' 4 | include FileUtils 5 | 6 | # path to your application root. 7 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 8 | 9 | def system!(*args) 10 | system(*args) || abort("\n== Command #{args} failed ==") 11 | end 12 | 13 | chdir APP_ROOT do 14 | # This script is a starting point to setup your application. 15 | # Add necessary setup steps to this file. 16 | 17 | puts '== Installing dependencies ==' 18 | system! 'gem install bundler --conservative' 19 | system('bundle check') || system!('bundle install') 20 | 21 | # puts "\n== Copying sample files ==" 22 | # unless File.exist?('config/database.yml') 23 | # cp 'config/database.yml.sample', 'config/database.yml' 24 | # end 25 | 26 | puts "\n== Preparing database ==" 27 | system! 'bin/rails db:setup' 28 | 29 | puts "\n== Removing old logs and tempfiles ==" 30 | system! 'bin/rails log:clear tmp:clear' 31 | 32 | puts "\n== Restarting application server ==" 33 | system! 'bin/rails restart' 34 | end 35 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) 11 | if spring = lockfile.specs.detect { |spec| spec.name == "spring" } 12 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 13 | gem 'spring', spring.version 14 | require 'spring/binstub' 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | require 'fileutils' 4 | include FileUtils 5 | 6 | # path to your application root. 7 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 8 | 9 | def system!(*args) 10 | system(*args) || abort("\n== Command #{args} failed ==") 11 | end 12 | 13 | chdir APP_ROOT do 14 | # This script is a way to update your development environment automatically. 15 | # Add necessary update steps to this file. 16 | 17 | puts '== Installing dependencies ==' 18 | system! 'gem install bundler --conservative' 19 | system('bundle check') || system!('bundle install') 20 | 21 | puts "\n== Updating database ==" 22 | system! 'bin/rails db:migrate' 23 | 24 | puts "\n== Removing old logs and tempfiles ==" 25 | system! 'bin/rails log:clear tmp:clear' 26 | 27 | puts "\n== Restarting application server ==" 28 | system! 'bin/rails restart' 29 | end 30 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative 'boot' 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module LetsencryptHerokuDashboard 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: redis://localhost:6379/1 10 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # PostgreSQL. Versions 9.1 and up are supported. 2 | # 3 | # Install the pg driver: 4 | # gem install pg 5 | # On OS X with Homebrew: 6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config 7 | # On OS X with MacPorts: 8 | # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config 9 | # On Windows: 10 | # gem install pg 11 | # Choose the win32 build. 12 | # Install PostgreSQL and put its /bin directory on your path. 13 | # 14 | # Configure Using Gemfile 15 | # gem 'pg' 16 | # 17 | default: &default 18 | adapter: postgresql 19 | encoding: unicode 20 | # For details on connection pooling, see rails configuration guide 21 | # http://guides.rubyonrails.org/configuring.html#database-pooling 22 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 23 | 24 | development: 25 | <<: *default 26 | database: letsencrypt-heroku-dashboard_development 27 | username: stan 28 | password: 29 | 30 | # The specified database role being used to connect to postgres. 31 | # To create additional roles in postgres see `$ createuser --help`. 32 | # When left blank, postgres will use the default role. This is 33 | # the same name as the operating system user that initialized the database. 34 | #username: letsencrypt-heroku-dashboard 35 | 36 | # The password associated with the postgres role (username). 37 | #password: 38 | 39 | # Connect on a TCP socket. Omitted by default since the client uses a 40 | # domain socket that doesn't need configuration. Windows does not have 41 | # domain sockets, so uncomment these lines. 42 | #host: localhost 43 | 44 | # The TCP port the server listens on. Defaults to 5432. 45 | # If your server runs on a different port number, change accordingly. 46 | #port: 5432 47 | 48 | # Schema search path. The server defaults to $user,public 49 | #schema_search_path: myapp,sharedapp,public 50 | 51 | # Minimum log levels, in increasing order: 52 | # debug5, debug4, debug3, debug2, debug1, 53 | # log, notice, warning, error, fatal, and panic 54 | # Defaults to warning. 55 | #min_messages: notice 56 | 57 | # Warning: The database defined as "test" will be erased and 58 | # re-generated from your development database when you run "rake". 59 | # Do not set this db to the same as development or production. 60 | test: 61 | <<: *default 62 | database: letsencrypt-heroku-dashboard_test 63 | 64 | # As with config/secrets.yml, you never want to store sensitive information, 65 | # like your database password, in your source code. If your source code is 66 | # ever seen by anyone, they now have access to your database. 67 | # 68 | # Instead, provide the password as a unix environment variable when you boot 69 | # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database 70 | # for a full rundown on how to provide these environment variables in a 71 | # production deployment. 72 | # 73 | # On Heroku and other platform providers, you may have a full connection URL 74 | # available as an environment variable. For example: 75 | # 76 | # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" 77 | # 78 | # You can use this database configuration with: 79 | # 80 | # production: 81 | # url: <%= ENV['DATABASE_URL'] %> 82 | # 83 | production: 84 | <<: *default 85 | database: letsencrypt-heroku-dashboard_production 86 | username: letsencrypt-heroku-dashboard 87 | password: <%= ENV['LETSENCRYPT-HEROKU-DASHBOARD_DATABASE_PASSWORD'] %> 88 | -------------------------------------------------------------------------------- /config/database.yml.example: -------------------------------------------------------------------------------- 1 | # PostgreSQL. Versions 9.1 and up are supported. 2 | # 3 | # Install the pg driver: 4 | # gem install pg 5 | # On OS X with Homebrew: 6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config 7 | # On OS X with MacPorts: 8 | # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config 9 | # On Windows: 10 | # gem install pg 11 | # Choose the win32 build. 12 | # Install PostgreSQL and put its /bin directory on your path. 13 | # 14 | # Configure Using Gemfile 15 | # gem 'pg' 16 | # 17 | default: &default 18 | adapter: postgresql 19 | encoding: unicode 20 | # For details on connection pooling, see rails configuration guide 21 | # http://guides.rubyonrails.org/configuring.html#database-pooling 22 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 23 | 24 | development: 25 | <<: *default 26 | database: letsencrypt-heroku-dashboard_development 27 | username: 28 | password: 29 | 30 | # The specified database role being used to connect to postgres. 31 | # To create additional roles in postgres see `$ createuser --help`. 32 | # When left blank, postgres will use the default role. This is 33 | # the same name as the operating system user that initialized the database. 34 | #username: letsencrypt-heroku-dashboard 35 | 36 | # The password associated with the postgres role (username). 37 | #password: 38 | 39 | # Connect on a TCP socket. Omitted by default since the client uses a 40 | # domain socket that doesn't need configuration. Windows does not have 41 | # domain sockets, so uncomment these lines. 42 | #host: localhost 43 | 44 | # The TCP port the server listens on. Defaults to 5432. 45 | # If your server runs on a different port number, change accordingly. 46 | #port: 5432 47 | 48 | # Schema search path. The server defaults to $user,public 49 | #schema_search_path: myapp,sharedapp,public 50 | 51 | # Minimum log levels, in increasing order: 52 | # debug5, debug4, debug3, debug2, debug1, 53 | # log, notice, warning, error, fatal, and panic 54 | # Defaults to warning. 55 | #min_messages: notice 56 | 57 | # Warning: The database defined as "test" will be erased and 58 | # re-generated from your development database when you run "rake". 59 | # Do not set this db to the same as development or production. 60 | test: 61 | <<: *default 62 | database: letsencrypt-heroku-dashboard_test 63 | 64 | # As with config/secrets.yml, you never want to store sensitive information, 65 | # like your database password, in your source code. If your source code is 66 | # ever seen by anyone, they now have access to your database. 67 | # 68 | # Instead, provide the password as a unix environment variable when you boot 69 | # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database 70 | # for a full rundown on how to provide these environment variables in a 71 | # production deployment. 72 | # 73 | # On Heroku and other platform providers, you may have a full connection URL 74 | # available as an environment variable. For example: 75 | # 76 | # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" 77 | # 78 | # You can use this database configuration with: 79 | # 80 | # production: 81 | # url: <%= ENV['DATABASE_URL'] %> 82 | # 83 | production: 84 | <<: *default 85 | database: letsencrypt-heroku-dashboard_production 86 | username: letsencrypt-heroku-dashboard 87 | password: <%= ENV['LETSENCRYPT-HEROKU-DASHBOARD_DATABASE_PASSWORD'] %> 88 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports. 13 | config.consider_all_requests_local = true 14 | 15 | # Enable/disable caching. By default caching is disabled. 16 | if Rails.root.join('tmp/caching-dev.txt').exist? 17 | config.action_controller.perform_caching = true 18 | 19 | config.cache_store = :memory_store 20 | config.public_file_server.headers = { 21 | 'Cache-Control' => 'public, max-age=172800' 22 | } 23 | else 24 | config.action_controller.perform_caching = false 25 | 26 | config.cache_store = :null_store 27 | end 28 | 29 | # Don't care if the mailer can't send. 30 | config.action_mailer.raise_delivery_errors = false 31 | 32 | config.action_mailer.perform_caching = false 33 | 34 | # Print deprecation notices to the Rails logger. 35 | config.active_support.deprecation = :log 36 | 37 | # Raise an error on page load if there are pending migrations. 38 | config.active_record.migration_error = :page_load 39 | 40 | # Debug mode disables concatenation and preprocessing of assets. 41 | # This option may cause significant delays in view rendering with a large 42 | # number of complex assets. 43 | config.assets.debug = true 44 | 45 | # Suppress logger output for asset requests. 46 | config.assets.quiet = true 47 | 48 | # Raises error for missing translations 49 | # config.action_view.raise_on_missing_translations = true 50 | 51 | # Use an evented file watcher to asynchronously detect changes in source code, 52 | # routes, locales, etc. This feature depends on the listen gem. 53 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker 54 | end 55 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Disable serving static files from the `/public` folder by default since 18 | # Apache or NGINX already handles this. 19 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 20 | 21 | # Compress JavaScripts and CSS. 22 | config.assets.js_compressor = :uglifier 23 | # config.assets.css_compressor = :sass 24 | 25 | # Do not fallback to assets pipeline if a precompiled asset is missed. 26 | config.assets.compile = false 27 | 28 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 29 | 30 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 31 | # config.action_controller.asset_host = 'http://assets.example.com' 32 | 33 | # Specifies the header that your server uses for sending files. 34 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 35 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 36 | 37 | # Mount Action Cable outside main process or domain 38 | # config.action_cable.mount_path = nil 39 | # config.action_cable.url = 'wss://example.com/cable' 40 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] 41 | 42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 43 | # config.force_ssl = true 44 | 45 | # Use the lowest log level to ensure availability of diagnostic information 46 | # when problems arise. 47 | config.log_level = :debug 48 | 49 | # Prepend all log lines with the following tags. 50 | config.log_tags = [ :request_id ] 51 | 52 | # Use a different cache store in production. 53 | # config.cache_store = :mem_cache_store 54 | 55 | # Use a real queuing backend for Active Job (and separate queues per environment) 56 | # config.active_job.queue_adapter = :resque 57 | # config.active_job.queue_name_prefix = "letsencrypt-heroku-dashboard_#{Rails.env}" 58 | config.action_mailer.perform_caching = false 59 | 60 | # Ignore bad email addresses and do not raise email delivery errors. 61 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 62 | # config.action_mailer.raise_delivery_errors = false 63 | 64 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 65 | # the I18n.default_locale when a translation cannot be found). 66 | config.i18n.fallbacks = true 67 | 68 | # Send deprecation notices to registered listeners. 69 | config.active_support.deprecation = :notify 70 | 71 | # Use default logging formatter so that PID and timestamp are not suppressed. 72 | config.log_formatter = ::Logger::Formatter.new 73 | 74 | # Use a different logger for distributed setups. 75 | # require 'syslog/logger' 76 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 77 | 78 | if ENV["RAILS_LOG_TO_STDOUT"].present? 79 | logger = ActiveSupport::Logger.new(STDOUT) 80 | logger.formatter = config.log_formatter 81 | config.logger = ActiveSupport::TaggedLogging.new(logger) 82 | end 83 | 84 | # Do not dump schema after migrations. 85 | config.active_record.dump_schema_after_migration = false 86 | end 87 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure public file server for tests with Cache-Control for performance. 16 | config.public_file_server.enabled = true 17 | config.public_file_server.headers = { 18 | 'Cache-Control' => 'public, max-age=3600' 19 | } 20 | 21 | # Show full error reports and disable caching. 22 | config.consider_all_requests_local = true 23 | config.action_controller.perform_caching = false 24 | 25 | # Raise exceptions instead of rendering exception templates. 26 | config.action_dispatch.show_exceptions = false 27 | 28 | # Disable request forgery protection in test environment. 29 | config.action_controller.allow_forgery_protection = false 30 | config.action_mailer.perform_caching = false 31 | 32 | # Tell Action Mailer not to deliver emails to the real world. 33 | # The :test delivery method accumulates sent emails in the 34 | # ActionMailer::Base.deliveries array. 35 | config.action_mailer.delivery_method = :test 36 | 37 | # Print deprecation notices to the stderr. 38 | config.active_support.deprecation = :stderr 39 | 40 | # Raises error for missing translations 41 | # config.action_view.raise_on_missing_translations = true 42 | end 43 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 11 | # Rails.application.config.assets.precompile += %w( search.js ) 12 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/new_framework_defaults.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | # 3 | # This file contains migration options to ease your Rails 5.0 upgrade. 4 | # 5 | # Read the Rails 5.0 release notes for more info on each option. 6 | 7 | # Enable per-form CSRF tokens. Previous versions had false. 8 | Rails.application.config.action_controller.per_form_csrf_tokens = true 9 | 10 | # Enable origin-checking CSRF mitigation. Previous versions had false. 11 | Rails.application.config.action_controller.forgery_protection_origin_check = true 12 | 13 | # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`. 14 | # Previous versions had false. 15 | ActiveSupport.to_time_preserves_timezone = true 16 | 17 | # Require `belongs_to` associations by default. Previous versions had false. 18 | Rails.application.config.active_record.belongs_to_required_by_default = true 19 | 20 | # Do not halt callback chains when a callback returns false. Previous versions had true. 21 | ActiveSupport.halt_callback_chains_on_return_false = false 22 | 23 | # Configure SSL options to enable HSTS with subdomains. Previous versions had false. 24 | Rails.application.config.ssl_options = { hsts: { subdomains: true } } 25 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_letsencrypt-heroku-dashboard_session' 4 | -------------------------------------------------------------------------------- /config/initializers/simple_form.rb: -------------------------------------------------------------------------------- 1 | # Use this setup block to configure all options available in SimpleForm. 2 | SimpleForm.setup do |config| 3 | # Wrappers are used by the form builder to generate a 4 | # complete input. You can remove any component from the 5 | # wrapper, change the order or even add your own to the 6 | # stack. The options given below are used to wrap the 7 | # whole input. 8 | config.wrappers :default, class: :input, 9 | hint_class: :field_with_hint, error_class: :field_with_errors do |b| 10 | ## Extensions enabled by default 11 | # Any of these extensions can be disabled for a 12 | # given input by passing: `f.input EXTENSION_NAME => false`. 13 | # You can make any of these extensions optional by 14 | # renaming `b.use` to `b.optional`. 15 | 16 | # Determines whether to use HTML5 (:email, :url, ...) 17 | # and required attributes 18 | b.use :html5 19 | 20 | # Calculates placeholders automatically from I18n 21 | # You can also pass a string as f.input placeholder: "Placeholder" 22 | b.use :placeholder 23 | 24 | ## Optional extensions 25 | # They are disabled unless you pass `f.input EXTENSION_NAME => true` 26 | # to the input. If so, they will retrieve the values from the model 27 | # if any exists. If you want to enable any of those 28 | # extensions by default, you can change `b.optional` to `b.use`. 29 | 30 | # Calculates maxlength from length validations for string inputs 31 | b.optional :maxlength 32 | 33 | # Calculates pattern from format validations for string inputs 34 | b.optional :pattern 35 | 36 | # Calculates min and max from length validations for numeric inputs 37 | b.optional :min_max 38 | 39 | # Calculates readonly automatically from readonly attributes 40 | b.optional :readonly 41 | 42 | ## Inputs 43 | b.use :label_input 44 | b.use :hint, wrap_with: { tag: :span, class: :hint } 45 | b.use :error, wrap_with: { tag: :span, class: :error } 46 | 47 | ## full_messages_for 48 | # If you want to display the full error message for the attribute, you can 49 | # use the component :full_error, like: 50 | # 51 | # b.use :full_error, wrap_with: { tag: :span, class: :error } 52 | end 53 | 54 | # The default wrapper to be used by the FormBuilder. 55 | config.default_wrapper = :default 56 | 57 | # Define the way to render check boxes / radio buttons with labels. 58 | # Defaults to :nested for bootstrap config. 59 | # inline: input + label 60 | # nested: label > input 61 | config.boolean_style = :nested 62 | 63 | # Default class for buttons 64 | config.button_class = 'btn' 65 | 66 | # Method used to tidy up errors. Specify any Rails Array method. 67 | # :first lists the first message for each field. 68 | # Use :to_sentence to list all errors for each field. 69 | # config.error_method = :first 70 | 71 | # Default tag used for error notification helper. 72 | config.error_notification_tag = :div 73 | 74 | # CSS class to add for error notification helper. 75 | config.error_notification_class = 'error_notification' 76 | 77 | # ID to add for error notification helper. 78 | # config.error_notification_id = nil 79 | 80 | # Series of attempts to detect a default label method for collection. 81 | # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] 82 | 83 | # Series of attempts to detect a default value method for collection. 84 | # config.collection_value_methods = [ :id, :to_s ] 85 | 86 | # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. 87 | # config.collection_wrapper_tag = nil 88 | 89 | # You can define the class to use on all collection wrappers. Defaulting to none. 90 | # config.collection_wrapper_class = nil 91 | 92 | # You can wrap each item in a collection of radio/check boxes with a tag, 93 | # defaulting to :span. 94 | # config.item_wrapper_tag = :span 95 | 96 | # You can define a class to use in all item wrappers. Defaulting to none. 97 | # config.item_wrapper_class = nil 98 | 99 | # How the label text should be generated altogether with the required text. 100 | # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" } 101 | 102 | # You can define the class to use on all labels. Default is nil. 103 | # config.label_class = nil 104 | 105 | # You can define the default class to be used on forms. Can be overriden 106 | # with `html: { :class }`. Defaulting to none. 107 | # config.default_form_class = nil 108 | 109 | # You can define which elements should obtain additional classes 110 | # config.generate_additional_classes_for = [:wrapper, :label, :input] 111 | 112 | # Whether attributes are required by default (or not). Default is true. 113 | # config.required_by_default = true 114 | 115 | # Tell browsers whether to use the native HTML5 validations (novalidate form option). 116 | # These validations are enabled in SimpleForm's internal config but disabled by default 117 | # in this configuration, which is recommended due to some quirks from different browsers. 118 | # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, 119 | # change this configuration to true. 120 | config.browser_validations = false 121 | 122 | # Collection of methods to detect if a file type was given. 123 | # config.file_methods = [ :mounted_as, :file?, :public_filename ] 124 | 125 | # Custom mappings for input types. This should be a hash containing a regexp 126 | # to match as key, and the input type that will be used when the field name 127 | # matches the regexp as value. 128 | # config.input_mappings = { /count/ => :integer } 129 | 130 | # Custom wrappers for input types. This should be a hash containing an input 131 | # type as key and the wrapper that will be used for all inputs with specified type. 132 | # config.wrapper_mappings = { string: :prepend } 133 | 134 | # Namespaces where SimpleForm should look for custom input classes that 135 | # override default inputs. 136 | # config.custom_inputs_namespaces << "CustomInputs" 137 | 138 | # Default priority for time_zone inputs. 139 | # config.time_zone_priority = nil 140 | 141 | # Default priority for country inputs. 142 | # config.country_priority = nil 143 | 144 | # When false, do not use translations for labels. 145 | # config.translate_labels = true 146 | 147 | # Automatically discover new inputs in Rails' autoload path. 148 | # config.inputs_discovery = true 149 | 150 | # Cache SimpleForm inputs discovery 151 | # config.cache_discovery = !Rails.env.development? 152 | 153 | # Default class for inputs 154 | # config.input_class = nil 155 | 156 | # Define the default class of the input wrapper of the boolean input. 157 | config.boolean_label_class = 'checkbox' 158 | 159 | # Defines if the default input wrapper class should be included in radio 160 | # collection wrappers. 161 | # config.include_default_input_wrapper_class = true 162 | 163 | # Defines which i18n scope will be used in Simple Form. 164 | # config.i18n_scope = 'simple_form' 165 | end 166 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /config/locales/simple_form.en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | simple_form: 3 | "yes": 'Yes' 4 | "no": 'No' 5 | required: 6 | text: 'required' 7 | mark: '*' 8 | # You can uncomment the line below if you need to overwrite the whole required html. 9 | # When using html, text and mark won't be used. 10 | # html: '*' 11 | error_notification: 12 | default_message: "Please review the problems below:" 13 | # Examples 14 | # labels: 15 | # defaults: 16 | # password: 'Password' 17 | # user: 18 | # new: 19 | # email: 'E-mail to sign in.' 20 | # edit: 21 | # email: 'E-mail.' 22 | # hints: 23 | # defaults: 24 | # username: 'User name to sign in.' 25 | # password: 'No special characters, please.' 26 | # include_blanks: 27 | # defaults: 28 | # age: 'Rather not say' 29 | # prompts: 30 | # defaults: 31 | # age: 'Select your age' 32 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum, this matches the default thread size of Active Record. 6 | # 7 | threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i 8 | threads threads_count, threads_count 9 | 10 | # Specifies the `port` that Puma will listen on to receive requests, default is 3000. 11 | # 12 | port ENV.fetch("PORT") { 3000 } 13 | 14 | # Specifies the `environment` that Puma will run in. 15 | # 16 | environment ENV.fetch("RAILS_ENV") { "development" } 17 | 18 | # Specifies the number of `workers` to boot in clustered mode. 19 | # Workers are forked webserver processes. If using threads and workers together 20 | # the concurrency of the application would be max `threads` * `workers`. 21 | # Workers do not work on JRuby or Windows (both of which do not support 22 | # processes). 23 | # 24 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 25 | 26 | # Use the `preload_app!` method when specifying a `workers` number. 27 | # This directive tells Puma to first boot the application and load code 28 | # before forking the application. This takes advantage of Copy On Write 29 | # process behavior so workers use less memory. If you use this option 30 | # you need to make sure to reconnect any threads in the `on_worker_boot` 31 | # block. 32 | # 33 | # preload_app! 34 | 35 | # The code in the `on_worker_boot` will be called if you are using 36 | # clustered mode by specifying a number of `workers`. After each worker 37 | # process is booted this block will be run, if you are using `preload_app!` 38 | # option you will want to use this block to reconnect to any threads 39 | # or connections that may have been created at application boot, Ruby 40 | # cannot share connections between processes. 41 | # 42 | # on_worker_boot do 43 | # ActiveRecord::Base.establish_connection if defined?(ActiveRecord) 44 | # end 45 | 46 | # Allow puma to be restarted by `rails restart` command. 47 | plugin :tmp_restart 48 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html 3 | resources :certificates 4 | 5 | # Bcrypt routes 6 | get '/login' => 'sessions#new' 7 | post '/login' => 'sessions#create' 8 | get '/logout' => 'sessions#destroy' 9 | 10 | get '/signup' => 'users#new' 11 | post '/users' => 'users#create' 12 | 13 | root to: 'certificates#index' 14 | end 15 | -------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rails secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: ca31f88b408e0a9d33ac981da0a34df82abc3d98b9e11b98e0c0ebc2a0637d6660d459c5dbff5d4605616ed5620136c944befed8a4687c66f3f836d3f2377c04 15 | 16 | test: 17 | secret_key_base: 2f6d967729b9934ee8b786e96fbc01d63b84da558b39a3c5432ecfe63ccdc7bdc413f11d45fa9e584c59c5626061a700add6bb096b67fc051cb62cf8a6165206 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | %w( 2 | .ruby-version 3 | .rbenv-vars 4 | tmp/restart.txt 5 | tmp/caching-dev.txt 6 | ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /db/migrate/20161118091701_create_certificates.rb: -------------------------------------------------------------------------------- 1 | class CreateCertificates < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :certificates do |t| 4 | t.string :identifier 5 | t.string :domain 6 | t.string :subdomains 7 | t.string :app_name 8 | t.integer :debug 9 | t.string :status 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20161118094110_change_debug_type_in_certificates.rb: -------------------------------------------------------------------------------- 1 | class ChangeDebugTypeInCertificates < ActiveRecord::Migration[5.0] 2 | def change 3 | change_column :certificates, :debug, 'boolean USING CAST(debug AS boolean)' 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20161118104931_add_status_path_to_certificates.rb: -------------------------------------------------------------------------------- 1 | class AddStatusPathToCertificates < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :certificates, :status_path, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20161118154903_add_status_errors_to_certificates.rb: -------------------------------------------------------------------------------- 1 | class AddStatusErrorsToCertificates < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :certificates, :status_errors, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20161118154957_add_message_to_certificates.rb: -------------------------------------------------------------------------------- 1 | class AddMessageToCertificates < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :certificates, :message, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20161121084342_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :users do |t| 4 | t.string :name 5 | t.string :email 6 | t.string :password_digest 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20161121100855_add_auth_token_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddAuthTokenToUsers < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :users, :auth_token, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20161124160747_add_user_to_certificates.rb: -------------------------------------------------------------------------------- 1 | class AddUserToCertificates < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :certificates, :user, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20170119105330_rename_domain_to_zone_in_certificates.rb: -------------------------------------------------------------------------------- 1 | class RenameDomainToZoneInCertificates < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :certificates, :domain, :zone 4 | rename_column :certificates, :subdomains, :domains 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # Note that this schema.rb definition is the authoritative source for your 6 | # database schema. If you need to create the application database on another 7 | # system, you should be using db:schema:load, not running all the migrations 8 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 9 | # you'll amass, the slower it'll run and the greater likelihood for issues). 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 20170119105330) do 14 | 15 | # These are extensions that must be enabled in order to support this database 16 | enable_extension "plpgsql" 17 | 18 | create_table "certificates", force: :cascade do |t| 19 | t.string "identifier" 20 | t.string "zone" 21 | t.string "domains" 22 | t.string "app_name" 23 | t.boolean "debug" 24 | t.string "status" 25 | t.string "status_path" 26 | t.string "status_errors" 27 | t.string "message" 28 | t.integer "user_id" 29 | t.index ["user_id"], name: "index_certificates_on_user_id", using: :btree 30 | end 31 | 32 | create_table "users", force: :cascade do |t| 33 | t.string "name" 34 | t.string "email" 35 | t.string "password_digest" 36 | t.datetime "created_at", null: false 37 | t.datetime "updated_at", null: false 38 | t.string "auth_token" 39 | end 40 | 41 | add_foreign_key "certificates", "users" 42 | end 43 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/lib/tasks/.keep -------------------------------------------------------------------------------- /lib/templates/slim/scaffold/_form.html.slim: -------------------------------------------------------------------------------- 1 | = simple_form_for(@<%= singular_table_name %>) do |f| 2 | = f.error_notification 3 | 4 | .form-inputs 5 | <%- attributes.each do |attribute| -%> 6 | = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> 7 | <%- end -%> 8 | 9 | .form-actions 10 | = f.button :submit 11 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/test/controllers/.keep -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/test/fixtures/.keep -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/test/fixtures/files/.keep -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | name: MyString 5 | email: MyString 6 | password_digest: MyString 7 | 8 | two: 9 | name: MyString 10 | email: MyString 11 | password_digest: MyString 12 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/test/helpers/.keep -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/test/integration/.keep -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/test/mailers/.keep -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/test/models/.keep -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Drawbotics/letsencrypt-heroku-dashboard/a97307f11ff7d3d498dbe7647af50a2f94b2452c/vendor/assets/stylesheets/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Base.sass: -------------------------------------------------------------------------------- 1 | 2 | // Base 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | // The base font-size is set at 62.5% for having the convenience 6 | // of sizing rems in a way that is similar to using px: 1.6rem = 16px 7 | html 8 | box-sizing: border-box 9 | font-size: 62.5% 10 | 11 | // Default body styles 12 | body 13 | color: $color-secondary 14 | font-family: 'Roboto', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif 15 | font-size: 1.6em // Currently ems cause chrome bug misinterpreting rems on body element 16 | font-weight: 300 17 | letter-spacing: .01em 18 | line-height: 1.6 19 | 20 | // Set box-sizing globally to handle padding and border widths 21 | *, 22 | *:after, 23 | *:before 24 | box-sizing: inherit 25 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Blockquote.sass: -------------------------------------------------------------------------------- 1 | 2 | // Blockquote 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | blockquote 6 | border-left: .3rem solid $color-quaternary 7 | margin-left: 0 8 | margin-right: 0 9 | padding: 1rem 1.5rem 10 | 11 | *:last-child 12 | margin-bottom: 0 13 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Button.sass: -------------------------------------------------------------------------------- 1 | 2 | // Button 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | .button, 6 | button, 7 | input[type='button'], 8 | input[type='reset'], 9 | input[type='submit'] 10 | background-color: $color-primary 11 | border: .1rem solid $color-primary 12 | border-radius: .4rem 13 | color: $color-initial 14 | cursor: pointer 15 | display: inline-block 16 | font-size: 1.1rem 17 | font-weight: 700 18 | height: 3.8rem 19 | letter-spacing: .1rem 20 | line-height: 3.8rem 21 | padding: 0 3.0rem 22 | text-align: center 23 | text-decoration: none 24 | text-transform: uppercase 25 | white-space: nowrap 26 | 27 | &:focus, 28 | &:hover 29 | background-color: $color-secondary 30 | border-color: $color-secondary 31 | color: $color-initial 32 | outline: 0 33 | 34 | &[disabled] 35 | cursor: default 36 | opacity: .5 37 | 38 | &:focus, 39 | &:hover 40 | background-color: $color-primary 41 | border-color: $color-primary 42 | 43 | &.button-outline 44 | background-color: transparent 45 | color: $color-primary 46 | 47 | &:focus, 48 | &:hover 49 | background-color: transparent 50 | border-color: $color-secondary 51 | color: $color-secondary 52 | 53 | &[disabled] 54 | 55 | &:focus, 56 | &:hover 57 | border-color: inherit 58 | color: $color-primary 59 | 60 | &.button-clear 61 | background-color: transparent 62 | border-color: transparent 63 | color: $color-primary 64 | 65 | &:focus, 66 | &:hover 67 | background-color: transparent 68 | border-color: transparent 69 | color: $color-secondary 70 | 71 | &[disabled] 72 | 73 | &:focus, 74 | &:hover 75 | color: $color-primary 76 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Code.sass: -------------------------------------------------------------------------------- 1 | 2 | // Code 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | code 6 | background: $color-tertiary 7 | border-radius: .4rem 8 | font-size: 86% 9 | margin: 0 .2rem 10 | padding: .2rem .5rem 11 | white-space: nowrap 12 | 13 | pre 14 | background: $color-tertiary 15 | border-left: .3rem solid $color-primary 16 | 17 | & > code 18 | border-radius: 0 19 | display: block 20 | padding: 1rem 1.5rem 21 | white-space: pre 22 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Color.sass: -------------------------------------------------------------------------------- 1 | 2 | // Color 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | $color-initial: #fff !default 6 | $color-primary: #9b4dca !default 7 | $color-secondary: #606c76 !default 8 | $color-tertiary: #f4f5f6 !default 9 | $color-quaternary: #d1d1d1 !default 10 | $color-quinary: #e1e1e1 !default 11 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Divider.sass: -------------------------------------------------------------------------------- 1 | 2 | // Divider 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | hr 6 | border: 0 7 | border-top: .1rem solid $color-tertiary 8 | margin: 3.0rem 0 9 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Form.sass: -------------------------------------------------------------------------------- 1 | 2 | // Form 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | input[type='email'], 6 | input[type='number'], 7 | input[type='password'], 8 | input[type='search'], 9 | input[type='tel'], 10 | input[type='text'], 11 | input[type='url'], 12 | textarea, 13 | select 14 | appearance: none // Removes awkward default styles on some inputs for iOS 15 | background-color: transparent 16 | border: .1rem solid $color-quaternary 17 | border-radius: .4rem 18 | box-shadow: none 19 | box-sizing: inherit // Forced to replace inherit values of the normalize.css 20 | height: 3.8rem 21 | padding: .6rem 1.0rem // The .6rem vertically centers text on FF, ignored by Webkit 22 | width: 100% 23 | 24 | &:focus 25 | border-color: $color-primary 26 | outline: 0 27 | 28 | select 29 | background: url('data:image/svg+xml;utf8,') center right no-repeat 30 | padding-right: 3.0rem 31 | 32 | &:focus 33 | background-image: url('data:image/svg+xml;utf8,') 34 | 35 | textarea 36 | min-height: 6.5rem 37 | 38 | label, 39 | legend 40 | display: block 41 | font-size: 1.6rem 42 | font-weight: 700 43 | margin-bottom: .5rem 44 | 45 | fieldset 46 | border-width: 0 47 | padding: 0 48 | 49 | input[type='checkbox'], 50 | input[type='radio'] 51 | display: inline 52 | 53 | .label-inline 54 | display: inline-block 55 | font-weight: normal 56 | margin-left: .5rem 57 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Grid.sass: -------------------------------------------------------------------------------- 1 | 2 | // Grid 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | // .container is main centered wrapper with a max width of 112.0rem (1120px) 6 | .container 7 | margin: 0 auto 8 | max-width: 112.0rem 9 | padding: 0 2.0rem 10 | position: relative 11 | width: 100% 12 | 13 | // Using flexbox for the grid, inspired by Philip Walton: 14 | // http://philipwalton.github.io/solved-by-flexbox/demos/grids/ 15 | // By default each .column within a .row will evenly take up 16 | // available width, and the height of each .column with take 17 | // up the height of the tallest .column in the same .row 18 | .row 19 | display: flex 20 | flex-direction: column 21 | padding: 0 22 | width: 100% 23 | 24 | &.row-no-padding 25 | padding: 0 26 | 27 | &> .column 28 | padding: 0 29 | 30 | &.row-wrap 31 | flex-wrap: wrap 32 | 33 | // Vertically Align Columns 34 | // .row-* vertically aligns every .col in the .row 35 | &.row-top 36 | align-items: flex-start 37 | 38 | &.row-bottom 39 | align-items: flex-end 40 | 41 | &.row-center 42 | align-items: center 43 | 44 | &.row-stretch 45 | align-items: stretch 46 | 47 | &.row-baseline 48 | align-items: baseline 49 | 50 | .column 51 | display: block 52 | flex: 1 53 | margin-left: 0 54 | max-width: 100% 55 | width: 100% 56 | 57 | // Column Offsets 58 | &.column-offset-10 59 | margin-left: 10% 60 | 61 | &.column-offset-20 62 | margin-left: 20% 63 | 64 | &.column-offset-25 65 | margin-left: 25% 66 | 67 | &.column-offset-33, 68 | &.column-offset-34 69 | margin-left: 33.3333% 70 | 71 | &.column-offset-50 72 | margin-left: 50% 73 | 74 | &.column-offset-66, 75 | &.column-offset-67 76 | margin-left: 66.6666% 77 | 78 | &.column-offset-75 79 | margin-left: 75% 80 | 81 | &.column-offset-80 82 | margin-left: 80% 83 | 84 | &.column-offset-90 85 | margin-left: 90% 86 | 87 | // Explicit Column Percent Sizes 88 | // By default each grid column will evenly distribute 89 | // across the grid. However, you can specify individual 90 | // columns to take up a certain size of the available area 91 | &.column-10 92 | flex: 0 0 10% 93 | max-width: 10% 94 | 95 | &.column-20 96 | flex: 0 0 20% 97 | max-width: 20% 98 | 99 | &.column-25 100 | flex: 0 0 25% 101 | max-width: 25% 102 | 103 | &.column-33, 104 | &.column-34 105 | flex: 0 0 33.3333% 106 | max-width: 33.3333% 107 | 108 | &.column-40 109 | flex: 0 0 40% 110 | max-width: 40% 111 | 112 | &.column-50 113 | flex: 0 0 50% 114 | max-width: 50% 115 | 116 | &.column-60 117 | flex: 0 0 60% 118 | max-width: 60% 119 | 120 | &.column-66, 121 | &.column-67 122 | flex: 0 0 66.6666% 123 | max-width: 66.6666% 124 | 125 | &.column-75 126 | flex: 0 0 75% 127 | max-width: 75% 128 | 129 | &.column-80 130 | flex: 0 0 80% 131 | max-width: 80% 132 | 133 | &.column-90 134 | flex: 0 0 90% 135 | max-width: 90% 136 | 137 | // .column-* vertically aligns an individual .column 138 | .column-top 139 | align-self: flex-start 140 | 141 | .column-bottom 142 | align-self: flex-end 143 | 144 | .column-center 145 | align-self: center 146 | 147 | // Larger than mobile screen 148 | @media (min-width: 40.0rem) // Safari desktop has a bug using `rem`, but Safari mobile works 149 | 150 | .row 151 | flex-direction: row 152 | margin-left: -1.0rem 153 | width: calc(100% + 2.0rem) 154 | 155 | .column 156 | margin-bottom: inherit 157 | padding: 0 1.0rem 158 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Image.sass: -------------------------------------------------------------------------------- 1 | 2 | // Image 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | img 6 | max-width: 100% 7 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Link.sass: -------------------------------------------------------------------------------- 1 | 2 | // Link 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | a 6 | color: $color-primary 7 | text-decoration: none 8 | 9 | &:focus, 10 | &:hover 11 | color: $color-secondary 12 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_List.sass: -------------------------------------------------------------------------------- 1 | 2 | // List 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | dl, 6 | ol, 7 | ul 8 | list-style: none 9 | margin-top: 0 10 | padding-left: 0 11 | 12 | dl, 13 | ol, 14 | ul 15 | font-size: 90% 16 | margin: 1.5rem 0 1.5rem 3.0rem 17 | 18 | ol 19 | list-style: decimal inside 20 | 21 | ul 22 | list-style: circle inside 23 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Spacing.sass: -------------------------------------------------------------------------------- 1 | 2 | // Spacing 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | .button, 6 | button, 7 | dd, 8 | dt, 9 | li 10 | margin-bottom: 1.0rem 11 | 12 | fieldset, 13 | input, 14 | select, 15 | textarea 16 | margin-bottom: 1.5rem 17 | 18 | blockquote, 19 | dl, 20 | figure, 21 | form, 22 | ol, 23 | p, 24 | pre, 25 | table, 26 | ul 27 | margin-bottom: 2.5rem 28 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Table.sass: -------------------------------------------------------------------------------- 1 | 2 | // Table 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | table 6 | width: 100% 7 | 8 | td, 9 | th 10 | border-bottom: .1rem solid $color-quinary 11 | padding: 1.2rem 1.5rem 12 | text-align: left 13 | 14 | &:first-child 15 | padding-left: 0 16 | 17 | &:last-child 18 | padding-right: 0 19 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Typography.sass: -------------------------------------------------------------------------------- 1 | 2 | // Typography 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | p 6 | margin-top: 0 7 | 8 | h1, 9 | h2, 10 | h3, 11 | h4, 12 | h5, 13 | h6 14 | font-weight: 300 15 | letter-spacing: -.1rem 16 | margin-bottom: 2.0rem 17 | margin-top: 0 18 | 19 | h1 20 | font-size: 4.0rem 21 | line-height: 1.2 22 | 23 | h2 24 | font-size: 3.6rem 25 | line-height: 1.25 26 | 27 | h3 28 | font-size: 3.0rem 29 | line-height: 1.3 30 | 31 | h4 32 | font-size: 2.4rem 33 | letter-spacing: -.08rem 34 | line-height: 1.35 35 | 36 | h5 37 | font-size: 1.8rem 38 | letter-spacing: -.05rem 39 | line-height: 1.5 40 | 41 | h6 42 | font-size: 1.6rem 43 | letter-spacing: 0 44 | line-height: 1.4 45 | 46 | // Larger than mobile screen 47 | @media (min-width: 40.0rem) // Safari desktop has a bug using `rem`, but Safari mobile works 48 | 49 | h1 50 | font-size: 5.0rem 51 | 52 | h2 53 | font-size: 4.2rem 54 | 55 | h3 56 | font-size: 3.6rem 57 | 58 | h4 59 | font-size: 3.0rem 60 | 61 | h5 62 | font-size: 2.4rem 63 | 64 | h6 65 | font-size: 1.5rem 66 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/_Utility.sass: -------------------------------------------------------------------------------- 1 | 2 | // Utility 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | // Clear a float with .clearfix 6 | .clearfix 7 | 8 | &:after 9 | clear: both 10 | content: ' ' // The space content is one way to avoid an Opera bug. 11 | display: table 12 | 13 | // Float either direction 14 | .float-left 15 | float: left 16 | 17 | .float-right 18 | float: right 19 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/milligram/milligram.sass: -------------------------------------------------------------------------------- 1 | 2 | // Sass Modules 3 | // –––––––––––––––––––––––––––––––––––––––––––––––––– 4 | 5 | @import Color 6 | @import Base 7 | @import Blockquote 8 | @import Button 9 | @import Code 10 | @import Divider 11 | @import Form 12 | @import Grid 13 | @import Link 14 | @import List 15 | @import Spacing 16 | @import Table 17 | @import Typography 18 | @import Image 19 | @import Utility 20 | --------------------------------------------------------------------------------