pfaffman
(Jay Pfaffman)
2019 年2 月 18 日 22:55
1
The uploads:migrate_to_s3
rake task could use some attention.
There is no GlobalSetting.use_s3?
, but a GlobalSetting.use_s3
and the ENV variables have changed, as DISCOURSE_S3_BUCKET
has been replaced by DISCOURSE_S3_UPLOAD_BUCKET
.
https://github.com/discourse/discourse/blob/master/lib/tasks/uploads.rake#L231
I’m only a little bit sure that I know how to fix this, and I think that it’s fresh in @gerhard ’s mind.
1 个赞
tgxworld
(Alan Tan)
2019 年2 月 18 日 23:59
2
[1] pry(main)> GlobalSetting.use_s3
NoMethodError: undefined method `use_s3' for GlobalSetting:Class
Did you mean? use_s3?
The code in the rake task is still valid from what I can tell. Did you run into any specific problems that made you bring up the issues above?
2 个赞
pfaffman
(Jay Pfaffman)
2019 年2 月 19 日 00:00
3
uh. Hmm. I’ll try again.
I think I’m confused because it seems like it should be able to read those variables from SiteSettings
and I don’t understand how the backup and upload buckets get defined from just the S3 bucket.
tgxworld
(Alan Tan)
2019 年2 月 19 日 00:17
4
For GlobalSettings
,
# Discourse supports multiple mechanisms for production config.
#
# 1. You can do nothing and get these defaults (not recommended, you should at least set hostname)
# 2. You can copy this file to config/discourse.conf and amend with your settings
# 3. You can pass in config from your environment, all the settings below are available.
# Append DISCOURSE_ and upper case the setting in ENV. For example:
# to pass in db_timeout of 200 you would use DISCOURSE_DB_TIMEOUT=200
Only SiteSettings
that are marked shadowed_by_global
can be configured via the env. In this case, s3_upload_bucket
isn’t.
Closing this as this isn’t a bug.
5 个赞