Quantcast
Channel: Discourse Meta - Latest topics
Viewing all 60309 articles
Browse latest View live

Rake task to bulk change users and groups in a message?

0
0

@tobiaseigen wrote:

I hope I am able to explain my need properly here - thinking on my feet so let me know if this does not make sense.

The question: is there a rake task to bulk change users and groups in messages?

The background: I have been using the moderators group to include more of my team in member support messages, as part of the experimentation around using discourse as a ticket system. Now I want to create a new group for providing member support and use that instead from now on. I’d also like to bulk update the history of messages so this new group is in those messages instead of the moderators group.

Bonus points for leaving alone automated moderator messages, but not essential.

Posts: 1

Participants: 1

Read full topic


Thanks, Discourse Devs

0
0

@dmagill wrote:

I’m in the process of transitioning a community that has been using MailMan for 13 years into Discourse.

Yesterday I mass invited everyone on the list and this weekend I’m importing all of that 13 years of history through the import tool. Those 13 years of history have been basically lost to time and unsearchable. After this weekend, we’ll be able to go back in time and re-discover good conversations that we should have been able to re-visit previously.

Just wanted to say thank you to the dev team and everyone who offers support. It’s a fantastic tool and I feel like I’m bringing my group into the 21st Century. You probably aren’t in this to get accolades, but it never hurts to know that you are having a positive impact on others. This is a great platform, and keep up the good work!

Posts: 2

Participants: 2

Read full topic

Image pattern option for category backgrounds

0
0

@terraboss wrote:

Hey friends,
since I saw this post from Angus yesterday, I felt inspired by the idea to round up some categories by decent stylish background images.

But most of you might know the main issue: To support large screen resolutions, it’s necessary to upload even larger images. This actually sucks in many ways:

  1. Long page loadings
  2. Wasted transfer volume (mobile users)
  3. There is no “image fits all sizes” option

Therefore, my idea is to add …

  1. … a checkbox with the option to use the image as pattern
  2. … a dropdown menu with 3 (or more) text style options (black/white/customized)

What do you think about this? Is it much work to implement such a feature?

Best

Posts: 2

Participants: 2

Read full topic

Inconsistent behaviour in plugins between development and production

0
0

@eatcodetravel wrote:

There is an inconsistency on how add_to_serializer works between development and production. This is due how plugins are applied

Given we reload the code in development, every modification we do to a parent serializer, children will pick them up. To reproduce this inconsistency you can execute the code below

add_to_serializer(:basic_user, :created_at) { user.created_at }

If you execute this in development, all descendants of BasicUserSerializer will have the created_at attribute. In production only BasicUserSerializer will have that attribute.

UserNameSerializer._attributes
=> {:id=>:id, :username=>:username, :avatar_template=>:avatar_template, :name=>:name, :title=>:title}
BasicUserSerializer._attributes
=> {:id=>:id, :username=>:username, :avatar_template=>:avatar_template, :created_at=>:created_at}

The problem is due how ActiveModel::Serializer works, and I’m not sure if they want to support this use case, they only get the attributes from the parent once when you call the attributes(*attrs) method.

Workaround

Here’s a workaround to this problem, this is how I’m dealing with it atm.

Inside a plugin do

after_initialize do
  # Monkey patch ActiveModel::Serializer to allow us
  # reload children serializers attributes after parent is modified
  class ::ActiveModel::Serializer
    # Update _attributes with superclass _attributes
    def self.reload
      self._attributes = _attributes.merge(superclass._attributes)
    end
  end

  add_to_serializer(:basic_user, :created_at) { user.created_at }

  # Reload all children serializers, so they include :created_at
  BasicUserSerializer.descendants.each(&:reload)
end

I saw some PRs from you @sam in the AMS repo, maybe you can take a look at this.

Thanks!

Posts: 2

Participants: 2

Read full topic

Disclosure of S3 secret access key

0
0

@Asher_Densmore-Lynn wrote:

I was working on a Discourse forum – v2.0.0.beta9 – recently, when I spotted the Files tab of the administrative settings. I was surprised to see the S3 secret key displayed to the user, and I was horrified to observe that my changes to it were echoed, in full, in the dashboard logs.

This means that an attacker who manages to simply observe the Files tab has the ability to seize and delete Discourse backups during a rampage.

Please consider not displaying the secret key to even administrative users, and simply noting who changed the key and when in the audit trail.

