From 40d7dea982925e4e04308c25490095b2d4e0c324 Mon Sep 17 00:00:00 2001 From: martadams89 Date: Mon, 11 Mar 2024 03:11:59 +0000 Subject: [PATCH] ci: update workflows for local and allow for more folders and domains --- .github/workflows/fork.yml | 19 +++++++ .github/workflows/main.yml | 110 ++++++++++++++++++------------------- app/config.py | 4 +- 3 files changed, 76 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/fork.yml diff --git a/.github/workflows/fork.yml b/.github/workflows/fork.yml new file mode 100644 index 00000000..32f1ac46 --- /dev/null +++ b/.github/workflows/fork.yml @@ -0,0 +1,19 @@ +name: Sync Fork + +on: + schedule: + - cron: '*/30 * * * *' # every 30 minutes + workflow_dispatch: # on button click + +jobs: + sync: + + runs-on: ubuntu-latest + + steps: + - uses: tgymnich/fork-sync@v1.8 + with: + owner: simple-login + repo: app + base: master + head: master \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e52bdfcf..babe4a22 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -125,7 +125,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: simplelogin/app-ci + images: martadams89/sl-app - name: Login to Docker Hub uses: docker/login-action@v2 @@ -145,15 +145,15 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Create Sentry release - uses: getsentry/action-release@v1 - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - with: - ignore_missing: true - ignore_empty: true + #- name: Create Sentry release + # uses: getsentry/action-release@v1 + # env: + # SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + # SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + # SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} + # with: + # ignore_missing: true + # ignore_empty: true - name: Prepare version file run: | @@ -186,53 +186,53 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Prepare Slack notification contents - if: startsWith(github.ref, 'refs/tags/v') - run: | - changelog=$(cat << EOH - ${{ steps.build_changelog.outputs.changelog }} - EOH - ) - messageWithoutNewlines=$(echo "${changelog}" | awk '{printf "%s\\n", $0}') - messageWithoutDoubleQuotes=$(echo "${messageWithoutNewlines}" | sed "s/\"/'/g") - echo "${messageWithoutDoubleQuotes}" + #- name: Prepare Slack notification contents + # if: startsWith(github.ref, 'refs/tags/v') + # run: | + # changelog=$(cat << EOH + # ${{ steps.build_changelog.outputs.changelog }} + # EOH + # ) + # messageWithoutNewlines=$(echo "${changelog}" | awk '{printf "%s\\n", $0}') + # messageWithoutDoubleQuotes=$(echo "${messageWithoutNewlines}" | sed "s/\"/'/g") + # echo "${messageWithoutDoubleQuotes}" - echo "SLACK_CHANGELOG=${messageWithoutDoubleQuotes}" >> $GITHUB_ENV + # echo "SLACK_CHANGELOG=${messageWithoutDoubleQuotes}" >> $GITHUB_ENV - - name: Post notification to Slack - uses: slackapi/slack-github-action@v1.19.0 - if: startsWith(github.ref, 'refs/tags/v') - with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} - payload: | - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "New tag created", - "emoji": true - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Tag: ${{ github.ref_name }}* (${{ github.sha }})" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Changelog:*\n${{ env.SLACK_CHANGELOG }}" - } - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + # - name: Post notification to Slack + # uses: slackapi/slack-github-action@v1.19.0 + # if: startsWith(github.ref, 'refs/tags/v') + # with: + # channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + # payload: | + # { + # "blocks": [ + # { + # "type": "header", + # "text": { + # "type": "plain_text", + # "text": "New tag created", + # "emoji": true + # } + # }, + # { + # "type": "section", + # "text": { + # "type": "mrkdwn", + # "text": "*Tag: ${{ github.ref_name }}* (${{ github.sha }})" + # } + # }, + # { + # "type": "section", + # "text": { + # "type": "mrkdwn", + # "text": "*Changelog:*\n${{ env.SLACK_CHANGELOG }}" + # } + # } + # ] + # } + # env: + # SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - name: Create GitHub Release if: startsWith(github.ref, 'refs/tags/v') diff --git a/app/config.py b/app/config.py index e8824f5a..3eba9a4c 100644 --- a/app/config.py +++ b/app/config.py @@ -99,8 +99,8 @@ except Exception: MAX_NB_EMAIL_OLD_FREE_PLAN = int(os.environ.get("MAX_NB_EMAIL_OLD_FREE_PLAN", 15)) # maximum number of directory a premium user can create -MAX_NB_DIRECTORY = 50 -MAX_NB_SUBDOMAIN = 5 +MAX_NB_DIRECTORY = 500 +MAX_NB_SUBDOMAIN = 50 ENFORCE_SPF = "ENFORCE_SPF" in os.environ