The previous code was basically placed on GitHub, but because some codes involve some scientific research projects, even if they are placed in the private repository, there may be potential security issues, so I want to build a private code repository and put them on my own computer or server.
- docker和docker compose
- Domain name (second-level domain name is sufficient)
- acme.sh (Generate SSL certificate)
- nginx (Reverse proxy)
Domain Name and SSL Certificate
For the installation and preparation of the above software and tools, please refer to “Building a Personal Cloud Network Disk using Nextcloud and Docker”
docker-compose to install Jellyfin. The specific operation refer to https://docs.gitlab.com/ee/install/docker.html.HTML.
Create the following
docker-compose.yml file under the installation directory
gitlab_rails['gitlab_shell_ssh_port'] = 22
Then execute the following command to start the GitLab service:
sudo docker-compose up -d
Website Initialization and Settings
If all the above configurations are successfully completed, you can access the website through the browser, you can enter
http: //0.0.0.0: 8080 in the address bar, or use the domain name
https: // git.jinli.cyouaccess.
If the website has not yet been initialized, you will see the prompt
502 Bad Gateway when you visit the browser, you need to wait patiently for a few minutes until the website is initialized.
When you visit the website for the first time, you need to set up an administrator account and password, and then you can create a common account for daily use.
Configuration System Notification Mailbox
After the above configuration, gitlab can be used normally.However, we also want to use the system notification function, such as sending the system to notify the email, the email verification when registering the account, etc., we need to configure the system to notify the mailbox. Here I use my own mailbox server. The specific configuration is as follows:
### GitLab email server settings
###! Docs: https://docs.gitlab.com/omnibus/settings/smtp.html
###! **Use smtp instead of sendmail/postfix.**
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "mail.jinli.cyou"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "your_email_password"
gitlab_rails['smtp_domain'] = "mail.jinli.cyou"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
# gitlab_rails['smtp_pool'] = false
###! **Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert'**
###! Docs: http://api.rubyonrails.org/classes/ActionMailer/Base.html
gitlab_rails['smtp_openssl_verify_mode'] = 'none'
# gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs"
# gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt"
### Email Settings
# gitlab_rails['gitlab_email_enabled'] = true
##! If your SMTP server does not like the default 'From: [email protected]'
##! can change the 'From' with this setting.
gitlab_rails['gitlab_email_from'] = '[email protected]'
gitlab_rails['gitlab_email_display_name'] = 'GitLab Mailer'
gitlab_rails['gitlab_email_reply_to'] = '[email protected]'
# gitlab_rails['gitlab_email_subject_suffix'] = ''
# gitlab_rails['gitlab_email_smime_enabled'] = false
# gitlab_rails['gitlab_email_smime_key_file'] = '/etc/gitlab/ssl/gitlab_smime.key'
# gitlab_rails['gitlab_email_smime_cert_file'] = '/etc/gitlab/ssl/gitlab_smime.crt'
# gitlab_rails['gitlab_email_smime_ca_certs_file'] = '/etc/gitlab/ssl/gitlab_smime_cas.crt'
In this way, our own Gitlab server also has a systematic notification function.