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/dependabot.yml b/.github/dependabot.yml index 26467758..7e8a08cd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,4 @@ updates: directory: "/" schedule: interval: "daily" + open-pull-requests-limit: 10 diff --git a/.github/workflows/build-custom-release.yml b/.github/workflows/build-custom-release.yml new file mode 100644 index 00000000..bc820e2f --- /dev/null +++ b/.github/workflows/build-custom-release.yml @@ -0,0 +1,55 @@ +--- +name: 'Build custom release' +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag to release' + required: true + type: string + name: + description: 'Name of the release' + required: true + type: string + +jobs: + build-and-publish-release: + name: 'Build custom release' + runs-on: ubuntu-latest + steps: + - + name: Checkout the code + uses: actions/checkout@v2 + with: + ref: ${{ inputs.tag }} + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + target: production + push: true + tags: | + tracksapp/tracks:${{ inputs.name }} + ghcr.io/tracksapp/tracks:${{ inputs.name }} + +# platforms: linux/amd64,linux/arm64 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/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9d89cdfa..fccf5bfb 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -6,18 +6,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ["3.0", "3.1", "3.2", "3.3"] + ruby: ["3.2", "3.3"] db: [sqlite, mysql, postgres] - exclude: - - ruby: "3.1" - db: sqlite - - ruby: "3.1" - db: postgres - - ruby: "3.2" - db: sqlite - - ruby: "3.2" - db: postgres - steps: - uses: actions/checkout@v1 - run: bash -x script/cibuild ${{ matrix.ruby }} ${{ matrix.db }} diff --git a/.ruby-version b/.ruby-version index 9f55b2cc..eb39e538 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0 +3.3 diff --git a/Dockerfile b/Dockerfile index 1a637feb..72ceffe2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,12 @@ -FROM ruby:3.3 - -# throw errors if Gemfile has been modified since Gemfile.lock -RUN bundle config --global frozen 1 +ARG RUBY_VERSION=3.3 +FROM ruby:${RUBY_VERSION} AS base WORKDIR /app - RUN touch /etc/app-env -COPY Gemfile* /app/ +RUN apt-get update && apt-get install -y npm netcat-openbsd +RUN npm install -g yarn 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 mkdir /app/log @@ -36,12 +29,38 @@ 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 -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 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 + +FROM base AS test +COPY test /app/test/ +# For testing the API client +COPY doc /app/doc/ +RUN bundle config set without assets +RUN bundle config set with development test +RUN bundle config --global frozen 1 +RUN bundle install --jobs 4 +COPY --from=precompile /app/public/assets /app/public/assets + +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 30ad6230..94c150bd 100644 --- a/Gemfile +++ b/Gemfile @@ -1,70 +1,72 @@ source 'https://rubygems.org' gem 'actionpack-xml_parser', '~> 2.0' -gem 'activemodel-serializers-xml', '~> 1.0.1' +gem 'activemodel-serializers-xml', '~> 1.0.3' -gem 'coffee-rails', '~> 5.0.0' +gem 'rails', '~> 7.1' +gem 'font-awesome-sass', '~> 6.7.2' 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 'jquery-ui-rails', '~>8.0.0' +gem 'aasm', '~> 5.5.1' gem 'acts_as_list' gem 'bcrypt', '~> 3.1.20' gem 'htmlentities' gem "kt-paperclip", "~> 7.2" -gem 'puma', '~> 6.4' +gem 'puma', '~> 6.6' gem 'rails_autolink' gem 'RedCloth' -gem 'sanitize', '~> 6.1' +gem 'sanitize', '~> 7.0' gem 'tracks-chartjs-ror' gem 'will_paginate' +gem 'rexml' + +# Use --without argument to skip unnecessary drivers +gem 'sqlite3', '~> 2.7', group: :sqlite +gem 'mysql2', '~> 0.5', group: :mysql +gem 'pg', '~> 1.5', group: :postgresql + # 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 +gem 'sprockets-rails' +gem 'coffee-rails', '~> 5.0.0' +gem 'dartsass-sprockets' +gem 'bootstrap-sass', '3.4.1' +gem 'terser' +gem 'listen' +gem 'tolk', '~> 6.0.0' -group :development do +group :development, :optional => true do gem 'spring', '~> 4' gem 'yard' - gem 'tolk', '~> 5.0.1' - gem 'bullet' gem 'rack-mini-profiler' gem 'solargraph' - gem 'i18n-tasks', '~> 1.0.14' + gem 'i18n-tasks', '~> 1.0.15' end -group :development, :test do +group :development, :test, :optional => true do gem 'byebug' - gem 'listen' - gem 'rubocop', '~> 1.64', require: false + gem 'rubocop', '~> 1.78' 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 'database_cleaner', '~> 1' + gem 'codeclimate-test-reporter', '1.0.9' + gem 'database_cleaner', '~> 2' 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 'rails-dom-testing', '~> 2.3.0' gem 'rspec-expectations' gem 'simplecov' end + +group :stripe, :optional => true do + gem 'stripe' +end diff --git a/Gemfile.lock b/Gemfile.lock index d4487d0e..d0945bdb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,92 +1,112 @@ GEM remote: https://rubygems.org/ specs: - RedCloth (4.3.3) - aasm (5.5.0) + RedCloth (4.3.4) + aasm (5.5.1) concurrent-ruby (~> 1.0) - actioncable (6.1.7.8) - actionpack (= 6.1.7.8) - activesupport (= 6.1.7.8) + actioncable (7.1.5.1) + actionpack (= 7.1.5.1) + activesupport (= 7.1.5.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.8) - actionpack (= 6.1.7.8) - activejob (= 6.1.7.8) - activerecord (= 6.1.7.8) - activestorage (= 6.1.7.8) - activesupport (= 6.1.7.8) + zeitwerk (~> 2.6) + actionmailbox (7.1.5.1) + actionpack (= 7.1.5.1) + activejob (= 7.1.5.1) + activerecord (= 7.1.5.1) + activestorage (= 7.1.5.1) + activesupport (= 7.1.5.1) mail (>= 2.7.1) - actionmailer (6.1.7.8) - actionpack (= 6.1.7.8) - actionview (= 6.1.7.8) - activejob (= 6.1.7.8) - activesupport (= 6.1.7.8) + net-imap + net-pop + net-smtp + actionmailer (7.1.5.1) + actionpack (= 7.1.5.1) + actionview (= 7.1.5.1) + activejob (= 7.1.5.1) + activesupport (= 7.1.5.1) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (6.1.7.8) - actionview (= 6.1.7.8) - activesupport (= 6.1.7.8) - rack (~> 2.0, >= 2.0.9) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.5.1) + actionview (= 7.1.5.1) + activesupport (= 7.1.5.1) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) actionpack-xml_parser (2.0.1) actionpack (>= 5.0) railties (>= 5.0) - actiontext (6.1.7.8) - actionpack (= 6.1.7.8) - activerecord (= 6.1.7.8) - activestorage (= 6.1.7.8) - activesupport (= 6.1.7.8) + actiontext (7.1.5.1) + actionpack (= 7.1.5.1) + activerecord (= 7.1.5.1) + activestorage (= 7.1.5.1) + activesupport (= 7.1.5.1) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.8) - activesupport (= 6.1.7.8) + actionview (7.1.5.1) + activesupport (= 7.1.5.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.8) - activesupport (= 6.1.7.8) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.5.1) + activesupport (= 7.1.5.1) globalid (>= 0.3.6) - activemodel (6.1.7.8) - activesupport (= 6.1.7.8) - activemodel-serializers-xml (1.0.2) - activemodel (> 5.x) - activesupport (> 5.x) + activemodel (7.1.5.1) + activesupport (= 7.1.5.1) + activemodel-serializers-xml (1.0.3) + activemodel (>= 5.0.0.a) + activesupport (>= 5.0.0.a) builder (~> 3.1) - activerecord (6.1.7.8) - activemodel (= 6.1.7.8) - activesupport (= 6.1.7.8) - activestorage (6.1.7.8) - actionpack (= 6.1.7.8) - activejob (= 6.1.7.8) - activerecord (= 6.1.7.8) - activesupport (= 6.1.7.8) + activerecord (7.1.5.1) + activemodel (= 7.1.5.1) + activesupport (= 7.1.5.1) + timeout (>= 0.4.0) + activestorage (7.1.5.1) + actionpack (= 7.1.5.1) + activejob (= 7.1.5.1) + activerecord (= 7.1.5.1) + activesupport (= 7.1.5.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (6.1.7.8) + activesupport (7.1.5.1) + base64 + benchmark (>= 0.3) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) tzinfo (~> 2.0) - zeitwerk (~> 2.3) - acts_as_list (1.2.1) + acts_as_list (1.2.4) activerecord (>= 6.1) activesupport (>= 6.1) - ast (2.4.2) - autoprefixer-rails (10.4.7.0) + ast (2.4.3) + autoprefixer-rails (10.4.21.0) execjs (~> 2) backport (1.2.0) + base64 (0.3.0) bcrypt (3.1.20) - benchmark (0.3.0) + benchmark (0.4.1) + bigdecimal (3.2.2) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) builder (3.3.0) - bullet (7.1.4) + bullet (8.0.8) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) - byebug (11.1.3) + byebug (12.0.0) climate_control (0.2.0) codeclimate-test-reporter (1.0.9) simplecov (<= 0.13) @@ -97,30 +117,47 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) crass (1.0.6) - database_cleaner (1.99.0) - date (3.3.4) - diff-lcs (1.5.0) + dartsass-sprockets (3.2.1) + railties (>= 4.0.0) + sassc-embedded (~> 1.80.1) + sprockets (> 3.0) + sprockets-rails + tilt + database_cleaner (2.1.0) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.2.0) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + date (3.4.1) + diff-lcs (1.6.2) docile (1.1.5) - e2mmap (0.1.0) - erubi (1.13.0) - execjs (2.8.1) - factory_bot (6.4.6) - activesupport (>= 5.0.0) - factory_bot_rails (6.4.3) - factory_bot (~> 6.4) - railties (>= 5.0.0) + drb (2.2.3) + erb (5.0.1) + erubi (1.13.1) + execjs (2.10.0) + factory_bot (6.5.4) + activesupport (>= 6.1.0) + factory_bot_rails (6.5.0) + factory_bot (~> 6.5) + railties (>= 6.1.0) ffi (1.17.0) - font-awesome-sass (6.5.2) + font-awesome-sass (6.7.2) sassc (~> 2.0) globalid (1.2.1) activesupport (>= 6.1) - highline (3.0.1) + google-protobuf (4.31.1) + bigdecimal + rake (>= 13) + highline (3.1.2) + reline htmlentities (4.3.4) - i18n (1.14.5) + i18n (1.14.7) concurrent-ruby (~> 1.0) - i18n-tasks (1.0.14) + i18n-tasks (1.0.15) activesupport (>= 4.0.2) ast (>= 2.1.0) erubi @@ -129,17 +166,23 @@ GEM parser (>= 3.2.2.1) rails-i18n rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.8, >= 1.8.1) terminal-table (>= 1.5.1) - jaro_winkler (1.5.6) + io-console (0.8.0) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jaro_winkler (1.6.1) jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (7.0.0) + jquery-ui-rails (8.0.0) railties (>= 3.2.16) - json (2.7.2) - kramdown (2.4.0) - rexml + json (2.12.2) + kramdown (2.5.1) + rexml (>= 3.3.9) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) kt-paperclip (7.2.0) @@ -148,12 +191,14 @@ GEM marcel (~> 1.0.1) mime-types terrapin (~> 0.6.0) - language_server-protocol (3.17.0.3) - libv8-node (21.7.2.0) + language_server-protocol (3.17.0.5) + libv8-node (24.1.0.0) + lint_roller (1.1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.22.0) + logger (1.7.0) + loofah (2.24.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -161,193 +206,223 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) - method_source (1.1.0) + marcel (1.0.4) mime-types (3.4.1) mime-types-data (~> 3.2015) mime-types-data (3.2023.0218.1) mini_mime (1.1.5) - mini_portile2 (2.8.7) - mini_racer (0.12.0) - libv8-node (~> 21.7.2.0) - minitest (5.23.1) + mini_portile2 (2.8.9) + mini_racer (0.19.0) + libv8-node (~> 24.1.0.0) + minitest (5.25.5) minitest-stub-const (0.6) - mocha (2.1.0) + mocha (2.7.1) ruby2_keywords (>= 0.0.5) + mutex_m (0.3.0) mysql2 (0.5.6) - net-imap (0.4.12) + net-imap (0.5.9) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.5.0) + net-smtp (0.5.1) net-protocol - nio4r (2.7.3) - nokogiri (1.16.6) + nio4r (2.7.4) + nokogiri (1.18.9) mini_portile2 (~> 2.8.2) racc (~> 1.4) - parallel (1.25.1) - parser (3.3.3.0) + observer (0.1.2) + ostruct (0.6.2) + parallel (1.27.0) + parser (3.3.8.0) ast (~> 2.4.1) racc - pg (1.5.6) - puma (6.4.2) + pg (1.5.9) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + prism (1.4.0) + psych (5.2.6) + date + stringio + puma (6.6.0) nio4r (~> 2.0) - racc (1.8.0) - rack (2.2.9) - rack-mini-profiler (3.3.1) + racc (1.8.1) + rack (3.2.0) + rack-mini-profiler (4.0.1) rack (>= 1.2.0) - rack-test (2.1.0) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) rack (>= 1.3) - rails (6.1.7.8) - actioncable (= 6.1.7.8) - actionmailbox (= 6.1.7.8) - actionmailer (= 6.1.7.8) - actionpack (= 6.1.7.8) - actiontext (= 6.1.7.8) - actionview (= 6.1.7.8) - activejob (= 6.1.7.8) - activemodel (= 6.1.7.8) - activerecord (= 6.1.7.8) - activestorage (= 6.1.7.8) - activesupport (= 6.1.7.8) + rackup (2.2.1) + rack (>= 3) + rails (7.1.5.1) + actioncable (= 7.1.5.1) + actionmailbox (= 7.1.5.1) + actionmailer (= 7.1.5.1) + actionpack (= 7.1.5.1) + actiontext (= 7.1.5.1) + actionview (= 7.1.5.1) + activejob (= 7.1.5.1) + activemodel (= 7.1.5.1) + activerecord (= 7.1.5.1) + activestorage (= 7.1.5.1) + activesupport (= 7.1.5.1) bundler (>= 1.15.0) - railties (= 6.1.7.8) - sprockets-rails (>= 2.0.0) + railties (= 7.1.5.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.2.0) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - rails-i18n (7.0.9) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.10) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) rails_autolink (1.1.8) actionview (> 3.1) activesupport (> 3.1) railties (> 3.1) - railties (6.1.7.8) - actionpack (= 6.1.7.8) - activesupport (= 6.1.7.8) - method_source + railties (7.1.5.1) + actionpack (= 7.1.5.1) + activesupport (= 7.1.5.1) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.2.1) + rake (13.3.0) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbs (2.8.4) - regexp_parser (2.9.2) - reverse_markdown (2.1.1) + rbs (3.9.4) + logger + rdoc (6.14.1) + erb + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.1) + io-console (~> 0.5) + reverse_markdown (3.0.0) nokogiri - rexml (3.3.0) - strscan - rspec-expectations (3.12.3) + rexml (3.4.1) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.0) - rubocop (1.64.1) + rspec-support (~> 3.13.0) + rspec-support (3.13.4) + rubocop (1.78.0) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.45.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) - parser (>= 3.3.1.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.45.1) + parser (>= 3.3.7.2) + prism (~> 1.4) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - safe_yaml (1.0.5) - sanitize (6.1.1) + sanitize (7.0.0) crass (~> 1.0.2) - nokogiri (>= 1.12.0) + nokogiri (>= 1.16.8) + sass-embedded (1.89.2) + google-protobuf (~> 4.31) + rake (>= 13) 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 + sassc-embedded (1.80.4) + sass-embedded (~> 1.80) + securerandom (0.4.1) simplecov (0.13.0) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - solargraph (0.50.0) + solargraph (0.56.0) backport (~> 1.2) - benchmark + benchmark (~> 0.4) bundler (~> 2.0) diff-lcs (~> 1.4) - e2mmap - jaro_winkler (~> 1.5) + jaro_winkler (~> 1.6, >= 1.6.1) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.1) + logger (~> 1.6) + observer (~> 0.1) + ostruct (~> 0.6) parser (~> 3.0) - rbs (~> 2.0) - reverse_markdown (~> 2.0) + prism (~> 1.4) + rbs (~> 3.3) + reverse_markdown (~> 3.0) rubocop (~> 1.38) thor (~> 1.0) tilt (~> 2.0) yard (~> 0.9, >= 0.9.24) - spring (4.2.1) - sprockets (4.2.0) + yard-solargraph (~> 0.1) + spring (4.3.0) + sprockets (4.2.2) concurrent-ruby (~> 1.0) + logger rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) - sqlite3 (1.6.9) + sqlite3 (2.7.3) mini_portile2 (~> 2.8.0) - strscan (3.1.0) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) + stringio (3.1.7) + stripe (15.5.0) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) - thor (1.3.1) - tilt (2.3.0) - timeout (0.4.1) - tolk (5.0.1) - rails (>= 6.0) - safe_yaml (>= 0.8.6) + terser (1.2.6) + execjs (>= 0.3.0, < 3) + thor (1.4.0) + tilt (2.6.0) + timeout (0.4.3) + tolk (6.0.0) + rails (>= 7.0, < 7.3) sprockets-rails (~> 3.4) tracks-chartjs-ror (3.6.4) rails (>= 3.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) - unicode-display_width (2.5.0) - uniform_notifier (1.16.0) - websocket-driver (0.7.6) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uniform_notifier (1.17.0) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) will_paginate (4.0.1) - yard (0.9.36) - zeitwerk (2.6.15) + yard (0.9.37) + yard-solargraph (0.1.0) + yard (~> 0.9) + zeitwerk (2.7.3) PLATFORMS ruby DEPENDENCIES RedCloth - aasm (~> 5.5.0) + aasm (~> 5.5.1) actionpack-xml_parser (~> 2.0) - activemodel-serializers-xml (~> 1.0.1) + activemodel-serializers-xml (~> 1.0.3) acts_as_list bcrypt (~> 3.1.20) bootstrap-sass (= 3.4.1) @@ -355,37 +430,40 @@ DEPENDENCIES byebug codeclimate-test-reporter (= 1.0.9) coffee-rails (~> 5.0.0) - database_cleaner (~> 1) + dartsass-sprockets + database_cleaner (~> 2) factory_bot_rails - font-awesome-sass (~> 6.5.2) + font-awesome-sass (~> 6.7.2) htmlentities - i18n-tasks (~> 1.0.14) + i18n-tasks (~> 1.0.15) jquery-rails (~> 4.6) - jquery-ui-rails (~> 7.0.0) + jquery-ui-rails (~> 8.0.0) kt-paperclip (~> 7.2) listen mini_racer minitest-stub-const mocha - mysql2 (~> 0.5.6) - pg (~> 1.5.6) - puma (~> 6.4) + mysql2 (~> 0.5) + pg (~> 1.5) + puma (~> 6.6) rack-mini-profiler - rails (~> 6.1) + rails (~> 7.1) rails-controller-testing - rails-dom-testing (~> 2.2.0) + rails-dom-testing (~> 2.3.0) rails_autolink + rexml rspec-expectations - rubocop (~> 1.64) - sanitize (~> 6.1) - sassc-rails (~> 2.1.2) + rubocop (~> 1.78) + sanitize (~> 7.0) simplecov solargraph spring (~> 4) - sqlite3 - tolk (~> 5.0.1) + sprockets-rails + sqlite3 (~> 2.7) + stripe + terser + tolk (~> 6.0.0) tracks-chartjs-ror - uglifier (>= 1.3.0) will_paginate yard diff --git a/README.md b/README.md index e96a9b99..8a89b454 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ * Hosted services: https://github.com/TracksApp/tracks/wiki/Hosted-Tracks * Bug reports and feature requests: https://github.com/TracksApp/tracks/issues * Mailing list: http://groups.google.com/group/TracksApp -* IRC channel: #tracks on Libera, available also on [Matrix](https://matrix.to/#/#tracks:matrix.org) * License: See COPYING Full instructions for both new installations and upgrades from older installations diff --git a/app/assets/javascripts-jquery-ui/datepicker-zh-TW.js b/app/assets/javascripts-jquery-ui/datepicker-zh-TW.js new file mode 100644 index 00000000..e67425bd --- /dev/null +++ b/app/assets/javascripts-jquery-ui/datepicker-zh-TW.js @@ -0,0 +1,40 @@ +/* Traditional Chinese (Taiwan) initialisation for the jQuery UI date picker plugin. */ +/* Written by Claude Code for Tracks application. */ +( function( factory ) { + "use strict"; + + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define( [ "../widgets/datepicker" ], factory ); + } else { + + // Browser globals + factory( jQuery.datepicker ); + } +} )( function( datepicker ) { +"use strict"; + +datepicker.regional["zh-TW"] = { + closeText: "關閉", + prevText: "上一月", + nextText: "下一月", + currentText: "今天", + monthNames: [ "一月", "二月", "三月", "四月", "五月", "六月", + "七月", "八月", "九月", "十月", "十一月", "十二月" ], + monthNamesShort: [ "1月", "2月", "3月", "4月", "5月", "6月", + "7月", "8月", "9月", "10月", "11月", "12月" ], + dayNames: [ "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" ], + dayNamesShort: [ "日", "一", "二", "三", "四", "五", "六" ], + dayNamesMin: [ "日", "一", "二", "三", "四", "五", "六" ], + weekHeader: "週", + dateFormat: "yy/mm/dd", + firstDay: 0, + isRTL: false, + showMonthAfterYear: true, + yearSuffix: "年" }; +datepicker.setDefaults( datepicker.regional["zh-TW"] ); + +return datepicker.regional["zh-TW"]; + +} ); \ No newline at end of file diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 113fc78d..ebb80724 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -10,9 +10,9 @@ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // about supported directives. // -//= require jquery //= require jquery_ujs -//= require bootstrap-sprockets +//= require jquery3 +//= require bootstrap //= require jquery-ui/widgets/autocomplete //= require jquery-ui/widgets/datepicker diff --git a/app/assets/stylesheets/include/manifest.scss b/app/assets/stylesheets/include/manifest.scss index 12066267..c7fac97e 100644 --- a/app/assets/stylesheets/include/manifest.scss +++ b/app/assets/stylesheets/include/manifest.scss @@ -21,7 +21,6 @@ } .bootstrap { - @import "bootstrap-sprockets"; @import "bootstrap"; @import "tracks-logo"; @import "login"; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5b4e2407..ab928d77 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,5 @@ require_dependency "login_system" -require_dependency "tracks/source_view" +require_dependency "tracks/source_view_switching" class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. diff --git a/app/controllers/feedlist_controller.rb b/app/controllers/feedlist_controller.rb index 8b6b1578..04342e43 100644 --- a/app/controllers/feedlist_controller.rb +++ b/app/controllers/feedlist_controller.rb @@ -36,7 +36,7 @@ class FeedlistController < ApplicationController def get_feeds_for(object) respond_to do |format| - format.html { render :file => "feedlist/get_feeds_for_#{object.class.name.downcase}" } + format.html { render :template => "feedlist/get_feeds_for_#{object.class.name.downcase}" } format.js end end 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/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/app/views/contexts/index.rss.builder b/app/views/contexts/index.rss.builder index 5459d1f1..ee98e19f 100644 --- a/app/views/contexts/index.rss.builder +++ b/app/views/contexts/index.rss.builder @@ -11,7 +11,7 @@ xml.rss :version => "2.0" do xml.item do xml.title h(context.title) xml.description context_summary(context, count_undone_todos_phrase(context)) - xml.pubDate context.created_at.to_s(:rfc822) + xml.pubDate context.created_at.to_formatted_s(:rfc822) xml.link context_url(context) xml.guid context_url(context) end 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 %>