Skip to content

Commit

Permalink
Merge pull request #15 from doornoc/develop
Browse files Browse the repository at this point in the history
[update] actions and library update
  • Loading branch information
yoneyan authored Nov 15, 2023
2 parents 7886a38 + eb42b8d commit 5b03243
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
interval: "weekly"
22 changes: 11 additions & 11 deletions .github/workflows/build-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ name: Publish Docker image(dev)

on:
push:
branches:
- develop
paths:
- '.github/**'
- 'files/**'
- 'dsbd/**'
- 'custom_auth/**'
- 'mgmt/**'
- 'Dockerfile'
- 'requirements.txt'

Expand All @@ -21,21 +18,24 @@ jobs:
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: doornoc/dsbd

images: ghcr.io/doornoc/dsbd
- uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: doornoc/dsbd:develop
labels: "develop version"
tags: ghcr.io/doornoc/dsbd:develop
labels: "develop version"
cache-from: type=gha
cache-to: type=gha,mode=max
64 changes: 47 additions & 17 deletions .github/workflows/build-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,72 @@ name: Publish Docker image(prod)

on:
push:
branches:
- master
tags:
- 'v*'
paths:
- '.github/**'
- 'files/**'
- 'dsbd/**'
- 'custom_auth/**'
- 'Dockerfile'
- 'requirements.txt'
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: get tag name
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: doornoc/dsbd
images: ghcr.io/doornoc/dsbd

- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
platform: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: |
ghcr.io/doornoc/dsbd:${{ env.TAG_NAME }}
ghcr.io/doornoc/dsbd:latest
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Create Changelog
id: create_changelog
uses: mikepenz/release-changelog-builder-action@v3
with:
configurationJson: |
{
"template": "## Commit Log \n #{{UNCATEGORIZED}} \n\n **Full Change Log**: #{{RELEASE_DIFF}}",
"pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}",
"sort": {
"order": "DESC",
"on_property": "mergedAt"
}
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ steps.create_changelog.outputs.changelog }}
13 changes: 3 additions & 10 deletions dsbd/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,15 @@ def _import_ldap_group_type(group_type_name):
USER_ACTIVATE_EXPIRED_DAYS = os.environ.get('USER_ACTIVATE_EXPIRED_DAYS', 7)
SIGN_UP_EXPIRED_DAYS = os.environ.get('SIGN_UP_EXPIRED_DAYS', 7)

## Stripe
# Stripe
STRIPE_PRIVATE_KEY = os.environ.get('STRIPE_PRIVATE_KEY', '')
STRIPE_SECRET_KEY = os.environ.get('STRIPE_SECRET_KEY', '')
STRIPE_WEBHOOK_SECRET_KEY = os.environ.get('STRIPE_WEBHOOK_SECRET_KEY', '')

## Slack
# Slack
SLACK_WEBHOOK_LOG = os.environ.get('SLACK_WEBHOOK_LOG', '')

TWO_FACTOR_WEBAUTHN_RP_NAME = 'doornoc_dsbd'

## LDAP
# LDAP
AUTH_LDAP_SERVER_URI = os.environ.get('AUTH_LDAP_SERVER_URI', '')
AUTH_LDAP_BIND_DN = os.environ.get('AUTH_LDAP_BIND_DN', '')
AUTH_LDAP_BIND_PASSWORD = os.environ.get('AUTH_LDAP_BIND_PASSWORD', '')
Expand All @@ -227,24 +225,19 @@ def _import_ldap_group_type(group_type_name):
ldap.SCOPE_SUBTREE,
f'({AUTH_LDAP_USER_SEARCH_ATTR}=%(user)s)'
)

AUTH_LDAP_USER_ATTR_MAP = {
"first_name": os.environ.get('AUTH_LDAP_ATTR_FIRSTNAME', 'givenName'),
"last_name": os.environ.get('AUTH_LDAP_ATTR_LASTNAME', 'sn'),
"email": os.environ.get('AUTH_LDAP_ATTR_MAIL', 'mail'),
}
AUTH_LDAP_GROUP_TYPE = _import_ldap_group_type(os.environ.get('AUTH_LDAP_GROUP_TYPE', 'GroupOfNamesType'))

AUTH_LDAP_REQUIRE_GROUP = os.environ.get('AUTH_LDAP_REQUIRE_GROUP_DN')

AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
os.environ.get('AUTH_LDAP_GROUP_SEARCH_BASE_DN', ''),
ldap.SCOPE_SUBTREE,
"(objectClass=group)",
)

AUTH_LDAP_FIND_GROUP_PERMS = True

AUTH_LDAP_USER_FLAGS_BY_GROUP = {
"is_active": os.environ.get('AUTH_LDAP_REQUIRE_GROUP_DN', ''),
"is_staff": os.environ.get('AUTH_LDAP_IS_ADMIN_DN', ''),
Expand Down
56 changes: 28 additions & 28 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
annotated-types==0.5.0
annotated-types==0.6.0
asgiref==3.7.2
asn1crypto==1.5.1
attrs==23.1.0
autobahn==23.6.2
Automat==22.10.0
cbor2==5.4.6
cbor2==5.5.1
certifi==2023.7.22
cffi==1.15.1
cffi==1.16.0
channels==4.0.0
charset-normalizer==3.2.0
constantly==15.1.0
cryptography==41.0.2
charset-normalizer==3.3.2
constantly==23.10.4
cryptography==41.0.5
daphne==4.0.0
Django==4.2.4
django-auth-ldap==4.5.0
Django==4.2.7
django-auth-ldap==4.6.0
django-debug-toolbar==4.2.0
django-formtools==2.4.1
django-phonenumber-field==6.4.0
django-widget-tweaks==1.4.12
django-phonenumber-field==7.2.0
django-widget-tweaks==1.5.0
h2==4.1.0
hpack==4.0.0
hyperframe==6.0.1
hyperlink==21.0.0
idna==3.4
incremental==22.10.0
Markdown==3.4.4
Markdown==3.5.1
mysqlclient==2.2.0
phonenumbers==8.13.18
Pillow==10.0.0
priority==1.3.0
protobuf==4.23.4
phonenumbers==8.13.25
Pillow==10.1.0
priority==2.0.0
protobuf==4.25.0
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser==2.21
pycryptodome==3.18.0
pydantic==2.2.0
pydantic_core==2.6.0
pycryptodome==3.19.0
pydantic==2.5.1
pydantic_core==2.14.3
PyMySQL==1.1.0
pyOpenSSL==23.2.0
pyOpenSSL==23.3.0
pyotp==2.9.0
pyparsing==3.1.0
pyparsing==3.1.1
pypng==0.20220715.0
python-ldap==3.4.3
pytz==2023.3
pytz==2023.3.post1
PyYAML==6.0.1
qrcode==7.4.2
requests==2.31.0
service-identity==23.1.0
six==1.16.0
slack-sdk==3.21.3
slack-sdk==3.23.1
sqlparse==0.4.4
stripe==5.5.0
Twisted==22.10.0
stripe==7.4.0
Twisted==23.10.0
txaio==23.1.1
typing_extensions==4.7.1
urllib3==2.0.4
webauthn==1.10.1
typing_extensions==4.8.0
urllib3==2.1.0
webauthn==1.11.1
YubiOTP==1.0.0
zope.interface==6.0
zope.interface==6.1

0 comments on commit 5b03243

Please sign in to comment.