From 52fff38cac448e1143d774498244f9df8bc55d5d Mon Sep 17 00:00:00 2001 From: Ryan Murphy Date: Tue, 29 May 2018 14:34:11 -0500 Subject: [PATCH 01/11] Move away from DATABASE_URL for K8 support --- config/database.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/database.yml b/config/database.yml index 0d1313ca..8a88fbce 100644 --- a/config/database.yml +++ b/config/database.yml @@ -19,4 +19,8 @@ test: production: <<: *default - url: <%= ENV['DATABASE_URL'] %> + database: <%= ENV.fetch('DB_NAME') %> + username: <%= ENV.fetch('DB_USER') %> + password: <%= ENV.fetch('DB_PASSWORD') %> + host: "127.0.0.1" + port: 5432 From 1fddfeab7f78d490daf582d030922cffbee168a0 Mon Sep 17 00:00:00 2001 From: Ryan Murphy Date: Tue, 29 May 2018 15:21:53 -0500 Subject: [PATCH 02/11] Maybe it needs to not use ENV.fetch --- config/database.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/database.yml b/config/database.yml index 8a88fbce..deb601d5 100644 --- a/config/database.yml +++ b/config/database.yml @@ -19,8 +19,8 @@ test: production: <<: *default - database: <%= ENV.fetch('DB_NAME') %> - username: <%= ENV.fetch('DB_USER') %> - password: <%= ENV.fetch('DB_PASSWORD') %> + database: <%= ENV['DB_NAME'] %> + username: <%= ENV['DB_USER'] %> + password: <%= ENV['DB_PASSWORD'] %> host: "127.0.0.1" port: 5432 From a83e9f08fff3f6574697c523e267d3127de33169 Mon Sep 17 00:00:00 2001 From: Ryan Murphy Date: Tue, 29 May 2018 15:38:56 -0500 Subject: [PATCH 03/11] Keep trying to pin this down --- config/database.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/database.yml b/config/database.yml index deb601d5..4ed412ff 100644 --- a/config/database.yml +++ b/config/database.yml @@ -22,5 +22,5 @@ production: database: <%= ENV['DB_NAME'] %> username: <%= ENV['DB_USER'] %> password: <%= ENV['DB_PASSWORD'] %> - host: "127.0.0.1" + host: localhost port: 5432 From face8b29ad2ddb3807bf278a6b72ead935d8a7cf Mon Sep 17 00:00:00 2001 From: Ryan Murphy Date: Tue, 29 May 2018 15:47:33 -0500 Subject: [PATCH 04/11] Prep for testing --- config/database.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/database.yml b/config/database.yml index 4ed412ff..a71139e8 100644 --- a/config/database.yml +++ b/config/database.yml @@ -19,8 +19,8 @@ test: production: <<: *default - database: <%= ENV['DB_NAME'] %> - username: <%= ENV['DB_USER'] %> - password: <%= ENV['DB_PASSWORD'] %> - host: localhost + database: <%= ENV.fetch('DB_NAME') %> + username: <%= ENV.fetch('DB_USER') %> + password: <%= ENV.fetch('DB_PASSWORD') %> + host: <%= ENV.fetch('DB_HOST', 'localhost') %> port: 5432 From e029ef9fdc602deb183dcf4fe188d091dca4a468 Mon Sep 17 00:00:00 2001 From: Ryan Murphy Date: Tue, 2 Apr 2019 14:58:02 -0500 Subject: [PATCH 05/11] Remove all the unnecessary cron stuff --- Dockerfile | 14 +----------- rootfs/etc/cont-init.d/10-config.sh | 33 ----------------------------- rootfs/etc/services.d/cron/finish | 4 ---- rootfs/etc/services.d/cron/run | 8 ------- rootfs/etc/services.d/klaxon/finish | 4 ---- rootfs/etc/services.d/klaxon/run | 5 ----- 6 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 rootfs/etc/cont-init.d/10-config.sh delete mode 100644 rootfs/etc/services.d/cron/finish delete mode 100644 rootfs/etc/services.d/cron/run delete mode 100644 rootfs/etc/services.d/klaxon/finish delete mode 100644 rootfs/etc/services.d/klaxon/run diff --git a/Dockerfile b/Dockerfile index 2bd3373e..8e09f2e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,16 +13,4 @@ RUN bundle install COPY . /usr/src/app EXPOSE 3000 - -# install s6overlay so that we can run cron inside this container as well. -ADD https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-amd64.tar.gz /tmp/ -RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / \ - && mkdir /config \ - && apt-get update \ - && apt-get install -y cron \ - && rm -rf /var/lib/apt/lists/* - -COPY rootfs/ / -VOLUME ["/config"] - -ENTRYPOINT ["/init"] +CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"] diff --git a/rootfs/etc/cont-init.d/10-config.sh b/rootfs/etc/cont-init.d/10-config.sh deleted file mode 100644 index d7351125..00000000 --- a/rootfs/etc/cont-init.d/10-config.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/with-contenv bash - -# run klaxon startup commands -cd /usr/src/app -bundle exec rake db:create db:migrate || true -bundle exec rake users:create_admin || true - - - -# Setup cron to run klaxon every 15 mins. -mkdir -p /config - -if [[ ! -f /config/klaxon-cron ]]; then - -cat > /config/klaxon-cron < /proc/1/fd/1 2>&1" > /etc/cron.d/klaxon-crontab -ln -s /config/klaxon-crontab /etc/cron.d/klaxon-crontab - -fi \ No newline at end of file diff --git a/rootfs/etc/services.d/cron/finish b/rootfs/etc/services.d/cron/finish deleted file mode 100644 index 8eebbb53..00000000 --- a/rootfs/etc/services.d/cron/finish +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/execlineb -S0 - -echo "crond exiting" -s6-svscanctl -t /var/run/s6/services \ No newline at end of file diff --git a/rootfs/etc/services.d/cron/run b/rootfs/etc/services.d/cron/run deleted file mode 100644 index 1c9533ac..00000000 --- a/rootfs/etc/services.d/cron/run +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/with-contenv bash - -echo "starting cron" - -#fix link-count, as cron is being a pain, and docker is making hardlink count >0 (very high) -touch /etc/crontab /etc/cron.*/* - -exec cron -L 8 -f diff --git a/rootfs/etc/services.d/klaxon/finish b/rootfs/etc/services.d/klaxon/finish deleted file mode 100644 index 572c8464..00000000 --- a/rootfs/etc/services.d/klaxon/finish +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/execlineb -S0 - -echo "klaxon exiting" -s6-svscanctl -t /var/run/s6/services \ No newline at end of file diff --git a/rootfs/etc/services.d/klaxon/run b/rootfs/etc/services.d/klaxon/run deleted file mode 100644 index 345ad83b..00000000 --- a/rootfs/etc/services.d/klaxon/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bash - -echo "starting klaxon" -cd /usr/src/app -bundle exec puma -C "config/puma.rb" From 84a262a04913d996bcf0476943d43d93435751f2 Mon Sep 17 00:00:00 2001 From: Ryan Murphy Date: Tue, 2 Apr 2019 17:34:21 -0500 Subject: [PATCH 06/11] Some more tweaks to get things working again --- Dockerfile | 2 +- Makefile | 8 ++++++++ entrypoint.sh | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 8e09f2e0..5a05ea62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,4 @@ RUN bundle install COPY . /usr/src/app EXPOSE 3000 -CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"] +CMD ["./entrypoint.sh"] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f733720a --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +GCLOUD_PROJECT:=$(shell gcloud config list project --format="value(core.project)") +PROJECT_NAME:=klaxon + +build: + docker build -t us.gcr.io/$(GCLOUD_PROJECT)/$(PROJECT_NAME) . + +push: build + docker push us.gcr.io/$(GCLOUD_PROJECT)/$(PROJECT_NAME) \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 00000000..a0531777 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Precompile files +bundle exec rake assets:precompile + +# Run the server +bundle exec puma -C config/puma.rb From 371a5327051ee65a19db3161089f0e93f6e99b93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Nov 2021 17:21:44 +0000 Subject: [PATCH 07/11] Bump addressable from 2.7.0 to 2.8.0 Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.0. - [Release notes](https://github.com/sporkmonger/addressable/releases) - [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md) - [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.7.0...addressable-2.8.0) --- updated-dependencies: - dependency-name: addressable dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff87f8c4..ef3a9097 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,7 +56,7 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) - addressable (2.7.0) + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) aws-eventstream (1.1.1) aws-partitions (1.444.0) From e94ff9240bda3b3e96e2a3142b9dc19191d8f152 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Nov 2021 17:22:04 +0000 Subject: [PATCH 08/11] Bump rdoc from 6.0.4 to 6.3.2 Bumps [rdoc](https://github.com/ruby/rdoc) from 6.0.4 to 6.3.2. - [Release notes](https://github.com/ruby/rdoc/releases) - [Changelog](https://github.com/ruby/rdoc/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rdoc/compare/v6.0.4...v6.3.2) --- updated-dependencies: - dependency-name: rdoc dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff87f8c4..51eb7d0c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -240,7 +240,7 @@ GEM rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) - rdoc (6.3.0) + rdoc (6.3.2) rexml (3.2.5) rspec (3.10.0) rspec-core (~> 3.10.0) From 1d8637b80be1ad7451b34dff54e456f9073f74df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Nov 2021 17:23:17 +0000 Subject: [PATCH 09/11] Bump puma from 3.12.1 to 4.3.9 Bumps [puma](https://github.com/puma/puma) from 3.12.1 to 4.3.9. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v3.12.1...v4.3.9) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff87f8c4..29391b2e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,7 +172,7 @@ GEM mustermann (1.1.1) ruby2_keywords (~> 0.0.1) nenv (0.3.0) - nio4r (2.5.7) + nio4r (2.5.8) nokogiri (1.11.3) mini_portile2 (~> 2.5.0) racc (~> 1.4) @@ -191,7 +191,7 @@ GEM coderay (~> 1.1) method_source (~> 1.0) public_suffix (4.0.6) - puma (4.3.7) + puma (4.3.9) nio4r (~> 2.0) racc (1.5.2) rack (2.2.3) From 11e65c17106671d2c18f6c25c869af5287c02a73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Nov 2021 17:25:57 +0000 Subject: [PATCH 10/11] Bump nokogiri from 1.11.3 to 1.12.5 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.3 to 1.12.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.3...v1.12.5) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 996a7a9e..1ff56bf8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -163,7 +163,7 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2021.0225) mini_mime (1.1.0) - mini_portile2 (2.5.0) + mini_portile2 (2.6.1) mini_racer (0.4.0) libv8-node (~> 15.14.0.0) minitest (5.14.4) @@ -173,8 +173,8 @@ GEM ruby2_keywords (~> 0.0.1) nenv (0.3.0) nio4r (2.5.8) - nokogiri (1.11.3) - mini_portile2 (~> 2.5.0) + nokogiri (1.12.5) + mini_portile2 (~> 2.6.1) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) @@ -193,7 +193,7 @@ GEM public_suffix (4.0.6) puma (4.3.9) nio4r (~> 2.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) rack-cache (1.12.1) rack (>= 0.4) From ff0d150a40c0c415f396496145f0a1693e20b8b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 13:03:38 +0000 Subject: [PATCH 11/11] Bump rails-html-sanitizer from 1.3.0 to 1.4.4 Bumps [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer) from 1.3.0 to 1.4.4. - [Release notes](https://github.com/rails/rails-html-sanitizer/releases) - [Changelog](https://github.com/rails/rails-html-sanitizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.3.0...v1.4.4) --- updated-dependencies: - dependency-name: rails-html-sanitizer dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1ff56bf8..e806f8cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -151,7 +151,7 @@ GEM listen (3.5.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.9.1) + loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.2.8) @@ -163,7 +163,7 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2021.0225) mini_mime (1.1.0) - mini_portile2 (2.6.1) + mini_portile2 (2.8.0) mini_racer (0.4.0) libv8-node (~> 15.14.0.0) minitest (5.14.4) @@ -173,8 +173,8 @@ GEM ruby2_keywords (~> 0.0.1) nenv (0.3.0) nio4r (2.5.8) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.10) + mini_portile2 (~> 2.8.0) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) @@ -193,7 +193,7 @@ GEM public_suffix (4.0.6) puma (4.3.9) nio4r (~> 2.0) - racc (1.6.0) + racc (1.6.1) rack (2.2.3) rack-cache (1.12.1) rack (>= 0.4) @@ -223,8 +223,8 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) - loofah (~> 2.3) + rails-html-sanitizer (1.4.4) + loofah (~> 2.19, >= 2.19.1) rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging