From f20aa13b7bb9e7869ea129b8276b8b5370f70a50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 00:55:39 +0000 Subject: [PATCH 001/121] Bump RedCloth from 4.3.3 to 4.3.4 Bumps [RedCloth](https://github.com/jgarber/redcloth) from 4.3.3 to 4.3.4. - [Changelog](https://github.com/jgarber/redcloth/blob/master/CHANGELOG) - [Commits](https://github.com/jgarber/redcloth/compare/v4.3.3...v4.3.4) --- updated-dependencies: - dependency-name: RedCloth dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d4487d0e..4850fbcf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - RedCloth (4.3.3) + RedCloth (4.3.4) aasm (5.5.0) concurrent-ruby (~> 1.0) actioncable (6.1.7.8) From b280485ef20ec84705766235b600c48fa16ba30c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 00:20:33 +0000 Subject: [PATCH 002/121] Bump bullet from 7.1.4 to 7.1.6 Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.1.4 to 7.1.6. - [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md) - [Commits](https://github.com/flyerhzm/bullet/compare/7.1.4...7.1.6) --- updated-dependencies: - dependency-name: bullet dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4850fbcf..48882364 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,7 +83,7 @@ GEM autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) builder (3.3.0) - bullet (7.1.4) + bullet (7.1.6) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) @@ -338,7 +338,7 @@ GEM websocket-extensions (0.1.5) will_paginate (4.0.1) yard (0.9.36) - zeitwerk (2.6.15) + zeitwerk (2.6.16) PLATFORMS ruby From 720cb02697d35d68b4c059e9657f898299ee74e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 00:12:49 +0000 Subject: [PATCH 003/121] Bump mocha from 2.1.0 to 2.4.0 Bumps [mocha](https://github.com/freerange/mocha) from 2.1.0 to 2.4.0. - [Changelog](https://github.com/freerange/mocha/blob/main/RELEASE.md) - [Commits](https://github.com/freerange/mocha/compare/v2.1.0...v2.4.0) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 48882364..f968fe8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,7 +172,7 @@ GEM libv8-node (~> 21.7.2.0) minitest (5.23.1) minitest-stub-const (0.6) - mocha (2.1.0) + mocha (2.4.0) ruby2_keywords (>= 0.0.5) mysql2 (0.5.6) net-imap (0.4.12) From 713c89c6e094eb7755b559f52244db2a309aaed0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 00:01:21 +0000 Subject: [PATCH 004/121] Bump rspec-expectations from 3.12.3 to 3.13.1 Bumps [rspec-expectations](https://github.com/rspec/rspec-expectations) from 3.12.3 to 3.13.1. - [Release notes](https://github.com/rspec/rspec-expectations/releases) - [Changelog](https://github.com/rspec/rspec-expectations/blob/main/Changelog.md) - [Commits](https://github.com/rspec/rspec-expectations/compare/v3.12.3...v3.13.1) --- updated-dependencies: - dependency-name: rspec-expectations dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f968fe8a..0afc88f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -101,7 +101,7 @@ GEM crass (1.0.6) database_cleaner (1.99.0) date (3.3.4) - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.1.5) e2mmap (0.1.0) erubi (1.13.0) @@ -251,10 +251,10 @@ GEM nokogiri rexml (3.3.0) strscan - rspec-expectations (3.12.3) + rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) rubocop (1.64.1) json (~> 2.3) language_server-protocol (>= 3.17.0) From 2108b203a65249238af7fe709f8ee2d7aaaa7bf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 00:27:42 +0000 Subject: [PATCH 005/121] Bump rubocop from 1.64.1 to 1.65.0 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.64.1 to 1.65.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.64.1...v1.65.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 30ad6230..a55f6a62 100644 --- a/Gemfile +++ b/Gemfile @@ -52,7 +52,7 @@ end group :development, :test do gem 'byebug' gem 'listen' - gem 'rubocop', '~> 1.64', require: false + gem 'rubocop', '~> 1.65', require: false end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 0afc88f6..dc72c4fb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -189,7 +189,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) parallel (1.25.1) - parser (3.3.3.0) + parser (3.3.4.0) ast (~> 2.4.1) racc pg (1.5.6) @@ -249,19 +249,19 @@ GEM regexp_parser (2.9.2) reverse_markdown (2.1.1) nokogiri - rexml (3.3.0) + rexml (3.3.1) strscan rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) - rubocop (1.64.1) + rubocop (1.65.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) + regexp_parser (>= 2.4, < 3.0) rexml (>= 3.2.5, < 4.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) @@ -376,7 +376,7 @@ DEPENDENCIES rails-dom-testing (~> 2.2.0) rails_autolink rspec-expectations - rubocop (~> 1.64) + rubocop (~> 1.65) sanitize (~> 6.1) sassc-rails (~> 2.1.2) simplecov From a66dca4a6b6122c7fd8a8e65f8fc4d531a21e173 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 00:39:04 +0000 Subject: [PATCH 006/121] Bump bullet from 7.1.6 to 7.2.0 Bumps [bullet](https://github.com/flyerhzm/bullet) from 7.1.6 to 7.2.0. - [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md) - [Commits](https://github.com/flyerhzm/bullet/compare/7.1.6...7.2.0) --- updated-dependencies: - dependency-name: bullet dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index dc72c4fb..0813fee8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,7 +83,7 @@ GEM autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) builder (3.3.0) - bullet (7.1.6) + bullet (7.2.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) @@ -170,7 +170,7 @@ GEM mini_portile2 (2.8.7) mini_racer (0.12.0) libv8-node (~> 21.7.2.0) - minitest (5.23.1) + minitest (5.24.1) minitest-stub-const (0.6) mocha (2.4.0) ruby2_keywords (>= 0.0.5) From 5940fe10a6e1c29fb6ec0d969112d96706f6ca98 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 18 Jul 2024 16:00:02 +0300 Subject: [PATCH 007/121] Add Stripe as an optional package --- Dockerfile | 1 + Gemfile | 11 +++++++---- Gemfile.lock | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1a637feb..be7d456e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM ruby:3.3 # throw errors if Gemfile has been modified since Gemfile.lock RUN bundle config --global frozen 1 +RUN bundle config set --local without test development stripe WORKDIR /app diff --git a/Gemfile b/Gemfile index a55f6a62..6e04c5fa 100644 --- a/Gemfile +++ b/Gemfile @@ -28,6 +28,11 @@ gem 'sanitize', '~> 6.1' gem 'tracks-chartjs-ror' gem 'will_paginate' +group :layout do + gem 'listen' + gem 'tolk', '~> 5.0.1' +end + # See https://github.com/sstephenson/execjs#readme for more supported runtimes gem 'mini_racer', group: :therubyracer @@ -40,8 +45,6 @@ group :development do gem 'spring', '~> 4' gem 'yard' - gem 'tolk', '~> 5.0.1' - gem 'bullet' gem 'rack-mini-profiler' gem 'solargraph' @@ -51,12 +54,10 @@ end group :development, :test do gem 'byebug' - gem 'listen' gem 'rubocop', '~> 1.65', require: false end group :test do - # get test coverage info on codeclimate gem 'codeclimate-test-reporter', '1.0.9', group: :test, require: nil gem 'database_cleaner', '~> 1' @@ -68,3 +69,5 @@ group :test do gem 'rspec-expectations' gem 'simplecov' end + +gem 'stripe', "~> 5.24.0", group: :stripe diff --git a/Gemfile.lock b/Gemfile.lock index 0813fee8..fad802ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -304,7 +304,7 @@ GEM tilt (~> 2.0) yard (~> 0.9, >= 0.9.24) spring (4.2.1) - sprockets (4.2.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) @@ -313,6 +313,7 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.6.9) mini_portile2 (~> 2.8.0) + stripe (5.24.0) strscan (3.1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) @@ -383,6 +384,7 @@ DEPENDENCIES solargraph spring (~> 4) sqlite3 + stripe (~> 5.24.0) tolk (~> 5.0.1) tracks-chartjs-ror uglifier (>= 1.3.0) From ff5adc5696682475825b0911a497eec4f794de7d Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 18 Jul 2024 17:12:31 +0300 Subject: [PATCH 008/121] Replace the version-specific Dockerfiles with one staged Dockerfile --- .dockerignore | 2 - .github/workflows/build-latest.yml | 1 + .github/workflows/build-release.yml | 1 + Dockerfile | 42 +++++++++++++------ Dockerfile-3.0 | 30 ------------- Dockerfile-3.1 | 30 ------------- Dockerfile-3.2 | 30 ------------- Gemfile | 30 ++++++------- docker-compose.yml | 4 +- script/cibuild | 4 +- script/poll-for-db | 18 ++++---- test-envs/docker-compose-3.0-mysql.yml | 29 ------------- test-envs/docker-compose-3.1-mysql.yml | 29 ------------- test-envs/docker-compose-3.2-mysql.yml | 29 ------------- test-envs/docker-compose-3.3-postgres.yml | 32 -------------- test-envs/docker-compose-3.3-sqlite.yml | 17 -------- ...3.3-mysql.yml => docker-compose-mysql.yml} | 4 +- ...stgres.yml => docker-compose-postgres.yml} | 4 +- ...0-sqlite.yml => docker-compose-sqlite.yml} | 10 +++-- 19 files changed, 75 insertions(+), 271 deletions(-) delete mode 100644 Dockerfile-3.0 delete mode 100644 Dockerfile-3.1 delete mode 100644 Dockerfile-3.2 delete mode 100644 test-envs/docker-compose-3.0-mysql.yml delete mode 100644 test-envs/docker-compose-3.1-mysql.yml delete mode 100644 test-envs/docker-compose-3.2-mysql.yml delete mode 100644 test-envs/docker-compose-3.3-postgres.yml delete mode 100644 test-envs/docker-compose-3.3-sqlite.yml rename test-envs/{docker-compose-3.3-mysql.yml => docker-compose-mysql.yml} (91%) rename test-envs/{docker-compose-3.0-postgres.yml => docker-compose-postgres.yml} (92%) rename test-envs/{docker-compose-3.0-sqlite.yml => docker-compose-sqlite.yml} (69%) diff --git a/.dockerignore b/.dockerignore index 51d21e85..808f30c7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,9 +3,7 @@ config/database.yml config/site.yml coverage db/*.sqlite3 -doc features log public/assets -test tmp diff --git a/.github/workflows/build-latest.yml b/.github/workflows/build-latest.yml index 53bf9d34..c9d1cce5 100644 --- a/.github/workflows/build-latest.yml +++ b/.github/workflows/build-latest.yml @@ -35,6 +35,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . + target: production push: true tags: | tracksapp/tracks:latest diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index ccc9a016..f70b4a33 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -35,6 +35,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . + target: production push: true tags: | tracksapp/tracks:${{ github.event.release.name }} diff --git a/Dockerfile b/Dockerfile index be7d456e..fb60c234 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,13 @@ -FROM ruby:3.3 - -# throw errors if Gemfile has been modified since Gemfile.lock -RUN bundle config --global frozen 1 -RUN bundle config set --local without test development stripe +ARG RUBY_VERSION=3.3 +FROM ruby:${RUBY_VERSION} AS base WORKDIR /app - RUN touch /etc/app-env -COPY Gemfile* /app/ -RUN gem install bundler -RUN bundle install --jobs 4 - RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list RUN apt-get update && apt-get install -y yarn netcat-openbsd +RUN gem install bundler RUN mkdir /app/log @@ -39,10 +32,33 @@ COPY db /app/db/ COPY .git /app/.git -RUN RAILS_ENV=production bundle exec rake assets:precompile +COPY Gemfile* /app/ ENTRYPOINT ["/app/docker-entrypoint.sh"] - EXPOSE 3000 - CMD ["./bin/rails", "server", "-b", "0.0.0.0"] + +FROM base AS precompile +RUN bundle config set with assets +RUN bundle config set deployment true +RUN bundle install --jobs 4 +RUN RAILS_GROUPS=assets bundle exec rake assets:precompile + +# Build the environment-specific stuff +FROM base AS production +RUN bundle config --global frozen 1 +RUN bundle install --jobs 4 +COPY --from=precompile /app/public/assets /app/public/assets + +FROM base AS test +COPY test /app/test/ +# For testing the API client +COPY doc /app/doc/ +RUN bundle config set with development test assets +RUN bundle config --global frozen 1 +RUN bundle install --jobs 4 +RUN RAILS_GROUPS=assets bundle exec rake assets:precompile + +FROM base AS development +RUN bundle config set with development test +RUN bundle install --jobs 4 diff --git a/Dockerfile-3.0 b/Dockerfile-3.0 deleted file mode 100644 index 534d5c92..00000000 --- a/Dockerfile-3.0 +++ /dev/null @@ -1,30 +0,0 @@ -FROM ruby:3.0 - -# throw errors if Gemfile has been modified since Gemfile.lock -RUN bundle config --global frozen 1 - -WORKDIR /app - -RUN touch /etc/app-env - -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - -RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -RUN apt-get update && apt-get install -y yarn - -COPY Gemfile* /app/ -RUN gem install bundler -RUN bundle install --jobs 4 - -RUN mkdir /app/log - -COPY . /app/ -COPY config/database.docker.yml /app/config/database.yml -COPY config/site.docker.yml /app/config/site.yml - -RUN RAILS_ENV=production bundle exec rake assets:precompile - -ENTRYPOINT ["/app/docker-entrypoint.sh"] - -EXPOSE 3000 - -CMD ["rails", "server", "-b", "0.0.0.0"] diff --git a/Dockerfile-3.1 b/Dockerfile-3.1 deleted file mode 100644 index 13ee22a2..00000000 --- a/Dockerfile-3.1 +++ /dev/null @@ -1,30 +0,0 @@ -FROM ruby:3.1 - -# throw errors if Gemfile has been modified since Gemfile.lock -RUN bundle config --global frozen 1 - -WORKDIR /app - -RUN touch /etc/app-env - -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - -RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -RUN apt-get update && apt-get install -y yarn - -COPY Gemfile* /app/ -RUN gem install bundler -RUN bundle install --jobs 4 - -RUN mkdir /app/log - -COPY . /app/ -COPY config/database.docker.yml /app/config/database.yml -COPY config/site.docker.yml /app/config/site.yml - -RUN RAILS_ENV=production bundle exec rake assets:precompile - -ENTRYPOINT ["/app/docker-entrypoint.sh"] - -EXPOSE 3000 - -CMD ["rails", "server", "-b", "0.0.0.0"] diff --git a/Dockerfile-3.2 b/Dockerfile-3.2 deleted file mode 100644 index 0e143fd7..00000000 --- a/Dockerfile-3.2 +++ /dev/null @@ -1,30 +0,0 @@ -FROM ruby:3.2 - -# throw errors if Gemfile has been modified since Gemfile.lock -RUN bundle config --global frozen 1 - -WORKDIR /app - -RUN touch /etc/app-env - -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - -RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -RUN apt-get update && apt-get install -y yarn - -COPY Gemfile* /app/ -RUN gem install bundler -RUN bundle install --jobs 4 - -RUN mkdir /app/log - -COPY . /app/ -COPY config/database.docker.yml /app/config/database.yml -COPY config/site.docker.yml /app/config/site.yml - -RUN RAILS_ENV=production bundle exec rake assets:precompile - -ENTRYPOINT ["/app/docker-entrypoint.sh"] - -EXPOSE 3000 - -CMD ["rails", "server", "-b", "0.0.0.0"] diff --git a/Gemfile b/Gemfile index 6e04c5fa..3e281bad 100644 --- a/Gemfile +++ b/Gemfile @@ -28,20 +28,17 @@ gem 'sanitize', '~> 6.1' gem 'tracks-chartjs-ror' gem 'will_paginate' -group :layout do - gem 'listen' - gem 'tolk', '~> 5.0.1' -end - -# See https://github.com/sstephenson/execjs#readme for more supported runtimes -gem 'mini_racer', group: :therubyracer - # Use --without argument to skip unnecessary drivers gem 'sqlite3', group: :sqlite gem 'mysql2', '~> 0.5.6', group: :mysql gem 'pg', '~> 1.5.6', group: :postgresql -group :development do +group :assets, :optional => true do + gem 'listen' + gem 'tolk', '~> 5.0.1' +end + +group :development, :optional => true do gem 'spring', '~> 4' gem 'yard' @@ -52,22 +49,25 @@ group :development do gem 'i18n-tasks', '~> 1.0.14' end -group :development, :test do +group :development, :test, :optional => true do gem 'byebug' - gem 'rubocop', '~> 1.65', require: false + gem 'rubocop', '~> 1.65' + gem 'mini_racer' end -group :test do +group :test, :optional => true do # get test coverage info on codeclimate - gem 'codeclimate-test-reporter', '1.0.9', group: :test, require: nil + gem 'codeclimate-test-reporter', '1.0.9' gem 'database_cleaner', '~> 1' gem 'factory_bot_rails' gem 'minitest-stub-const' - gem 'mocha', :require => false + gem 'mocha' gem 'rails-controller-testing' gem 'rails-dom-testing', '~> 2.2.0' gem 'rspec-expectations' gem 'simplecov' end -gem 'stripe', "~> 5.24.0", group: :stripe +group :stripe, :optional => true do + gem 'stripe', "~> 5.24.0" +end diff --git a/docker-compose.yml b/docker-compose.yml index 00872463..b60ecad3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,9 @@ services: volumes: - db-data:/var/lib/mysql web: - build: . + build: + context: . + target: production # can also be development or test environment: # These are set in script/ci-build, so we need to pass-thru them. RAILS_ENV: $RAILS_ENV diff --git a/script/cibuild b/script/cibuild index 564941a4..a68de2ad 100755 --- a/script/cibuild +++ b/script/cibuild @@ -2,7 +2,9 @@ set -e -docker_compose="docker-compose --file test-envs/docker-compose-$1-$2.yml" +export RUBY_VERSION=$1 + +docker_compose="docker-compose --file test-envs/docker-compose-$2.yml" function cleanup() { $docker_compose down diff --git a/script/poll-for-db b/script/poll-for-db index 05b1db4b..4be07922 100755 --- a/script/poll-for-db +++ b/script/poll-for-db @@ -2,13 +2,15 @@ echo "==> Polling DB…" -appdir=$(cd $(dirname "$0")/.. && pwd) -[ -f /etc/app-env ] || exec "$appdir/script/docker-environment" $0 $@ +if [ "$DATABASE_TYPE" == "mysql" ]; then + appdir=$(cd $(dirname "$0")/.. && pwd) + [ -f /etc/app-env ] || exec "$appdir/script/docker-environment" $0 $@ -for i in {1..60}; do - nc -z -w5 db 3306 && exit - sleep 1 -done + for i in {1..60}; do + nc -z -w5 db 3306 && exit + sleep 1 + done -echo "Unable to reach database!" -exit 1 + echo "Unable to reach database!" + exit 1 +fi diff --git a/test-envs/docker-compose-3.0-mysql.yml b/test-envs/docker-compose-3.0-mysql.yml deleted file mode 100644 index 2cd0413f..00000000 --- a/test-envs/docker-compose-3.0-mysql.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: '3' -services: - db: - image: mysql:5.7 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: 1 - MYSQL_DATABASE: ${TRACKS_DB:-tracks} - volumes: - - db-data:/var/lib/mysql - web: - build: - context: .. - dockerfile: Dockerfile-3.0 - environment: - # These are set in script/ci-build, so we need to pass-thru them. - RAILS_ENV: $RAILS_ENV - DATABASE_NAME: $DATABASE_NAME - DATABASE_USERNAME: root - DATABASE_PASSWORD_EMPTY: 1 - volumes: - - ${VOLUME:-..}:/app:Z - - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z - ports: - - 3000:3000 - depends_on: - - db -volumes: - db-data: diff --git a/test-envs/docker-compose-3.1-mysql.yml b/test-envs/docker-compose-3.1-mysql.yml deleted file mode 100644 index 03f609e5..00000000 --- a/test-envs/docker-compose-3.1-mysql.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: '3' -services: - db: - image: mysql:5.7 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: 1 - MYSQL_DATABASE: ${TRACKS_DB:-tracks} - volumes: - - db-data:/var/lib/mysql - web: - build: - context: .. - dockerfile: Dockerfile-3.1 - environment: - # These are set in script/ci-build, so we need to pass-thru them. - RAILS_ENV: $RAILS_ENV - DATABASE_NAME: $DATABASE_NAME - DATABASE_USERNAME: root - DATABASE_PASSWORD_EMPTY: 1 - volumes: - - ${VOLUME:-..}:/app:Z - - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z - ports: - - 3000:3000 - depends_on: - - db -volumes: - db-data: diff --git a/test-envs/docker-compose-3.2-mysql.yml b/test-envs/docker-compose-3.2-mysql.yml deleted file mode 100644 index 48b2e6d9..00000000 --- a/test-envs/docker-compose-3.2-mysql.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: '3' -services: - db: - image: mysql:5.7 - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: 1 - MYSQL_DATABASE: ${TRACKS_DB:-tracks} - volumes: - - db-data:/var/lib/mysql - web: - build: - context: .. - dockerfile: Dockerfile-3.2 - environment: - # These are set in script/ci-build, so we need to pass-thru them. - RAILS_ENV: $RAILS_ENV - DATABASE_NAME: $DATABASE_NAME - DATABASE_USERNAME: root - DATABASE_PASSWORD_EMPTY: 1 - volumes: - - ${VOLUME:-..}:/app:Z - - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z - ports: - - 3000:3000 - depends_on: - - db -volumes: - db-data: diff --git a/test-envs/docker-compose-3.3-postgres.yml b/test-envs/docker-compose-3.3-postgres.yml deleted file mode 100644 index a66d41b2..00000000 --- a/test-envs/docker-compose-3.3-postgres.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '3' -services: - db: - image: postgres:13 - environment: - POSTGRES_DB: ${DATABASE_NAME:-tracks} - POSTGRES_PASSWORD: password - volumes: - - db-data:/var/lib/postgresql/data - web: - build: - context: .. - dockerfile: Dockerfile - environment: - # These are set in script/ci-build, so we need to pass-thru them. - RAILS_ENV: $RAILS_ENV - DATABASE_NAME: $DATABASE_NAME - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: password - DATABASE_TYPE: postgresql - DATABASE_ENCODING: unicode - DATABASE_PORT: 5432 - volumes: - - ${VOLUME:-..}:/app:Z - - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z - ports: - - 3000:3000 - depends_on: - - db -volumes: - db-data: diff --git a/test-envs/docker-compose-3.3-sqlite.yml b/test-envs/docker-compose-3.3-sqlite.yml deleted file mode 100644 index 4fd50bd5..00000000 --- a/test-envs/docker-compose-3.3-sqlite.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3' -services: - web: - build: - context: .. - dockerfile: Dockerfile - environment: - # These are set in script/ci-build, so we need to pass-thru them. - RAILS_ENV: $RAILS_ENV - DATABASE_NAME: "/app/db.sqlite" - DATABASE_TYPE: sqlite3 - volumes: - - ${VOLUME:-..}:/app:Z - - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z - ports: - - 3000:3000 diff --git a/test-envs/docker-compose-3.3-mysql.yml b/test-envs/docker-compose-mysql.yml similarity index 91% rename from test-envs/docker-compose-3.3-mysql.yml rename to test-envs/docker-compose-mysql.yml index 67e67f17..6982fe3a 100644 --- a/test-envs/docker-compose-3.3-mysql.yml +++ b/test-envs/docker-compose-mysql.yml @@ -10,7 +10,9 @@ services: web: build: context: .. - dockerfile: Dockerfile + target: test + args: + RUBY_VERSION: ${RUBY_VERSION} environment: # These are set in script/ci-build, so we need to pass-thru them. RAILS_ENV: $RAILS_ENV diff --git a/test-envs/docker-compose-3.0-postgres.yml b/test-envs/docker-compose-postgres.yml similarity index 92% rename from test-envs/docker-compose-3.0-postgres.yml rename to test-envs/docker-compose-postgres.yml index 0c6d9b03..378d30cf 100644 --- a/test-envs/docker-compose-3.0-postgres.yml +++ b/test-envs/docker-compose-postgres.yml @@ -10,7 +10,9 @@ services: web: build: context: .. - dockerfile: Dockerfile-3.0 + target: test + args: + RUBY_VERSION: ${RUBY_VERSION} environment: # These are set in script/ci-build, so we need to pass-thru them. RAILS_ENV: $RAILS_ENV diff --git a/test-envs/docker-compose-3.0-sqlite.yml b/test-envs/docker-compose-sqlite.yml similarity index 69% rename from test-envs/docker-compose-3.0-sqlite.yml rename to test-envs/docker-compose-sqlite.yml index ba4d3709..374ff3eb 100644 --- a/test-envs/docker-compose-3.0-sqlite.yml +++ b/test-envs/docker-compose-sqlite.yml @@ -3,15 +3,19 @@ services: web: build: context: .. - dockerfile: Dockerfile-3.0 + target: test + args: + RUBY_VERSION: ${RUBY_VERSION} environment: # These are set in script/ci-build, so we need to pass-thru them. RAILS_ENV: $RAILS_ENV - DATABASE_NAME: "/app/db.sqlite" + DATABASE_NAME: "/app/db/db.sqlite" DATABASE_TYPE: sqlite3 volumes: - - ${VOLUME:-..}:/app:Z + - ${VOLUME:-sqlite}:/app/db:Z - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z ports: - 3000:3000 +volumes: + sqlite: {} From 212b2dc20c63f2fbb34f5d62e983d32a928d828a Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 18 Jul 2024 21:36:51 +0300 Subject: [PATCH 009/121] Fix DB adapters with the same constraints as in the ActiveRecord files (for example https://github.com/rails/rails/blob/v7.1.3.4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb ) --- Gemfile | 6 +++--- Gemfile.lock | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 3e281bad..2ca6347b 100644 --- a/Gemfile +++ b/Gemfile @@ -29,9 +29,9 @@ gem 'tracks-chartjs-ror' gem 'will_paginate' # Use --without argument to skip unnecessary drivers -gem 'sqlite3', group: :sqlite -gem 'mysql2', '~> 0.5.6', group: :mysql -gem 'pg', '~> 1.5.6', group: :postgresql +gem 'sqlite3', '~> 1.4', group: :sqlite +gem 'mysql2', '~> 0.5', group: :mysql +gem 'pg', '~> 1.1', group: :postgresql group :assets, :optional => true do gem 'listen' diff --git a/Gemfile.lock b/Gemfile.lock index fad802ed..a368acec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -311,7 +311,7 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.9) + sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) stripe (5.24.0) strscan (3.1.0) @@ -368,8 +368,8 @@ DEPENDENCIES mini_racer minitest-stub-const mocha - mysql2 (~> 0.5.6) - pg (~> 1.5.6) + mysql2 (~> 0.5) + pg (~> 1.1) puma (~> 6.4) rack-mini-profiler rails (~> 6.1) @@ -383,7 +383,7 @@ DEPENDENCIES simplecov solargraph spring (~> 4) - sqlite3 + sqlite3 (~> 1.4) stripe (~> 5.24.0) tolk (~> 5.0.1) tracks-chartjs-ror From 8464d0c60e70395ecb6ee8ae5fcac85f8cb67e45 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 18 Jul 2024 21:39:08 +0300 Subject: [PATCH 010/121] Remove the version constraint from Stripe --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 2ca6347b..a5ea9dd1 100644 --- a/Gemfile +++ b/Gemfile @@ -69,5 +69,5 @@ group :test, :optional => true do end group :stripe, :optional => true do - gem 'stripe', "~> 5.24.0" + gem 'stripe' end diff --git a/Gemfile.lock b/Gemfile.lock index a368acec..1cf6f3b4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -384,7 +384,7 @@ DEPENDENCIES solargraph spring (~> 4) sqlite3 (~> 1.4) - stripe (~> 5.24.0) + stripe tolk (~> 5.0.1) tracks-chartjs-ror uglifier (>= 1.3.0) From 0968152c5ad308c4e6ca48c0052afd70d620b02e Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 18 Jul 2024 21:53:03 +0300 Subject: [PATCH 011/121] Update rexml --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1cf6f3b4..d0e75558 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -249,7 +249,7 @@ GEM regexp_parser (2.9.2) reverse_markdown (2.1.1) nokogiri - rexml (3.3.1) + rexml (3.3.2) strscan rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) From d2fff6a64c4988744f0f164ce9ccfa8a3481b648 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 18 Jul 2024 22:09:35 +0300 Subject: [PATCH 012/121] Don't require the .git directory to exist for a successful Docker build. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fb60c234..ee0313a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,9 @@ COPY lib /app/lib/ COPY app /app/app/ COPY db /app/db/ -COPY .git /app/.git +# Use glob to omit error if the .git directory doesn't exists (in case the +# code is from a release archive, not a Git clone) +COPY .gi[t] /app/.git COPY Gemfile* /app/ From 2bf2f9476aff3b3bde96e8ef7a2e8da993aa27f2 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 18 Jul 2024 22:34:04 +0300 Subject: [PATCH 013/121] Fix a few user creation errors to be prettier --- app/controllers/users_controller.rb | 4 +++- config/locales/en.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 30b63172..159449f8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -81,13 +81,15 @@ class UsersController < ApplicationController end unless params['approve_tos'] == 'on' || SITE_CONFIG['tos_link'].blank? - render_failure "You have to accept the terms of service to sign up!" + notify :error, t('users.tos_error') + redirect_to signup_path return end user = User.new(user_params) unless user.valid? + notify :error, t('users.create_error') redirect_to signup_path return end diff --git a/config/locales/en.yml b/config/locales/en.yml index 9b8efd03..102f3863 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1281,6 +1281,7 @@ en: change_password_title: TRACKS::Change password choose_password: Choose password confirm_password: Confirm password + create_error: User creation failed, maybe you already have an account here? desired_login: Desired login destroy_confirmation: 'Warning: this will delete user ''%{login}'', all their actions, contexts, project and notes. Are you sure that you want to continue?' @@ -1315,6 +1316,7 @@ en: signup_successful: Signup successful for user %{username}. successfully_deleted_user: Successfully deleted user %{username} tos_link: read the Terms of Service + tos_error: You have to accept the terms of service to sign up! total_actions: Total actions total_contexts: Total contexts total_notes: Total notes From ad87729e31881eb9cc0d712675542095adf42849 Mon Sep 17 00:00:00 2001 From: "Sean M. Pappalardo" Date: Thu, 18 Jul 2024 14:25:56 -0400 Subject: [PATCH 014/121] Update bundle config command, add instructions for PostgreSQL --- doc/installation.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/installation.md b/doc/installation.md index 375997e8..a3c2712a 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -153,13 +153,22 @@ Tracks is built upon a number of Ruby libraries (known as ‘gems’). The Bundl * If you are using SQLite: ``` - bundle install --without "development test mysql" + bundle config set without "development test mysql" + bundle install ``` * If you are using MySQL: ``` - bundle install --without "development test sqlite" + bundle config set without "development test sqlite" + bundle install + ``` + + * If you are using PostgreSQL: + + ``` + bundle config set without "development test sqlite mysql" + bundle install ``` * If you are installing Tracks on Windows or Mac OS X, or if you have another JavaScript runtime such as Node.js installed, you may also append `therubyracer` as an additional "without" parameter. From f5f0193b60e67a8b20e48e6bdce6b45ffa1d3da6 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 18 Jul 2024 23:37:40 +0300 Subject: [PATCH 015/121] Add asset stuff back to being included by default for non-Docker users; move more asset-related packages to the group --- Dockerfile | 7 ++++--- Gemfile | 22 ++++++++++------------ doc/installation.md | 8 ++++---- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee0313a7..e569d8df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,13 +41,13 @@ EXPOSE 3000 CMD ["./bin/rails", "server", "-b", "0.0.0.0"] FROM base AS precompile -RUN bundle config set with assets RUN bundle config set deployment true RUN bundle install --jobs 4 RUN RAILS_GROUPS=assets bundle exec rake assets:precompile # Build the environment-specific stuff FROM base AS production +RUN bundle config set without assets RUN bundle config --global frozen 1 RUN bundle install --jobs 4 COPY --from=precompile /app/public/assets /app/public/assets @@ -56,10 +56,11 @@ FROM base AS test COPY test /app/test/ # For testing the API client COPY doc /app/doc/ -RUN bundle config set with development test assets +RUN bundle config set without assets +RUN bundle config set with development test RUN bundle config --global frozen 1 RUN bundle install --jobs 4 -RUN RAILS_GROUPS=assets bundle exec rake assets:precompile +COPY --from=precompile /app/public/assets /app/public/assets FROM base AS development RUN bundle config set with development test diff --git a/Gemfile b/Gemfile index a5ea9dd1..59a0a548 100644 --- a/Gemfile +++ b/Gemfile @@ -3,19 +3,9 @@ source 'https://rubygems.org' gem 'actionpack-xml_parser', '~> 2.0' gem 'activemodel-serializers-xml', '~> 1.0.1' -gem 'coffee-rails', '~> 5.0.0' - -gem 'jquery-rails', '~> 4.6' -gem 'jquery-ui-rails', '~>7.0.0' - gem 'rails', '~> 6.1' -gem 'sassc-rails', '~> 2.1.2' -gem 'bootstrap-sass', '3.4.1' gem 'font-awesome-sass', '~> 6.5.2' - -gem 'uglifier', '>=1.3.0' - gem 'aasm', '~> 5.5.0' gem 'acts_as_list' gem 'bcrypt', '~> 3.1.20' @@ -33,7 +23,16 @@ gem 'sqlite3', '~> 1.4', group: :sqlite gem 'mysql2', '~> 0.5', group: :mysql gem 'pg', '~> 1.1', group: :postgresql -group :assets, :optional => true do +# See https://github.com/sstephenson/execjs#readme for more supported runtimes +gem 'mini_racer', group: :therubyracer + +group :assets do + gem 'coffee-rails', '~> 5.0.0' + gem 'jquery-rails', '~> 4.6' + gem 'jquery-ui-rails', '~>7.0.0' + gem 'sassc-rails', '~> 2.1.2' + gem 'bootstrap-sass', '3.4.1' + gem 'uglifier', '>=1.3.0' gem 'listen' gem 'tolk', '~> 5.0.1' end @@ -52,7 +51,6 @@ end group :development, :test, :optional => true do gem 'byebug' gem 'rubocop', '~> 1.65' - gem 'mini_racer' end group :test, :optional => true do diff --git a/doc/installation.md b/doc/installation.md index a3c2712a..2e937f63 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -44,7 +44,7 @@ Tracks container. In future there should be an official image in Docker Hub. You 1. Get the Tracks code base by either downloading the archive file for the latest releast or cloning it from GitHub. 2. Run the following command in the Tracks directory to build the image: ``` - $ docker build -t="tracks" . + $ docker build -t="tracks" --target=production . ``` 1. Make sure you have Docker properly installed. @@ -153,21 +153,21 @@ Tracks is built upon a number of Ruby libraries (known as ‘gems’). The Bundl * If you are using SQLite: ``` - bundle config set without "development test mysql" + bundle config set without mysql postgresql bundle install ``` * If you are using MySQL: ``` - bundle config set without "development test sqlite" + bundle config set without sqlite postgresql bundle install ``` * If you are using PostgreSQL: ``` - bundle config set without "development test sqlite mysql" + bundle config set without sqlite mysql bundle install ``` From 55050af2cbd5d6bf4405192729885cf51f2e5657 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 18 Jul 2024 23:44:19 +0300 Subject: [PATCH 016/121] Test the builded code, not the one mounted. --- test-envs/docker-compose-mysql.yml | 1 - test-envs/docker-compose-postgres.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/test-envs/docker-compose-mysql.yml b/test-envs/docker-compose-mysql.yml index 6982fe3a..7793c6b4 100644 --- a/test-envs/docker-compose-mysql.yml +++ b/test-envs/docker-compose-mysql.yml @@ -20,7 +20,6 @@ services: DATABASE_USERNAME: root DATABASE_PASSWORD_EMPTY: 1 volumes: - - ${VOLUME:-..}:/app:Z - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z ports: diff --git a/test-envs/docker-compose-postgres.yml b/test-envs/docker-compose-postgres.yml index 378d30cf..0bb095fa 100644 --- a/test-envs/docker-compose-postgres.yml +++ b/test-envs/docker-compose-postgres.yml @@ -23,7 +23,6 @@ services: DATABASE_ENCODING: unicode DATABASE_PORT: 5432 volumes: - - ${VOLUME:-..}:/app:Z - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z ports: From 13d7a711a420fc487f6dca9c6c33ce7bdc89dd52 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Fri, 19 Jul 2024 00:14:41 +0300 Subject: [PATCH 017/121] Move jquery back to default group --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 59a0a548..6cb7fada 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,8 @@ gem 'activemodel-serializers-xml', '~> 1.0.1' gem 'rails', '~> 6.1' gem 'font-awesome-sass', '~> 6.5.2' +gem 'jquery-rails', '~> 4.6' +gem 'jquery-ui-rails', '~>7.0.0' gem 'aasm', '~> 5.5.0' gem 'acts_as_list' gem 'bcrypt', '~> 3.1.20' @@ -28,8 +30,6 @@ gem 'mini_racer', group: :therubyracer group :assets do gem 'coffee-rails', '~> 5.0.0' - gem 'jquery-rails', '~> 4.6' - gem 'jquery-ui-rails', '~>7.0.0' gem 'sassc-rails', '~> 2.1.2' gem 'bootstrap-sass', '3.4.1' gem 'uglifier', '>=1.3.0' From 50f5a946d469e150404a621ebc8eebd6dfe2b7bc Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Fri, 19 Jul 2024 00:36:42 +0300 Subject: [PATCH 018/121] Don't use old databases in test runs --- test-envs/docker-compose-mysql.yml | 4 ---- test-envs/docker-compose-postgres.yml | 4 ---- test-envs/docker-compose-sqlite.yml | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/test-envs/docker-compose-mysql.yml b/test-envs/docker-compose-mysql.yml index 7793c6b4..002f5b9e 100644 --- a/test-envs/docker-compose-mysql.yml +++ b/test-envs/docker-compose-mysql.yml @@ -5,8 +5,6 @@ services: environment: MYSQL_ALLOW_EMPTY_PASSWORD: 1 MYSQL_DATABASE: ${TRACKS_DB:-tracks} - volumes: - - db-data:/var/lib/mysql web: build: context: .. @@ -26,5 +24,3 @@ services: - 3000:3000 depends_on: - db -volumes: - db-data: diff --git a/test-envs/docker-compose-postgres.yml b/test-envs/docker-compose-postgres.yml index 0bb095fa..52ba2945 100644 --- a/test-envs/docker-compose-postgres.yml +++ b/test-envs/docker-compose-postgres.yml @@ -5,8 +5,6 @@ services: environment: POSTGRES_DB: ${DATABASE_NAME:-tracks} POSTGRES_PASSWORD: password - volumes: - - db-data:/var/lib/postgresql/data web: build: context: .. @@ -29,5 +27,3 @@ services: - 3000:3000 depends_on: - db -volumes: - db-data: diff --git a/test-envs/docker-compose-sqlite.yml b/test-envs/docker-compose-sqlite.yml index 374ff3eb..7a04620c 100644 --- a/test-envs/docker-compose-sqlite.yml +++ b/test-envs/docker-compose-sqlite.yml @@ -12,7 +12,7 @@ services: DATABASE_NAME: "/app/db/db.sqlite" DATABASE_TYPE: sqlite3 volumes: - - ${VOLUME:-sqlite}:/app/db:Z + - sqlite:/app/db:Z - ${VOLUME:-..}/config/database.docker.yml:/app/config/database.yml:Z - ${VOLUME:-..}/config/site.docker.yml:/app/config/site.yml:Z ports: From 76d3083e8f6c10f02813b1e7b53f7eb7ac184df9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:40:03 +0000 Subject: [PATCH 019/121] Bump mocha from 2.4.0 to 2.4.2 Bumps [mocha](https://github.com/freerange/mocha) from 2.4.0 to 2.4.2. - [Changelog](https://github.com/freerange/mocha/blob/main/RELEASE.md) - [Commits](https://github.com/freerange/mocha/compare/v2.4.0...v2.4.2) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d0e75558..c2fb7da0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,7 +172,7 @@ GEM libv8-node (~> 21.7.2.0) minitest (5.24.1) minitest-stub-const (0.6) - mocha (2.4.0) + mocha (2.4.2) ruby2_keywords (>= 0.0.5) mysql2 (0.5.6) net-imap (0.4.12) From a0999e3e453a5a0865033d0dd975a71027620f9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:40:25 +0000 Subject: [PATCH 020/121] Bump acts_as_list from 1.2.1 to 1.2.2 Bumps [acts_as_list](https://github.com/brendon/acts_as_list) from 1.2.1 to 1.2.2. - [Changelog](https://github.com/brendon/acts_as_list/blob/master/CHANGELOG.md) - [Commits](https://github.com/brendon/acts_as_list/compare/v1.2.1...v1.2.2) --- updated-dependencies: - dependency-name: acts_as_list dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d0e75558..c768d5fd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,7 +70,7 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - acts_as_list (1.2.1) + acts_as_list (1.2.2) activerecord (>= 6.1) activesupport (>= 6.1) ast (2.4.2) From 36f139d8793c049cfa48ea27fb04dbea7f35e645 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Fri, 19 Jul 2024 14:00:19 +0300 Subject: [PATCH 021/121] Update schema.rb for Postgres support --- db/schema.rb | 78 +++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index a0b9a251..6e2fb9c3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,30 +2,33 @@ # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 2020_08_20_000743) do - create_table "attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| - t.integer "todo_id" + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "attachments", force: :cascade do |t| + t.bigint "todo_id" t.string "file_file_name" t.string "file_content_type" - t.integer "file_file_size" + t.bigint "file_file_size" t.datetime "file_updated_at" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["todo_id"], name: "index_attachments_on_todo_id" end - create_table "contexts", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "contexts", force: :cascade do |t| t.string "name", null: false - t.integer "position", default: 0 + t.integer "position" t.integer "user_id", default: 1 t.datetime "created_at" t.datetime "updated_at" @@ -34,7 +37,7 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.index ["user_id"], name: "index_contexts_on_user_id" end - create_table "dependencies", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "dependencies", force: :cascade do |t| t.integer "successor_id", null: false t.integer "predecessor_id", null: false t.string "relationship_type" @@ -42,7 +45,7 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.index ["successor_id"], name: "index_dependencies_on_successor_id" end - create_table "notes", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "notes", force: :cascade do |t| t.integer "user_id", null: false t.integer "project_id", null: false t.text "body" @@ -52,7 +55,7 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.index ["user_id"], name: "index_notes_on_user_id" end - create_table "open_id_authentication_associations", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "open_id_authentication_associations", force: :cascade do |t| t.integer "issued" t.integer "lifetime" t.string "handle" @@ -61,13 +64,13 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.binary "secret" end - create_table "open_id_authentication_nonces", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "open_id_authentication_nonces", force: :cascade do |t| t.integer "timestamp", null: false t.string "server_url" t.string "salt", null: false end - create_table "preferences", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "preferences", force: :cascade do |t| t.integer "user_id", null: false t.string "date_format", limit: 40, default: "%d/%m/%Y", null: false t.integer "week_starts", default: 0, null: false @@ -79,9 +82,9 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.integer "refresh", default: 0, null: false t.boolean "verbose_action_descriptors", default: false, null: false t.boolean "show_hidden_projects_in_sidebar", default: true, null: false - t.string "time_zone", default: "London", null: false + t.string "time_zone", limit: 255, default: "London", null: false t.boolean "show_project_on_todo_done", default: false, null: false - t.string "title_date_format", default: "%A, %d %B %Y", null: false + t.string "title_date_format", limit: 255, default: "%A, %d %B %Y", null: false t.integer "mobile_todos_per_page", default: 6, null: false t.string "sms_email" t.integer "sms_context_id" @@ -91,11 +94,11 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.index ["user_id"], name: "index_preferences_on_user_id" end - create_table "projects", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "projects", force: :cascade do |t| t.string "name", null: false - t.integer "position", default: 0 + t.integer "position" t.integer "user_id", default: 1 - t.text "description", limit: 16777215 + t.text "description" t.string "state", limit: 20, null: false t.datetime "created_at" t.datetime "updated_at" @@ -109,12 +112,12 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.index ["user_id"], name: "index_projects_on_user_id" end - create_table "recurring_todos", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "recurring_todos", force: :cascade do |t| t.integer "user_id", default: 1 t.integer "context_id", null: false t.integer "project_id" t.string "description", null: false - t.text "notes", limit: 16777215 + t.text "notes" t.string "state", limit: 20, null: false t.datetime "start_from" t.string "ends_on" @@ -133,21 +136,21 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.integer "every_count" t.integer "weekday" t.datetime "completed_at" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "show_always" t.index ["state"], name: "index_recurring_todos_on_state" t.index ["user_id"], name: "index_recurring_todos_on_user_id" end - create_table "sessions", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "sessions", force: :cascade do |t| t.string "session_id" t.text "data" t.datetime "updated_at" - t.index ["session_id"], name: "sessions_session_id_index" + t.index ["session_id"], name: "index_sessions_on_session_id" end - create_table "taggings", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "taggings", force: :cascade do |t| t.integer "taggable_id" t.integer "tag_id" t.string "taggable_type" @@ -156,7 +159,7 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.index ["taggable_id", "taggable_type"], name: "index_taggings_on_taggable_id_and_taggable_type" end - create_table "tags", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "tags", force: :cascade do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" @@ -164,11 +167,11 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.index ["name"], name: "index_tags_on_name" end - create_table "todos", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "todos", force: :cascade do |t| t.integer "context_id", null: false t.integer "project_id" t.text "description", null: false - t.text "notes", limit: 16777215 + t.text "notes" t.datetime "created_at" t.datetime "due" t.datetime "completed_at" @@ -177,7 +180,6 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.string "state", limit: 20, null: false t.integer "recurring_todo_id" t.datetime "updated_at" - t.text "rendered_notes", limit: 16777215 t.index ["context_id"], name: "index_todos_on_context_id" t.index ["project_id"], name: "index_todos_on_project_id" t.index ["state"], name: "index_todos_on_state" @@ -186,20 +188,20 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.index ["user_id", "state"], name: "index_todos_on_user_id_and_state" end - create_table "tolk_locales", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "tolk_locales", force: :cascade do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" t.index ["name"], name: "index_tolk_locales_on_name", unique: true end - create_table "tolk_phrases", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "tolk_phrases", force: :cascade do |t| t.text "key" t.datetime "created_at" t.datetime "updated_at" end - create_table "tolk_translations", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "tolk_translations", force: :cascade do |t| t.integer "phrase_id" t.integer "locale_id" t.text "text" @@ -210,9 +212,9 @@ ActiveRecord::Schema.define(version: 2020_08_20_000743) do t.index ["phrase_id", "locale_id"], name: "index_tolk_translations_on_phrase_id_and_locale_id", unique: true end - create_table "users", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| + create_table "users", force: :cascade do |t| t.string "login", limit: 80, null: false - t.string "crypted_password", limit: 60 + t.string "crypted_password", limit: 60, null: false t.string "token" t.boolean "is_admin", default: false, null: false t.string "first_name" From a9a978c1f84662079ce76d1b227c0ad651edeff1 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Fri, 19 Jul 2024 14:34:54 +0300 Subject: [PATCH 022/121] Fix the installation documentation of postgresql. Fixes #2845. --- doc/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/installation.md b/doc/installation.md index 2e937f63..89829c8b 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -142,7 +142,7 @@ You need to create a database and database-user to use with Tracks. For this, yo #### PostgreSQL $ sudo -u postgres psql - postgres=# CREATE USER tracks WITH ENCRYPTED PASSWORD 'password-goes-here'; + postgres=# CREATE ROLE tracks WITH LOGIN NOSUPERUSER INHERIT CREATEDB CREATEROLE NOREPLICATION PASSWORD 'password-goes-here'; postgres=# CREATE DATABASE tracks OWNER=tracks; ### Install dependencies From 3fcdb41fa9e6c2a1ec7f19149b522a1d2514baf0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 00:25:45 +0000 Subject: [PATCH 023/121] Bump stripe from 5.24.0 to 12.3.0 Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.24.0 to 12.3.0. - [Release notes](https://github.com/stripe/stripe-ruby/releases) - [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/stripe/stripe-ruby/compare/v5.24.0...v12.3.0) --- updated-dependencies: - dependency-name: stripe dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e9bc84cb..f9c51435 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -313,7 +313,7 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - stripe (5.24.0) + stripe (12.3.0) strscan (3.1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) From 0d2d89780b7a90d1ac0add92921972e7923469ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 00:33:56 +0000 Subject: [PATCH 024/121] Bump mocha from 2.4.2 to 2.4.3 Bumps [mocha](https://github.com/freerange/mocha) from 2.4.2 to 2.4.3. - [Changelog](https://github.com/freerange/mocha/blob/main/RELEASE.md) - [Commits](https://github.com/freerange/mocha/compare/v2.4.2...v2.4.3) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e9bc84cb..b3e8c8e6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,7 +172,7 @@ GEM libv8-node (~> 21.7.2.0) minitest (5.24.1) minitest-stub-const (0.6) - mocha (2.4.2) + mocha (2.4.3) ruby2_keywords (>= 0.0.5) mysql2 (0.5.6) net-imap (0.4.12) From a984011ddc0b63fb663a3175567357febb07d326 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 00:32:02 +0000 Subject: [PATCH 025/121] Bump mocha from 2.4.3 to 2.4.4 Bumps [mocha](https://github.com/freerange/mocha) from 2.4.3 to 2.4.4. - [Changelog](https://github.com/freerange/mocha/blob/main/RELEASE.md) - [Commits](https://github.com/freerange/mocha/compare/v2.4.3...v2.4.4) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 79558d8d..31302178 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,7 +172,7 @@ GEM libv8-node (~> 21.7.2.0) minitest (5.24.1) minitest-stub-const (0.6) - mocha (2.4.3) + mocha (2.4.4) ruby2_keywords (>= 0.0.5) mysql2 (0.5.6) net-imap (0.4.12) From 49fa90c7a66c0dd62f0d877e44913faba67fc6cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 00:28:45 +0000 Subject: [PATCH 026/121] Bump mocha from 2.4.4 to 2.4.5 Bumps [mocha](https://github.com/freerange/mocha) from 2.4.4 to 2.4.5. - [Changelog](https://github.com/freerange/mocha/blob/main/RELEASE.md) - [Commits](https://github.com/freerange/mocha/compare/v2.4.4...v2.4.5) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 31302178..8e16f046 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,7 +172,7 @@ GEM libv8-node (~> 21.7.2.0) minitest (5.24.1) minitest-stub-const (0.6) - mocha (2.4.4) + mocha (2.4.5) ruby2_keywords (>= 0.0.5) mysql2 (0.5.6) net-imap (0.4.12) From 784f8c3009b265fe584aef1d8644f0c45a2503b9 Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Mon, 22 Jul 2024 10:34:27 +0000 Subject: [PATCH 027/121] Translated using Weblate (Spanish) Currently translated at 100.0% (1121 of 1121 strings) Translation: Tracks/Tracks Translate-URL: https://hosted.weblate.org/projects/tracks/tracks/es/ --- config/locales/es.yml | 74 +++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/config/locales/es.yml b/config/locales/es.yml index 6f008359..2b235861 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -93,14 +93,15 @@ es: body: 'Hubo problemas con los campos siguientes:' header: one: Un error ha impedido que se guarde este %{model} - other: '%{count} errores han impedido que se guarden este %{model}' + many: '%{count} errores han impedido que se guarden este %{model}' + other: '' common: action: Tarea actions: Tareas actions_midsentence: - one: tarea + one: tareas + many: tarea other: tareas - zero: tareas add: Añadir ajaxError: Hubo un error al recuperar desde el servidor back: Atrás @@ -113,7 +114,8 @@ es: create: Crear days_midsentence: one: día - other: días + many: días + other: '' deferred: pospuestas description: Descripción drag_handle: ARRASTRAR @@ -132,9 +134,9 @@ es: none: Ninguno not_available_abbr: n/d note: - one: 1 nota - other: "%{count} notas" - zero: 0 notas + one: 0 notas + many: 1 nota + other: '%{count} notas' notes: Notas numbered_step: Paso %{number} ok: Aceptar @@ -313,40 +315,49 @@ es: distance_in_words: about_x_hours: one: alrededor de 1 hora - other: Acerca de %{count} horas + many: Acerca de %{count} horas + other: '' about_x_months: one: alrededor de 1 mes - other: Acerca de %{count} meses + many: Acerca de %{count} meses + other: '' about_x_years: one: alrededor de 1 año - other: Acerca de %{count} años + many: Acerca de %{count} años + other: '' almost_x_years: one: casi 1 año - other: Casi %{count} años + many: Casi %{count} años + other: '' half_a_minute: medio minuto less_than_x_minutes: - one: menos de un minuto + one: menos de 1 minuto + many: menos de un minuto other: menos de %{count} minutos - zero: menos de 1 minuto less_than_x_seconds: one: menos de 1 segundo + many: menos de 1 segundo other: menos de %{count} segundos - zero: menos de 1 segundo over_x_years: one: más de un año - other: en %{count} años + many: en %{count} años + other: '' x_days: one: 1 día - other: '%{count} días' + many: '%{count} días' + other: '' x_minutes: one: 1 minuto - other: '%{count} minutos' + many: '%{count} minutos' + other: '' x_months: one: 1 mes - other: '%{count} meses' + many: '%{count} meses' + other: '' x_seconds: one: Un segundo - other: '%{count} segundos' + many: '%{count} segundos' + other: '' prompts: day: Día hour: Hora @@ -698,7 +709,8 @@ es: units: byte: one: Byte - other: Bytes + many: Bytes + other: '' gb: GB kb: KB mb: MB @@ -1056,7 +1068,8 @@ es: completed_actions_with: Acciones completadas con la lengüeta «%{tag_name}» completed_in_archive: one: There is one completed action in the archive. - other: There are %{count} completed actions in the archive. + many: There are %{count} completed actions in the archive. + other: '' completed_last_day: Completed in the last 24 hours completed_last_x_days: Completed in last %{count} days completed_recurrence_completed: There is no next action after the recurring action @@ -1076,7 +1089,8 @@ es: due date before deferring. defer_x_days: one: Defer one day - other: Defer %{count} days + many: Defer %{count} days + other: '' deferred_actions_with: Deferred actions with the tag '%{tag_name}' deferred_pending_actions: Deferred/pending actions deferred_tasks_title: TRACKS::Recordatorio @@ -1116,7 +1130,8 @@ es: due: 'Vence: %{date}' has_x_pending: one: Tiene una tarea pendiente - other: Tiene %{count} tareas pendientes + many: Tiene %{count} tareas pendientes + other: '' hidden_actions: Tareas ocultas in_hidden_state: en estado oculto in_pending_state: en estado pendiente @@ -1283,8 +1298,9 @@ es: task_list_title: TRACKS::List etiquetadas tickler_items_due: one: Un elemento de tiquet ahora está vencido - recargue la página para verlo. - other: '%{count} elementos de ticket ahora están vencidos - recargue la página + many: '%{count} elementos de ticket ahora están vencidos - recargue la página para verlos.' + other: '' to_tickler: al recordatorio unable_to_add_dependency: Es imposible añadir dependencia unresolved_dependency: 'El valor que ha introducido en el campo de dependencia @@ -1347,6 +1363,8 @@ es: user_created: User created. you_have_to_reset_your_password: Usted tiene que restablecer su contraseña manage_users_title: TRACKS::Gestión de usuarios + create_error: La creación de usuario falló, ¿quizás ya tienes una cuenta aquí? + tos_error: ¡Tienes que aceptar los términos del servicio para registrarte! will_paginate: next_label: Siguiente » page_entries_info: @@ -1354,13 +1372,13 @@ es: multi_page_html: Representando %{model} %{from} - %{to} de %{count} en el total single_page: - one: Viendo del 1 %{model} + one: No %{model} encontrado + many: Viendo del 1 %{model} other: Viendo todos los %{count} %{model} - zero: No %{model} encontrado single_page_html: - one: Viendo del 1 %{model} + one: No %{model} encontrado + many: Viendo del 1 %{model} other: Viendo todos los %{count} %{model} - zero: No %{model} encontrado page_gap: "…" previous_label: "« Anterior" rest_help: From c7d81bb79f4625f5a61fd7963bab563b00b25c58 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Tue, 23 Jul 2024 11:32:01 +0000 Subject: [PATCH 028/121] Translated using Weblate (Finnish) Currently translated at 99.1% (1111 of 1121 strings) Translation: Tracks/Tracks Translate-URL: https://hosted.weblate.org/projects/tracks/tracks/fi/ --- config/locales/fi.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 3c68b79c..008cba69 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -131,9 +131,8 @@ fi: none: Ei not_available_abbr: ei note: - one: 1 muistiinpano - other: "%{count} muistiinpanoa" - zero: ei muistiinpanoja + one: ei muistiinpanoja + other: 1 muistiinpano notes: Muistiinpanot numbered_step: Askel %{number} ok: Ok @@ -1331,6 +1330,9 @@ fi: total_users_count: Sinulla on yhteensä %{count} käyttäjää user_created: Käyttäjä luotu. you_have_to_reset_your_password: Palauta salasanasi + create_error: Tunnuksen luominen epäonnistui, ehkä sinulla on jo käyttäjätunnus + täällä? + tos_error: Sinun täytyy hyväksyä käyttöehdot rekisteröityäksesi! will_paginate: next_label: Seuraava → page_entries_info: @@ -1338,13 +1340,11 @@ fi: multi_page_html: Näytetään %{model} %{from} - %{to} yhteensä %{count} tietueesta single_page: - one: Näytetään 1 %{model} - other: Näytetään kaikki %{count} %{model} - zero: '%{model} ei löytynyt' + one: '%{model} ei löytynyt' + other: Näytetään 1 %{model} single_page_html: - one: Näytetään 1 %{model} - other: Näytetään kaikki %{count} %{model} - zero: '%{model} ei löytynyt' + one: '%{model} ei löytynyt' + other: Näytetään 1 %{model} page_gap: "…" previous_label: "← Edellinen" auth_type: From c23ca0574ec1149993476632ffd66643aec6aac2 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 25 Jul 2024 14:53:04 +0300 Subject: [PATCH 029/121] Fix reflected XSS vulnerability on the stats page --- app/views/stats/show_selection_from_chart.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/stats/show_selection_from_chart.html.erb b/app/views/stats/show_selection_from_chart.html.erb index 29e9dfdb..abe7f04b 100644 --- a/app/views/stats/show_selection_from_chart.html.erb +++ b/app/views/stats/show_selection_from_chart.html.erb @@ -4,8 +4,8 @@ unless @further -%> <%= raw t('stats.click_to_show_actions_from_week', - :link => link_to("here", show_actions_from_chart_path(:id=>"#{params[:id]}_end", :index => params[:index])), - :week => params[:index]) + :link => link_to("here", show_actions_from_chart_path(:id=>"#{params[:id].to_i}_end", :index => params[:index].to_i)), + :week => params[:index].to_i) -%> <% end From d64e1a0fa436ab0762f18dd37c8d5cb40d87e500 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 25 Jul 2024 21:34:12 +0300 Subject: [PATCH 030/121] Fix the plurals as usual --- config/locales/es.yml | 70 +++++++++++++++++-------------------------- config/locales/fi.yml | 15 ++++++---- 2 files changed, 36 insertions(+), 49 deletions(-) diff --git a/config/locales/es.yml b/config/locales/es.yml index 2b235861..e4dffa6d 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -93,15 +93,14 @@ es: body: 'Hubo problemas con los campos siguientes:' header: one: Un error ha impedido que se guarde este %{model} - many: '%{count} errores han impedido que se guarden este %{model}' - other: '' + other: '%{count} errores han impedido que se guarden este %{model}' common: action: Tarea actions: Tareas actions_midsentence: - one: tareas - many: tarea + one: tarea other: tareas + zero: tareas add: Añadir ajaxError: Hubo un error al recuperar desde el servidor back: Atrás @@ -114,8 +113,7 @@ es: create: Crear days_midsentence: one: día - many: días - other: '' + other: días deferred: pospuestas description: Descripción drag_handle: ARRASTRAR @@ -134,9 +132,9 @@ es: none: Ninguno not_available_abbr: n/d note: - one: 0 notas - many: 1 nota + one: 1 nota other: '%{count} notas' + zero: 0 notas notes: Notas numbered_step: Paso %{number} ok: Aceptar @@ -315,49 +313,40 @@ es: distance_in_words: about_x_hours: one: alrededor de 1 hora - many: Acerca de %{count} horas - other: '' + other: Acerca de %{count} horas about_x_months: one: alrededor de 1 mes - many: Acerca de %{count} meses - other: '' + other: Acerca de %{count} meses about_x_years: one: alrededor de 1 año - many: Acerca de %{count} años - other: '' + other: Acerca de %{count} años almost_x_years: one: casi 1 año - many: Casi %{count} años - other: '' + other: Casi %{count} años half_a_minute: medio minuto less_than_x_minutes: - one: menos de 1 minuto - many: menos de un minuto + one: menos de un minuto other: menos de %{count} minutos + zero: menos de 1 minuto less_than_x_seconds: one: menos de 1 segundo - many: menos de 1 segundo other: menos de %{count} segundos + zero: menos de 1 segundo over_x_years: one: más de un año - many: en %{count} años - other: '' + other: en %{count} años x_days: one: 1 día - many: '%{count} días' - other: '' + other: '%{count} días' x_minutes: one: 1 minuto - many: '%{count} minutos' - other: '' + other: '%{count} minutos' x_months: one: 1 mes - many: '%{count} meses' - other: '' + other: '%{count} meses' x_seconds: one: Un segundo - many: '%{count} segundos' - other: '' + other: '%{count} segundos' prompts: day: Día hour: Hora @@ -709,8 +698,7 @@ es: units: byte: one: Byte - many: Bytes - other: '' + other: Bytes gb: GB kb: KB mb: MB @@ -1068,8 +1056,7 @@ es: completed_actions_with: Acciones completadas con la lengüeta «%{tag_name}» completed_in_archive: one: There is one completed action in the archive. - many: There are %{count} completed actions in the archive. - other: '' + other: There are %{count} completed actions in the archive. completed_last_day: Completed in the last 24 hours completed_last_x_days: Completed in last %{count} days completed_recurrence_completed: There is no next action after the recurring action @@ -1089,8 +1076,7 @@ es: due date before deferring. defer_x_days: one: Defer one day - many: Defer %{count} days - other: '' + other: Defer %{count} days deferred_actions_with: Deferred actions with the tag '%{tag_name}' deferred_pending_actions: Deferred/pending actions deferred_tasks_title: TRACKS::Recordatorio @@ -1130,8 +1116,7 @@ es: due: 'Vence: %{date}' has_x_pending: one: Tiene una tarea pendiente - many: Tiene %{count} tareas pendientes - other: '' + other: Tiene %{count} tareas pendientes hidden_actions: Tareas ocultas in_hidden_state: en estado oculto in_pending_state: en estado pendiente @@ -1298,9 +1283,8 @@ es: task_list_title: TRACKS::List etiquetadas tickler_items_due: one: Un elemento de tiquet ahora está vencido - recargue la página para verlo. - many: '%{count} elementos de ticket ahora están vencidos - recargue la página + other: '%{count} elementos de ticket ahora están vencidos - recargue la página para verlos.' - other: '' to_tickler: al recordatorio unable_to_add_dependency: Es imposible añadir dependencia unresolved_dependency: 'El valor que ha introducido en el campo de dependencia @@ -1372,13 +1356,13 @@ es: multi_page_html: Representando %{model} %{from} - %{to} de %{count} en el total single_page: - one: No %{model} encontrado - many: Viendo del 1 %{model} + one: Viendo del 1 %{model} other: Viendo todos los %{count} %{model} + zero: No %{model} encontrado single_page_html: - one: No %{model} encontrado - many: Viendo del 1 %{model} + one: Viendo del 1 %{model} other: Viendo todos los %{count} %{model} + zero: No %{model} encontrado page_gap: "…" previous_label: "« Anterior" rest_help: diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 008cba69..6286ad2e 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -131,8 +131,9 @@ fi: none: Ei not_available_abbr: ei note: - one: ei muistiinpanoja - other: 1 muistiinpano + one: 1 muistiinpano + other: '%{count} muistiinpanoa' + zero: ei muistiinpanoja notes: Muistiinpanot numbered_step: Askel %{number} ok: Ok @@ -1340,11 +1341,13 @@ fi: multi_page_html: Näytetään %{model} %{from} - %{to} yhteensä %{count} tietueesta single_page: - one: '%{model} ei löytynyt' - other: Näytetään 1 %{model} + one: Näytetään 1 %{model} + other: Näytetään kaikki %{count} %{model} + zero: '%{model} ei löytynyt' single_page_html: - one: '%{model} ei löytynyt' - other: Näytetään 1 %{model} + one: Näytetään 1 %{model} + other: Näytetään kaikki %{count} %{model} + zero: '%{model} ei löytynyt' page_gap: "…" previous_label: "← Edellinen" auth_type: From b0d288d2efd0f8020d04ca95b8e0738a9eab6c51 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 25 Jul 2024 15:34:44 +0300 Subject: [PATCH 031/121] Fix reflected XSS vulnerabilities in some views --- app/controllers/todos_controller.rb | 6 ++++-- app/views/layouts/application.html.erb | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index 1c852420..05b7a95a 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -863,8 +863,10 @@ class TodosController < ApplicationController end @single_tag = @tag_expr.size == 1 && @tag_expr[0].size == 1 - @tag_name = @tag_expr[0][0] - @tag_title = @single_tag ? @tag_name : tag_title(@tag_expr) + + # These are used in the templates, sanitise to prevent XSS. + @tag_name = sanitize(@tag_expr[0][0]) + @tag_title = sanitize(@single_tag ? @tag_name : tag_title(@tag_expr)) end def filter_format_for_tag_view diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 31e5808e..4640637a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,14 +7,14 @@ <%= javascript_include_tag "application" %> <%= csrf_meta_tags %>