Skip to content

Commit 2044b8e

Browse files
authored
Merge branch 'main' into dependabot/pip/idna-3.7
2 parents 205888f + 743e8a8 commit 2044b8e

File tree

9 files changed

+529
-146
lines changed

9 files changed

+529
-146
lines changed

.env.example.googleworkspace

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#########################
2+
## GitHub App Settings ##
3+
#########################
4+
## Webhook Secret
5+
WEBHOOK_SECRET=development
6+
## GitHub App ID
7+
APP_ID=12345
8+
## Private Key Path
9+
PRIVATE_KEY_PATH=.ssh/team-sync.pem
10+
## Uncomment the following line and use your own GitHub Enterprise
11+
## instance if this will not be used on https://github.com
12+
#GHE_HOST=github.example.com
13+
## Uncomment if you are using a self-signed certificate on GitHub Enterprise.
14+
## Defaults to False.
15+
#VERIFY_SSL=False
16+
17+
## User directory to sync GitHub teams from
18+
## Azure AD = AAD
19+
## Active Directory = LDAP
20+
## OpenLDAP = LDAP
21+
## Okta = OKTA
22+
## OneLogin = ONELOGIN
23+
## Google Workspace = GOOGLE_WORKSPACE
24+
USER_DIRECTORY=GOOGLE_WORKSPACE
25+
## Attribute to compare users with, username or email
26+
## For Google Workspace, the username option will use the specefied custom schema attribute
27+
USER_SYNC_ATTRIBUTE=username
28+
29+
30+
###############################
31+
## Google Workspace Settings ##
32+
###############################
33+
## Location of the Google Workspace service account credentials file
34+
GOOGLE_WORKSPACE_SA_CREDS_FILE=googleAuth.json
35+
## Email of a Google Workspace Admin account the service account will impersonate
36+
37+
## Email attribute to use for syncing users, not required if syncing by username
38+
## Default: primaryEmail
39+
# GOOGLE_WORKSPACE_USER_MAIL_ATTRIBUTE=
40+
## Custom schema name
41+
## Not required if syncing by email
42+
GOOGLE_WORKSPACE_USERNAME_CUSTOM_SCHEMA_NAME=schema-name
43+
## Custom schema attribute field name
44+
## Not required if syncing by email
45+
GOOGLE_WORKSPACE_USERNAME_FIELD=field-name
46+
47+
#########################
48+
## Additional settings ##
49+
#########################
50+
## Stop if number of changes exceeds this number
51+
## Default: 25
52+
#CHANGE_THRESHOLD=25
53+
## Create an issue if the sync fails for any reason
54+
## Default: false
55+
#OPEN_ISSUE_ON_FAILURE=true
56+
## Where to open the issue upon sync failure
57+
#REPO_FOR_ISSUES=github-demo/demo-repo
58+
## Who to assign the issues to
59+
#ISSUE_ASSIGNEE=githubber
60+
## Sync schedule, cron style schedule
61+
62+
## Default (hourly): 0 * * * *
63+
SYNC_SCHEDULE=0 * * * *
64+
## Show the changes, but do not make any changes
65+
## Default: false
66+
#TEST_MODE=false
67+
## Automatically add users missing from the organization
68+
ADD_MEMBER=false
69+
## Automatically remove users from the organisation that are not part of a team
70+
REMOVE_ORG_MEMBERS_WITHOUT_TEAM=false
71+
72+
####################
73+
## Flask Settings ##
74+
####################
75+
## Default: app
76+
FLASK_APP=app
77+
## Default: production
78+
FLASK_ENV=development
79+
## Default: 5000
80+
FLASK_RUN_PORT=5000
81+
## Default: 127.0.0.1
82+
FLASK_RUN_HOST=0.0.0.0

