Ian Kelling [Mon, 22 May 2023 20:03:51 +0000 (16:03 -0400)]
Merge branch 'main' into fsf-master
Jarek Radosz [Tue, 9 May 2023 09:57:55 +0000 (11:57 +0200)]
DEV: Remove `RUBY_GLOBAL_METHOD_CACHE_SIZE` (#711)
It doesn't do anything since ruby 3.0.0.preview1. It was removed in https://github.com/ruby/ruby/pull/2888
David Taylor [Tue, 2 May 2023 14:55:16 +0000 (15:55 +0100)]
Bump default base image to 2.0.
20230502-0058 (#715)
Alan Guo Xiang Tan [Mon, 1 May 2023 02:50:50 +0000 (10:50 +0800)]
DEV: Introduce `enable-ruby-yjit template
This adds the `RUBY_YJIT_ENABLE` environment variable which would enable
Ruby 3.2's YJIT. See
https://github.com/ruby/ruby/blob/master/doc/yjit/yjit.md for more
information about YJIT.
Saj Goonatilleke [Thu, 27 Apr 2023 09:29:23 +0000 (19:29 +1000)]
templates: abort on fetch error
David Taylor [Mon, 24 Apr 2023 10:33:34 +0000 (11:33 +0100)]
DEV: Install all yarn dependencies (#708)
`devDependencies` is often used for things like ember-cli build tooling. Until now we have been moving those things to `dependencies` in our `package.json`, but it makes more sense for us to conform to the industry norms.
Andrew Schleifer [Fri, 21 Apr 2023 04:10:11 +0000 (04:10 +0000)]
Bump default base image to discourse/base:2.0.
20230420-0104
Andrew Engelbrecht [Thu, 20 Apr 2023 21:01:44 +0000 (17:01 -0400)]
Merge branch 'main' into fsf-master
Rafael dos Santos Silva [Wed, 19 Apr 2023 20:02:28 +0000 (17:02 -0300)]
DEV: Wait up to 10 minutes for safe PG stop (#709)
Over the years we had LOTS of cases of PostgreSQL instances that weren't stopped properly. This gives PG more time to handle it's shutdown cleanly on the worst case, but will still shutdown fast in normal cases.
Gerhard Schlager [Thu, 13 Apr 2023 10:41:02 +0000 (12:41 +0200)]
FEATURE: Store the `version` parameter as custom value in git config
This is particularly useful when the version is pointing to a git tag like `beta`, otherwise we won't be able to reliably detect the tracked version at runtime.
Gerhard Schlager [Thu, 13 Apr 2023 10:39:19 +0000 (12:39 +0200)]
FIX: Rebuild fails when tracked `version` switches from branch to tag
We are replacing the `beta` branch with a tag of the same name. Rebuilding a container will fail when a user tracks the `beta` version and the base image was built at a time where `beta` was still a branch. This resolves that by pruning tags and branches and forcing an update of tags during the rebuild.
Alan Guo Xiang Tan [Mon, 10 Apr 2023 00:35:12 +0000 (08:35 +0800)]
Bump default base image to run Ruby 3.2.2 as default
Ruby 3.2.2 was released with a two security fixes. While the security
fixes have been assessed to have low impact on Discourse, we still want
to get the upgrade in as a preventive measure.
Michael Brown [Tue, 4 Apr 2023 17:36:41 +0000 (13:36 -0400)]
Add template to enable an IPv6 listener
By default nginx in the container only listens for IPv4 connections. Some users
want to enable direct IPv6 connectivity to the container either via forwarding
or NAT. This provides an easy method to allow that.
David Taylor [Tue, 4 Apr 2023 09:05:11 +0000 (10:05 +0100)]
Remove stable-specific image (#700)
This was only introduced as a temporary solution for Discourse 2.8, which is now EOL
Andrew Engelbrecht [Fri, 31 Mar 2023 19:47:14 +0000 (15:47 -0400)]
Merge branch 'main' into fsf-master
Rafael dos Santos Silva [Fri, 31 Mar 2023 14:50:12 +0000 (11:50 -0300)]
Bum to latest Ruby (#699)
Blake Erickson [Sun, 26 Mar 2023 13:12:01 +0000 (07:12 -0600)]
DEV: Ubuntu installs do not like bullseye-backports (#698)
Check for Ubuntu 22.04 and 22.10 versions before trying to use
`bullseye-backports` otherwise they throw this error.
```
E: The value 'bullseye-backports' is invalid for APT::Default-Release as
such a release is not available in the sources failed
```
Gerhard Schlager [Mon, 13 Mar 2023 20:55:19 +0000 (21:55 +0100)]
FIX: Rebuild was broken when an older image with shallow clone was used (#696)
This adds the original special handling for shallow clones back. It can be removed once everyone uses images with partial clones.
Gerhard Schlager [Mon, 13 Mar 2023 14:31:22 +0000 (15:31 +0100)]
Bump base image to support partial clone (#695)
Gerhard Schlager [Mon, 13 Mar 2023 09:58:46 +0000 (10:58 +0100)]
DEV: Create partial clone of discourse repository (#691)
A treeless clone is nearly as small as a shallow clone, but it contains the full history which makes it possible to easily checkout tags and commits and allows all features of docker_manager to work correctly.
See https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ for more information on treeless clones.
Also this change makes it possible to correctly pull the main branch which didn't work before.
Gerhard Schlager [Mon, 13 Mar 2023 09:55:44 +0000 (10:55 +0100)]
DEV: Remove deprecation warnings from bundler (#690)
Gerhard Schlager [Mon, 13 Mar 2023 09:55:15 +0000 (10:55 +0100)]
FIX: Compiling oxipng didn't work on aarch64 (#694)
This uses the new sparse-registry feature from Rust 1.68 which lowers the memory usage. This avoids that cargo is killed due to an OOM issue (exit code 137) during "Updating crates.io index".
Derek J. Lambert [Thu, 9 Mar 2023 02:04:11 +0000 (20:04 -0600)]
Compile oxipng from source (#688)
* Download and compile oxipng from source
* Move oxipng install step after rust since it uses cargo
Rafael dos Santos Silva [Fri, 24 Feb 2023 14:39:14 +0000 (11:39 -0300)]
Bump base image for Ruby 3.2 (#682)
Andrew Schleifer [Fri, 17 Feb 2023 04:40:41 +0000 (04:40 +0000)]
Bump default base image to discourse/base:2.0.
20230217-0055
Rafael dos Santos Silva [Fri, 17 Feb 2023 23:04:22 +0000 (20:04 -0300)]
DEV: Bump Ruby to 3.2.1 (#650)
* DEV: Bump Ruby to 3.2.0
* Add libffi-dev
* Ruby 3.2.1
Jarek Radosz [Thu, 16 Feb 2023 11:07:09 +0000 (12:07 +0100)]
DEV: Remove `Press any key` from arm64 path (#675)
Gabe Pacuilla [Tue, 14 Feb 2023 04:01:50 +0000 (23:01 -0500)]
DEV: update ImageMagick to 7.1.0-62 (#679)
Leonardo Mosquera [Mon, 13 Feb 2023 23:19:47 +0000 (20:19 -0300)]
Correct parameter naming for PTY.spawn (#678)
Per the docs, first parameter for the block is STDOUT + STDERR, 2nd one is STDIN:
https://ruby-doc.org/3.1.3/exts/pty/PTY.html#method-c-spawn
As it is now, the method looks like it's reading from STDIN, though in
fact it's reading from an incorrectly named parameter for STDOUT.
Rafael dos Santos Silva [Fri, 3 Feb 2023 19:47:47 +0000 (16:47 -0300)]
FIX: Relax min kernel version (#674) [ci skip]
Users reported Discourse installing fine on kernel 4.4+.
See https://meta.discourse.org/t/kernel-version-upgrade-required-when-manually-updating-discourse/253756?u=falco
Rafael dos Santos Silva [Tue, 31 Jan 2023 18:31:02 +0000 (15:31 -0300)]
Add kernel version check (#673) [ci skip]
On Ruby 3.1 there is a `RuntimeException` when calling `Random.urandom` on platforms where it's not properly implemented, which includes people running Ubuntu 14.04 with kernel 3.13.
See
https://meta.discourse.org/t/docker-build-broken-site-down/252047
https://meta.discourse.org/t/undefined-method-deprecated-for-nil-nilclass-on-rebuild/251711
https://meta.discourse.org/t/discourse-update-error/253197
https://meta.discourse.org/t/bootstrap-failure-during-most-recent-upgrade/253424
David Taylor [Mon, 30 Jan 2023 16:06:46 +0000 (16:06 +0000)]
FIX: Perform git operations as owning user (#672)
The `git` version in our discourse_test docker image was recently updated to include a permissions check before running any git commands. For this to pass, git operations must be performed by the user which owns the git repository's directory.
Andrew Engelbrecht [Thu, 26 Jan 2023 22:21:25 +0000 (17:21 -0500)]
Merge branch 'main' into fsf-master
Rafael dos Santos Silva [Wed, 18 Jan 2023 15:10:43 +0000 (12:10 -0300)]
Bump base image for ImageMagick SVG fix
Rafael dos Santos Silva [Fri, 13 Jan 2023 02:35:56 +0000 (23:35 -0300)]
Add explicit SVG delete to ImageMagick
Rafael dos Santos Silva [Thu, 12 Jan 2023 03:51:54 +0000 (00:51 -0300)]
Bump stable image
David Taylor [Tue, 10 Jan 2023 20:43:35 +0000 (20:43 +0000)]
Fix permissions error in dev image (#666)
Andrew Engelbrecht [Wed, 4 Jan 2023 20:36:09 +0000 (15:36 -0500)]
Merge branch 'main' into fsf-master
David Taylor [Tue, 3 Jan 2023 17:58:51 +0000 (17:58 +0000)]
discourse_dev: use local bundler directory for temp install (#662)
discourse_dev installs a temporary version of Discourse to create a pre-migrated database. Previously this was installing gems in the global bundler directory, which could lead to permissions errors. This commit makes it use a local vendor directory, just like we do in the production install of Discourse.
David Taylor [Tue, 3 Jan 2023 17:29:46 +0000 (17:29 +0000)]
Update deprecated `::set-output` in GitHub actions workflow (#664)
David Taylor [Tue, 3 Jan 2023 17:20:49 +0000 (17:20 +0000)]
discourse_test: Only apply `ENTRYPOINT` to release image (#663)
The slim images aren't able to run the full `rake docker:test` task, so having it as the entrypoint doesn't make sense. We only want it as the entrypoint on `discourse_test:release`
David Taylor [Tue, 3 Jan 2023 16:36:36 +0000 (16:36 +0000)]
Use larger GitHub actions workers (#661)
Larger workers will be used for non-cron triggers to improve feedback-loop time when actively working on changes to the repository
David Taylor [Fri, 30 Dec 2022 20:11:52 +0000 (20:11 +0000)]
Fix tagging
David Taylor [Fri, 30 Dec 2022 12:45:32 +0000 (12:45 +0000)]
DEV: Allow booting app with slim image and make default for aarch46
Rafael dos Santos Silva [Fri, 30 Dec 2022 16:03:59 +0000 (13:03 -0300)]
Revert "Revert last nginx bump"
This reverts commit
f2d598c2cd2341b1b18bf040e6349678edc55b1b.
We fixed the nginx.config in core to work with latest nginx
Rafael dos Santos Silva [Wed, 28 Dec 2022 23:10:13 +0000 (20:10 -0300)]
Revert last nginx bump
Still investigating, but something between a Discourse site being
proxied as unicorn>nginx>haproxy>cloudflare broke on the new nginx.
Rafael dos Santos Silva [Wed, 28 Dec 2022 15:11:38 +0000 (12:11 -0300)]
Automatic old image switch for stable
David Taylor [Wed, 28 Dec 2022 14:47:34 +0000 (14:47 +0000)]
Revert "bump base image for Ruby 3.1.3" (#653)
This reverts commit
0595fc28210d1b563723b31baf55995afe856caf.
The new image is currently incompatible with the Discourse stable branch.
Rafael dos Santos Silva [Tue, 27 Dec 2022 18:50:41 +0000 (15:50 -0300)]
bump base image for Ruby 3.1.3
Rafael dos Santos Silva [Tue, 20 Dec 2022 22:16:26 +0000 (19:16 -0300)]
Update Ruby to 3.1.3 and deps bump
Rafael dos Santos Silva [Tue, 20 Dec 2022 22:05:51 +0000 (19:05 -0300)]
Revert "Update Ruby to 3.2"
This reverts commit
c8837e7516c92650d35d28afdd791c986c415cba.
Rafael dos Santos Silva [Tue, 20 Dec 2022 22:05:36 +0000 (19:05 -0300)]
Revert "bump deps"
This reverts commit
b1d243400cd43359769e1ba6ca7219a9e5e2a4a4.
Rafael dos Santos Silva [Tue, 20 Dec 2022 16:15:18 +0000 (13:15 -0300)]
bump deps
Rafael dos Santos Silva [Thu, 1 Dec 2022 23:57:42 +0000 (20:57 -0300)]
Update Ruby to 3.2
Andrew Engelbrecht [Fri, 18 Nov 2022 20:35:19 +0000 (15:35 -0500)]
Merge branch 'main' into fsf-master
Jarek Radosz [Tue, 15 Nov 2022 11:16:05 +0000 (12:16 +0100)]
FEATURE: Update node to version 18.x (#646)
Jarek Radosz [Tue, 15 Nov 2022 11:15:54 +0000 (12:15 +0100)]
FEATURE: Add `pnpm` to the base slim image (#645)
Andrew Engelbrecht [Wed, 5 Oct 2022 20:28:56 +0000 (16:28 -0400)]
Merge branch 'main' into fsf-master
Glenn Adams [Sun, 25 Sep 2022 05:20:09 +0000 (00:20 -0500)]
Ubuntu Jammy (22.04) doesn't have libwebp6
Conditionally use libwebp7 on Jammy. N.B. This conditionalization should probably be generalized.
Andrew Engelbrecht [Mon, 26 Sep 2022 15:38:16 +0000 (11:38 -0400)]
Merge branch 'main' into fsf-master
David Taylor [Sat, 17 Sep 2022 12:22:34 +0000 (13:22 +0100)]
FIX: Reorder yarn/bundle install for compatibility (#642)
Some existing templates (e.g. those written by following [the multisite guide](https://meta.discourse.org/t/multisite-configuration-with-docker/14084) use the `after_bundle_exec` hook to run application code like `multisite:migrate`. Relatively recently, the ruby app has started depending on `yarn` dependencies for basic functionality, and therefore requires `yarn install` to have been run to avoid errors.
This commit moves the `yarn install` step before `bundle install`, so that existing users of the `after_bundle_exec` hook do not need to update their templates.
Gabe Pacuilla [Mon, 12 Sep 2022 22:34:27 +0000 (18:34 -0400)]
FIX: use proper acmesh-official upstream repo (#641)
Andrew Schleifer [Thu, 18 Aug 2022 12:54:35 +0000 (12:54 +0000)]
Bump default base image to discourse/base:2.0.
20220818-0047
Andrew Schleifer [Wed, 20 Jul 2022 09:53:12 +0000 (09:53 +0000)]
Bump default base image to discourse/base:2.0.
20220720-0049
Andrew Engelbrecht [Wed, 13 Jul 2022 18:54:29 +0000 (14:54 -0400)]
Merge branch 'main' into fsf-master
David Taylor [Wed, 13 Jul 2022 16:16:26 +0000 (17:16 +0100)]
FIX: Run `yarn install` when building development image (#638)
The rails app now leans on JS dependencies being present in node_modules
David Taylor [Wed, 13 Jul 2022 13:04:27 +0000 (14:04 +0100)]
DEV: Use yarn `--frozen-lockfile` in production (#637)
This ensures that a `yarn install` will never modify the lockfile. We always want to use the lockfile from source control.
Andrew Schleifer [Tue, 21 Jun 2022 05:54:36 +0000 (05:54 +0000)]
Bump default base image to 2.0.
20220621-0049
Andrew Schleifer [Tue, 21 Jun 2022 07:19:11 +0000 (07:19 +0000)]
slim: use apt-get instead of apt
WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.
Also apply some DEBIAN_FRONTEND=noninteractive because this is running
in CI.
David Taylor [Mon, 20 Jun 2022 18:12:17 +0000 (19:12 +0100)]
DEV: Remove Ember CLI flag from templates (#633)
Ember CLI assets are now the only option in Discourse. This flag is now a no-op.
Jarek Radosz [Mon, 13 Jun 2022 22:10:43 +0000 (00:10 +0200)]
FIX: Update the macOS memory check (#632)
`free` is not available by default on macOS
Jarek Radosz [Tue, 31 May 2022 11:01:37 +0000 (13:01 +0200)]
FIX: Unset RAILS_ENV to allow running both dev stuff and test (#629)
Trying to run specs with RAILS_ENV=development ends up like:
```
/usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30: warning: ⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis.
Randomized with seed 1716
FF
Failures:
1) CategoryBadge escapes HTML in category names / descriptions
Failure/Error: DB.test_transaction = ActiveRecord::Base.connection.current_transaction
NoMethodError:
undefined method `test_transaction=' for #<MiniSqlMultisiteConnection:0x000055a7662ea1e0>
# ./spec/rails_helper.rb:284:in `block (2 levels) in <top (required)>'
# ./spec/rails_helper.rb:277:in `block (2 levels) in <top (required)>'
```
Gabe Pacuilla [Tue, 3 May 2022 15:54:24 +0000 (11:54 -0400)]
DEV: Ensure secure file permissions by default (#627)
`discourse-setup` will now ensure container definitions are
installed with `0600` permissions mode only.
`launcher` will now throw a warning when an existing container
definition is world-readable.
Also clean up leftover `launcher setup` logic which no longer exists.
Merge pre-existing logic into `check_prereqs` function.
Michael Brown [Tue, 3 May 2022 00:41:07 +0000 (20:41 -0400)]
FIX: ensure the latest image is always pulled for the container we're building
If the user has overridden the `base_image` to something other than default, we
may not get the latest version of that image when bootstrapping.
To remedy, always pull the image to check the manifest after we parse it out.
Jarek Radosz [Fri, 29 Apr 2022 18:28:47 +0000 (20:28 +0200)]
FIX: rsyslog uses `adm` group now (#625)
`syslog` group doesn't exist anymore and:
```
# grep -i 'group' /etc/rsyslog.conf
$FileGroup adm
```
Jarek Radosz [Fri, 29 Apr 2022 12:19:37 +0000 (14:19 +0200)]
DEV: Add usage info to auto_build script (#626)
Jarek Radosz [Fri, 29 Apr 2022 10:18:10 +0000 (12:18 +0200)]
DEV: Don't install eslint and babel-eslint (#624)
Core has eslint in its dependencies, so there's no need for global eslint as far I can tell.
Jarek Radosz [Fri, 29 Apr 2022 10:18:02 +0000 (12:18 +0200)]
DEV: Fix workflow formatting (#623)
and update actions/checkout version
Jarek Radosz [Fri, 29 Apr 2022 09:40:27 +0000 (11:40 +0200)]
DEV: Update readme (#622)
Rafael dos Santos Silva [Mon, 18 Apr 2022 21:34:53 +0000 (18:34 -0300)]
Always pull image on arm
Alan Guo Xiang Tan [Wed, 13 Apr 2022 04:22:53 +0000 (12:22 +0800)]
Alan Guo Xiang Tan [Wed, 13 Apr 2022 02:33:37 +0000 (10:33 +0800)]
Bump base Ruby version to 2.7.6
Pulls in fix for CVE-2022-28739
https://www.ruby-lang.org/en/news/2022/04/12/buffer-overrun-in-string-to-float-cve-2022-28739/
Andrew Engelbrecht [Tue, 12 Apr 2022 18:48:32 +0000 (14:48 -0400)]
Merge branch 'main' into fsf-master
Stefan Weil [Tue, 5 Apr 2022 09:27:51 +0000 (11:27 +0200)]
Fix some typos (found by codespell) (#613)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Michael Brown [Thu, 31 Mar 2022 16:28:55 +0000 (12:28 -0400)]
CLEANUP: literally this was my own feedback on my own changes I forgot to push before merging
Michael Brown [Thu, 31 Mar 2022 02:47:08 +0000 (22:47 -0400)]
Add label showing image creation time on commit
Michael Brown [Thu, 31 Mar 2022 02:46:34 +0000 (22:46 -0400)]
Cleanup code in the bootstrap function
I came here to do something else, but could not help cleaning up the bootstrap
code.
* add die() helper
* pull the container ID into an environment variable right away instead of
interpolating it every time
* we don't need to write out to a file prior to piping it into docker
* use $() instead of backticks
* tidied up messaging from failed docker commits
Grant [Thu, 24 Mar 2022 22:51:41 +0000 (22:51 +0000)]
FIX: pg_basebackup parameter in take-database-backup (#611)
take-database-backup tries to use pg_baseback --xlog parameter which
was remove in postgres >=10.
Jarek Radosz [Tue, 15 Mar 2022 09:43:10 +0000 (10:43 +0100)]
DEV: Make wget consistently quiet (#612)
That firefox download is ~1.5k log lines long. 😅
Gabe Pacuilla [Mon, 14 Mar 2022 23:22:43 +0000 (19:22 -0400)]
DEV: use consistent third-party installation method (#610)
* DEV: use consistent third-party installation method
* FIX: slim base image build on aarch64
Gabe Pacuilla [Fri, 4 Mar 2022 20:38:33 +0000 (15:38 -0500)]
DEV: use proper upstream repo path for ruby-build (#609)
Fernando (Ariznaf) [Thu, 3 Mar 2022 13:11:35 +0000 (14:11 +0100)]
Add support for btrfs storage driver in docker
After several months of using btrfs in our forum in production with no issue, I can say that btrfs seems quite stable and I am proposing to add it to the supported storage drivers under docker.
Using btrfs makes it a breeze to take snapshots and revert to a previous state of discourse, and taking backups with minimal forum interrupt time.
Here is a discussion about it in discourse forum:
https://meta.discourse.org/t/unable-to-rebuild-app-not-supported-docker-storage-driver-btrfs/209200/14
Eleni Michalaki [Thu, 3 Mar 2022 15:27:22 +0000 (16:27 +0100)]
Bump base image
Gabe Pacuilla [Thu, 24 Feb 2022 19:14:33 +0000 (14:14 -0500)]
DEV: compile redis with TLS support in our base image (#606)
Rafael dos Santos Silva [Wed, 23 Feb 2022 19:03:53 +0000 (16:03 -0300)]
FIX: Worker connections are set on nginx.conf
Rafael dos Santos Silva [Thu, 17 Feb 2022 19:54:08 +0000 (16:54 -0300)]
FEATURE: Bump and allow customization of nginx worker_processes
MessageBus connections on busy sites can easily use more than the max
default number of connections.
Refer to http://nginx.org/en/docs/ngx_core_module.html#worker_connections
Jarek Radosz [Thu, 27 Jan 2022 23:25:38 +0000 (00:25 +0100)]
Fix checksums
Jarek Radosz [Thu, 27 Jan 2022 23:14:25 +0000 (00:14 +0100)]
DEV: Update nginx
Jarek Radosz [Thu, 27 Jan 2022 23:14:15 +0000 (00:14 +0100)]
DEV: Update ImageMagick
Jarek Radosz [Thu, 27 Jan 2022 23:00:00 +0000 (00:00 +0100)]
DEV: Update oxipng to 5.0.1