디스코urs 커뮤니티 여러분,
최근 프로덕션 백업의 배포와 복구를 디스코urs 포럼의 개발 및 테스트 인스턴스에 자동화했습니다.
이를 통해 모든 사이트에 동일한 데이터를 유지할 수 있습니다.
다만 인스턴스에 따라 사이트 로고를 커스터마이징하고 싶습니다.
해당 주제에서 안내된 바와 같이 이 site_setting.yml 파일을 따르려 합니다: Comprehensive list of SiteSettings?
# Available options:
#
# default - The default value of the setting. For upload site settings, use the id of the upload seeded
# in db/fixtures/010_uploads.rb.
# client - Set to true if the javascript should have access to this setting's value.
# refresh - Set to true if clients should refresh when the setting is changed.
# min - For a string setting, the minimum length. For an integer setting, the minimum value.
# max - For a string setting, the maximum length. For an integer setting, the maximum value.
# regex - A regex that the value must match.
# validator - The name of the class that will be use to validate the value of the setting.
# allow_any - For choice settings allow items not specified in the choice list (default true)
# secret - Set to true if input type should be password and value needs to be scrubbed from logs (default false).
# enum - The setting has a fixed set of allowed values, and only one can be chosen.
# Set to the class name that defines the set.
# locale_default - A hash which overrides according to `SiteSetting.default_locale`.
# The key should be as the same as possible value of default_locale.
# mandatory_values - A list of mandatory values that must be included in the setting, these cannot be changed or removed
# in the UI. Only applies to pipe-separated list type settings (e.g. group_list), as the values
# are merged into the setting's value on both read and write.
# disallowed_groups - A list of group IDs (pipe-separated) that should be hidden from the group selector.
This file has been truncated. show original
다양한 변수를 사용하여 사이트의 주요 설정을 구성하는 데 성공했습니다.
그러나 로고 부분은 문서화가 잘 되어 있지 않아 여러 가지 방법을 시도해 보았습니다.
...
# Available options:
#
# default - The default value of the setting. For upload site settings, use the id of the upload seeded
# in db/fixtures/010_uploads.rb.
...
branding:
logo:
default: -5
client: true
type: upload
logo_small:
default: -6
client: true
type: upload
기본값은 010_uploads.rb 에 정의된 정수 인덱스인 것 같습니다:
-5 => "discourse-logo-sketch.png",
-6 => "discourse-logo-sketch-small.png",
UI 설정 히스토리에서 최신 로고와 logo_small의 참조를 /upload 디렉토리로 연결되는 링크 형태로 찾았습니다.
예: /uploads/default/original/3X/2/4/242dc879cbffed41ee64646a0dffded5c34bb9c6.png
제 앱 설정 .yml 파일에서는 기본값을 실험하며 시작했습니다:
# Backup
DISCOURSE_s3_backup_bucket: "backup-test"
# Logo
DISCOURSE_logo: -5
DISCOURSE_logo_small: -6
site_settings.yml에 지정된 기본값으로 DISCOURSE_logo와 DISCOURSE_logo_small을 설정했습니다.
사이트를 재빌드했을 때 500 에러가 발생하여 사이트가 더 이상 작동하지 않았습니다.
또한 해당 사이트의 로고로 사용하려는 업로드에 대한 문자열 참조를 전달해 보았지만, 안타깝게도 동일한 결과가 나와 사이트가 사용 불가능한 상태가 되었습니다.
DISCOURSE_logo: "/uploads/default/original/3X/2/4/242dc879cbffed41ee64646a0dffded5c34bb9c6.png"
제 생각의 흐름은 다음과 같았습니다. 프로덕션 인스턴스에 개발, 테스트, 프로덕션을 위한 서로 다른 로고를 업로드한 후, 프로덕션 백업을 복원하고 사이트 재빌드 시 특정 인스턴스에 맞는 올바른 로고를 가리키도록 하는 것이었습니다.
도움을 주시면 감사하겠습니다.
nathank
(Nathan Kershaw)
8월 16, 2025, 2:16오전
2
저도 같은 이유로 이 길을 걸어봤습니다(물론 그렇게 멀리까지 가지는 않았지만).
결국 포기하고 사이트 클론들 간의 구분이 잘 안 되는 상태로 지내고 있습니다.
적어도 서버 볼륨 이름을 바꾸는 것은 비교적 쉬워서, 정말 어리석은 실수를 할 가능성을 줄여줍니다!!!