132 Commits

Author SHA1 Message Date
Kazunori Kimura
9f5961939d Allow patching Ruby, add patch for lib/securernadom.rb
Backport: fix behavior of `SecureRandom.gen_random_openssl(n)`
commit:
64e503eb62

This has been merged into the Ruby 3.3 release, but Ruby (at least) 3.0 and later are affected by the issues fixed by this commit.
2024-02-13 04:27:50 +09:00
Kazunori Kimura
e636b969a9 Revise build patch structure
to allow patching each middleware or library

Just move patches to assets/build/patches/gitlabhq
Folder name are matched to assets/runtime/config
2024-02-13 04:27:50 +09:00
Kazunori Kimura
1c286f72d1 Remove trailing whitespace in patch for assets:compile
to suppress warning on build like below:

    Applying patch /etc/docker-gitlab/build/patches/0004-fix-raketask-gitlab-assets-compile.patch for gitlab-foss...
    <stdin>:15: trailing whitespace.
           removal_targets += Dir.children(Tasks::Gitlab::Assets::PUBLIC_ASSETS_DIR).map {|child| File.join(Tasks::Gitlab::Assets::PUBLIC_ASSETS_DIR, child)}
    warning: 1 line adds whitespace errors.
2024-01-30 06:39:52 +00:00
Kazunori Kimura
9345235f27 Replace removed function in patch for assets::compile
`Dir.exists?(file_name) -> bool` have been deprecated since Ruby 2.1
and removed on Ruby 3.2.
See https://bugs.ruby-lang.org/issues/17391

Replacement is `Dir.exist?(file_name) -> bool`.
2024-01-30 06:39:52 +00:00
Steven Achilles
5b092729fa
Merge pull request #2884 from kkimurak/issue/2866-fix-assets_webpack_manifest.json-not-found
Add build patch to prevent rake task assets:compile to remove assets dir
2024-01-19 22:53:40 +01:00
Kazunori Kimura
3885a455d1 Add build patch to prevent rake task assets:compile to remove assets dir
GitLab does not launch after second run if relative url is used.
This is caused by following upstream change to remove assets directory on assets compile.
See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103715

This is introduced on v15.6.0
````sh
$ git -C ../gitlab.git/ tag --contains e46d92c0 | sort --version-sort | head -n 1
v15.6.0-ee
````

1. `sameersbn/gitlab` create symbolic link /home/git/gitlab/public/assets/
  to point /home/git/data/tmp/assets if relative url is used.
  This is to store assets in the docker volume to avoid unnecessary recompilations.
  These assets are removed and recompiled only when the gitlab version or relative url root is changed.
2. By the change provided by gitlab.com/gitlab-org/gitlab!103715,
  rake task `gitlab:assets:compile` became to remove assets directory directly (by `FileUtils.rm_rf()`).
  It does not remove compiled assets itself, but remove symlink /home/git/gitlab/public/assets .
  Then it compiles assets as usual, but they will be stored in newly-created normal directory /home/git/gitlab/public/assets/
3. On container down, whole container statement (except volumes) will be reset.
  These compiled assets will be removed as well because they are not in docker volume.
4. As we store version info and relative url root path to /home/git/data/tmp/,
  we cannot recognize we have to recompile assets (that have been removed by mistake)

To avoid the issue, this commit add a build time patch to change the behavior of rake task `gitlab:assets:compile`
to empty assets instead of removing assets directory itself.
2024-01-18 18:10:26 +09:00
Kazunori Kimura
d16119b54b Remove ajv as an explicit dependency
There was an issue that `ajv` is not installed by mistake.
This issue have been fixed on upstream, a few years ago.

Now, we can revert the change.
This commit partially reverts 985d57afb9673b2f5acb1f12cbc13f230f6ec074
See sameersbn/gitlab#1358

It seems that fix MR on upstream is https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14543
but we cannot check diff because source / target branch removed by mistake

Anyway, no need to add ajv as an explicit dependency with (at least) gitlab v11 or later
2024-01-18 15:42:17 +09:00
Kazunori Kimura
da0d78bf5b Add build patch to avoid removing node_modules
note: Only affected if using the relative_url feature

`gitlab/script/frontent/preinstall.mjs` is introduced since v16.4.0.
This script is executed on container startup, if using the relative url.
This script removes `NODE_MODULES` (/home/git/gitlab/node_modules) when
"the folder seems to end up being a corrupted somehow"
See more detail:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130938

On sameersbn/gitlab, the folder node_modules is declared as volume.
The volume is always busy so that cannot be removed in the container.
You can see following error reported on container startup
(sameersbn/gitlab:16.4.0 or later).

````
yarn install v1.22.19
$ node ./scripts/frontend/preinstall.mjs
[WARNING] package.json changed significantly. Removing node_modules to be sure there are no problems. node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

[Error: EBUSY: resource busy or locked, rmdir '/home/git/gitlab/node_modules'] {
  errno: -16,
  code: 'EBUSY',
  syscall: 'rmdir',
  path: '/home/git/gitlab/node_modules'
}

