[](https://badge.fury.io/py/sentry-auth-gitlab-v2)
## Disclaimer 1
Thats a second level for of this library. This fork was made in order to prepare PyPi package and make installation process easier via supported plugins install flow.
Original fork disclamer is below.
## Disclaimer 2
I am NOT a python developer. I just changed what was necessary to make it work. This repository can be used directly or be an inspiration to others to enable Gitlab SSO with Sentry 10. These files can be installed from local folder only as no updated package is available in pip repository.
## How to install
### Install via `pip`
Use `enhance-image.sh` script to build new image with this plugin.
Create a new file `sentry/enhance-image.sh` if it is missing.
```shell
cp sentry/enhance-image.example.sh sentry/enhance-image.sh
```
Add the following line to `sentry/enhance-image.sh` file:
```shell
pip install sentry-auth-gitlab-v2
```
Then run `./install.sh` script to build new image with this plugin.
### Install from sources
Create plugins folder in `sentry` and clone this repo:
```shell
mkdir sentry/plugins
cd sentry/plugins
git clone https://github.com/zekker6/sentry-auth-gitlab.git
```
Use `enhance-image.sh` script to build new image with this plugin.
Create a new file `sentry/enhance-image.sh` if it is missing.
```shell
cp sentry/enhance-image.example.sh sentry/enhance-image.sh
```
Add the following line to `sentry/enhance-image.sh` file:
```shell
pip install /usr/src/sentry/plugins/sentry-auth-gitlab
```
### Gitlab configuration
Tested with an official [sentry/self-hosted](https://github.com/getsentry/self-hosted) installation:
- Sentry 24.1.0
- Gitlab 17.1
Create a new application under your GitLab.
Enter the **Callback URL** as the prefix to your Sentry installation:
```
http(s?)://sentry.example.com/auth/sso/
```
Once done, grab your API keys and drop them in your `sentry.conf.py`:
```python
GITLAB_APP_ID = "APP-ID"
GITLAB_APP_SECRET = "APP-SECRET"
GITLAB_BASE_DOMAIN = "git.example.com"
```
Optionally you may also specify the api version, scheme, and scope:
```python
GITLAB_API_VERSION = 4
GITLAB_HTTP_SCHEME = "https"
GITLAB_AUTH_SCOPE = "api"
```
### Notice
If your gitlab is deployed in a private network (probably).
You need to alter sentry's default ip black list to make oauth flow work.
Put following config in your **sentry.conf.py** and delete conflict ones
```python
SENTRY_DISALLOWED_IPS = (
'0.0.0.0/8',
'10.0.0.0/8',
'100.64.0.0/10',
'127.0.0.0/8',
'169.254.0.0/16',
'172.16.0.0/12',
'192.0.0.0/29',
'192.0.2.0/24',
'192.88.99.0/24',
'192.168.0.0/16',
'198.18.0.0/15',
'198.51.100.0/24',
'224.0.0.0/4',
'240.0.0.0/4',
'255.255.255.255/32'
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/zekker6/sentry-auth-gitlab",
"name": "sentry-auth-gitlab-v2",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Zakhar Bessarab",
"author_email": "zekker6@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/57/85/88d311fb9e732b945543b8013054fc5033909a315c2789fab54868c9b846/sentry_auth_gitlab_v2-0.4.3.tar.gz",
"platform": null,
"description": "[](https://badge.fury.io/py/sentry-auth-gitlab-v2)\n\n## Disclaimer 1\nThats a second level for of this library. This fork was made in order to prepare PyPi package and make installation process easier via supported plugins install flow.\nOriginal fork disclamer is below.\n\n## Disclaimer 2\nI am NOT a python developer. I just changed what was necessary to make it work. This repository can be used directly or be an inspiration to others to enable Gitlab SSO with Sentry 10. These files can be installed from local folder only as no updated package is available in pip repository.\n\n## How to install\n\n### Install via `pip`\n\nUse `enhance-image.sh` script to build new image with this plugin.\nCreate a new file `sentry/enhance-image.sh` if it is missing.\n```shell\ncp sentry/enhance-image.example.sh sentry/enhance-image.sh\n```\n\nAdd the following line to `sentry/enhance-image.sh` file:\n```shell\npip install sentry-auth-gitlab-v2\n```\n\nThen run `./install.sh` script to build new image with this plugin.\n\n### Install from sources\n\nCreate plugins folder in `sentry` and clone this repo:\n```shell\nmkdir sentry/plugins\ncd sentry/plugins\ngit clone https://github.com/zekker6/sentry-auth-gitlab.git\n```\n\nUse `enhance-image.sh` script to build new image with this plugin.\nCreate a new file `sentry/enhance-image.sh` if it is missing.\n```shell\ncp sentry/enhance-image.example.sh sentry/enhance-image.sh\n```\n\nAdd the following line to `sentry/enhance-image.sh` file:\n```shell\npip install /usr/src/sentry/plugins/sentry-auth-gitlab\n```\n\n### Gitlab configuration\n\nTested with an official [sentry/self-hosted](https://github.com/getsentry/self-hosted) installation:\n- Sentry 24.1.0\n- Gitlab 17.1\n\nCreate a new application under your GitLab.\nEnter the **Callback URL** as the prefix to your Sentry installation:\n```\nhttp(s?)://sentry.example.com/auth/sso/\n```\n\nOnce done, grab your API keys and drop them in your `sentry.conf.py`:\n\n```python\nGITLAB_APP_ID = \"APP-ID\"\nGITLAB_APP_SECRET = \"APP-SECRET\"\nGITLAB_BASE_DOMAIN = \"git.example.com\"\n```\n\nOptionally you may also specify the api version, scheme, and scope:\n\n```python\nGITLAB_API_VERSION = 4\nGITLAB_HTTP_SCHEME = \"https\"\nGITLAB_AUTH_SCOPE = \"api\"\n```\n\n### Notice\n\nIf your gitlab is deployed in a private network (probably).\nYou need to alter sentry's default ip black list to make oauth flow work.\n\nPut following config in your **sentry.conf.py** and delete conflict ones\n\n\n```python\nSENTRY_DISALLOWED_IPS = (\n '0.0.0.0/8',\n '10.0.0.0/8',\n '100.64.0.0/10',\n '127.0.0.0/8',\n '169.254.0.0/16',\n '172.16.0.0/12',\n '192.0.0.0/29',\n '192.0.2.0/24',\n '192.88.99.0/24',\n '192.168.0.0/16',\n '198.18.0.0/15',\n '198.51.100.0/24',\n '224.0.0.0/4',\n '240.0.0.0/4',\n '255.255.255.255/32'\n)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Gitlab authentication provider for Sentry",
"version": "0.4.3",
"project_urls": {
"Homepage": "https://github.com/zekker6/sentry-auth-gitlab"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "578588d311fb9e732b945543b8013054fc5033909a315c2789fab54868c9b846",
"md5": "a0b25ccf8c373beacb6bd67c1f12b8b8",
"sha256": "5a694e7b7af6775783ec105a4fb0e0a05f831daa6325ccaf2225179322206cb1"
},
"downloads": -1,
"filename": "sentry_auth_gitlab_v2-0.4.3.tar.gz",
"has_sig": false,
"md5_digest": "a0b25ccf8c373beacb6bd67c1f12b8b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9078,
"upload_time": "2024-08-05T06:25:32",
"upload_time_iso_8601": "2024-08-05T06:25:32.992411Z",
"url": "https://files.pythonhosted.org/packages/57/85/88d311fb9e732b945543b8013054fc5033909a315c2789fab54868c9b846/sentry_auth_gitlab_v2-0.4.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-05 06:25:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zekker6",
"github_project": "sentry-auth-gitlab",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "sentry-auth-gitlab-v2"
}