Thanks.

Posts: 11

Participants: 4

Read full topic

IAM and bucket policy for S3 access

0
0

@Asher_Densmore-Lynn wrote:

I noticed that all of the tutorials i found for Discourse S3 access granted the user absolute authority over the bucket – they allow ‘s3:*’ authority.

This is an extremely unwise policy, since it allows significantly more control over the bucket than is reasonable. Should you be using S3 for Discourse backup storage, a rampaging attacker would be able to delete your bucket and your backups on the way out.

There are two ways to combat this: One, a tighter policy…

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "s3:List*",
                "s3:Get*",
                "s3:AbortMultipartUpload",                
                "s3:DeleteObject",               
                "s3:PutObject"               
            ],
            "Resource": [
                "arn:aws:s3:::whatever-bucket",
                "arn:aws:s3:::whatever-bucket/*"
            ]
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "s3:ListAllMyBuckets",
                "s3:HeadBucket"
            ],
            "Resource": "*"
        }
    ]
}

… and two, apply some sensible precautions to the bucket policy. (This is actually well beyond what the actual minimum would need to be, but I was in a hurry and didn’t have time to experiment, and it’s better than what I found.) I’d recommend turning on versioning, and then setting a lifecycle rule for “previous versions” that sees them reaped after a reasonable time, like 21 days. The given policy would permit log rotation and file deletion, but it would not allow the S3-credentialed user access to restore or purge previous versions, and that means that although they could delete a backup, a rampaging attacker couldn’t wipe it from the version history before an administrator with root credentials could salvage it.

Thanks!

Posts: 9

Participants: 4

Read full topic

Custom top navigation links

0
0

@Johani wrote:

This is a theme component that will allow you to add links to Discourse top navigation.


Repository link:

https://github.com/hnb-ku/Discourse-nav-links-component

Preview

https://theme-creator.discourse.org/theme/Johani/nav-links


Samples:

Desktop

Mobile


Settings:

A navigation link needs three things

  • Name
  • Description
  • Path or URL

Name is the text for the link that shows up on the menu. Description shows up when you hover the name like this:

Path/URL is where you want the link to go.

You can add links as semicolon delimited values in theme settings following this order

name;description;URL

URL can also be relative like

/c/staff

/t/232

/groups/plugin_authors

/about

/tags/theme-component


How do I install this theme?

follow the official theme installation guide here:

Then add the component to your theme as a theme component and you’re all set!


Posts: 1

Participants: 1

Read full topic

Need help! with gmail and dicourse

0
0

@Danielh90 wrote:

Hello, I got Dicourse and running and I’m using bitnamihosting.com to host my discourse forum. But it seems like I can’t get the email setup right. It will fail I’m trying to use a email. I think I’m doing everthing right. Here’s my config I think I have it all setup correct but when I try and do a test email. I get this https://i.imgur.com/TBSXx6Q.png Can someone help me?
image

Posts: 4

Participants: 2

Read full topic


Vdo on google drive not show and play on ifram

Extracting discourse's text diffing functionality

0
0

@gdpelican wrote:

I’ve recently found myself with a need for Discourse’s excellent post diffing functionality in a project.

Normally for a project like this I’d take a look at Discourse’s code and re-implement it to my taste, but this time it struck me as an great library to extract (given that it’s self-contained and uses a computer-sciency algorithm with a fancy name and whatnot)

I’ve extracted it to a gem here:

Which is a straight port of the existing functionality, no fiddling necessary, for anyone else who might need such a thing.

(PS, more than happy to transfer ownership of this to the Discourse team if they want that, as long as I can keep using it :slight_smile: )

Posts: 1

Participants: 1

Read full topic

Site & SSH inaccessible after Discourse installation

0
0

@jwtan wrote:

Hi,

I have rebuild discourse with a new app.yml and the site became inaccessible.
SSH is not connecting. Which means nothing I could do to make changes.
Any advice?

Thanks

Posts: 4

Participants: 2

Read full topic

Weird tag deleting

0
0

@ncl wrote:

A tag created by mistake, it doesn’t show on /tags list,
neither in the tags group, even /tags/{tag}
but only appear when you are going to have a new topic,
it’s just right there, couldn’t find any way to let it disappear :frowning:

Posts: 1

Participants: 1

Read full topic

Can I install Discourse alongside Plesk Cpanl

