From 4ebc277bdf563e444e584f2e2225c87e7d1ba76a Mon Sep 17 00:00:00 2001 From: Nesha Date: Fri, 3 Mar 2023 22:53:01 +0100 Subject: [PATCH 01/24] mrsk --- .env | 1 + .env.erb | 1 + .gitignore | 2 +- .ruby-version | 2 +- Gemfile | 5 ++++- Gemfile.lock | 40 ++++++++++++++++++++++++++++++++++++++-- config/deploy.yml | 8 ++++++++ 7 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 .env create mode 100644 .env.erb create mode 100644 config/deploy.yml diff --git a/.env b/.env new file mode 100644 index 00000000..4e65c10e --- /dev/null +++ b/.env @@ -0,0 +1 @@ +MRSK_REGISTRY_PASSWORD='dckr_pat_dGJz7C5EY7UNpDa_CTa9nD5BABY' \ No newline at end of file diff --git a/.env.erb b/.env.erb new file mode 100644 index 00000000..4e65c10e --- /dev/null +++ b/.env.erb @@ -0,0 +1 @@ +MRSK_REGISTRY_PASSWORD='dckr_pat_dGJz7C5EY7UNpDa_CTa9nD5BABY' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0e18499b..57722d77 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ # Ignore bundler config. /.bundle -/vendor/bundle +/vendor/bundle/* # Ignore the default SQLite database. /db/*.sqlite3 diff --git a/.ruby-version b/.ruby-version index 4e34c4dd..85588beb 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.7.6 +ruby-3.0.0 diff --git a/Gemfile b/Gemfile index 53b290c7..3a7d6eb1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,8 @@ source "https://rubygems.org" +#source "https://gems.data.ruby.ci" git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby "2.7.6" +ruby "3.0.0" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.0.4" @@ -9,6 +10,8 @@ gem "rails", "~> 7.0.4" # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem "sprockets-rails" +gem "administrate" + # Use sqlite3 as the database for Active Record gem "sqlite3", "~> 1.4" diff --git a/Gemfile.lock b/Gemfile.lock index 0da0887b..9de89b45 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -68,6 +68,14 @@ GEM tzinfo (~> 2.0) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) + administrate (0.18.0) + actionpack (>= 5.0) + actionview (>= 5.0) + activerecord (>= 5.0) + jquery-rails (>= 4.0) + kaminari (>= 1.0) + sassc-rails (~> 2.1) + selectize-rails (~> 0.6) bindex (0.8.1) bootsnap (1.14.0) msgpack (~> 1.2) @@ -90,6 +98,7 @@ GEM reline (>= 0.3.1) diff-lcs (1.5.0) erubi (1.11.0) + ffi (1.15.5) globalid (1.0.0) activesupport (>= 5.0) i18n (1.12.0) @@ -103,6 +112,22 @@ GEM jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) + jquery-rails (4.5.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + kaminari (1.2.2) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) + actionview + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) + activerecord + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) loofah (2.19.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -186,6 +211,15 @@ GEM rspec-support (~> 3.11) rspec-support (3.12.0) rubyzip (2.3.2) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + selectize-rails (0.12.6) selenium-webdriver (4.6.1) childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) @@ -208,6 +242,7 @@ GEM stimulus-rails (1.1.1) railties (>= 6.0.0) thor (1.2.1) + tilt (2.0.11) timeout (0.3.0) turbo-rails (1.3.2) actionpack (>= 6.0.0) @@ -236,6 +271,7 @@ PLATFORMS ruby DEPENDENCIES + administrate bootsnap capybara debug @@ -256,7 +292,7 @@ DEPENDENCIES webdrivers RUBY VERSION - ruby 2.7.6p219 + ruby 3.0.0p0 BUNDLED WITH - 2.1.4 + 2.2.3 diff --git a/config/deploy.yml b/config/deploy.yml new file mode 100644 index 00000000..77f83791 --- /dev/null +++ b/config/deploy.yml @@ -0,0 +1,8 @@ +service: basicapp +image: kolosek/basicapp +servers: + - 116.203.207.181 +registry: + username: kolosek + password: + - MRSK_REGISTRY_PASSWORD \ No newline at end of file From 30a8d460fae00dcb625652ac63b779e6fe1c03b3 Mon Sep 17 00:00:00 2001 From: Nesha Date: Fri, 3 Mar 2023 22:55:26 +0100 Subject: [PATCH 02/24] new ip --- config/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.yml b/config/deploy.yml index 77f83791..4b03cf77 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -1,7 +1,7 @@ service: basicapp image: kolosek/basicapp servers: - - 116.203.207.181 + - 5.161.63.224 registry: username: kolosek password: From 3c42207868a95bb4152a94c7b90c27f276a3f57f Mon Sep 17 00:00:00 2001 From: Nesha Date: Fri, 3 Mar 2023 23:39:05 +0100 Subject: [PATCH 03/24] dockerfiles --- Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ bin/docker-entrypoint | 8 ++++++++ 2 files changed, 46 insertions(+) create mode 100644 Dockerfile create mode 100644 bin/docker-entrypoint diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..7491a383 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +# Make sure it matches the Ruby version in .ruby-version and Gemfile +ARG RUBY_VERSION=3.0.0 +FROM ruby:$RUBY_VERSION + +# Install libvips for Active Storage preview support +RUN apt-get update -qq && \ + apt-get install -y build-essential libvips && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man + +# Rails app lives here +WORKDIR /rails + +# Set production environment +ENV RAILS_LOG_TO_STDOUT="1" \ + RAILS_SERVE_STATIC_FILES="true" \ + RAILS_ENV="production" \ + BUNDLE_WITHOUT="development" + +# Install application gems +COPY Gemfile Gemfile.lock ./ +RUN bundle install + +# Copy application code +COPY . . + +# Precompile bootsnap code for faster boot times +RUN bundle exec bootsnap precompile --gemfile app/ lib/ + +# Precompiling assets for production without requiring secret RAILS_MASTER_KEY +#RUN SECRET_KEY_BASE_DUMMY=0 bundle exec rails assets:precompile + +# Entrypoint prepares the database. +ENTRYPOINT ["/rails/bin/docker-entrypoint"] + +# Start the server by default, this can be overwritten at runtime +EXPOSE 3000 +CMD ["./bin/rails", "server"] diff --git a/bin/docker-entrypoint b/bin/docker-entrypoint new file mode 100644 index 00000000..1fd12f1d --- /dev/null +++ b/bin/docker-entrypoint @@ -0,0 +1,8 @@ +#!/bin/bash + +# If running the rails server then create or migrate existing database +if [ "${*}" == "./bin/rails server" ]; then + ./bin/rails db:prepare +fi + +exec "${@}" \ No newline at end of file From 14a3858c8d40c80b4195af8b7e95f5ba20ecb71d Mon Sep 17 00:00:00 2001 From: Nesha Date: Fri, 3 Mar 2023 23:41:29 +0100 Subject: [PATCH 04/24] make executable --- bin/docker-entrypoint | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bin/docker-entrypoint diff --git a/bin/docker-entrypoint b/bin/docker-entrypoint old mode 100644 new mode 100755 From 97772cb85b30382543695f83a15c28660c35db25 Mon Sep 17 00:00:00 2001 From: Nesha Date: Sat, 4 Mar 2023 00:36:28 +0100 Subject: [PATCH 05/24] on purpose --- spec/routing/items_routing_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/routing/items_routing_spec.rb b/spec/routing/items_routing_spec.rb index d78dbff3..519c787d 100644 --- a/spec/routing/items_routing_spec.rb +++ b/spec/routing/items_routing_spec.rb @@ -7,7 +7,7 @@ end it "routes to #new" do - expect(get: "/items/new").to route_to("items#new") + expect(get: "/items/new1").to route_to("items#new") end it "routes to #show" do From 1bc86d1eb5c5761eb02d5a0389d903065becb536 Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 08:40:47 +0100 Subject: [PATCH 06/24] trigger --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a31c4311..06bb4647 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,4 @@ Things you may want to cover: * Deployment instructions * ... + From 79be6c145422ed12eb53521e029136b621e2930c Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 14:10:27 +0100 Subject: [PATCH 07/24] secret_key_base --- config/secrets.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 config/secrets.yml diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 00000000..b0ffb168 --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,4 @@ +development: + secret_key_base: '39f8f601064f8f6a9fd36a0804105979abe6040d8c6b167ab3614b4336a5e1d5800cdf47e512783fdb60d16ac7695f972c9ca83880ad56e9f61aefd1f57993c7' +production: + secret_key_base: '39f8f601064f8f6a9fd36a0804105979abe6040d8c6b167ab3614b4336a5e1d5800cdf47e512783fdb60d16ac7695f972c9ca83880ad56e9f61aefd1f57993c7' \ No newline at end of file From eeed21d33c4347775f754841c7652ac4b6202bd8 Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 14:16:46 +0100 Subject: [PATCH 08/24] include master key --- config/deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/deploy.yml b/config/deploy.yml index 4b03cf77..57a8048f 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -5,4 +5,7 @@ servers: registry: username: kolosek password: - - MRSK_REGISTRY_PASSWORD \ No newline at end of file + - MRSK_REGISTRY_PASSWORD +env: + secret: + - RAILS_MASTER_KEY \ No newline at end of file From 336113c4017c3b998e3383b727b4e58f0231110a Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 14:22:12 +0100 Subject: [PATCH 09/24] creditentials --- config/credentials.yml.enc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc index fca12356..4ac27fbe 100644 --- a/config/credentials.yml.enc +++ b/config/credentials.yml.enc @@ -1 +1 @@ -qhV4QM5XHhfopSMHPQOnCbd6aOnQOF6+/kNB0arsN9G0B7PLlEwRHJRglfEsKZxvzzv0KEhJLtm2Ei6GYSmdx72hg6aCeNMKI8SrkpBLLQ7kdqj/05kTkSlYw1WeoWuIlxRXiOUywStOrL0QGNla/xRYsSpk1RS/+o6457Rd8yPUdWOC5ORjUhYWm5SgDii3vV7Z2Y9pOhtNsF/CZj5vu8wpfm/SI223gDryZ9ZE6X1DGDfBnJ1uVDsScqQlubz9ZRYmAXmqLySgDpIWE/jU4xBPKHZJ1Gh1ZKrX3icw1brgOLsgquYf9842sw3wP59upXrG7f82xXDhrU37+xvs1zvGkyJExGSi1n9d+lhc1ATQFqipb3CnU3mnH1L4Krr7iEQu/0Au6MTw5UONZ7wlOtRjqjkLHOILLjK5--+U1aMORLTomguj1a--FDN7kbBv3sr911kx6mQFSA== \ No newline at end of file +Sfe68WvrD7utpNrlblSMy5Y3GZIhAlSjliVRMGqRcy5etWRIN5jh15KB2Bj/t+wu7qqdGTbms3ivhWQqE0ssJWpqA7vVAx57DrLLtqCIXYxQnNFd0JADhHZPeDRa2h2Cnj7qcwMzkTe+NdJZH0RHg4Vb76y6CaJmxJ3YXlitpfp0Z3BzdlPfv26dfsoH6ZfKQ68/QD+oRrm4cQnBKO+j+eMDSbqIgq+ib9gaYv2uCqenrEF69yt3DZaBQvjbAkd1JTKiyD5H0Y4t5CpQ92hQ/rTa4zym9GshfExOygHRDYvi68wIZifYc55gkV10R8KG8gvwGZ2MAzlceeRWGD7D9bwALX0QLQhF4ao5a7Qbwn9mTcCbo/JRyXTbk9YgsJoyfWz/kYnduwlK6EGlS5UfJneJRX+monmy7cQb--JwxEUFZ2PggAQa41--1p6beAXEHbxqKhHzu3FxDA== \ No newline at end of file From 265d40d1bf83cad6b1afdf4707d48351febae254 Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 17:25:52 +0100 Subject: [PATCH 10/24] healthcheck --- app/controllers/health_controller.rb | 7 +++++++ app/helpers/health_helper.rb | 2 ++ app/views/health/show.html.erb | 2 ++ config/routes.rb | 2 ++ 4 files changed, 13 insertions(+) create mode 100644 app/controllers/health_controller.rb create mode 100644 app/helpers/health_helper.rb create mode 100644 app/views/health/show.html.erb diff --git a/app/controllers/health_controller.rb b/app/controllers/health_controller.rb new file mode 100644 index 00000000..73fa40cb --- /dev/null +++ b/app/controllers/health_controller.rb @@ -0,0 +1,7 @@ +class HealthController < ApplicationController + rescue_from(Exception) { render head: 503 } + + def show + render head: 200 + end +end diff --git a/app/helpers/health_helper.rb b/app/helpers/health_helper.rb new file mode 100644 index 00000000..21e809ac --- /dev/null +++ b/app/helpers/health_helper.rb @@ -0,0 +1,2 @@ +module HealthHelper +end diff --git a/app/views/health/show.html.erb b/app/views/health/show.html.erb new file mode 100644 index 00000000..7d127737 --- /dev/null +++ b/app/views/health/show.html.erb @@ -0,0 +1,2 @@ +

