Make all Public Channels visible

Mattermost Version: 7.5.2
Database Schema Version: 95
Database: postgres

How do I make all public channels visible in the left sidebar for all new members by default, without making the user search first?
Is there another way, without letting the user join?

Hi Akito,

no, unfortunately not - the LHS menu only shows channels you’re part of. For everything else, you need to use the “Browse Channels” feature/button to search for public channels you could be part of.
You could, however, join your users to all channels automatically, not sure if that’s feasible. Being part of a channel also sends you notifications for everything that happens in those channels (although the users could mute them then or leave them if they think they do not require it).

Yes, thought that, too. In my case, it’s easier to make them leave, rather than getting them to join a new channel.

Where would I set the option for auto-joining?

It’s in your config.json, section TeamSettings and there the option ExperimentalDefaultChannels. It’s a JSON array of channel names new members will get joined to, but I’ve not had luck in a short test getting it to work, maybe your faith is better :slight_smile:

1 Like

I was just looking for a feature to make new users and existing users automatically join a sets of channels. how can I access ExperimentalDefaultChannels from a docker installation? and is there simple way to add/invite all existing members to a recently created channel?

The docker deployment also has config.json and it’s mounted to the host.
In the base directory of your docker deployment, you should have the folder structure volumes/app/mattermost/config and in there is the config.json file for your container.

I just tried this feature again and it works very well, new users are automatically being added to the public channels! Let’s say your channels are named public1 and public2, then this is what the settings needs to look like in your config.json:

        "ExperimentalDefaultChannels": [
            "public1",
            "public2"
        ]

Newly created users will then automatically be joined to this channels and will see them in the LHS menu:

grafik

To add existing members to existing channels, you can use the commandline tool mmctl for doing that quickly. With a docker deployment, it’s also inside the container, so you’d have to access it using docker exec:

# docker exec <yourcontainerid> mmctl
Mattermost offers workplace messaging across web, PC and phones with archiving, search and integration with your existing systems. Documentation available at https://docs.mattermost.com

Usage:
  mmctl [command]
[...]

mmctl requires authentication or a local socket (which is also not enabled by default on the docker deployments), so you should set the settings ServiceSettings.EnableLocalMode to true in your config.json (see the path above), then restart the application container and afterwards you should be able to run the following command:

# docker exec <yourcontainerid> mmctl --local system version
Server version 7.8.1.7.8.1.1738519c0a6c648f3f0d5685040ab2c9.false

If this command returns your server version, you know it’s working and when this is the case, you can start adding users to the channels.

To list all users:

# docker exec <yourcontainerid> mmctl --local user list
wcq7ruhex7nz5msm8qdigpjexy: appsbot (appsbot@localhost)
ofb5ff4ytbnzjmqqy1gdkqpycr: boards (boards@localhost)
[...]

To list all channels:

# docker exec <yourcontainerid> mmctl --local  channel list test
off-topic
public1
public2
town-square

There are 4 channels on local instance

To add a user to a channel:

# docker exec <yourcontainerid> mmctl --local channel users add <teamname>:<channelname> <username>

And you can also create a small bashscript to add all listed users from above.

Let me know if this helps or if your require further information on any of these topics.

2 Likes