«> 19. TEXT» is rendered as «> 1. TEXT» Is it a markdown parser bug?
Hide features for non-admin users through plugin
@gingerman wrote:
tldr: I would like to hide certain features in the page & api backend for non-admin users.
For example,
I would like to show the list of liked users only for admin users and not for everyone. The count can be seen by everyone but not the list of users.Of course this is just an example for my specific need. I am sure this feature will not enter in the core but how could I implement this as a plugin ? I would be interested to know about the api overrides (especially) & UI overrides through plugins.
Posts: 6
Participants: 3
Only 1 tag is shown in the latest page
@Alankrit_Choudh wrote:
One of my community members found this out.
Only 1 tag is shown in the latest page.
Whereas at the topic page is
The other tags are missing (anime is my case.)
On chrome latest - and discourse latest.
Posts: 1
Participants: 1
Update failed: Failed to Bootstrap
@Krischan wrote:
I just tried to update my Discourse instance running on Digital Ocean with
git pull
and./launcher rebuild app
. Always worked, not today:FAILED -------------------- Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 869 exit 1> Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn' exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]} ab158c7e72f3547805adf8fcc40254520f99ee5fc5886b6d1355279c0822657e ** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one root@Diskurs:/var/discourse#
Earlier error message:
Parse error at _application-0f0cd464bfe613663fc764d0331ceef8df9386e3cc677c2f0cbfcbee0c69e345.js:99567,22 Unexpected token name «of», expected punc «;» Error at new JS_Parse_Error (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1526:18) at js_error (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1534:11) at croak (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2026:9) at token_error (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2034:9) at expect_token (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2047:9) at expect (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2050:36) at regular_for (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2280:9) at for_ (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2276:16) at eval (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2158:24) at eval (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2073:24) at block_ (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2353:20)
Any help appreciated. Thanks!
Posts: 11
Participants: 5
FAILED TO BOOTSTRAP : 'Pups::ExecError'
@CamilleRoux wrote:
Hi!
Here is the error I get when I try to rebuild my app (Git revision: beta):
Compressing: application-db30cb7af624e44f554adaa4f48e592c263b25627dac6aaded087b41331c3a55.js uglifyjs '/var/www/discourse/public/assets/_application-db30cb7af624e44f554adaa4f48e592c263b25627dac6aaded087b41331c3a55.js' -p relative -c -m -o '/var/www/discourse/public/assets/application-db30cb7af624e44f554adaa4f48e592c263b25627dac6aaded087b41331c3a55.js' --source-map-root '/assets' --source-map '/var/www/discourse/public/assets/application-db30cb7af624e44f554adaa4f48e592c263b25627dac6aaded087b41331c3a55.js.map' --source-map-url '/assets/application-db30cb7af624e44f554adaa4f48e592c263b25627dac6aaded087b41331c3a55.js.map' Parse error at _application-db30cb7af624e44f554adaa4f48e592c263b25627dac6aaded087b41331c3a55.js:99232,22 Unexpected token name «of», expected punc «;» Error at new JS_Parse_Error (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1526:18) at js_error (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:1534:11) at croak (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2026:9) at token_error (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2034:9) at expect_token (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2047:9) at expect (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2050:36) at regular_for (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2280:9) at for_ (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2276:16) at eval (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2158:24) at eval (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2073:24) at block_ (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:22:1), <anonymous>:2353:20) I, [2016-07-29T17:37:24.968689 #13] INFO -- : Purging temp files Bundling assets Compressing Javascript and Generating Source Maps I, [2016-07-29T17:37:24.998638 #13] INFO -- : Terminating async processes I, [2016-07-29T17:37:25.000414 #13] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main pid: 1471 I, [2016-07-29T17:37:25.003670 #13] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 1584 1584:signal-handler (1469813845) Received SIGTERM scheduling shutdown... 2016-07-29 17:37:25 UTC [1471-2] LOG: received fast shutdown request 2016-07-29 17:37:25 UTC [1471-3] LOG: aborting any active transactions 2016-07-29 17:37:25 UTC [1478-2] LOG: autovacuum launcher shutting down 1584:M 29 Jul 17:37:25.013 # User requested shutdown... 1584:M 29 Jul 17:37:25.015 * Saving the final RDB snapshot before exiting. 2016-07-29 17:37:25 UTC [1475-1] LOG: shutting down 2016-07-29 17:37:25 UTC [1475-2] LOG: database system is shut down 1584:M 29 Jul 17:37:31.212 * DB saved on disk 1584:M 29 Jul 17:37:31.216 # Redis is now ready to exit, bye bye... FAILED -------------------- Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 2330 exit 1> Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn' exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]} 57e43153b440f230cf2513f54b0ef86c917261ed63e668021b3d134f7cc4715b ** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
Here are the plugins I'm using:
- git clone https://github.com/discourse/docker_manager.git - git clone https://github.com/discourse/discourse-akismet.git - git clone https://github.com/discourse/discourse-affiliate.git
Posts: 2
Participants: 1
500 error on move topic
@rhyolight wrote:
I'm getting a 500 error indication when I select posts from a topic and attempt to move them into a new topic. See this video for demo:
Posts: 2
Participants: 2
How to use Discord to display Discourse RSS feed
@Trash wrote:
So you want visualize RSS feed from your Discourse forum to your Discord server.
To do that you need a Discord Bot. You can use a hosted bot with an RSS cog and add it to your server or install a self-hosted bot and configure it.
I prefer Red-DiscordBot because it is self-hosted (you can install it on your server, it's very easy to maintain, highly customizable and it has a very active community.)
Setting up the bot
Follow this tutorial to install and configure Red.
Create a new bot account on Discord and add the bot to your Discord server.
Adding the RSS feeds (custom cog)
When the bot is online on your server, you need to add a new custom cog (RSS) from the approved repositories
In your Discord channel type the follow commands:
[p]cog repo add squid-plugins https://github.com/tekulvw/Squid-Plugins
where
[p]
is your own bot's prefix[p]cog install squid rss
You can see the author's message in your channel, remember to type
yes
to complete the installation.Now you have an RSS cog to configure. Choose the channel you want to use to visualize your RSS feed.
Note that every RSS is diplayed only in the channel you send the command, so you can add more RSS in one channel or you can add RSS for more (even all) channels (e.g. in #laboratory channel I have https://meta.discourse.org/latest.rss, in #general http://my.site.net/latest.rss, in #assistance http://my.site.net/c/assistance.rss and so on...)
Type:
[p]rss add Discourse https://meta.discourse.org/latest.rss
where "Discourse" is the name I have assigned to this RSS. You can add more than one RSS, but every RSS must have a different name.
If you use more than one word in your feed name, you have to use the double quotes e.g.
[p]rss add "Discourse Support" https://meta.discourse.org/c/support.rss`
Now you can add a template without link preview:
[p]rss template Discourse $name:\n$title\n<$link>
or with link preview:
[p]rss template Discourse $name:\n$title\n$link
To force the feed preview type:
[p]rss force your-feed-name
(e.g.[p]rss force Discourse
)This is the result without preview:
Discourse RSS feeds
http://your.site.net/posts.rss
latest posts (if your site is medium or big this link can create a lot of traffic in your Discord channel. Maybe create a channel only for RSS feed is better).http://your.site.net/t/title-of-the-topic/number-id.rss
for a particular topic (e.g.https://meta.discourse.org/t/babble-a-chat-plugin/31753.rss
to follow the thread about Babble plugin)http://your.site.net/latest.rss
latest topicshttp:/your.site.net/top.rss
top rated topicshttp://your.site.net/c/support.rss
posts and topics from a category (e.g. #support)http://your.site.net/users/someone/activity.rss
latest posts from someone (changesomeone
with an username, e.g.codinghorror
)http://your.site.net/users/someone/activity/topics.rss
latest topics from someone (changesomeone
with an username, e.g.codinghorror
)http://your.site.net/groups/team/posts.rss
all the public posts from a group (changeteam
with the name of your group).
Thanks to @erlend_sh for his review
Posts: 2
Participants: 2
Mapping "external names" to usernames vs names when using SSO
@swisspol wrote:
Hi,
I'm right in the middle of setting up a trial Discourse instance and this includes configuring SSO with the user accounts on an external server. These user accounts must have an email / password, and they may have an optional name and avatar. That name is not guaranteed to be unique and can contain arbitrary UTF8 including whitespace.
Looking at the docs, I have no idea if this "external name" should be mapped to the Discourse "name" or "username"? I assume Discouse usernames have to be unique and can't contain whitespace, so I may have to use "name". But then what happens if the SSO'ed Discourse accounts have a name but no username?
Thanks for any help!
PS: I plan to enable all the "sso overrides" settings so that things remain in sync.
Posts: 3
Participants: 2
Rss feed to threads or posts in Discourse based forums
@Gomu wrote:
Hi,
I am new to discourse and i was searching for the feature where Rss feed from various sources will be converted to threads or posts in Discourse based forums community that I want to start.
Can anyone tell me where can i find it ?
Posts: 2
Participants: 2
Invite someone to join and give them a staged user account
@tobiaseigen wrote:
I still don't fully understand how the staged user functionality works but am wondering if it can be employed to support our outreach workflow.
We spend alot of our time inviting people to join our network. It would be really helpful if moderators could send a PM to an email address and for it to be associated with a new staged user, so if they reply the message remains with there so we can keep an eye on it and follow up. When they do join the staged user would become a full user, and we can mark it completed.
As it is, we use PMs actively to support people once they are signed up and have to use email before they sign up.
Posts: 3
Participants: 2
Problem when uploading images
@ClubPokemon wrote:
Why it is very slow to upload an image inside topic? I am using Digital Ocean build in Discourse Apps. The spec follow the minimum requirement from Discourse.
Only a small size images. Currently 200kb images still waiting to be uploaded.
Posts: 3
Participants: 2
'rake posts:rebake' killed
@CamilleRoux wrote:
Hi,
I can't rebake all posts because of this error:
# rake posts:rebake Rebaking post markdown for 'default' 1071 / 20326 ( 5.3%)/usr/local/bin/rake: line 2: 32559 Killed RAILS_ENV=production sudo -H -E -u discourse bundle exec bin/rake "$@"
thanks
Posts: 1
Participants: 1
API post creation breaks if post contains an ampersand
@nivshah wrote:
When posting to the
/post
end point to create a post (a little redundant I know), if theraw
parameter contains an '&', the body of the created post will contain everything up to that '&' but won't include the '&' or anything after it. For example:
curl -X POST -d topic_id=topic_id -d raw="This is a test post with an ampersand & nothing after the ampersand will show up in the post" http://discourse.example.com/posts?api_key=api_key&api_username=api_username
The post is still created, so I imagine there is something bugged out on the /post endpoint? I tried changing '&' to something html-safe like '&' but the post body ends no matter what at the '&'.
EDIT: To add some more context, if I pass along a raw parameter such as:
-d raw="This is a test post with an ampersand \\& does it work"
The response contains:
"cooked":"\u003cp\u003eThis is a test post with an ampersand \\\u003c/p\u003e"
Posts: 3
Participants: 2
Hidden icons in menu items of user pages?
@claas wrote:
I noticed that the menu items on the user pages have icons that are there, but hidden. Is this a bug or a feature?
Go here:
It looks like this:
And it could look like this (by removing the glyph css class from and adding a whitespace after the icons):
Posts: 5
Participants: 3
Editor image/file upload selector: wrong tips
@claas wrote:
When I Add an image or a file via the icon, the remote_tip_with_attachments (client.yml) is also shown for the from_my_computer field (instead of the local_tip_with_attachments):
This is because both reference {{tip}} rather than the specific translation keys:
Posts: 1
Participants: 1
How to Return 200 OK for certain IPs
@P16 wrote:
I need to return a 200 OK to certain IPs which are getting a 301. The details are:
"GET / HTTP/1.1" "GoogleHC/1.0" "-" 301 439 "-" - 0.0
I need to return a 200 instead of the 301 and 439. Can someone please help?
Posts: 8
Participants: 2
Category notification settings don't adjust reliably
@claas wrote:
I noticed this in an internal instance and I just reproduced it here on meta:
- Go to a category, such as #plugin:extras (where you did not customise your notification setting yet, so it defaults to Normal).
- Change the setting to anything else, e.g. Muted.
- Reload the page using your browser (e.g. F5).
- If the setting is as expected, try changing to another setting (including Normal).
If the setting is not as expected, that's the bug.Sometimes the settings are applied, but more often they are not, in particular when switching between Normal, Watching and Muted (but this last observation could just be my impression).
(Workoaround: Go to the preferences and set the notification settings there – and don't forget to Save Changes.)
P.S.: While the XHR HTTP POSTs to the notifications endpoint yield a
HTTP 200
, I noticed that they submit thenotification_level
as a string (i.e. "0" for Muted, "1" for Normal up to
"3" for Watching), but maybe this is intentional and not the problem.
Posts: 1
Participants: 1
"suppress uncategorized badge" and "topic page title includes category" settings don't appear to work
@swisspol wrote:
Hi,
I disabled "suppress uncategorized badge" and "topic page title includes category" settings but this doesn't appear to have any effect:
PS: This is a on a trial Discourse instance at http://community.hyperrr.co/.
Posts: 2
Participants: 2
Migration of Google Groups to Discourse
@pacharanero wrote:
Continuing the discussion from How to import Google Groups to Discourse:
Here is a 'working prototype' of a google group migration script that attempts to be more 'all-in-one' and reduce the number of steps, complexity and difficulty of doing google group imports.
Having finally gotten around to doing a pro-bono google group import I promised to do for the wonderful Valentina Project, I had to re-familiarise myself with the available google group scraping tools, as suggested to me by @erlend_sh, who pointed me in the direction of a few google group scraping libraries and Discourse's own mbox importer script. So while it's all in my head I thought I'd have a go at a more user-friendly import script, and some documentation for it.
Thanks to @steinwaywhw for his work, both in the linked topic and in https://meta.discourse.org/t/an-importer-for-google-groups/45624, without which I wouldn't have been able to do this.
Notes
- I think I may have solved the problem of email addresses being redacted by Google Groups, (it doesn't happen if you are logged is with a Manager account) so that now, the
mbox.rb
importer can create users in Discourse with the correct email addresses. Those users would only need to do a password reset in order to be able to log into their new user on Discourse, and all their Google Group posts would be correctly assigned to them. I've tested this on a real migration, and I'm keen to get feedback from other testers.- I've tried to use the OO design pattern established in the other import scripts, for example
ImportScripts::Mbox
subclassesImportScripts::Base
. In my case, I wanted to use a lot of functionality fromImportScripts::Mbox
, so my script is a subclass ofImportScripts::Mbox
.- It works.... but it's definitely not finished yet and I'd appreciate constructive criticism, pull requests and amusing emoji.
How to use it
You will need to be a little bit familiar with the Linux command line, SSH and stuff like that. I've tried to make the step-by-step instructions as clear as possible, but there might be slight variations in the output of certain commands. Please reply to the thread if you are having problems.
Cookies. In order to be able to extract users' email addresses correctly from the Google Group, you will need to have Manager access to the Google Group. Having logged into Google Groups (on your normal computer) with this Manager account, export the Google cookies from your browser. (I used the cookies.txt Chrome extension to get the cookies.txt file (Without this step, the scrape will work BUT the email addresses are truncated/redacted by Google Groups so they look like this:
marcu....@gmail.com
, and of course this messes up creation of new users on Discourse)Upload cookies.txt. Once you have the cookies.txt file, the easiest way to get it into your Docker container from your computer is to upload it as an attachment to any post in your discourse forum. You will need the file path for the next step, you can get the URL from the post, it will be something like:
/uploads/default/original/1X/245aa0cdc6847cf59647e1c7102e253e99d40b69.txt
SSH into your server
$ ssh user@your-discourse-server
Change directory into the Discourse directory
$ cd /var/discourse
Enter the Discourse Docker container, using ./launcher tool.
$ ./launcher enter app
Copy cookies.txt to
/tmp/
so that the import script can find it. Prepend/var/www/discourse/public
to the URL from the previous step, this gives you the full file path, to use with thecp
(unix copy) command:# cp '/var/www/discourse/public/uploads/default/original/1X/245aa......40b69.txt /tmp/
Install some stuff that's needed by
mbox.rb
, the importer script, for its index# apt install sqlite3 libsqlite3-dev
# gem install sqlite3
Change into the import scripts directory with the
cd
command.# cd /var/www/discourse/script/import_scripts
Get the google group script (and the monkeypatched version of
mbox.rb
it requires)# wget https://raw.githubusercontent.com/pacharanero/discourse/master/script/import_scripts/googlegroups.rb
`# wget https://raw.githubusercontent.com/pacharanero/discourse/master/script/import_scripts/mbox.rb'Change user to the
discourse
user so that you can make changes to the database# su discourse
Run the script!
# ruby googlegroups.rb
name-of-your-google-group
Any problems, please feel free to discuss in the replies.
Marcus
Posts: 2
Participants: 1
Installed without error but won't run - getting a file open error
@Derek_Lai wrote:
I was able to get v1.6.0beta9 installed and working. However, have been having problem with v1.6.0beta11 and beta12. The installation finished without error however, I get a "Page isn't working" error. When I run ./launcher logs app, it looks like maybe a certificate file is missing
nginx: [emerg] BIO_new_file("/shared/ssl/test-discourse05.b2s.local.cer") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/test-discourse05.b2s.local.cer','r') error:2006D080:BIO routines:BIO_new_file:no such file)
How do I generate this "shared/ssl/test-discourse05.b2s.local.cer file?
Thanks,
Derek
Posts: 1
Participants: 1