From 46d1b5caf5e5b67151e29f121c050270e91d847b Mon Sep 17 00:00:00 2001 From: CactusPuppy Date: Wed, 10 Feb 2021 17:10:18 -0800 Subject: [PATCH 1/5] Add ability to use local environment variables via config/local_env.yml --- .gitignore | 1 + config/application.rb | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 8331c5c8..ee9739f8 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ docker-compose.override.yml .buildconfig osem_development osem_test +config/local_env.yml diff --git a/config/application.rb b/config/application.rb index e3483d4a..874f4456 100644 --- a/config/application.rb +++ b/config/application.rb @@ -65,5 +65,12 @@ module Osem config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=31536000' } config.active_job.queue_adapter = :delayed_job + + config.before_configuration do + env_file = File.join(Rails.root, 'config', 'local_env.yml') + YAML.load(File.open(env_file)).each do |key, value| + ENV[key.to_s] = value + end if File.exists?(env_file) + end end end From a45008640f9308303ad8c2efd63bfd905bc4c38d Mon Sep 17 00:00:00 2001 From: CactusPuppy Date: Thu, 11 Feb 2021 16:17:13 -0800 Subject: [PATCH 2/5] Add back user/password loading --- config/database.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/database.yml b/config/database.yml index ecf07a0f..e8a3d502 100644 --- a/config/database.yml +++ b/config/database.yml @@ -11,8 +11,8 @@ default: &default encoding: <%= encoding %> host: <%= ENV['OSEM_DB_HOST'] || 'database' %> port: <%= ENV['OSEM_DB_PORT'] || '5432' %> - # username: <%= ENV['OSEM_DB_USER'] || 'postgres' %> - # password: <%= ENV['OSEM_DB_PASSWORD'] || 'mysecretpassword' %> + username: <%= ENV['OSEM_DB_USER'] || 'postgres' %> + password: <%= ENV['OSEM_DB_PASSWORD'] || 'mysecretpassword' %> database: <%= ENV['OSEM_DB_NAME'] || 'postgres' %> pool: 5 timeout: 50000 From 5746ae80aa1408ce8dd7d7116ec18b641b626531 Mon Sep 17 00:00:00 2001 From: Ziyi Date: Wed, 17 Feb 2021 12:44:25 -0800 Subject: [PATCH 3/5] gitignore for Mac --- .gitignore | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/.gitignore b/.gitignore index ee9739f8..f35f94d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,23 @@ +# Global, for Macs +*~ + +# Compiled Python files +*.pyc + +# Folder view configuration files +.DS_Store +Desktop.ini + +# Thumbnail cache files +._* +Thumbs.db + +# Files that might appear on external disks +.Spotlight-V100 +.Trashes + + +# Legacy from before Feb 2021 /db/test.sqlite3-journal config/application.rb config/config.yml @@ -41,3 +61,62 @@ docker-compose.override.yml osem_development osem_test config/local_env.yml + +# From GitHub, for Ruby +# https://github.com/github/gitignore/blob/master/Ruby.gitignore +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +# .env + +# Ignore Byebug command history file. +.byebug_history + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# vendor/Pods/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# Used by RuboCop. Remote config files pulled in from inherit_from directive. +.rubocop-https?--* From 20c6320dcd599cbf65ac7baa814e371ac0f52b7f Mon Sep 17 00:00:00 2001 From: CactusPuppy Date: Wed, 17 Feb 2021 15:17:54 -0800 Subject: [PATCH 4/5] Add Badges except for Bluejay --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2fe87dcf..64243d7e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -[![Build Status](https://travis-ci.org/openSUSE/osem.svg?branch=master)](https://travis-ci.org/openSUSE/osem) -[![Code Climate](https://codeclimate.com/github/openSUSE/osem.png)](https://codeclimate.com/github/openSUSE/osem) -[![codecov](https://codecov.io/gh/opensuse/osem/branch/master/graph/badge.svg)](https://codecov.io/gh/opensuse/osem) -[![Security Status](https://hakiri.io/github/openSUSE/osem/master.svg)](https://hakiri.io/github/openSUSE/osem/master) -[![Dependencies](https://badges.depfu.com/badges/8fcd630367d20f5b48d393774c00c5fd/overview.svg)](https://depfu.com/repos/openSUSE/osem) +[![Build Status](https://travis-ci.com/CactusPuppy/snapcon.svg?branch=master)](https://travis-ci.com/CactusPuppy/snapcon) +[![Maintainability](https://api.codeclimate.com/v1/badges/6c7fc446b3b10866ba71/maintainability)](https://codeclimate.com/github/CactusPuppy/snapcon/maintainability) +[![codecov](https://codecov.io/gh/CactusPuppy/snapcon/branch/master/graph/badge.svg?token=y4aEAtw6KJ)](https://codecov.io/gh/CactusPuppy/snapcon) +[![Security Status](https://hakiri.io/github/CactusPuppy/snapcon/master.svg)](https://hakiri.io/github/CactusPuppy/snapcon/master) +[![Depfu](https://badges.depfu.com/badges/16eb1ffb3a9f1a36c4e595a5ae2a1dca/overview.svg)](https://depfu.com/github/CactusPuppy/snapcon?project_id=22682) Deploy From f473ca838ff2dbca71c3bd480f548f5ed99672ce Mon Sep 17 00:00:00 2001 From: CactusPuppy Date: Wed, 17 Feb 2021 21:48:18 -0800 Subject: [PATCH 5/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 64243d7e..46ea6cab 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![codecov](https://codecov.io/gh/CactusPuppy/snapcon/branch/master/graph/badge.svg?token=y4aEAtw6KJ)](https://codecov.io/gh/CactusPuppy/snapcon) [![Security Status](https://hakiri.io/github/CactusPuppy/snapcon/master.svg)](https://hakiri.io/github/CactusPuppy/snapcon/master) [![Depfu](https://badges.depfu.com/badges/16eb1ffb3a9f1a36c4e595a5ae2a1dca/overview.svg)](https://depfu.com/github/CactusPuppy/snapcon?project_id=22682) +[![Bluejay Dashboard](https://img.shields.io/badge/Bluejay-Dashboard_5-blue.svg)](http://dashboard.bluejay.governify.io/dashboard/script/dashboardLoader.js?dashboardURL=https://reporter.bluejay.governify.io/api/v4/dashboards/tpa-CS169L-GH-CactusPuppy_snapcon/main) Deploy