As the Synology DSM uses Docker to run GitLab, we can use Docker as well to install GitLab. To run the GitLab console, connect to the Synology using SSH first:
ssh <admin-user>@<synology> -p <port>
Then, connect to the GitLab container by using the following command:
docker exec -it synology_gitlab /bin/bash
Note: you might adjust the name of the GitLab docker depending on your system. In the example above, synology_gitlab
was used.
Then you can open the console:
gitlab-rails console
When GItLab is installed using the DSM package manager, just use the following commands instead of the one above:
cd /home/git/gitlab/bin
./rails console production
Commands for the GitLab console
The Rails console provides a way to interact with your GitLab instance from the command line, and also grants access to the amazing tools built right into Rails. […] The Rails console is for GitLab system administrators who are troubleshooting a problem or need to retrieve some data that can only be done through direct access of the GitLab application.
https://docs.gitlab.com/ee/administration/operations/rails_console.html
Below are some examples of console commands and how to perform specific actions. In my case, I needed to check for the mail delivery settings: verify the delivery method, verify the SMTP settings and send a test email.
Check the mail delivery method
ActionMailer::Base.delivery_method
Output might be: => :smtp
Check the smtp settings
ActionMailer::Base.smtp_settings
Output might be: => {:address=>"example.com", :port=>25, …
Testing the SMTP configuration
You can verify that GitLab can send emails properly using the Rails console. As described in the documentation, you can enter the following command at the console prompt to cause GitLab to send a test email:
Notify.test_email('mail@example.com', 'Subject', 'Mail Body').deliver_now
Leave a Reply