This documentation outlines the configuration options available for setting up the GitLab Community Edition (CE) development environment.
Configuration Options
1. GitLab Configuration File
The primary configuration file for GitLab is located at config/gitlab.yml
. This file contains application-wide settings influencing how the application behaves and communicates.
Example Configuration
production:
gitLab:
host: "gitlab.example.com"
port: 80
https: false
ssh_host: "gitlab.example.com"
ssh_port: 22
In this snippet, basic configurations for the GitLab instance are defined. Adjust host
, port
, and ssh_port
according to your setup.
2. Database Configuration
Database settings are detailed in the config/database.yml
file. The sections in the file correspond to different environments such as development
, test
, and production
.
Example Database Configuration
development:
adapter: postgresql
encoding: unicode
database: gitlab_development
pool: 5
username: gitlab
password: password
host: localhost
The above configuration sets up a PostgreSQL database for the development environment with specified parameters.
3. Redis Configuration
Redis is used in GitLab for caching and session management. Configuration settings for Redis can be found in config/initializers/redis.rb
.
Example Redis Configuration
$redis = Redis.new(
host: 'localhost',
port: 6379,
db: 0
)
The above code initializes a connection to Redis, modifying the host
, port
, and db
values as needed.
4. Secrets Configuration
Secrets management is crucial for securing sensitive information. You can configure your secrets in config/secrets.yml
.
Example Secrets Configuration
development:
secret_key_base: "your_development_secret_key_base"
Replace your_development_secret_key_base
with a secure, randomly generated key.
5. Caching Configuration
Caching settings influence performance. You can customize caching for various environments in config/environments/development.rb
.
Example Caching Configuration
Rails.application.configure do
config.cache_classes = false
config.eager_load = false
config.cache_store = :memory_store, { size: 64.megabytes }
end
This configuration disables class caching for development, facilitating code reloading during development.
6. Mailer Configuration
Email delivery settings can be configured in config/environments/development.rb
to facilitate testing email features.
Example Mailer Configuration
Rails.application.configure do
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "localhost",
port: 1025
}
end
This setup assumes a local SMTP server is running for testing email sending capabilities.
7. Sidekiq Configuration
For background processing, Sidekiq must be configured. This can be set in config/initializers/sidekiq.rb
.
Example Sidekiq Configuration
Sidekiq.configure_server do |config|
config.redis = { url: "redis://localhost:6379/0" }
end
Sidekiq.configure_client do |config|
config.redis = { url: "redis://localhost:6379/0" }
end
This example specifies the Redis connection used by Sidekiq.
8. Webpack Configuration
Managing JavaScript and stylesheets requires configuring Webpack within GitLab’s assets. This is commonly found in webpacker.yml
.
Example Webpack Configuration
development:
compile: true
source_maps: true
These options enable compiling assets for development while providing source maps for better debugging.
Conclusion
Proper configuration of the GitLab CE development environment is critical for effective development workflows. Each component plays a significant role in functionality and performance. Developers are encouraged to review these settings and adjust them according to their requirements.
Source: gitlab-org/gitlab-ce