22222 / gogs-adsync

A windows service to sync Active Directory users and groups with Gogs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A windows service for synchronizing Active Directory users and groups with Gogs.

Build status

Install

Download the latest release. Then you can run GogsActiveDirectorySync.exe directly as a console application, or install it as a windows service:

GogsActiveDirectorySync.exe install

The Topshelf library is used to make this run as a windows service. So see the Topshelf commandline documentation for more details.

Configuration

The configuration for this thing is in GogsActiveDirectorySync.exe.config. There's also NLog configuration in the NLog.config.

Some AppSettings you'll probably want to change:

  • SyncIntervalHours: How often the sync runs
  • MinimumTimeOfDay, MaximumTimeOfDay: Can be used to make sure the sync only runs at night (or any interval you want)
  • GogsApiUrl: The URL to your Gogs installation's API (like https://try.gogs.io/api/v1/)
  • GogsUsername: An Gogs user with enough permissions to create users and organizations
  • GogsPassword: Set this if you want to use password authentication with the Gogs API
  • GogsAccessToken: Set this if you want to use token authentication with the Gogs API

There's more of these, but I'm tired of writing about them in this readme that no one will read. There may be more comments about them in AppConfiguration.cs.

Outside of those AppSettings, there's also a custom groupNameMappings section. This determines how things will be mapped from Active Directory to Gogs. Example:

<groupNameMappings>
	<mapping activeDirectoryGroupName="Development" gogsOrgName="Dev" />
</groupNameMappings>

You need an entry in there for every Active Directory group you want to have synchronized with a Gogs organization.

About

A windows service to sync Active Directory users and groups with Gogs.

License:MIT License


Languages

Language:C# 100.0%