Recently updated my copy of discourse and noticed this weird little bug in the console that also prevents the preview window from loading. [blocked] The page at https://domain.com/t/topic/4512/484 was not allowed to run insecure content from...
Reading time: 1 mins 🕑
Likes: 3 ❤
https://meta.discourse.org/t/discourse-preview-not-working/67584/46
SSLリバースプロキシー使用時にプレビュー用スクリプトをhttpでロードしてしまう為セキュリティエラーが発生。nginxの設定を修正します。
Docker上のDiscourseコンテナ内にアクセスします。
$cd /var/discourse
$sudo ./launcher enter your_discourse_container_name
your_discourse_container_nameはcontainersフォルダ内の.ymlを除外した名称です。
nginxのdiscourse設定ファイルを編集します。
#vi /etc/nginx/conf.d/discourse.conf
location @discourseの箇所の
proxy_set_header X-Forwarded-Proto $thescheme;
を
proxy_set_header X-Forwarded-Proto https;
に書換えます。
location @discourse {
limit_conn connperip 20;
limit_req zone=flood burst=12 nodelay;
limit_req zone=bot burst=100 nodelay;
add_header Referrer-Policy 'no-referrer-when-downgrade';
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://discourse;
}
最後にnginxの設定をリロードします。nginxの再起動は必要ありません。
#service nginx reload
上記の対応をしても問題解決しない場合、mod_pagespeed に起因する可能性があります。
Discourseに適用されているApacheまたはNginxのVirtual Hostsの設定内でmod_pagespeedを無効 にします。
ModPagespeed unplugged を追加
<VirtualHost *:80>
DocumentRoot /www/example2
ServerName www.example2.org
ModPagespeedMapRewriteDomain cdn.example2.org *example.org
# Don't want combine_css here
ModPagespeed unplugged
</VirtualHost>
参考サイト
https://www.modpagespeed.com/doc/configuration
https://www.modpagespeed.com/doc/config_filters.html
ついでに以下の箇所もアンコメント(一般的なJavaScriptライブラリをサーバからでなくGoogleから読取るようにします)
# Certain common JavaScript libraries are available from Google, which acts
# as a CDN and allows you to benefit from browser caching if a new visitor
# to your site previously visited another site that makes use of the same
# libraries as you do. Enable the following filter to turn on this feature.
#
ModPagespeedEnableFilters canonicalize_javascript_libraries
閲覧数 の小数点が “。” になっている不具合。日本語ローカライズに起因。
js.number.format.separator を “。” から “.” に置換えます。
設定—>カスタマイズ—>Text
docker_manager "Currently Upgrading…"アップグレードエラー
<対策>
./launcher enter app
rails c
$redis.keys('upgrade:*').each{|key| $redis.del key }
日本語カナ・ひらがな検索不具合
Thank you for your reply. A sample paragraph here in katakana 通報テスト9,通報テスト11,通報テスト8…etc A sample search term that you have that is not working テスト The “テスト” is not working. But the “通報” or “通報テスト” seems to be working correctly. ...
設定—>検索
min search term length : 1
へ変更
バックアップファイル容量制限エラー
Nginxの設定によりアップロードエラーが発生するが、直接サーバへバックアップファイルを転送し以下ディレクトリへ格納。所有権も変更。
$ sudo cp ficusonline-forum-2021-11-06-140512-v20211019092048.tar.gz /var/discourse/shared/standalone/backups/default
$ sudo chown docker_user:www-data /var/discourse/shared/standalone/backups/default/ficusonline-forum-2021-11-06-140512-v20211019092048.tar.gz
I’m moving an existing Discourse instance from its current home to an AWS EC2 VM. The site sits behind Amazon load balancers. I’ve already successfully tweaked app.yml with the appropriate set_real_ip_from directives so NGINX knows about the...
Reading time: 1 mins 🕑
Likes: 4 ❤
hljs-theme-pickerエラー
The code block works fine in the past. However, there is an user created a new post with code block yesterday, and I found the format failed. Not only this post with block code, but also whole site. I just rebuild discourse app to the most update...
Reading time: 1 mins 🕑
Likes: 6 ❤
以下任意のcssファイルをテーマのカスタムセクションに追加、 コンポーネント hljs-theme-picker
は削除。
rainbows.css
を直接 Light
テーマに移植。但し以下の padding
と tag
の色指定を追加。
.hljs {
padding: 1.25em !important;
display: block;
overflow-x: auto;
padding: 0.5em;
background: #474949;
color: #d1d9e1;
}
.....
.....
.hljs-tag, .hljs-tag .hljs-title, .django .hljs-tag .hljs-keyword {
color: #bdbdbd;
}
highlight-js
highlight-js theme
Onebox表示エラー
AzureのVMでのみ発生。リンク先アドレス不明と判断されURLのみ表示。
While users can create rich link previews in their posts using oneboxes (See: Create rich link previews with Onebox), there are some controls available to site administrators, and sometimes when links do not preview as expected, it can be helpful...
Reading time: 1 mins 🕑
Likes: 1 ❤
Oneboxテストサイト
上記テストによりリンク先の問題ではない。