Giter Club home page Giter Club logo

mattermost-plugin-disable-dm's Introduction

mattermost-plugin-disable-dm

A mattermost plugin to disable direct messages and group chats.

Installation and setup

Platform & tools

Building the plugins

  • Run the following commands to prepare a compiled, distributable plugin zip:
$ mkdir -p ${GOPATH}/src/github.com/Brightscout
$ cd ${GOPATH}/src/github.com/Brightscout
$ git clone [email protected]:Brightscout/mattermost-plugin-disable-dm.git
$ cd mattermost-plugin-disable-dm
$ make dist
  • This will produce three tar.gz files in /dist directory corresponding to various platforms:
Flavor Distribution
Linux mattermost-plugin-disable-dm-v<X.Y.Z>-linux-amd64.tar.gz
MacOS mattermost-plugin-disable-dm-v<X.Y.Z>-darwin-amd64.tar.gz
Windows mattermost-plugin-disable-dm-v<X.Y.Z>-windows-amd64.tar.gz

This will also install, Glide - the Go package manager.

Install the plugin to Mattermost

  • Make sure that the plugin uploads are enabled in PluginSettings.EnableUploads in your config.json file.
  • Go to System Console > Plugins (Beta) > Management and set Enable Plugins to true.
  • From System Console > Plugins (Beta) > Management, upload the plugin generated above based on the OS of your Mattermost server.
  • Once installed, open System Console > Plugins (Beta) > Team Membership in left-hand sidebar and configure the plugin settings.
  • Enable the plugin from System Console > Plugins (Beta) > Management.

Made with โ™ฅ by Brightscout

mattermost-plugin-disable-dm's People

Contributors

chetanyakan avatar mkdbns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mattermost-plugin-disable-dm's Issues

Admin override?

Disabling DMs based on user roles would be a nice addition. I want to disable members sending DMs to one another, but still be able to send them DMs as admin of the server.

Non intuitive UI for blocked DMs

As I mentioned in mattermost/mattermost#2440 (comment) the DM-UI needs some polish to make it viable in a educational context.

Right now the plugin blocks DMs to a user and displays this as follows:

image

In cases where sending DMs is blocked the user is still able to create a new DM-Channel which then doesn't work. A more intuitive approach would be to hide the plus button next to "direct message" so users on an instance with disabled DMs can't even open a new DM-Channel.

darwin/amd64 error: exit status 2

Error while creating plugin zips

Golang: 1.19.4
Last command used: make dist

Behaviour:

Building plugin

mkdir -p dist/disable-dm/
cp plugin.json dist/disable-dm/
# Build files from server and copy server executables
cd server && go get github.com/mitchellh/gox
/home/mattermoster/go/bin/gox -osarch='darwin/amd64 linux/amd64 windows/amd64' -output 'dist/intermediate/plugin_{{.OS}}_{{.Arch}}' ./server
Number of parallel builds: 1

-->   windows/amd64: github.com/Brightscout/mattermost-plugin-disable-dm/server
-->    darwin/amd64: github.com/Brightscout/mattermost-plugin-disable-dm/server
-->     linux/amd64: github.com/Brightscout/mattermost-plugin-disable-dm/server

1 errors occurred:
--> darwin/amd64 error: exit status 2
Stderr: # github.com/Brightscout/mattermost-plugin-disable-dm/server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:136:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:151:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:166:3: //go:linkname must refer to declared function or variable
server/vendor/github.com/mattermost/mattermost-server/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:166:3: too many errors

make: *** [Makefile:162: build] Error 1

Expected behavior:

  • Creating "mattermost-plugin-disable-dm-v<X.Y.Z>-linux-amd64.tar.gz" in /dist

Build fails with go 1.12 due to `go vet -shadow` in Makefile

So, the go developers decided to remove the "experimental" checker shadow (see golang/go/issue/29260 and references therein). This means that the Makefile throws an error at line 69 where it tries to run @$(GO) vet -shadow $(PKGS):

Running GOVET
vet: flag "-shadow" not defined
Run "go help vet" for more information
make: *** [govet] Error 2

Taking the brualist approach and deleting that line allowed the build to complete. It would be great if the Makefile was corrected at source, please.

[Req] Exceptions list

Hello,

Would be great to have a feature to whitelist some users/channels.

Thank you!

make dist returning error: Recipe for target 'govet' failed

Hi!

I'm trying to implement this plugin into my mattermost setup. I've enabled plug in and am in need of uploading the plugin, but I can't seem to make the dist directory.

This is the error I get:

Running GOVET

image

I've tried making systemlinks, but that didn't work :(

Any help would be greatly appreciated! Alternatively, if anyone has the built version I can upload to my mattermost team that would be great too!

Thanks!

Binary archives

Hello!

I think it would be useful to have binary releases for this plugin like this

Thank you!

recipe for target 'govet' failed

hi all

can somebody help us? we install the described versions, but became this issue on create it.

Running GOVET
go vet: can't execute /bin/shadow -flags: fork/exec /bin/shadow: no such file or directory
Makefile:62: recipe for target 'govet' failed

or can somebody send me the linux dist plugin file? on release it is included an .exe file

thank you for helping

Users can still create Private Channels

Hi, I'm trying to run a mattermost server for my children and their friends learning during lockdown.

I'm running the team edition.

I want to disable all mechanisms for users to send private messages to each other. This includes direct messages, group direct messages and private channels. Ideall I, as sysadmin would still be able to send them, but this isn't essential.

I've installed this plugin and it works great for disabling private direct messages.

However, because I'm running the team edition, I can't use the new permissioning system in mattermost. The ability to turn off private channels seems to have been a feature in v4, but in v5 it's only available to people running paid versions of the server.

Is it possible for this plugin to also restrict users from creating private channels?

{GOVET} make dist config file error

Command used: make dist
user: server user with additional root access
folder: mattermost-plugin-disable-dm#

Getting dependencies using glide

cd server && go get github.com/Masterminds/glide
cd server && /root/go/bin/glide install
[WARN] The name listed in the config file (github.com/Brightscout/mattermost-plugin-disable-dm/server) does not match the current location (.)
[INFO] Downloading dependencies. Please wait...
...
[INFO] Replacing existing vendor dependencies

Running GOVET
cannot find package "/src/github.com/Brightscout/mattermost-plugin-disable-dm/server" in any of:
/usr/local/go/src/
/src/github.com/Brightscout/mattermost-plugin-disable-dm/server (from $GOROOT)
/root/go/src//src/github.com/Brightscout/mattermost-plugin-disable-dm/server (from $GOPATH)
cannot find package "
/src/github.com/Brightscout/mattermost-plugin-disable-dm/server/config" in any of:
/usr/local/go/src//src/github.com/Brightscout/mattermost-plugin-disable-dm/server/config (from $GOROOT)
/root/go/src/
/src/github.com/Brightscout/mattermost-plugin-disable-dm/server/config (from $GOPATH)
make: *** [Makefile:66: govet] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.