.env.example.keycloak

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#########################
2+
## GitHub App Settings ##
3+
#########################
4+
## Webhook Secret
5+
WEBHOOK_SECRET=development
6+
## GitHub App ID
7+
APP_ID=12345
8+
## Private Key Path
9+
PRIVATE_KEY_PATH=.ssh/team-sync.pem
10+
## Uncomment the following line and use your own GitHub Enterprise
11+
## instance if this will not be used on https://github.com
12+
#GHE_HOST=github.example.com
13+
## Uncomment if you are using a self-signed certificate on GitHub Enterprise.
14+
## Defaults to False.
15+
#VERIFY_SSL=False
16+
17+
## User directory to sync GitHub teams from
18+
## Azure AD = AAD
19+
## Active Directory = LDAP
20+
## OpenLDAP = LDAP
21+
## Okta = OKTA
22+
## Keycloak = KEYCLOAK
23+
USER_DIRECTORY=KEYCLOAK
24+
## Attribute to compare users with
25+
## username or email
26+
USER_SYNC_ATTRIBUTE=username
27+
28+
29+
###################
30+
## Keycloak Settings ##
31+
###################
32+
## Your organizations Okta URL
33+
KEYCLOAK_SERVER_URL=https://example.okta.com
34+
35+
###############################
36+
## Keycloak authentication ##
37+
###############################
38+
## Keycloak account credentials
39+
## This account needs to have access to the master (or equivalent) realm
40+
## as it will be using the Admin API
41+
KEYCLOAK_USERNAME=api-account
42+
KEYCLOAK_PASSWORD=ExamplePassword
43+
## Realm where users are stored
44+
## Default: master
45+
#KEYCLOAK_REALM=master
46+
## Realm where the API account is stored
47+
## Only required if the account is stored in a different realm than your
48+
## users are in
49+
## Default: same as KEYCLOAK_REALM
50+
#KEYCLOAK_ADMIN_REALM=master
51+
## Use the Github Identity Provider within Keycloak?
52+
## This requires you to set up the provider as an Identity provider with
53+
## the user realm
54+
#KEYCLOAK_USE_GITHUB_IDP=true
55+
56+
#########################
57+
## Additional settings ##
58+
#########################
59+
## Stop if number of changes exceeds this number
60+
## Default: 25
61+
#CHANGE_THRESHOLD=25
62+
## Create an issue if the sync fails for any reason
63+
## Default: false
64+
#OPEN_ISSUE_ON_FAILURE=true
65+
## Where to open the issue upon sync failure
66+
#REPO_FOR_ISSUES=github-demo/demo-repo
67+
## Who to assign the issues to
68+
#ISSUE_ASSIGNEE=githubber
69+
## Sync schedule, cron style schedule
70+
## Shortcode for emu accounts
71+
#EMU_SHORTCODE=volcano
72+
73+
## Default (hourly): 0 * * * *
74+
SYNC_SCHEDULE=0 * * * *
75+
## Show the changes, but do not make any changes
76+
## Default: false
77+
#TEST_MODE=false
78+
## Automatically add users missing from the organization
79+
ADD_MEMBER=false
80+
## Automatically remove users from the organisation that are not part of a team
81+
REMOVE_ORG_MEMBERS_WITHOUT_TEAM=false
82+
83+
####################
84+
## Flask Settings ##
85+
####################
86+
## Default: app
87+
FLASK_APP=app
88+
## Default: production
89+
FLASK_ENV=development
90+
## Default: 5000
91+
FLASK_RUN_PORT=5000
92+
## Default: 127.0.0.1
93+
FLASK_RUN_HOST=0.0.0.0

Dockerfile

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,18 @@ LABEL maintainer="GitHub Services <[email protected]>"
66

77
ARG TZ='UTC'
88

9-
ENV DEFAULT_TZ ${TZ}
10-
11-
COPY . /opt/github-team-sync
12-
WORKDIR /opt/github-team-sync
13-
14-
RUN apk add --no-cache \
15-
libxml2-dev \
16-
libxslt-dev \
17-
python3-dev \
18-
make \
19-
gcc \
20-
libffi-dev \
21-
build-base \
22-
openssl-dev \
23-
cargo \
24-
tzdata
9+
ENV DEFAULT_TZ=${TZ}
2510

2611
# Fix the warning where no timezone is specified
2712
RUN cp /usr/share/zoneinfo/${DEFAULT_TZ} /etc/localtime
2813

2914
RUN pip install --no-cache-dir --upgrade pipenv
3015

16+
WORKDIR /opt/github-team-sync
17+
COPY Pipfile Pipfile.lock .
18+
3119
RUN pipenv install
3220

33-
CMD pipenv run flask run
21+
COPY . /opt/github-team-sync
22+
23+
CMD ["pipenv", "run", "flask", "run"]

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ setuptools = "*"
3333
cryptography = "*"
3434
werkzeug = "*"
3535
importlib-metadata = "*"
36+
python-keycloak = "*"
3637

3738
[pipenv]
3839
allow_prereleases = false

0 commit comments

Comments
 (0)