Compare commits

...

3 Commits

4 changed files with 90 additions and 0 deletions

View File

@ -218,6 +218,24 @@ ACTION=="add", SUBSYSTEM=="tty", \
locations."~ /api/v[0-9]+/(users/)?websocket$".proxyPass = "http://127.0.0.1:8065";
locations."~ /api/v[0-9]+/(users/)?websocket$".proxyWebsockets = true;
};
"hooks.m-labs.hk" = {
extraConfig = ''
location / {
include ${pkgs.nginx}/conf/uwsgi_params;
uwsgi_pass unix:${config.services.uwsgi.runDir}/uwsgi.sock;
}
'';
};
};
};
services.uwsgi = {
enable = true;
plugins = [ "python3" ];
instance = {
type = "emperor";
vassals = {
mattermostgithub = import ./mattermost-github-integration/uwsgi-config.nix { inherit config pkgs; };
};
};
};

View File

@ -0,0 +1,25 @@
USERNAME = "Github"
ICON_URL = ""
# Repository settings
MATTERMOST_WEBHOOK_URLS = {
'default' : ("chat.m-labs.hk/hooks/hookid", "town-square"),
}
# Ignore specified event actions
GITHUB_IGNORE_ACTIONS = {
}
# Ignore events from specified users
IGNORE_USERS = {
}
# Redirect events to different channels
REDIRECT_EVENTS = {
}
SECRET = ""
SHOW_AVATARS = True
SERVER = {
'hook': "/mattermost-github",
}

View File

@ -0,0 +1,32 @@
{ fetchFromGitHub, python3Packages }:
with python3Packages;
buildPythonPackage rec {
pname = "mattermost-github-integration";
version = "0.0.0-unstable";
src = fetchFromGitHub {
owner = "softdevteam";
repo = "mattermost-github-integration";
rev = "master";
sha256 = "1hfvjaxjhliy8sv9j3616fkdwd2jqhfsj9ai7ggx88zhxknrfx85";
};
propagatedBuildInputs = [
appdirs
click
flask
itsdangerous
jinja2
markupsafe
olefile
packaging
pillow
pyparsing
requests
six
werkzeug
];
checkInputs = [
pytest
];
doCheck = true;
}

View File

@ -0,0 +1,15 @@
{ config, pkgs }:
let
pkg = pkgs.callPackage ./pkg.nix {};
in {
type = "normal";
pythonPackages = self: [ pkg ];
module = "mattermostgithub:app";
env = [
"MGI_CONFIG_FILE=${./config.py}"
];
socket = "${config.services.uwsgi.runDir}/uwsgi.sock";
# allow access from nginx
chmod-socket = 666;
}