Health#show

+

Find me in app/views/health/show.html.erb

diff --git a/config/routes.rb b/config/routes.rb index 7871dd5a..b0fdf5b3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,9 @@ Rails.application.routes.draw do + get 'health/show' resources :items # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html # Defines the root path route ("/") # root "articles#index" + get '/up', to: 'health#show' end From 35cc16b6cedec75c67cbb41a30854ee6a0332efc Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 17:33:52 +0100 Subject: [PATCH 11/24] changes --- .env | 1 - .gitignore | 1 + Dockerfile | 5 +++-- config/deploy.yml | 4 +++- config/secrets.yml | 4 ---- spec/routing/items_routing_spec.rb | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 .env delete mode 100644 config/secrets.yml diff --git a/.env b/.env deleted file mode 100644 index 4e65c10e..00000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -MRSK_REGISTRY_PASSWORD='dckr_pat_dGJz7C5EY7UNpDa_CTa9nD5BABY' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 57722d77..3d0a50c2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # Ignore bundler config. /.bundle /vendor/bundle/* +.env # Ignore the default SQLite database. /db/*.sqlite3 diff --git a/Dockerfile b/Dockerfile index 7491a383..4700b015 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,10 +25,11 @@ RUN bundle install COPY . . # Precompile bootsnap code for faster boot times -RUN bundle exec bootsnap precompile --gemfile app/ lib/ +RUN bundle exec bootsnap precompile --gemfile app/ lib/ +RUN bundle config set force_ruby_platform true # Precompiling assets for production without requiring secret RAILS_MASTER_KEY -#RUN SECRET_KEY_BASE_DUMMY=0 bundle exec rails assets:precompile +RUN bundle exec rails assets:precompile # Entrypoint prepares the database. ENTRYPOINT ["/rails/bin/docker-entrypoint"] diff --git a/config/deploy.yml b/config/deploy.yml index 57a8048f..f0b81032 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -8,4 +8,6 @@ registry: - MRSK_REGISTRY_PASSWORD env: secret: - - RAILS_MASTER_KEY \ No newline at end of file + - RAILS_MASTER_KEY +builder: + multiarch: false \ No newline at end of file diff --git a/config/secrets.yml b/config/secrets.yml deleted file mode 100644 index b0ffb168..00000000 --- a/config/secrets.yml +++ /dev/null @@ -1,4 +0,0 @@ -development: - secret_key_base: '39f8f601064f8f6a9fd36a0804105979abe6040d8c6b167ab3614b4336a5e1d5800cdf47e512783fdb60d16ac7695f972c9ca83880ad56e9f61aefd1f57993c7' -production: - secret_key_base: '39f8f601064f8f6a9fd36a0804105979abe6040d8c6b167ab3614b4336a5e1d5800cdf47e512783fdb60d16ac7695f972c9ca83880ad56e9f61aefd1f57993c7' \ No newline at end of file diff --git a/spec/routing/items_routing_spec.rb b/spec/routing/items_routing_spec.rb index 519c787d..d78dbff3 100644 --- a/spec/routing/items_routing_spec.rb +++ b/spec/routing/items_routing_spec.rb @@ -7,7 +7,7 @@ end it "routes to #new" do - expect(get: "/items/new1").to route_to("items#new") + expect(get: "/items/new").to route_to("items#new") end it "routes to #show" do From 9b723613b6bcef2015f88973898c8fead2971397 Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 17:34:35 +0100 Subject: [PATCH 12/24] c --- .env.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/.env.erb b/.env.erb index 4e65c10e..e69de29b 100644 --- a/.env.erb +++ b/.env.erb @@ -1 +0,0 @@ -MRSK_REGISTRY_PASSWORD='dckr_pat_dGJz7C5EY7UNpDa_CTa9nD5BABY' \ No newline at end of file From 8a5970dec5c99c9a2b0ca6d69fc10a415b4c4dbe Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 18:11:00 +0100 Subject: [PATCH 13/24] ch --- .env.erb | 0 Dockerfile | 2 +- config/deploy.yml | 4 +++- config/environments/production.rb | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) delete mode 100644 .env.erb diff --git a/.env.erb b/.env.erb deleted file mode 100644 index e69de29b..00000000 diff --git a/Dockerfile b/Dockerfile index 4700b015..a69bd692 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM ruby:$RUBY_VERSION # Install libvips for Active Storage preview support RUN apt-get update -qq && \ - apt-get install -y build-essential libvips && \ + apt-get install -y build-essential libvips vim && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man diff --git a/config/deploy.yml b/config/deploy.yml index f0b81032..7e10dc80 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -10,4 +10,6 @@ env: secret: - RAILS_MASTER_KEY builder: - multiarch: false \ No newline at end of file + multiarch: false +#labels: +# traefik.http.routers.hey.rule: Host(\'basic.kolosek.me\'') \ No newline at end of file diff --git a/config/environments/production.rb b/config/environments/production.rb index 065a4128..bc9380f7 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,7 +46,8 @@ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true + config.force_ssl = true + config.assume_ssl = true # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). From 715a4431afc831515b83e595fbb8ee418b03f9f6 Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 18:16:39 +0100 Subject: [PATCH 14/24] a --- config/environments/production.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index bc9380f7..c56553d5 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,8 +46,8 @@ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = true - config.assume_ssl = true + #config.force_ssl = true + #config.assume_ssl = true # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). From 2beae868056f79e4dcf98d4ba1e6930d415ce064 Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 18:34:21 +0100 Subject: [PATCH 15/24] a --- config/deploy.yml | 4 ++-- config/environments/production.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/deploy.yml b/config/deploy.yml index 7e10dc80..0b86b588 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -11,5 +11,5 @@ env: - RAILS_MASTER_KEY builder: multiarch: false -#labels: -# traefik.http.routers.hey.rule: Host(\'basic.kolosek.me\'') \ No newline at end of file +# labels: +# traefik.http.routers.hey.rule: Host(\'basic.kolosek.me\'') \ No newline at end of file diff --git a/config/environments/production.rb b/config/environments/production.rb index c56553d5..1a5ce78d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -47,7 +47,7 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. #config.force_ssl = true - #config.assume_ssl = true + config.assume_ssl = true # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). From 628ec0a102feb438c09a490abdbbb22cc367eb8c Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 18:39:21 +0100 Subject: [PATCH 16/24] force --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 1a5ce78d..bc9380f7 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,7 +46,7 @@ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - #config.force_ssl = true + config.force_ssl = true config.assume_ssl = true # Include generic and useful information about system operation, but avoid logging too much From efe57387affafd4a49926f7e2db484189f9b19c4 Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sat, 4 Mar 2023 18:51:08 +0100 Subject: [PATCH 17/24] force not --- config/deploy.yml | 6 ++++-- config/environments/production.rb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/deploy.yml b/config/deploy.yml index 0b86b588..8c248098 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -11,5 +11,7 @@ env: - RAILS_MASTER_KEY builder: multiarch: false -# labels: -# traefik.http.routers.hey.rule: Host(\'basic.kolosek.me\'') \ No newline at end of file +volumes: + - "~/basic/public:/rails/public" + labels: + traefik.http.routers.hey.rule: Host(\'basic.kolosek.me\'') \ No newline at end of file diff --git a/config/environments/production.rb b/config/environments/production.rb index bc9380f7..1a5ce78d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,7 +46,7 @@ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = true + #config.force_ssl = true config.assume_ssl = true # Include generic and useful information about system operation, but avoid logging too much From 891bded83efedce0da98e8b4285a43e35db0c52c Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sun, 19 Mar 2023 01:12:39 +0100 Subject: [PATCH 18/24] port --- config/deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/deploy.yml b/config/deploy.yml index 8c248098..48f6be4b 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -11,7 +11,7 @@ env: - RAILS_MASTER_KEY builder: multiarch: false -volumes: - - "~/basic/public:/rails/public" - labels: - traefik.http.routers.hey.rule: Host(\'basic.kolosek.me\'') \ No newline at end of file +labels: + traefik.http.routers.hey.rule: Host(\'basic.kolosek.me\'') +traefik: + host_port: 81 \ No newline at end of file From 708e8cecadab749506fc3c998b1e526684a725de Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sun, 19 Mar 2023 01:21:03 +0100 Subject: [PATCH 19/24] upd --- config/deploy.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/deploy.yml b/config/deploy.yml index 48f6be4b..6732b614 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -1,7 +1,10 @@ service: basicapp image: kolosek/basicapp servers: - - 5.161.63.224 + web: + - 5.161.63.224 + traefik: + host_port: 81 registry: username: kolosek password: @@ -13,5 +16,3 @@ builder: multiarch: false labels: traefik.http.routers.hey.rule: Host(\'basic.kolosek.me\'') -traefik: - host_port: 81 \ No newline at end of file From 0ccfb72e1dd162c2646d63b2761451041a7487be Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sun, 19 Mar 2023 08:15:00 +0100 Subject: [PATCH 20/24] a --- config/deploy.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/config/deploy.yml b/config/deploy.yml index 6732b614..e268334e 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -1,10 +1,7 @@ service: basicapp image: kolosek/basicapp servers: - web: - - 5.161.63.224 - traefik: - host_port: 81 + - 5.161.63.224 registry: username: kolosek password: @@ -14,5 +11,7 @@ env: - RAILS_MASTER_KEY builder: multiarch: false -labels: - traefik.http.routers.hey.rule: Host(\'basic.kolosek.me\'') +traefik: + host_port: 8080 + labels: + traefik.http.routers.basicapp.rule: Host(\'basic.kolosek.me\'') From de531a0e6ad499e9f5991fd7c7e2aa8d47646651 Mon Sep 17 00:00:00 2001 From: Kolosek Date: Sun, 19 Mar 2023 08:42:28 +0100 Subject: [PATCH 21/24] ss --- config/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.yml b/config/deploy.yml index e268334e..ea052374 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -12,6 +12,6 @@ env: builder: multiarch: false traefik: - host_port: 8080 + host_port: 81 labels: traefik.http.routers.basicapp.rule: Host(\'basic.kolosek.me\'') From 1cd0998acd06ee7f80bf3a5f1b4afb07ee06a0fd Mon Sep 17 00:00:00 2001 From: Nebojsa Zoric Date: Sun, 14 May 2023 11:00:55 +0200 Subject: [PATCH 22/24] Update items_controller.rb --- app/controllers/items_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index cab14057..0d156485 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -4,6 +4,7 @@ class ItemsController < ApplicationController # GET /items or /items.json def index @items = Item.all + @items = Item.all end # GET /items/1 or /items/1.json From 2d7857a55fe8172896ad3bc565c4c96d3cb65fb4 Mon Sep 17 00:00:00 2001 From: Nebojsa Zoric Date: Sun, 14 May 2023 12:30:56 +0200 Subject: [PATCH 23/24] Update items_controller.rb --- app/controllers/items_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index 0d156485..cab14057 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -4,7 +4,6 @@ class ItemsController < ApplicationController # GET /items or /items.json def index @items = Item.all - @items = Item.all end # GET /items/1 or /items/1.json From c47a3ed5bc5b7d6e7da99e6a24e306d3f7beba7a Mon Sep 17 00:00:00 2001 From: Nebojsa Zoric Date: Sun, 21 May 2023 10:41:16 +0200 Subject: [PATCH 24/24] Update items_controller.rb --- app/controllers/items_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index cab14057..21eab1ba 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -4,6 +4,7 @@ class ItemsController < ApplicationController # GET /items or /items.json def index @items = Item.all + @items = Item.all end # GET /items/1 or /items/1.json