Node.js v18.17.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. -----
````

This PR add a build time patch to change the behavior of
script/frontend/preinstall.mjs to not to remove node_modules directly,
but empty it instead.
2023-10-21 01:24:39 +09:00
Steven Achilles
2fb3680976 Remove temporary patch for lfs object URL (see c51770292e) 2023-09-02 08:28:56 +02:00
Steven Achilles
c51770292e Add temporary patch for lfs object URL 2023-08-23 18:57:51 +02:00
Steven Achilles
230284ebcf Do not copy ruby by installing gitaly 2023-05-25 18:14:23 +02:00
Steven Achilles
5fc732eb3c Add new configuration options for database.yml 2023-05-25 06:44:20 +02:00
Kazunori Kimura
029186dc63 Avoid permission error on creating config file
`assets/build/config/database.yml.postgresql` is owned by root:root,
and permission is rwxrw----
so the user `git` (`${GILTAB_USER}`) doesn't have a permission to copy the file.
This raises an error while building.
2023-04-17 16:06:35 +09:00
Steven Achilles
5450187484
Merge pull request #2735 from zimmski/enable-git-protocol-2
Allow SSH clients to explicitly set the Git transfer protocol
2023-04-12 16:17:53 +02:00
Kazunori Kimura
95bc778ee0 Silence "CRIT unixServer" warning from supervisord
Silence the message like below:
  CRIT Server 'unix_http_server' running without any HTTP authentication checking

Reference:
  https://github.com/Supervisor/supervisor/issues/717#issuecomment-176860145
  https://github.com/sameersbn/docker-redmine/commit/0fb84b9
2023-03-31 03:01:19 +09:00
Markus Zimmermann
4bfc8974ba
Allow SSH clients to explicitly set the Git transfer protocol
This allows to the client to explicitly select protocol version 2, which is much more efficient. Without allowing that environment variable it seems that SSH connections are always stuck in version1.  See https://docs.gitlab.com/ee/administration/git_protocol.html on how to check if protocol 2 is used.
2023-03-24 11:55:42 +01:00
Kazunori Kimura
a1dcfe6eaf Update sidekiq supervisord config; sidekiq v6.0
Sidekiq is updated to v6.0 here (first contained tag: v14.4.0-ee)
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69655

In Sidekiq 6.0, these options have been marked as "deprecated":
-P (set pid file)
-L (set log file)
See https://github.com/sidekiq/sidekiq/commit/3f5b1c5

Now, we can see error message in {GITLAB_LOGS_DIR}/supervisor/sidekiq.log
like below:

----
ERROR: PID file creation was removed in Sidekiq 6.0, please use a proper process supervisor to start and manage your services
ERROR: Logfile redirection was removed in Sidekiq 6.0, Sidekiq will only log to STDOUT
----

Just stop using this option.
2023-02-22 20:42:51 +09:00
Kazunori Kimura
10a48c1541 Clarify user=root in supervisord.conf
to prevent "Supervisor running as root" warning
2023-02-22 20:42:51 +09:00
Antt1995
8db9ed8908
Upgrade Go & safe dir 2022-11-23 15:14:40 +00:00
Steven Achilles
5c9c5cad1b Temporary remove geo from config/database.yml 2022-07-02 15:49:54 +02:00
Kazunori Kimura
fbcdd290be fix condition to apply patch during build gitlab
rewrite patch applying with find | while read chain
`if [[ -f ]]` with globbing may not works
2022-06-21 08:46:32 +09:00
Steven Achilles
0badf7cdd7 Use git instead of git-core 2022-05-05 19:53:52 +02:00
Steven Achilles
64e6256012 transfer build packages from Dockerfile to install.sh 2022-05-03 19:36:22 +02:00
Steven Achilles
889d9c36bf collective deletion of packages 2022-05-03 19:14:50 +02:00
Steven Achilles
a02abdce2d Address inconsistencies when using git (packaged with gitaly). 2022-05-03 17:58:58 +02:00
Paolo Mainardi
21b459216b refs #2549: Install git from gitaly 2022-04-29 17:19:40 +02:00
Kazunori Kimura
464cd644d6 set bundler version based on gitlab's Gemfile.lock
bundler used in gitlab is upgraded from 2.1.4 to 2.3.6
See more detail on : https://gitlab.com/gitlab-org/gitlab/-/merge_requests/79251
first contained tag : v14.8.0
2022-04-14 00:30:26 +09:00
Olivier Mueller
3ab737d218 Fix suggested by Kazunori Kimura 2022-03-23 13:02:14 +01:00
Kazunori Kimura
af9bfee78f add patch to change SSH_ALGORITHMS_PATH
To enable ssh host key info in help page
2022-01-26 00:23:40 +09:00
Steven Achilles
e83bb7e17a Rename/remove build patch for gitlab-foss
- Expand if condition so that non-existent gitlab patches are not a problem
2021-12-23 13:04:38 +01:00
Steven Achilles
6c0888b669 Add make target for gitlab-shell 2021-10-19 22:18:11 +02:00
Steven Achilles
3232a10fe4 Update base image, fix problems compiling gitlab-shell and complete changelog 2021-10-19 21:41:12 +02:00
Steven Achilles
1d6fa315f2
Merge pull request #2429 from kkimurak/install-ruby-from-source
Install ruby from source
2021-10-19 21:01:53 +02:00
Steven Achilles
c36fc17354
Add variable for the source url of ruby
I think that defining a variable for the source of the Ruby tarball makes sense.
2021-10-19 20:00:55 +02:00
Kazunori Kimura
47d17b6ffb remove duplicated installation of bundler
`bundler 2.1.4` is default gem of ruby >= 2.7.1 and installed during ruby installation
so we don't need to install it explicitly.
2021-10-10 23:51:57 +09:00
Kazunori Kimura
f8f2190826 supress build time warnings
- [git] set advice.detachHead=false
- [bundle] use `bundle config set --local` instead of
  - `--deployment`
  - `--with` / `--without`
  arguments for `bundle install`
