FreeBSD で gitlab-ceを動かす。　途中まで。。。

# gitlab を使う
* github でも個人のプライベートなrepo使うのは、そこそこ便利ですが、プライベートなまま他所様に見てもらうにあたっては、ssh キーを登録しなくちゃなりません。そうすると見てほしくないものもあるわけで、sshキーに 使い分けが出来るのかはっきりしません。

* プライベートな git repo を sshアクセスできるどこかに置くのが正解だとは思うのですが、どうせなら gitlab-ce というものもあるのだし、使ってみるのも一興ということになります。

## インストールまで
* ruby/railsベースであることは薄々知っていました。大体Linux向けオールインワンパッケージで苦労しないんだろうなと思うところがありますが、FreeBSDではそういう情報を見つけられていません。多分探せばありそうですが、ともあれ入れてしまってから悩もうというところです。
* ports から突っ込むと結構かかるのでpkgでやってしまいました。
* 全部で 711 のpkg　が入ります・・・デプロイ・インストールだけで数分かかりました。
* rails系は最近手を出してますので、動かし方はわかるんですが、pkg で入れてしまうとよくわからない。
* FreeBSD では　/usr/local/www/gitlab に入ります。
```
# ls -la
total 1947
drwxr-xr-x  42 git  git       117 Apr  3 13:56 .
drwxr-xr-x   5 root wheel       5 Apr  2 17:25 ..
drwxr-xr-x   2 root wheel      65 Apr  2 17:25 .bin
-rw-r--r--   1 root wheel     324 Mar 26 13:53 .browserslistrc
drwxr-xr-x   2 root wheel       3 Apr  2 17:25 .bundle
-rw-r--r--   1 root wheel     952 Mar 26 13:53 .dockerignore
-rw-r--r--   1 root wheel     681 Mar 26 13:53 .editorconfig
drwxr-xr-x   2 root wheel       4 Apr  2 17:25 .eslint_todo
-rw-r--r--   1 root wheel    5755 Mar 26 13:53 .git-blame-ignore-revs
-rw-r--r--   1 root wheel     112 Mar 26 13:53 .gitattributes
drwxr-xr-x   2 root wheel       4 Apr  2 17:25 .github
drwxr-xr-x   6 root wheel      11 Apr  2 17:25 .gitlab
-rw-r--r--   1 root wheel   15070 Mar 26 13:53 .gitlab-ci.yml
-rw-r--r--   1 root wheel     964 Mar 26 13:53 .gitleaksignore
-rw-r--r--   1 root wheel    5418 Mar 26 13:53 .gitpod.yml
-rw-r--r--   1 root wheel     289 Mar 26 13:53 .graphqlrc
-rw-r--r--   1 root wheel    4930 Mar 26 13:53 .haml-lint.yml
-rw-r--r--   1 root wheel     137 Mar 26 13:53 .index.yml.example
drwxr-xr-x   3 root wheel       4 Apr  2 17:25 .lefthook
-rw-r--r--   1 root wheel     451 Mar 26 13:53 .license_encryption_key.pub
-rw-r--r--   1 root wheel    1961 Mar 26 13:53 .mailmap
-rw-r--r--   1 root wheel    3494 Mar 26 13:53 .markdownlint-cli2.yaml
-rw-r--r--   1 root wheel       8 Mar 26 13:53 .nvmrc
-rw-r--r--   1 root wheel     209 Mar 26 13:53 .prettierignore
-rw-r--r--   1 root wheel     197 Mar 26 13:53 .prettierrc
-rw-r--r--   1 root wheel    7604 Mar 26 13:53 .projections.json.example
drwxr-xr-x   2 root wheel       3 Apr  2 17:25 .rubocop
-rw-r--r--   1 root wheel   29666 Mar 26 13:53 .rubocop.yml
drwxr-xr-x  25 root wheel      25 Apr  2 17:25 .rubocop_todo
-rw-r--r--   1 root wheel       6 Mar 26 13:53 .ruby-version
-rw-r--r--   1 root wheel     397 Mar 26 13:53 .solargraph.yml.example
-rw-r--r--   1 root wheel     889 Mar 26 13:53 .stylelintrc
-rw-r--r--   1 root wheel     451 Mar 26 13:53 .test_license_encryption_key.pub
-rw-r--r--   1 root wheel     242 Mar 26 13:53 .vale.ini
-rw-r--r--   1 root wheel    1406 Mar 26 13:53 .yamllint
-rw-r--r--   1 root wheel      41 Mar 26 13:53 AI_GATEWAY_VERSION
-rw-r--r--   1 root wheel 2021681 Mar 26 13:53 CHANGELOG.md
-rw-r--r--   1 root wheel    3944 Mar 26 13:53 CONTRIBUTING.md
-rw-r--r--   1 root wheel    7658 Mar 26 13:53 DEI.md
-rw-r--r--   1 root wheel       7 Mar 26 13:53 DUO_WORKFLOW_EXECUTOR_VERSION
-rw-r--r--   1 root wheel     841 Mar 26 13:53 Dangerfile
-rw-r--r--   1 root wheel     104 Mar 26 13:53 Dockerfile.assets
-rw-r--r--   1 root wheel       7 Mar 26 13:53 GITALY_SERVER_VERSION
-rw-r--r--   1 root wheel       6 Mar 26 13:53 GITLAB_ELASTICSEARCH_INDEXER_VERSION
-rw-r--r--   1 root wheel       7 Mar 26 13:53 GITLAB_KAS_VERSION
-rw-r--r--   1 root wheel      41 Mar 26 13:53 GITLAB_OPENBAO_VERSION
-rw-r--r--   1 root wheel       7 Mar 26 13:53 GITLAB_PAGES_VERSION
-rw-r--r--   1 root wheel       8 Mar 26 13:53 GITLAB_SHELL_VERSION
-rw-r--r--   1 root wheel       8 Mar 30 13:59 GITLAB_WORKHORSE_VERSION
-rw-r--r--   1 root wheel   27371 Mar 30 13:59 Gemfile
-rw-r--r--   1 root wheel  112740 Mar 26 13:53 Gemfile.checksum
-rw-r--r--   1 git  git     49629 Apr  3 13:56 Gemfile.lock
lrwxr-xr-x   1 root wheel       7 Mar 26 13:53 Gemfile.next -> Gemfile
-rw-r--r--   1 root wheel  114483 Mar 26 13:53 Gemfile.next.checksum
-rw-r--r--   1 root wheel   63291 Mar 26 13:53 Gemfile.next.lock
-rw-r--r--   1 root wheel    2937 Mar 26 13:53 Guardfile
-rw-r--r--   1 root wheel       7 Mar 26 13:53 INSTALLATION_TYPE
-rw-r--r--   1 root wheel    2001 Mar 26 13:53 LICENSE
-rw-r--r--   1 root wheel      88 Mar 26 13:53 MAINTENANCE.md
-rw-r--r--   1 root wheel     216 Mar 26 13:53 PHILOSOPHY.md
-rw-r--r--   1 root wheel     160 Mar 26 13:53 Pipfile
-rw-r--r--   1 root wheel     773 Mar 26 13:53 Pipfile.lock
-rw-r--r--   1 root wheel    5740 Mar 26 13:53 README.md
-r-xr-xr-x   1 root wheel     830 Mar 26 13:53 Rakefile
-rw-r--r--   1 root wheel       7 Mar 26 13:53 VERSION
drwxr-xr-x  23 root wheel      23 Apr  2 17:25 app
-rw-r--r--   1 root wheel    1067 Mar 26 13:53 axe-linter.yml
-rw-r--r--   1 root wheel    1166 Mar 26 13:53 babel.config.js
dr-xr-xr--   2 git  git        30 Mar 30 16:07 bin
drwx------   2 git  www         2 Mar 30 16:07 builds
drwxr-xr-x   2 root wheel      11 Apr  2 17:25 changelogs
drwxr-xr-x  18 git  www        77 Apr  2 17:36 config
-rw-r--r--   1 root wheel     357 Mar 26 13:53 config.ru
-rw-r--r--   1 root wheel     439 Mar 26 13:53 crowdin.yml
drwxr-xr-x  49 root wheel      50 Apr  2 17:25 danger
drwxr-xr-x   4 root wheel       4 Apr  2 17:25 data
drwxr-xr-x  10 root wheel      17 Apr  2 17:25 db
drwxr-xr-x  26 root wheel      28 Apr  2 17:25 doc
-rw-r--r--   1 root wheel      38 Mar 26 13:53 docker-compose.yml
-rw-r--r--   1 root wheel   21701 Mar 26 13:53 eslint.config.mjs
drwxr-xr-x   3 root wheel       3 Apr  2 17:25 file_hooks
drwxr-xr-x   4 root wheel       4 Apr  2 17:25 fixtures
drwxr-xr-x  19 root wheel      22 Apr  2 17:25 gems
drwxr-xr-x   5 root wheel       5 Apr  2 17:25 generator_templates
drwxr-xr-x   3 root wheel       3 Apr  2 17:25 haml_lint
-rw-r--r--   1 root wheel   10680 Mar 26 13:53 jest.config.base.js
-rw-r--r--   1 root wheel     186 Mar 26 13:53 jest.config.contract.js
-rw-r--r--   1 root wheel     202 Mar 26 13:53 jest.config.eslint.js
-rw-r--r--   1 root wheel    1404 Mar 26 13:53 jest.config.integration.js
-rw-r--r--   1 root wheel     640 Mar 26 13:53 jest.config.js
-rw-r--r--   1 root wheel     198 Mar 26 13:53 jest.config.scripts.js
-rw-r--r--   1 root wheel    1306 Mar 26 13:53 jest.config.snapshots.js
-rw-r--r--   1 root wheel     621 Mar 26 13:53 jest_resolver.js
drwxr-xr-x   3 root wheel      13 Apr  2 17:25 keeps
-rw-r--r--   1 root wheel   12148 Mar 26 13:53 lefthook.yml
drwxr-xr-x  61 root wheel      81 Apr  2 17:25 lib
drwxr--r--  80 git  www        82 Mar 26 13:53 locale
drwxr--r--   2 git  www         7 Apr  2 17:36 log
drwxr-xr-x   2 root wheel       7 Apr  2 17:25 metrics_server
-rw-r--r--   1 root wheel   13113 Mar 26 13:53 package.json
drwxr-xr-x   2 root wheel      16 Apr  2 17:25 patches
-rw-r--r--   1 root wheel     178 Mar 26 13:53 postcss.config.js
drwxr-xr-x   5 git  www        15 Apr  2 17:26 public
drwxr-xr-x  14 root wheel      22 Apr  2 17:25 qa
drwxr-xr-x   4 root wheel      19 Apr  2 17:25 rubocop
drwxr-xr-x  23 root wheel      96 Apr  2 17:25 scripts
drwxr-xr-x  11 git  www        11 Mar 30 16:07 shared
drwxr-xr-x   2 root wheel       4 Apr  2 17:25 sidekiq_cluster
drwxr-xr-x  52 root wheel      63 Apr  2 17:25 spec
drwxr-xr-x   5 root wheel       9 Apr  2 17:25 storybook
-rw-r--r--   1 root wheel   17893 Mar 26 13:53 tests.yml
drwxrwx---   9 git  www         9 Mar 30 16:07 tmp
drwxr-xr-x  15 root wheel      18 Apr  2 17:25 tooling
drwxrwx---  15 git  www        17 Mar 30 16:07 vendor
-rw-r--r--   1 root wheel    5320 Mar 26 13:53 vite.config.js
drwxr-xr-x   3 root wheel       3 Apr  2 17:25 workhorse
-rw-r--r--   1 root wheel  743610 Mar 26 13:53 yarn.lock
```
* 例によって [FreeBSD/jail](https://docs.freebsd.org/en/books/handbook/jails/) に入れています。 "#" = rootで入るのが普通。
* rootで入る関係で起動時にお叱りを受けます。
```
Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this machine.
Starting GitLab web server (puma)
Starting GitLab Sidekiq
Starting GitLab Workhorse
Starting Gitaly
.No pidfile found at /usr/local/www/gitlab/tmp/pids/sidekiq-cluster.pid; is Sidekiq running?
.{"timestamp":"2025-04-03T05:17:26.655Z","pid":95476,"message":"Puma starting in cluster mode..."}
{"timestamp":"2025-04-03T05:17:26.660Z","pid":95476,"message":"* Puma version: 6.6.0 (\"Return to Forever\")"}
{"timestamp":"2025-04-03T05:17:26.660Z","pid":95476,"message":"* Ruby version: ruby 3.2.7 (2025-02-04 revision 02ec315244) [amd64-freebsd14]"}
{"timestamp":"2025-04-03T05:17:26.660Z","pid":95476,"message":"*  Min threads: 1"}
{"timestamp":"2025-04-03T05:17:26.660Z","pid":95476,"message":"*  Max threads: 16"}
{"timestamp":"2025-04-03T05:17:26.660Z","pid":95476,"message":"*  Environment: production"}
{"timestamp":"2025-04-03T05:17:26.660Z","pid":95476,"message":"*   Master PID: 95476"}
{"timestamp":"2025-04-03T05:17:26.660Z","pid":95476,"message":"*      Workers: 3"}
{"timestamp":"2025-04-03T05:17:26.660Z","pid":95476,"message":"*     Restarts: (✔) hot (✖) phased"}
{"timestamp":"2025-04-03T05:17:26.660Z","pid":95476,"message":"* Preloading application"}
.........{"timestamp":"2025-04-03T05:17:36.112Z","pid":95476,"message":"! Unable to load application: ActiveRecord::ConnectionNotEstablished: connection to server at \"127.0.0.1\", port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\n"}
bundler: failed to load command: puma (/usr/local/bin/puma)
/usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:87:in `rescue in new_client': connection to server at "127.0.0.1", port 5432 failed: Connection refused (ActiveRecord::ConnectionNotEstablished)
	Is the server running on that host and accepting TCP/IP connections?

	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_handling.rb:280:in `connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/model_schema.rb:407:in `table_exists?'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:95:in `get_primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:83:in `reset_primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:71:in `primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/delegation.rb:93:in `primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/finder_methods.rb:575:in `ordered_relation'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/finder_methods.rb:174:in `last'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/querying.rb:22:in `last'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:19:in `current_without_cache'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:63:in `rescue in current'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:51:in `current'
	from /usr/local/www/gitlab/lib/gitlab/application_setting_fetcher.rb:33:in `uncached_application_settings'
	from /usr/local/www/gitlab/lib/gitlab/application_setting_fetcher.rb:11:in `current_application_settings'
	from /usr/local/www/gitlab/lib/gitlab/current_settings.rb:15:in `block in current_application_settings'
	from /usr/local/www/gitlab/gems/gitlab-safe_request_store/lib/gitlab/safe_request_store/null_store.rb:37:in `fetch'
	from /usr/local/lib/ruby/gems/3.2/gems/forwardable-1.3.3/lib/forwardable.rb:240:in `fetch'
	from /usr/local/www/gitlab/lib/gitlab/current_settings.rb:15:in `current_application_settings'
	from /usr/local/www/gitlab/lib/banzai/filter/asset_proxy_filter.rb:67:in `initialize_settings'
	from /usr/local/www/gitlab/config/initializers/asset_proxy_settings.rb:7:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in `class_eval'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in `block in execute_hook'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:85:in `with_execution_control'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:90:in `execute_hook'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:60:in `block in on_load'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in `on_load'
	from /usr/local/www/gitlab/config/initializers/asset_proxy_settings.rb:6:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:667:in `load'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:667:in `block in load_config_initializer'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/notifications.rb:208:in `instrument'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:666:in `load_config_initializer'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:620:in `block (2 levels) in <class:Engine>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:619:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:619:in `block in <class:Engine>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in `instance_exec'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /usr/local/lib/ruby/3.2/tsort.rb:228:in `block in tsort_each'
	from /usr/local/lib/ruby/3.2/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:431:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:421:in `block in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:50:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:50:in `tsort_each_child'
	from /usr/local/lib/ruby/3.2/tsort.rb:415:in `call'
	from /usr/local/lib/ruby/3.2/tsort.rb:415:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:349:in `block in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `each'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `call'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:226:in `tsort_each'
	from /usr/local/lib/ruby/3.2/tsort.rb:205:in `tsort_each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in `run_initializers'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/application.rb:372:in `initialize!'
	from /usr/local/www/gitlab/config/environment.rb:7:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from config.ru:5:in `block in <main>'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:116:in `eval'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:116:in `new_from_string'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:105:in `load_file'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:66:in `parse_file'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/configuration.rb:386:in `load_rackup'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/configuration.rb:297:in `app'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/runner.rb:169:in `load_and_bind'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/cluster.rb:373:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/launcher.rb:203:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/cli.rb:75:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/bin/puma:10:in `<top (required)>'
	from /usr/local/bin/puma:25:in `load'
	from /usr/local/bin/puma:25:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:59:in `load'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:59:in `kernel_load'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:452:in `exec'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:35:in `dispatch'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:29:in `start'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/exe/bundle:28:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/exe/bundle:20:in `<top (required)>'
	from /usr/local/bin/bundle:25:in `load'
	from /usr/local/bin/bundle:25:in `<main>'
/usr/local/lib/ruby/gems/3.2/gems/pg-1.5.9/lib/pg/connection.rb:709:in `async_connect_or_reset': connection to server at "127.0.0.1", port 5432 failed: Connection refused (PG::ConnectionBad)
	Is the server running on that host and accepting TCP/IP connections?

	from /usr/local/lib/ruby/gems/3.2/gems/pg-1.5.9/lib/pg/connection.rb:844:in `connect_to_hosts'
	from /usr/local/lib/ruby/gems/3.2/gems/pg-1.5.9/lib/pg/connection.rb:772:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/pg-1.5.9/lib/pg.rb:63:in `connect'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_handling.rb:280:in `connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/model_schema.rb:407:in `table_exists?'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:95:in `get_primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:83:in `reset_primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:71:in `primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/delegation.rb:93:in `primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/finder_methods.rb:575:in `ordered_relation'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/finder_methods.rb:174:in `last'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/querying.rb:22:in `last'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:19:in `current_without_cache'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:63:in `rescue in current'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:51:in `current'
	from /usr/local/www/gitlab/lib/gitlab/application_setting_fetcher.rb:33:in `uncached_application_settings'
	from /usr/local/www/gitlab/lib/gitlab/application_setting_fetcher.rb:11:in `current_application_settings'
	from /usr/local/www/gitlab/lib/gitlab/current_settings.rb:15:in `block in current_application_settings'
	from /usr/local/www/gitlab/gems/gitlab-safe_request_store/lib/gitlab/safe_request_store/null_store.rb:37:in `fetch'
	from /usr/local/lib/ruby/gems/3.2/gems/forwardable-1.3.3/lib/forwardable.rb:240:in `fetch'
	from /usr/local/www/gitlab/lib/gitlab/current_settings.rb:15:in `current_application_settings'
	from /usr/local/www/gitlab/lib/banzai/filter/asset_proxy_filter.rb:67:in `initialize_settings'
	from /usr/local/www/gitlab/config/initializers/asset_proxy_settings.rb:7:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in `class_eval'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in `block in execute_hook'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:85:in `with_execution_control'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:90:in `execute_hook'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:60:in `block in on_load'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in `on_load'
	from /usr/local/www/gitlab/config/initializers/asset_proxy_settings.rb:6:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:667:in `load'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:667:in `block in load_config_initializer'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/notifications.rb:208:in `instrument'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:666:in `load_config_initializer'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:620:in `block (2 levels) in <class:Engine>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:619:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:619:in `block in <class:Engine>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in `instance_exec'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /usr/local/lib/ruby/3.2/tsort.rb:228:in `block in tsort_each'
	from /usr/local/lib/ruby/3.2/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:431:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:421:in `block in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:50:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:50:in `tsort_each_child'
	from /usr/local/lib/ruby/3.2/tsort.rb:415:in `call'
	from /usr/local/lib/ruby/3.2/tsort.rb:415:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:349:in `block in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `each'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `call'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:226:in `tsort_each'
	from /usr/local/lib/ruby/3.2/tsort.rb:205:in `tsort_each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in `run_initializers'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/application.rb:372:in `initialize!'
	from /usr/local/www/gitlab/config/environment.rb:7:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from config.ru:5:in `block in <main>'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:116:in `eval'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:116:in `new_from_string'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:105:in `load_file'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:66:in `parse_file'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/configuration.rb:386:in `load_rackup'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/configuration.rb:297:in `app'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/runner.rb:169:in `load_and_bind'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/cluster.rb:373:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/launcher.rb:203:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/cli.rb:75:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/bin/puma:10:in `<top (required)>'
	from /usr/local/bin/puma:25:in `load'
	from /usr/local/bin/puma:25:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:59:in `load'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:59:in `kernel_load'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:452:in `exec'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:35:in `dispatch'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:29:in `start'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/exe/bundle:28:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/exe/bundle:20:in `<top (required)>'
	from /usr/local/bin/bundle:25:in `load'
	from /usr/local/bin/bundle:25:in `<main>'
/usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:87:in `rescue in new_client': connection to server at "127.0.0.1", port 5432 failed: Connection refused (ActiveRecord::ConnectionNotEstablished)
	Is the server running on that host and accepting TCP/IP connections?

	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_handling.rb:280:in `connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/model_schema.rb:407:in `table_exists?'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:95:in `get_primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:83:in `reset_primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:71:in `primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/delegation.rb:93:in `primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/finder_methods.rb:575:in `ordered_relation'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/finder_methods.rb:174:in `last'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/querying.rb:22:in `last'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:19:in `current_without_cache'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:55:in `current'
	from /usr/local/www/gitlab/lib/gitlab/application_setting_fetcher.rb:33:in `uncached_application_settings'
	from /usr/local/www/gitlab/lib/gitlab/application_setting_fetcher.rb:11:in `current_application_settings'
	from /usr/local/www/gitlab/lib/gitlab/current_settings.rb:15:in `block in current_application_settings'
	from /usr/local/www/gitlab/gems/gitlab-safe_request_store/lib/gitlab/safe_request_store/null_store.rb:37:in `fetch'
	from /usr/local/lib/ruby/gems/3.2/gems/forwardable-1.3.3/lib/forwardable.rb:240:in `fetch'
	from /usr/local/www/gitlab/lib/gitlab/current_settings.rb:15:in `current_application_settings'
	from /usr/local/www/gitlab/lib/banzai/filter/asset_proxy_filter.rb:67:in `initialize_settings'
	from /usr/local/www/gitlab/config/initializers/asset_proxy_settings.rb:7:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in `class_eval'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in `block in execute_hook'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:85:in `with_execution_control'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:90:in `execute_hook'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:60:in `block in on_load'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in `on_load'
	from /usr/local/www/gitlab/config/initializers/asset_proxy_settings.rb:6:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:667:in `load'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:667:in `block in load_config_initializer'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/notifications.rb:208:in `instrument'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:666:in `load_config_initializer'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:620:in `block (2 levels) in <class:Engine>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:619:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:619:in `block in <class:Engine>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in `instance_exec'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /usr/local/lib/ruby/3.2/tsort.rb:228:in `block in tsort_each'
	from /usr/local/lib/ruby/3.2/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:431:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:421:in `block in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:50:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:50:in `tsort_each_child'
	from /usr/local/lib/ruby/3.2/tsort.rb:415:in `call'
	from /usr/local/lib/ruby/3.2/tsort.rb:415:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:349:in `block in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `each'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `call'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:226:in `tsort_each'
	from /usr/local/lib/ruby/3.2/tsort.rb:205:in `tsort_each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in `run_initializers'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/application.rb:372:in `initialize!'
	from /usr/local/www/gitlab/config/environment.rb:7:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from config.ru:5:in `block in <main>'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:116:in `eval'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:116:in `new_from_string'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:105:in `load_file'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:66:in `parse_file'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/configuration.rb:386:in `load_rackup'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/configuration.rb:297:in `app'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/runner.rb:169:in `load_and_bind'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/cluster.rb:373:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/launcher.rb:203:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/cli.rb:75:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/bin/puma:10:in `<top (required)>'
	from /usr/local/bin/puma:25:in `load'
	from /usr/local/bin/puma:25:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:59:in `load'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:59:in `kernel_load'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:452:in `exec'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:35:in `dispatch'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:29:in `start'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/exe/bundle:28:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/exe/bundle:20:in `<top (required)>'
	from /usr/local/bin/bundle:25:in `load'
	from /usr/local/bin/bundle:25:in `<main>'
/usr/local/lib/ruby/gems/3.2/gems/pg-1.5.9/lib/pg/connection.rb:709:in `async_connect_or_reset': connection to server at "127.0.0.1", port 5432 failed: Connection refused (PG::ConnectionBad)
	Is the server running on that host and accepting TCP/IP connections?

	from /usr/local/lib/ruby/gems/3.2/gems/pg-1.5.9/lib/pg/connection.rb:844:in `connect_to_hosts'
	from /usr/local/lib/ruby/gems/3.2/gems/pg-1.5.9/lib/pg/connection.rb:772:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/pg-1.5.9/lib/pg.rb:63:in `connect'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/connection_handling.rb:280:in `connection'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/model_schema.rb:407:in `table_exists?'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:95:in `get_primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:83:in `reset_primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/attribute_methods/primary_key.rb:71:in `primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/delegation.rb:93:in `primary_key'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/finder_methods.rb:575:in `ordered_relation'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/relation/finder_methods.rb:174:in `last'
	from /usr/local/lib/ruby/gems/3.2/gems/activerecord-7.0.8.7/lib/active_record/querying.rb:22:in `last'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:19:in `current_without_cache'
	from /usr/local/www/gitlab/app/models/concerns/cacheable_attributes.rb:55:in `current'
	from /usr/local/www/gitlab/lib/gitlab/application_setting_fetcher.rb:33:in `uncached_application_settings'
	from /usr/local/www/gitlab/lib/gitlab/application_setting_fetcher.rb:11:in `current_application_settings'
	from /usr/local/www/gitlab/lib/gitlab/current_settings.rb:15:in `block in current_application_settings'
	from /usr/local/www/gitlab/gems/gitlab-safe_request_store/lib/gitlab/safe_request_store/null_store.rb:37:in `fetch'
	from /usr/local/lib/ruby/gems/3.2/gems/forwardable-1.3.3/lib/forwardable.rb:240:in `fetch'
	from /usr/local/www/gitlab/lib/gitlab/current_settings.rb:15:in `current_application_settings'
	from /usr/local/www/gitlab/lib/banzai/filter/asset_proxy_filter.rb:67:in `initialize_settings'
	from /usr/local/www/gitlab/config/initializers/asset_proxy_settings.rb:7:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in `class_eval'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:95:in `block in execute_hook'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:85:in `with_execution_control'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:90:in `execute_hook'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:60:in `block in on_load'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/lazy_load_hooks.rb:59:in `on_load'
	from /usr/local/www/gitlab/config/initializers/asset_proxy_settings.rb:6:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:667:in `load'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:667:in `block in load_config_initializer'
	from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/notifications.rb:208:in `instrument'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:666:in `load_config_initializer'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:620:in `block (2 levels) in <class:Engine>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:619:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/engine.rb:619:in `block in <class:Engine>'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in `instance_exec'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:32:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /usr/local/lib/ruby/3.2/tsort.rb:228:in `block in tsort_each'
	from /usr/local/lib/ruby/3.2/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:431:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:421:in `block in each_strongly_connected_component_from'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:50:in `each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:50:in `tsort_each_child'
	from /usr/local/lib/ruby/3.2/tsort.rb:415:in `call'
	from /usr/local/lib/ruby/3.2/tsort.rb:415:in `each_strongly_connected_component_from'
	from /usr/local/lib/ruby/3.2/tsort.rb:349:in `block in each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `each'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `call'
	from /usr/local/lib/ruby/3.2/tsort.rb:347:in `each_strongly_connected_component'
	from /usr/local/lib/ruby/3.2/tsort.rb:226:in `tsort_each'
	from /usr/local/lib/ruby/3.2/tsort.rb:205:in `tsort_each'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/initializable.rb:60:in `run_initializers'
	from /usr/local/lib/ruby/gems/3.2/gems/railties-7.0.8.7/lib/rails/application.rb:372:in `initialize!'
	from /usr/local/www/gitlab/config/environment.rb:7:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from config.ru:5:in `block in <main>'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:116:in `eval'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:116:in `new_from_string'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:105:in `load_file'
	from /usr/local/lib/ruby/gems/3.2/gems/rack-2.2.13/lib/rack/builder.rb:66:in `parse_file'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/configuration.rb:386:in `load_rackup'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/configuration.rb:297:in `app'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/runner.rb:169:in `load_and_bind'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/cluster.rb:373:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/launcher.rb:203:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/lib/puma/cli.rb:75:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/puma-6.6.0/bin/puma:10:in `<top (required)>'
	from /usr/local/bin/puma:25:in `load'
	from /usr/local/bin/puma:25:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:59:in `load'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:59:in `kernel_load'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:452:in `exec'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:35:in `dispatch'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/cli.rb:29:in `start'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/exe/bundle:28:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.6/exe/bundle:20:in `<top (required)>'
	from /usr/local/bin/bundle:25:in `load'
	from /usr/local/bin/bundle:25:in `<main>'
..............................................................................................................
Waited 120s for the processes to write their pids, something probably went wrong.
```
* エラーの大半は、バックエンドDBにつながらなかったから躓いて動いてないことに起因しているとわかります。
* バックエンドDBの立ち上げが必要ですが、ここから手探り。

## gitlab-ce のバックエンド migration の手順
* 別の jail で　postgresql のサーバならすでに建ててあります。　別の　railsプロジェクト で使っているものです。
* gitlabガイド の日本語訳があります。
* ここに「別のPostgresqlで・・・」手順があります。
* [GitLabデータベースを別のPostgreSQLインスタンスに移動 ](https://gitlab-docs.creationline.com/ee/administration/postgresql/moving.html)
* 初期のmigrationとかがないので読み解きました。が・・

>ソースからデータベースをダンプします：
> /opt/gitlab/embedded/bin/pg_dump -h $SRC_PGHOST -U $SRC_PGUSER -c -C -f gitlabhq_production.sql gitlabhq_production
>
* そもそもDB作ってないので、dumpができない。 orz..

* 先程のガイドの後半部分にありました。　[パッケージ化されていない・・・](https://adex.ltd/migrate-gitlab-postgresql-database-to-custom-location-using-ansible) 
* コレに従って作業してまいりましょう。
::: note warn
パッケージ化されていないPostgreSQLサーバーを使う場合は、[データベース要件文書](https://docs.gitlab.com/install/requirements/#database)に従ってPostgreSQLが設定されていることを確認する必要があります。
:::
>Depending on the number of users, the PostgreSQL >server should have:
>
>    For most GitLab instances, at least 5 to 10 GB of storage
>    For GitLab  Ultimate, at least 12 GB of storage (1 GB of vulnerability data must be imported)

* 最小は5GB〜　という感じ、GitLab Ultimate は 12GB〜
* postgresql のバージョン対応は以下の通り。

| GitLab version | Minimum PostgreSQL | version	Maximum PostgreSQL version |
-----------------|--------------------|-----------------------------------------|
|18.x	|16.x (proposed in epic 12172) |	To be determined |
|17.x	| 14.x	| 16.x (tested against GitLab 16.10 and later) |
|16.x	| 13.6	| 15.x (tested against GitLab 16.1 and later)|
|15.x	| 12.10	| 14.x (tested against GitLab 15.11 only), 13.x |

* 2025年4月現在、FreeBSD-ports では　gitlab version 17.10 で、運用中のpostgresql 16.8 と適合します。 
## 設定していく・・・

> 編集 /etc/gitlab/gitlab.rb ：
* etc がないので・・・
```# pwd
/usr/local/www/gitlab
# find . -name gitlab.rb
./qa/qa/service/docker_run/gitlab.rb
./qa/qa/page/component/import/gitlab.rb
./scripts/lib/gitlab.rb
./vendor/gems/omniauth-gitlab/lib/omniauth/strategies/gitlab.rb
./lib/gitlab.rb
```
えー、どれだ？？
## gitlab.rb のありか
* FreeBSDなので /usr/local/etc/rc.d/gitlab を読むしかないです。
* /etc/default/gitlab というPATHが書かれているのですが、そんなとこをFreeBSDの人がサードパーティに開放しているはずがないんでおかしい。
* 素直に installation.md を読むしか無さそうなところ・・・orz

## [【FreeBSD】 GitLabサーバーをFreeBSDのjailシステムを使って構築した話](https://qiita.com/himrock922/items/25f0beea5c48055ae27d#gitlab%E3%81%AE%E8%A8%AD%E5%AE%9A)

おおお、　記事が丸かぶりしていました。とはいえ、もう何年も前の話で勝手が違う場合もありますので、なぞりつつです。

## JAILのロケール変更

> jailシステムのロケールをUTF-8に変更します。

そこからやっておく必要があったのですね・・・

>$ vi /etc/login.conf
>default:\
>...
>:charset=UTF-8:\
>:lang=en_US.UTF-8:

もともと、　lang=C.UTF-8; になっていました。ja_JPにしたらどうなるかはそのうち。

## postgresql DB設定
* postgresql サーバの構築は端折ります。もう出来てるのもあるのと、巷間に流布されている導入記事を読めば誰でも出来ます。
* gitlabに関係ありそうなことを書きます
```
root@pgsql:~ # createuser -U postgres git
root@pgsql:~ # createdb -U postgres -O git gitlabhq_production
root@pgsql:~ # psql -U git gitlabhq_production
psql (16.8)
Type "help" for help.

gitlabhq_production=> CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION
gitlabhq_production=> 
```
## REDIS
* すでに入っているので設定のみ。
```bash
# pkg info | grep redis
redis-7.4.2                    Persistent key-value database with built-in net interface
```
>% echo 'unixsocket /var/run/redis/redis.sock' >> /usr/local/etc/redis.conf
>% echo 'unixsocketperm 770' >> /usr/local/etc/redis.conf
>% sysrc redis_enable=YES
>% service redis restart
>% pw groupmod redis -m git

* FreeBSDにおける、初期の redis.conf の設定は
```
bind 127.0.0.1 -::1
protected-mode yes
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
pidfile /var/run/redis/redis.pid
loglevel notice
logfile /var/log/redis/redis.log
databases 16
always-show-logo no
set-proc-title yes
proc-title-template "{title} {listen-addr} {server-mode}"
locale-collate ""
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
rdb-del-sync-files no
dir /var/db/redis/
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync yes
repl-diskless-sync-delay 5
repl-diskless-sync-max-replicas 0
repl-diskless-load disabled
repl-disable-tcp-nodelay no
replica-priority 100
acllog-max-len 128
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
lazyfree-lazy-user-del no
lazyfree-lazy-user-flush no
oom-score-adj no
oom-score-adj-values 0 200 800
disable-thp yes
appendonly no
appendfilename "appendonly.aof"
appenddirname "appendonlydir"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
aof-timestamp-enabled no
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-listpack-entries 512
hash-max-listpack-value 64
list-max-listpack-size -2
list-compress-depth 0
set-max-intset-entries 512
set-max-listpack-entries 128
set-max-listpack-value 64
zset-max-listpack-entries 128
zset-max-listpack-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
jemalloc-bg-thread yes
```
で、gitlabでは、　これに unixsocket listenを追加するだけ。
bind 127.0.0.1 はもしかしたら不要？　ですが、他のアプリで使うかもですから
そのままにします。

* 編集終わったら被りがないか確認します。 設定ファイルが大きいと見落としがち。
```
# grep unix  redis.conf
unixsocket /var/run/redis/redis.sock
unixsocket perm 770
```

## gitlabの設定
* Gitユーザのホームディレクトリの変更
これですねぇ。はい。 (installation.md) に書かれてるツリーのとおりになるのでしょうか？？　 [https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/install/installation.md]

|-- home
|   |-- git
|       |-- .ssh
|       |-- gitlab
|       |-- gitlab-shell
|       |-- repositories

* ともあれ、先人の軌跡をなぞり続けます。
---
> パッケージでインストールしたGitLab経由で作成されたgitユーザーのホームディレクトリを変更します。

>vipw -d /etc
>git:*:211:211::0:0:gitosis user:/usr/local/git:/bin/sh
>git:*:211:211::0:0:gitosis user:/usr/home/git:/bin/sh

* 変更は出来ましたが、ここは？
>次にgitlab.ymlを変更します。
>% cd /usr/local/www/gitlab-ce

今は　/usr/local/www/gitlab ですね。:thinking:
* gitlab.yaml の場所もちょっと怪しくなっていますので原本を確認、ここからは、[現行版](https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/doc/install/installation.md#9-gitlab)　　を見るんですが・・・

## gitlab からcloneしてみる・・・
* もはや pkg のものだとよく判らんところがあるので、タグを探して cloneしてみます。なんというか linuxサーバでやったほうがラクな気がしてきますがとりあえず横車を押し続けていきます。。

```
# mkdir gitlab_dist
# chown git gitlab_dist
# cd gitlab_dist
# sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab.git -b v17.10.3-ee
Cloning into 'gitlab'...
remote: Enumerating objects: 5975800, done.
remote: Counting objects: 100% (2432784/2432784), done.
remote: Compressing objects: 100% (393808/393808), done.
remote: Total 5975800 (delta 2118964), reused 2298914 (delta 2014464), pack-reused 3543016 (from 1)
Receiving objects: 100% (5975800/5975800), 2.23 GiB | 21.33 MiB/s, done.
Resolving deltas: 100% (4676855/4676855), done.
warning: refs/tags/v17.10.3-ee 3fb3f27435401735c8914250a499bdfbec25c54e is not a commit!
Note: switching to 'ed705b29e5c4370265a87b8bec1b08493ba340f7'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (85943/85943), done.

```
## ああ、今日も時間が。
* とにかく時間がかかるのでまた今度です。
* いずれにしろ必要なので構築はします。