289 Commits

Author SHA1 Message Date
Filipe Roque
c9973b4ba6 Fix recompile spelling 2024-04-30 09:26:00 +01:00
Kazunori Kimura
05794a2b47 Allow setting feature flags via configuration parameter
- It requires database is set up because
  feature flags are stored to DB (table `application_settings`)
- Add configuration parameter GITLAB_FEATURE_FLAGS_ENABLE_TARGETS
  and GITLAB_FEATURE_FLAGS_DISABLE_TARGETS
- Add ruby script to configure feature flags from command line
  and invoke runtime (from configure_gitlab())
2024-03-24 18:43:51 +09:00
Kazunori Kimura
846a051bbe Allow additional configurations after DB migration
Such as feature flags (which is stored to database, application_settings table)

At this commit, it does nothing (no operation `:`)
2024-03-24 18:43:51 +09:00
Daniel Mulholland
3f2e8c2ce4
Create ci_secure_files directory if missing, closes #2790 2024-02-11 10:17:36 +13: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
massej
d11ae7b617
Added missing configuration variable OAUTH_ALLOW_BYPASS_TWO_FACTOR. 2023-10-23 22:17:20 -04:00
Steven Achilles
daae8b70d3
Merge pull request #2841 from massej/patch-1
Added - OAuth2 Generic - missing label and scope variables
2023-10-23 22:45:00 +02:00
Kazunori Kimura
a2dd4e5ed8 Accept multiple hosts for RACK_ATTACK_WHITELIST
see sameersbn/docker-gitlab#2828

The current setup also accepts multiple hosts,
but the syntax is a bit strange.
The leading/trailing double quotes are embedded
in the configuration file itself,
so users should expect double quotes around the string they set.
In other words, when setting two hosts 0.0.0.0 and 1.1.1.1,
you will set the strings 0.0.0.0","1.1.1.1 in the
environment variables. This is not intuitive.

This commit removes double quote around corresponding config
and set backward compatibility fallback process
to surround whole with [], each host with double quote.
Also, validation script (written in ruby) will be executed during configuration.

Example docker-compose.yml
````yaml
services:
  gitlab:
    image: sameersbn/gitlab:latest
    environment:
    - RACK_ATTACK_WHITELIST='["127.0.0.1","0.0.0.0"]'
````

Co-authored-by: Mikhail Khadarenka <chodorenko@mail.ru>
2023-10-20 22:24:22 +09:00
massej
a903d98290
Update functions 2023-10-01 13:45:02 -04:00
Kazunori Kimura
7140f0342b Fix unused client removal on restarted container
Handle the case where the target does not exist
in the process of deleting unused clients.
Such a situation will not occur in newly launched containers,
but will occur if they are restarted.

During container restarts, container status are preserved.
If the unused database client was deleted in the last run,
grep will not match anything.
It returns non-zero code and the container stops there
because entrypoint sets option `-e`
(exit immediately on non-zero exit code excluding some special cases)

This commit make the uninstall process to handle the case
UNUSED_DB_CLIENTS is empty.
2023-06-02 22:12:29 +09:00
Kazunori Kimura
598a666693 Add -y option on uninstalling unused db client
Co-authored-by: Steven Achilles <steven.achilles@googlemail.com>
Co-authored-by: @f-io
2023-05-25 12:44:32 +09:00
Kazunori Kimura
24e2b581fb Use purge instead to uninstall unused db clients
Instead of `remove` that does not remove actual files.

Co-authored-by: @f-io
2023-05-24 20:26:15 +09:00
Kazunori Kimura
b3b700a701 Uninstall unused postgresql-client on startup
Unused clients are determinate by checking ~/.postgresqlrc
Uninstall logs like the following will appear in the docker log:

- Uninstalling unused version(s) of client: postgresql-client-12
2023-05-12 06:58:11 +09:00
Kazunori Kimura
260f548c5b Ship with multiple versions of postgresql-client
It is intended to work even in environments without an internet connection.

- Use latest version of pg_isready on checking database connection
- Switch postgresql-client version checking server on startup
- If the server versions do not match exactly, use the latest installed client
  and warn on docker log

From postgresql documentation:
https://www.postgresql.org/docs/15/app-pgdump.html#PG-DUMP-NOTES

> Also, it is not guaranteed that pg_dump's output can be loaded
> into a server of an older major version — not even if the dump
> was taken from a server of that version.

To switch client version, generate a file ~/.postgresqlrc with content like:

{server side major version} {server hostname}:{server port} {default database}

See detail on:
https://manpages.ubuntu.com/manpages/bionic/man5/postgresqlrc.5.html

Following messages appear on docker log:

