Skip to content

Instantly share code, notes, and snippets.

View coltoneshaw's full-sized avatar
Verified

Colton Shaw coltoneshaw

Verified
View GitHub Profile
@coltoneshaw
coltoneshaw / merge.sql
Created March 27, 2024 20:58
Merge Mattermost Channels
-- This makes a few assumptions that the secondary channel's setup information is now irrelevant and is being deleted
-- this means sidebar preferences, data retention, channel members, etc. are all being deleted in favor of what is setup on the primary
-- Playbook channel data IS moved to the new channel. However, if the playbook resides on the old team it'll need to be manually moved.
DO $$
DECLARE
_primaryChannelId VARCHAR := 'primary_channel_id';
_secondaryChannelId VARCHAR := 'secondary_channel_name';
@coltoneshaw
coltoneshaw / go.mod
Created March 25, 2024 18:29
Merge jsonl with db users and org users.
module warpcore_fix
go 1.22
require github.com/mattermost/mattermost/server/public v0.1.0
require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/dyatlov/go-opengraph/opengraph v0.0.0-20220524092352-606d7b1e5f8a // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
package main
import (
"encoding/json"
"fmt"
"os"
"strings"
"time"
)
@coltoneshaw
coltoneshaw / README.md
Last active October 30, 2023 18:28
Mattermost Kubernetes Azure setup

Mattermost Kubernetes Azure setup

This guide shows you how to setup Mattermost deployed via Kubernetes.

Prereqs

  • Have an Azure account
  • Have a domain name that can be used.

Setup

@coltoneshaw
coltoneshaw / Setup guide.md
Last active January 6, 2023 21:25
fapolicyd with Mattermost

Summary

You are trying to use Mattermost and have fapolicyd enabled and want them to play nicely.

Steps

  1. Create a rule file The naming convention for your rule is really important here. It must come before the rule that's denying Mattermost. If you're using a stock fapolicyd then 80 works fine. You can check the deny rule with the troubleshooting steps.
@coltoneshaw
coltoneshaw / Phase 10.md
Created November 1, 2022 20:49
LDAP Sync Process

Phase 10- Sync Group Members to Channels and Teams

This is the bulk of what you see on the frontend. This takes the existing groups and syncs the end users to their specific teams and channels associated with that group.

Errors:

  • phase10SyncGroupMembersToChannelsAndTeams
    • ??
    • Appears to be a general error if it cannot find the last ldap job. Seen with the error below.
  • app.job.get_newest_job_by_status_and_type.app_error
  • Failed to fetch the last LDAP job from the store.
@coltoneshaw
coltoneshaw / upgrade_mattermost.sh
Last active April 11, 2022 12:20
Upgrading Mattermost
#!/bin/bash
MATTERMOST_INSTALL_DIR=/opt/mattermost
SETUP_DIR=/tmp
SETUP_DIR=setup
echoStatus () {
echo ""
printf '=%.0s' {1..80}
echo ""
printf "\n $1 \n"
@coltoneshaw
coltoneshaw / Observations.md
Last active March 19, 2024 07:41
Postgres Replica Setup Observations

Observations

Config Suggestions

If the database has less than 12GB RAM, reduce the below settings.

Note that you can set shared_buffers and effective_cache_size higher on the primary database because they generally receive less traffic.

Primary Database

@coltoneshaw
coltoneshaw / upgrade.sh
Last active May 15, 2021 08:11
Upgrade script for Mattermost Docker Install
#!/bin/bash
# Credit for helping to outline the correct upgrade process goes to @tuxity and @GuidoDr
##
## Instructions
##
# 1. Edit the variables below to match your environment. This uses default variables and assumes you're on 5.31.0.
# If you're wanting to use another version of Postgres/Mattermost , update the variables as desired.
@coltoneshaw
coltoneshaw / ChannelMemberHelp.md
Last active December 15, 2020 14:43
Mattermost ChannelMember Mention & MsgCount Explanation

UserA Sends "Hello" to UserB

In this example UserA sent "Hello" via DM to UserB. UserB has yet to read the message, so the mentionCount is 1, and the MsgCount is 0 for UserB.

ChannelId Username MsgCount. MentionCount
k7az1dt6nig67kgdcgfyxbn4we UserA 1 0
k7az1dt6nig67kgdcgfyxbn4we UserB 0 1