0
0

@nit wrote:

Can I install Discourse on a VPS with Pleks Control Panel on it !?

Does it create any issue with Pleks and Discourse

Posts: 2

Participants: 2

Read full topic

User custom fields for SSO payload

0
0

@kinqsley wrote:

How can I update user’s custom field value through SSO payload params everytime the user logins?

I am using a sso for php repo by GitHub - cviebrock/discourse-php: A PHP class for helping with Discourse's SSO login

I have created a user custom field named Fame

$params= array('name' => 'johndoe', 'custom.Fame' => '7788' );
$query = $sso->getSignInString($nonce, $session->id, $session->email, $params);

But it doesn’t update to the user.

Posts: 1

Participants: 1

Read full topic

'Last IP address' being prefixed by '::ffff:'

0
0

@AstonJ wrote:

This appears to have started recently - if you go to a user’s profile > admin - their last IP address is shown as prefixed with ::ffff: (and so when you do an ip lookup it does not work).

Posts: 3

Participants: 2

Read full topic


Cant update email via API - invalid_access error

0
0

@shahidmir wrote:

Hi Guys,

Im getting an error when trying to use the API to update email.
I have looked at the logs and can see the following:

Started PUT “/discussion/users/davetest/preferences/email.json” for xx.xx.xx.xx at 2018-05-11 12:22:11 +0000

Processing by UsersEmailController#update as JSON

Parameters: {“api_key”=>"[FILTERED]", “api_username”=>“daveAdmin”, “email”=>“new.email@example.com”, “username”=>“davetest”}

Can’t verify CSRF token authenticity.

This is a PUT request, but looking at the scopes below, doesnt seem like PUT is supported for the WRITE scope? surely im misunderstanding, so could someone please assist?

I have re-generated the all-user api-key, also created specific user api-keys to use, but same result.

SCOPES = {
read: [:get],
write: [:get, :post, :patch],
message_bus: [[:post, ‘message_bus’]],
push: nil,
notifications: [[:post, ‘message_bus’], [:get, ‘notifications#index’], [:put, ‘notifications#mark_read’]],
session_info: [[:get, ‘session#current’], [:get, ‘users#topic_tracking_state’]]
}

Regards

Posts: 1

Participants: 1

Read full topic

Changing a user's id

0
0

@Alexander_Wright wrote:

Hi,

My Discourse instance is authenticating against my organisation’s membership system via the discourse-oauth2-basic plugin.

It uses the membership number from the membership system as the Discourse user_id.

Now some bright person has swapped two users’ ids in the membership system, so they are now logging in to each other’s accounts. Grrrr.

Is it possible to change the user_id of an account on Discourse? I’m guessing that I’ll have to go through every table updating user_ids on both user’s posts. My approach is to do the following:

User A (user_id=1)
User B (user_id=2)

  1. Find all rows in all tables with user_id=1 and update to user_id=99999
  2. Find all rows in all tables with user_id=2 and update to user_id=1
  3. Find all rows in all tables with user_id=99999 and update to user_id=2
  4. Find the person that thinks that sharing membership ids is a good thing and educate them.

Does anyone see a problem with the above?

Cheers!

Posts: 1

Participants: 1

Read full topic

Problem with opening external links

0
0

@Garrick wrote:

Hey guys. I have the settings set under user preferences for default external links in new window. However its not working any longer. It was working until today when I checked. Not sure how long ago it stopped.

Under my personal user preferences there is no where to set it.

Posts: 1

Participants: 1

Read full topic

Seeing assigned topics in advanced search

0
0

@jordan1909 wrote:

I am writing a tool to help my team find their assigned topics by user. I was trying to put together a search query that would be something like:

@username assigned:staffmember in:solved 

or other similar things. Is this possible? I saw that @tobiaseigen seemed to be doing something similar here: Searching “Solved” posts but I can’t seem to replicate this.

Posts: 7

Participants: 2

Read full topic

Not receiving notifications for announcements

0
0

@LeoMcA wrote:

I have #feature:announcements set to Watching, but for the past 3 or so sets of release notes (like this one) I haven’t received a notification for it, and have only found it in my New list.

Once I open the topic, it says that it is set to Watching, despite my not receiving a notification for it.

Posts: 3

Participants: 3

Read full topic

Viewing all 60309 articles
Browse latest View live




Latest Images