Comments (9)
@arnos so you only need to specify the SMTP_HOST and SMTP_PORT for mails to go out?
This might be difficult considering the broader audience. You can however override the smtp mailer configuration.
This is how you do it.
Download https://github.com/sameersbn/docker-gitlab/raw/master/config.tar.bz2 and extract the file config/gitlabhq/smtp_settings.rb into /opt/gitlab/data/config/gitlabhq/
wget "https://github.com/sameersbn/docker-gitlab/raw/master/assets/setup/config.tar.bz2" -O /tmp/config.tar.bz2
cd /opt/gitlab/data/
tar -jvxf /tmp/config.tar.bz2 config/gitlabhq/smtp_settings.rb
You can edit the /opt/gitlab/data/config/gitlabhq/smtp_settings.rb to remove the smtp settings you do not require and restart the gitlab application for the changes to take effect.
Using this method you can literally override all of my configuration but be warned that you could break the whole application, especially if you change paths in the configuration files. Generally parameters with {{}} around their values are the ones safe to edit. The values with the {{}} that you leave behind will be updated as per the configuration you provide via the environment configuration.
Using this method you can also change the default projects number as you have mentioned in #42 and could also have been used to get by #36. I have not documented it yet so that I can see how people are using the image and understand what all options I should be adding.
from docker-gitlab.
Yes, and all I'm proposing is that the default be changed to include the
other (SMTP_AUTHENTICATION, etc...) only when a user fills it out. This way
you still reach a broader audience.
There could also be another flag say (GMAIL_DEFAULT=true) that would fill
the SMTP parameters with the gmail config.
In terms of manually updating the configurations that's what I've been
doing for testing and it's maintainable at a certain level, but it means
keeping my own container image and then syncing it up with yours at every
upgrade.
How about an alternate approach based on the idea I mentioned in the logs
issue (#40), instead of having to input all the options to configure gitlab
everytime and running it through the init script have init check if
pre-configured configuration files exist in /opt/gitlab/ (a mounted volume
on the host) and use these to overwrite the default config files.
In this manner configurations can be saved and re-used.
On Thu, Apr 10, 2014 at 1:30 PM, Sameer Naik [email protected]:
@arnos https://github.com/arnos so you only need to specify the
SMTP_HOST and SMTP_PORT for mails to go out?
This might be difficult considering the broader audience. You can however
override the smtp mailer configuration.This is how you do it.
Download
https://github.com/sameersbn/docker-gitlab/raw/master/assets/setup/config.tar.bz2and extract the file config/gitlabhq/smtp_settings.rb into
/opt/gitlab/data/config/gitlabhq/wget "https://github.com/sameersbn/docker-gitlab/raw/master/assets/setup/config.tar.bz2" -O /tmp/config.tar.bz2
cd /opt/gitlab/data/
tar -jvxf /tmp/config.tar.bz2 config/gitlabhq/smtp_settings.rbYou can edit the /opt/gitlab/data/config/gitlabhq/smtp_settings.rb to
remove the smtp settings you do not require and restart the gitlab
application for the changes to take effect.Using this method you can literally override all of my configuration but
be warned that you could break the whole application, especially if you
change paths in the configuration files. Generally parameters with _{{}}_around their values are the ones safe to edit. The values with the
{{}} that you leave behind will be updated as per the configuration you
provide via the environment configuration.Using this method you can also change the default projects number as you
have mentioned in #42https://github.com/sameersbn/docker-gitlab/issues/42and could also have been used to get by
#36 #36. I have not
documented it yet so that I can see how people are using the image and
understand what all options I should be adding.Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-40113799
.
from docker-gitlab.
@arnos I think you misunderstood. The edit that I mentioned is done at the data store on the host, not inside the container.
How this works is that when the container is started, it checks if there are any configuration overrides in the config/ directory of the datastore, which in this case would be the smtp_settings.rb file in the /opt/gitlab/data/config/gitlabhq folder. Now this file would be used as the template on top of which the container would start applying the configuration.
This means that you can upgrade the image normally without having to worry much. The only time you could face an issue is if the base template itself changed, In which case you would have to update your copy in /opt/gitlab/data/config/gitlabhq. So the golden rule of thumb would be to copy only the files you wish to change in the /opt/gitlab/data/config directory and apply the rest of the config using the environment variables.
How about an alternate approach based on the idea I mentioned in the logs issue (#40), instead of having to input all the options to configure gitlab everytime and running it through the init >script have init check if pre-configured configuration files exist in /opt/gitlab/ (a mounted volume >on the host) and use these to overwrite the default config files.
Well this is exactly what the files inside /opt/gitlab/data/config/ are meant to do. You can specify the entire configuration here and the image will just pick up this configuration and fill out whatever is left to be filled.
Generating the configuration at run time is important so that we do not end up in a fix when the configs are changed upstream (read my above "golden rule of thumb" comment).
NOTE: the mountpoint /opt/gitlab/data I mentioned is in reference to the path of the datastore I have used in the README examples. This could be a different path in your case if you have changed it.
from docker-gitlab.
My bad, you're right I missed that.
Ok after testing both the project number and the SMTP config changes in
/opt/gitlab/data/config.
On Thu, Apr 10, 2014 at 2:23 PM, Sameer Naik [email protected]:
@arnos https://github.com/arnos I think you misunderstood. The edit
that I mentioned is done at the data storehttps://github.com/sameersbn/docker-gitlab#data-storeon host, not inside the container.How this works is that when the container is started, it checks if there
are any configuration overrides in the config/ directory of the datastore,
which in this case would be the smtp_settings.rb file in the
/opt/gitlab/data/config/gitlabhq folder. Now this file would be used as the
template on top of which the container would start applying the
configuration.This means that you can upgrade the image normally without having to worry
much. The only time you could face an issue is if the base template itself
changed, In which case you would have to update your copy in
/opt/gitlab/data/config/gitlabhq. So the golden rule of thumb would be to
copy only the files you wish to change in the /opt/gitlab/data/config
directory and apply the rest of the config using the environment variables.How about an alternate approach based on the idea I mentioned in the logs
issue (#40 #40),
instead >of having to input all the options to configure gitlab everytime
and running it through the init >script have init check if pre-configured
configuration files exist in /opt/gitlab/ (a mounted volume >on the host)
and use these to overwrite the default config files.Well this is exactly what the files inside /opt/gitlab/data/config/ are
meant to do. You can specify the entire configuration here and the image
will just pick up this configuration and fill out whatever is left to be
filled.Generating the configuration at run time is important so that we do not
end up in a fix when the configs are changed upstream (read my above
"golden rule of thumb" comment).NOTE: the mountpoint /opt/gitlab/data I mentioned is in reference to
the path of the datastore I have using in the READMEhttps://github.com/sameersbn/docker-gitlab#data-storeexamples. This could be a different path in your case if you have changed
it.Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-40120336
.
from docker-gitlab.
@arnos so should we close this?
from docker-gitlab.
Yes
On Friday, April 11, 2014, Sameer Naik [email protected] wrote:
@arnos https://github.com/arnos so should we close this?
Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-40175296
.
from docker-gitlab.
Hi, @sameersbn
I use this in my LAN,
I clone smtp_settings.rb
to /opt/gitlab/data/config/gitlabhq
change to
# To enable smtp email delivery for your GitLab instance do next:
# 1. Rename this file to smtp_settings.rb
# 2. Edit settings inside this file
# 3. Restart GitLab instance
#
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: "exmail.my.com.cn",
port: 25,
domain: "my.com.cn",
authentication: "plain" #I also test authentication: ":plain", but still not work...
}
end
But I can't receive mail, the production.log show : Sent mail to [email protected] (5135.6ms)
I run this docker use:
docker run --name=gitlab -p 88:80 -d \
--link mysql:mysql \
-e "DB_USER=gitlab" -e "DB_PASS=root" -e "DB_NAME=gitlabhq_production" \
-e "[email protected]" -e "[email protected]" \
-e "GITLAB_SIGNUP=true" \
-e "GITLAB_HOST=gitlab2.my.com.cn" \
-v /opt/gitlab/data:/home/git/data \
sameersbn/gitlab:7.0.0
I have an old gitlab, configure step by step. has SMTP conf in production.rb
like this
## SMTP Settings
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'exmail.my.com.cn',
:port => 25,
:domain => 'my.com.cn', ## My Domain
:authentication => :plain, ## Let it be plain as it is inside my LAN
##:user_name => '[email protected]', ## This is not required as long as
##:password => 'yourPassword', ## SMTP Gateway allows anonymous relay
##:enable_starttls_auto => true ## In LAN
##:user_name => '',
##:password => '',
:enable_starttls_auto => true,
:openssl_verify_mode => 'none'
}
config.eager_load = true
config.assets.js_compressor = :uglifier
config.allow_concurrency = false
end
This server works OK, is there any thing wrong I set in smtp_settings.rb
from docker-gitlab.
@jay61439476 All you need to do is correctly configure the smtp_settings.rb. I see that you have not added the :enable_starttls_auto
and :openssl_verify_mode
like you have in your old gitlab installation. I reckon that copying old config and updating the syntax should just work.
I guess your smtp_setting.rb should look like this:
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: 'exmail.my.com.cn',
port: 25,
domain: "my.com.cn",
authentication: "plain",
enable_starttls_auto: true,
openssl_verify_mode: "none"
}
end
If this does not work then Iām afraid I will not be of much help.
from docker-gitlab.
thanks @sameersbn
It still no work, I'm trying to find other configure, I run docker-gitlab and my old gitlab on the same server, I will send it to a new server and try again.
thank you~
from docker-gitlab.
Related Issues (20)
- Register a WebAuthn device error
- ENOENT: No such file or directory HOT 4
- problem deleting image or tag 16.6.1 HOT 13
- 16.7.0: Rake aborts launch with "failed to get urandom" HOT 36
- Migrate gitlab 11.10.4 to gitlab 16.6.2 with mysql to postgresql
- Error fetching repo data HOT 1
- CVE-2023-7028 HOT 3
- Upgrade Ruby to 3.2.x to remove bug introduced on Ruby 3.1.x HOT 3
- Unable to fetch commit when using --depth 1 mode
- GitLab Critical Security Release: 16.8.1, 16.7.4, 16.6.6, 16.5.8 HOT 1
- How to backup GitLab in Kubernetes? Do you have any good ideas, templates, or documentation? I'm not very familiar with Kubernetes, so please help me. HOT 2
- Backups not functioning in v16.8.1 HOT 3
- [Question] How to change the clone link from localhost to my domain? HOT 2
- Support setting `global_time_tracking_report` HOT 1
- I have set up an auto-backup strategy in Kubernetes, but it seems not to take effect. How can I troubleshoot the problem? HOT 9
- How is openid_connect_signing_key handled? HOT 1
- level=error correlation_id= duration_ms=0 error="badgateway: failed to receive response: dial unix /home/git/gitlab/tmp/sockets/gitlab.socket: connect: no such file or directory
- Please support pages namespace_in_path
- Web log-in broken HOT 2
- missing 16.1.6 and 16.3.7 version needed for upgrade path HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-gitlab.