2021-10-09 15:56:07 +09:00
Kazunori Kimura
173e5e25a3 Install ruby from source (v2.4.2) 2021-10-09 15:45:11 +09:00
Steven Achilles
93a47b7d75 Update patch '0001-fix-feature-checking-for-gitaly-on-a-fresh-install.patch' 2021-08-24 21:19:06 +02:00
Kazunori Kimura
4ccb8eefb5 Support healthcheck with relative URL
traditional one with relative url always returns 404 (unhealthy).
Now we can use ${GITLAB_RELATIVE_URL_ROOT} variable to set healcheck URL
after moving script generation to runtime,
2021-04-08 21:12:19 +09:00
intec_bf
82630d2d93 use Ubuntu 20.04 as base image 2021-04-06 12:06:41 +02:00
intec_bf
af6bfcb789 workhorse is now bundled with gitlab 2021-03-22 21:55:05 +01:00
intec_bf
2d0159b61d reduce image size 2020-12-02 22:57:31 +01:00
Constantin Wildförster
3f349977f5 update patch to work on gitlab 13.2.0+ 2020-08-02 17:15:51 +02:00
Carlos Álvaro
31325c1007 fix: healthcheck and GITLAB_HTTPS=true
Follow redirects
Allow connections to SSL sites without certs
2020-05-27 21:09:51 +02:00
Carlos Álvaro
74013d82ab feat: Add healthcheck for gitlab service 2020-05-26 18:10:55 +02:00
Aurélien Chrétien
f377eda47a
handle new gitaly logs correctly 2020-05-06 12:20:47 +02:00
Sameer Naik
4422e1c4a0
remove "Fix for rebase in forks" 2020-05-06 10:05:01 +05:30
Sameer Naik
452062d9fe
build: clean up build caches from bundle and go steps 2020-05-03 10:23:42 +05:30
Niclas Mietz
e87f29c2a3
Upgrade to 12.9.0 (#2117)
* Upgrade GitLab CE to 12.9.0

* Update gitlab-shell to 12.0.0

Signed-off-by: solidnerd <niclas@mietz.io>

* Update gitlab-workhorse to 8.25.0

Signed-off-by: solidnerd <niclas@mietz.io>

* Update gitlab-pages to 1.17.0

Signed-off-by: solidnerd <niclas@mietz.io>

* Update gitaly to 12.9.0-rc42

Signed-off-by: solidnerd <niclas@mietz.io>

* feat: replace unicorn with puma as webserver

Signed-off-by: solidnerd <niclas@mietz.io>
2020-04-04 10:08:52 +02:00
Niclas Mietz
67a5fc30b4
Upgrade to 12.8.0 (#2090)
* Upgrade GitLab CE to 12.8.0

* Update gitlab-workhorse to 8.21.0

Signed-off-by: solidnerd <niclas@mietz.io>

* Update gitlab-pages to 1.16.0

Signed-off-by: solidnerd <niclas@mietz.io>

* Update gitaly to 12.8.0

Signed-off-by: solidnerd <niclas@mietz.io>

* fix: gitaly-hooks missing symlink

Signed-off-by: solidnerd <niclas@mietz.io>

* chore(base-image): update base image to 20200219

* fix: unicorn worker limits

Signed-off-by: solidnerd <niclas@mietz.io>

* fix(ci): disable caching

Signed-off-by: solidnerd <niclas@mietz.io>

* feat: add patch support for gitlab during the installation

Signed-off-by: solidnerd <niclas@mietz.io>

* fix: ArgumentError: 'import/{{oauth2_generic_name}}' is not a supported controller name

Closes #2101

Signed-off-by: solidnerd <niclas@mietz.io>

* fix: add fix for upstream gitaly problems during a fresh install

Signed-off-by: solidnerd <niclas@mietz.io>

* chore: update changelog.md
2020-03-29 15:29:09 +02:00