Initial commit
This commit is contained in:
parent
a33f3a16d8
commit
e8ef4d3214
|
@ -0,0 +1,19 @@
|
|||
import os
|
||||
import json
|
||||
import requests
|
||||
import flask
|
||||
|
||||
INCOMING_WEBHOOK_SECRET = os.environ["INCOMING_WEBHOOK_SECRET"]
|
||||
REDMINE_URL = os.environ["REDMINE_URL"]
|
||||
REDMINE_API_KEY = os.environ["REDMINE_API_KEY"]
|
||||
|
||||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/incoming-webhook/<token>", methods=['POST'])
|
||||
def incoming_webhook(token):
|
||||
if token != INCOMING_WEBHOOK_SECRET:
|
||||
return {'status': 'error', 'detail': 'Invalid token'}, 403
|
||||
|
||||
return {'status': 'success'}
|
|
@ -0,0 +1,27 @@
|
|||
#! /usr/bin/env python
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
setup(
|
||||
name='gitea-redmine',
|
||||
version="0.1",
|
||||
description='Micro serveur HTTP pour intercepter les webhooks Gitea et mettre à jour les tickets redmine correspondants avec les bons status / liens vers pull requests.',
|
||||
author='Agate Berriot',
|
||||
author_email='aberriot@entrouvert.com',
|
||||
packages=find_packages(exclude=['tests']),
|
||||
include_package_data=True,
|
||||
url='https://gitea.entrouvert.org/entrouvert/gitea-redmine',
|
||||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Environment :: Web Environment',
|
||||
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 3',
|
||||
],
|
||||
install_requires=[
|
||||
'python-redmine',
|
||||
'flask'
|
||||
],
|
||||
zip_safe=False,
|
||||
)
|
Loading…
Reference in New Issue