From b39ac8f649d95e8ca23e88ef216cd72a245dcc2b Mon Sep 17 00:00:00 2001 From: Sven Michels Date: Fri, 28 May 2021 23:48:15 +0200 Subject: [PATCH 1/7] [Web] Fix: spf record validation failed with redirect When using a redirect in your SPF record, the web UI validation failed when your record contained a ipv6 address. In web/inc/ajax/dns_diagnostics.php the function get_spf_allowed_hosts is called with the second parameter to be true to expand ipv6 addresses. But when called for redirects, the value was not set to true, so it defaulted back to false. This caused an unexpanded ipv6 address to be added to the array and the in_array match for ipv6 never matched as it is always called with expand_ipv6. While looking at the code i noted some messed up in the indention, which is also "fixed" by this commit. --- data/web/inc/spf.inc.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/data/web/inc/spf.inc.php b/data/web/inc/spf.inc.php index a3abcbe4..55e164b4 100644 --- a/data/web/inc/spf.inc.php +++ b/data/web/inc/spf.inc.php @@ -24,7 +24,7 @@ function get_spf_allowed_hosts($check_domain, $expand_ipv6 = false) { $mod = explode('=', $mech); if ($mod[0] == 'redirect') // handle a redirect { - $hosts = get_spf_allowed_hosts($mod[1]); + $hosts = get_spf_allowed_hosts($mod[1],true); return $hosts; } } @@ -79,13 +79,13 @@ function get_spf_allowed_hosts($check_domain, $expand_ipv6 = false) { } foreach ($hosts as &$host) { if (filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { - if ($expand_ipv6 === true) { - $hex = unpack("H*hex", inet_pton($host)); - $host = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1); - } - else { - $host = $host; - } + if ($expand_ipv6 === true) { + $hex = unpack("H*hex", inet_pton($host)); + $host = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1); + } + else { + $host = $host; + } } } return $hosts; From ab4750680d5eaab5d55e143772a7bca6b06bd502 Mon Sep 17 00:00:00 2001 From: 74k1n984ckmyp21v4cy <79848514+74k1n984ckmyp21v4cy@users.noreply.github.com> Date: Tue, 1 Jun 2021 12:09:34 +0200 Subject: [PATCH 2/7] [Update] URL to update feed for available updates (#4109) * URL to update feed for available updates With this change, the URL to the update feed will be displayed in a new line if updates are available. * Update update.sh --- update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.sh b/update.sh index f4f058d8..c53f3759 100755 --- a/update.sh +++ b/update.sh @@ -123,7 +123,7 @@ while (($#)); do exit 99 fi if [[ -z $(git log HEAD --pretty=format:"%H" | grep "${LATEST_REV}") ]]; then - echo "Updated code is available." + echo -e "Updated code is available.\nThe changes can be found here: https://github.com/mailcow/mailcow-dockerized/commits/master" git log --date=short --pretty=format:"%ad - %s" $(git rev-parse --short HEAD)..origin/master exit 0 else From 0d374b74e2ad6bf283a337beb9751bcdf58183f4 Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 2 Jun 2021 21:35:51 +0200 Subject: [PATCH 3/7] Create close_old_issues_and_prs.yml --- .../workflows/close_old_issues_and_prs.yml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/close_old_issues_and_prs.yml diff --git a/.github/workflows/close_old_issues_and_prs.yml b/.github/workflows/close_old_issues_and_prs.yml new file mode 100644 index 00000000..0f081980 --- /dev/null +++ b/.github/workflows/close_old_issues_and_prs.yml @@ -0,0 +1,30 @@ +name: 'Close stale issues and PRs' +on: + schedule: + # Once every day at midnight UTC + - cron: "0 0 * * *" + workflow_dispatch: + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - name: Mark/Close Stale Issues and Pull Requests 🗑️ + uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 60 + days-before-close: 7 + stale-issue-message: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + stale-pr-message: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + exempt-issue-labels: "pinned,security,enhancement" + exempt-pr-labels: "pinned,security,enhancement" + stale-issue-label: "stale" + stale-pr-label: "stale" + operations-per-run: "50" + #DRY-RUN + debug-only: "true" From 52308d55993518b17129da546ee8a9e768afe8d4 Mon Sep 17 00:00:00 2001 From: MAGIC Date: Wed, 2 Jun 2021 21:48:09 +0200 Subject: [PATCH 4/7] [GH-Actions][scale] Restrict permissions --- .github/workflows/close_old_issues_and_prs.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/close_old_issues_and_prs.yml b/.github/workflows/close_old_issues_and_prs.yml index 0f081980..beebff2b 100644 --- a/.github/workflows/close_old_issues_and_prs.yml +++ b/.github/workflows/close_old_issues_and_prs.yml @@ -3,11 +3,14 @@ on: schedule: # Once every day at midnight UTC - cron: "0 0 * * *" - workflow_dispatch: + #workflow_dispatch: jobs: stale: runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write steps: - name: Mark/Close Stale Issues and Pull Requests 🗑️ uses: actions/stale@v3 From 15e6ae8720cde6e2934e9dffaf6714f284a74ab3 Mon Sep 17 00:00:00 2001 From: MAGIC Date: Wed, 2 Jun 2021 21:48:45 +0200 Subject: [PATCH 5/7] [GH-Actions][scale] Disable dry-run --- .github/workflows/close_old_issues_and_prs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close_old_issues_and_prs.yml b/.github/workflows/close_old_issues_and_prs.yml index beebff2b..9a58e912 100644 --- a/.github/workflows/close_old_issues_and_prs.yml +++ b/.github/workflows/close_old_issues_and_prs.yml @@ -30,4 +30,4 @@ jobs: stale-pr-label: "stale" operations-per-run: "50" #DRY-RUN - debug-only: "true" + debug-only: "false" From 0f49600023b560ea31ff9de21ebc32770765dbd3 Mon Sep 17 00:00:00 2001 From: MAGIC Date: Wed, 2 Jun 2021 21:54:24 +0200 Subject: [PATCH 6/7] [GH-Actions][scale] Allow to run it manually --- .github/workflows/close_old_issues_and_prs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close_old_issues_and_prs.yml b/.github/workflows/close_old_issues_and_prs.yml index 9a58e912..50db7591 100644 --- a/.github/workflows/close_old_issues_and_prs.yml +++ b/.github/workflows/close_old_issues_and_prs.yml @@ -3,7 +3,7 @@ on: schedule: # Once every day at midnight UTC - cron: "0 0 * * *" - #workflow_dispatch: + workflow_dispatch: jobs: stale: From c9ce83fa978df474e71338e7bd71100f15771659 Mon Sep 17 00:00:00 2001 From: MAGIC Date: Wed, 2 Jun 2021 22:08:26 +0200 Subject: [PATCH 7/7] [GH-Actions][scale] Use ascending mode + increase operations-per-run --- .github/workflows/close_old_issues_and_prs.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/close_old_issues_and_prs.yml b/.github/workflows/close_old_issues_and_prs.yml index 50db7591..5b86aed1 100644 --- a/.github/workflows/close_old_issues_and_prs.yml +++ b/.github/workflows/close_old_issues_and_prs.yml @@ -28,6 +28,7 @@ jobs: exempt-pr-labels: "pinned,security,enhancement" stale-issue-label: "stale" stale-pr-label: "stale" - operations-per-run: "50" + operations-per-run: "250" + ascending: "true" #DRY-RUN - debug-only: "false" + debug-only: "false" \ No newline at end of file