- Detected server version: 140007
- Generating /home/git/.postgresqlrc
2023-05-12 06:58:11 +09:00
kkkkkks0
f408585d8b
fixes sameersbn#2645 2022-10-20 18:58:03 +08:00
Ivan Baranov
8b9ca622f9 Tested support for azure_activedirectory_v2 2022-09-05 21:46:20 +09:00
Kazunori Kimura
844d57dad2 update *:object_store:enabled regardless of the value
apply for artifact,packages,terraform_state,lfs,uploads
2022-06-21 08:46:05 +09:00
haroldsamuels87
944a638a28
fixed a typo
took me 5 HOURS to find this tiny little typo.
2022-05-12 18:13:55 +04:30
Péter Józsa
82e88ff0ad create terraform state directory based on new configuration variables during datadir initialization
#2501
2022-04-11 12:13:28 +02:00
Péter Józsa
4752be956c Allow to configure terraform state feature 2022-04-11 12:13:09 +02:00
Steven Achilles
1a091cea44
Merge pull request #2511 from getfloret/master
Fix: HealthCheck Script will Fail if the ENV GITLAB_HTTPS set True
2022-03-29 20:45:41 +02:00
AlpsTsui
def7ef5fea Fix: HealthCheck Script will Fail if the ENV GITLAB_HTTPS set True 2022-03-29 22:22:31 +08:00
Kazunori Kimura
e91d9b5f7c support GITLAB_ISSUE_CLOSING_PATTERN 2022-03-27 07:28:01 +09:00
Kazunori Kimura
a9b4feb77b add NGINX_CUSTOM_GITLAB_SERVER_CONFIG 2022-03-04 22:49:52 +09:00
Kazunori Kimura
2448c6aada add terraform/packages dir to initialize_datadir()
Also add them to sanitize_datadir()

Note that the backup will fail if these directories do not exist
with each feature enabled.
2022-01-28 02:12:35 +09:00
Paolo Mainardi
09e76bb2e7 Missing redis db number 2022-01-03 18:28:10 +01:00
Paolo Mainardi
0a24da2cfe Copy cable.yml template file 2022-01-03 16:54:08 +01:00
Paolo Mainardi
36330f5366 Support actioncable 2022-01-03 16:32:16 +01:00
sue445
82576f27d0 Fixed Pages config not being created when GITLAB_PAGES_ACCESS_CONTROL was disabled 2021-12-09 22:24:30 +01:00
Kazunori Kimura
729a00a3c9 remove runtime/config/gitlabhq/rack_attack.rb 2021-10-09 15:45:11 +09:00
Jonathan Kline
f323481206 Corrected a typo in the artifacts section to allow proper updating and
replacement of the AWS_SIGNING_VERSION for artifacts
2021-08-02 16:39:10 -05:00
Akanoa
e2354ed8aa feat: Add "AWS_SIGNATURE_VERSION" related environment variables 2021-07-30 22:41:31 +00:00
Akanoa
bed4200b02 feat: allow to configure the packages registry from environment variables 2021-07-30 16:32:24 +00:00
sue445
73dae28e31 Pass {{GITLAB_INSTALL_DIR}} to gitlab-pages/config 2021-07-21 09:38:37 +09:00
sue445
50bad15845 Resolved. GitLab Pages doesn't work since GitLab v14.0
ref. #2375

As I can see from the error message below, it looks like both
`api-secret-key` and `gitlab-server` (or `internal-gitlab-server` ) are required since GitLab v14.0

```
time="2021-06-28T02:28:34Z" level=fatal msg="could not create domains config source" error="GitLab API URL or API secret has not been provided"
```

https://gitlab.com/gitlab-org/gitlab-pages/-/blob/v1.41.0/internal/source/gitlab/client/client.go#L50-52
2021-07-20 18:38:04 +09:00
Sameer Naik
6ed4aa776c fixed typo 2021-07-01 19:06:26 +02:00
G.J.R. Timmer
e194e7d8d0 moved default TIMEZONE variable to env-defaults
Resolve conversation
2021-07-01 19:06:26 +02:00
Gert-Jan Timmer
9180bed1fe fix Container TimeZone
Fix Container TimeZone


Fix Container TimeZone
2021-07-01 19:06:26 +02:00
Sameer Naik
09b8c1c265
Merge pull request #1884 from taomaree/custom_hooks_dir
Add support for GITLAB_SHELL_CUSTOM_HOOKS_DIR
2021-06-23 10:46:02 +05:30
Sameer Naik
6b619f4891
Merge pull request #2311 from sue445/csp_params
Add content_security_policy params
2021-06-23 10:45:20 +05:30
Sameer Naik
7b25affe22
Merge pull request #2321 from l00v3/add_prevent_ldap_sign_in
Add LDAP_PREVENT_LDAP_SIGN_IN configuration parameter
2021-06-21 10:31:36 +05:30
Rene Gärtner
bb6a889e0b added OAUTH_AUTO_LINK_USER option 2021-04-30 14:17:28 +02:00
sue445
b820c61f33 Add content_security_policy params 2021-04-18 23:28:28 +09: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
l00v3
9b7536a32e Add LDAP_PREVENT_LDAP_SIGN_IN configuration parameter
Committer: l00v3 <love@localhost.localdomain>
2021-03-12 11:59:03 +01:00
Sameer Naik
adf79a6c11 functions: properly delete the bitbucket auth config when not in use 2021-03-10 13:42:54 +05:30
Bruno Léon
8311b1ee74 Set default value for BITBUCKET_URL
If this value is not set importing repo fails when connecting to
bitbucket.
2021-02-23 08:19:52 +01:00
麦当苗儿
83202cdf6a
added SSL_PROTOCOLS option to change protocols of the nginx (#2304) 2021-02-16 08:21:06 +01:00
solidnerd
ca34ea0486 fix: GITLAB_RELATIVE_URL_ROOT installation method
During the last remove of the node_modules folder it wasn’t possbile to recompile assets on the start of the container. This is neccesarry for the GITLAB_RELATIVE_URL_ROOT to work correctly.

Signed-off-by: solidnerd <niclas@mietz.io>
2020-12-26 14:40:51 +01:00
sue445
0946fef04c Add GITLAB_PAGES_ARTIFACTS_SERVER_URL 2020-12-02 22:57:46 +01:00