From 05d6c1ad1b8b2b0463e47b104bc675838e096206 Mon Sep 17 00:00:00 2001 From: qtwrk Date: Tue, 2 Nov 2021 23:41:47 +0100 Subject: [PATCH 1/7] auto-sync to gitee.com --- .github/workflows/sync2gitee.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/sync2gitee.yml diff --git a/.github/workflows/sync2gitee.yml b/.github/workflows/sync2gitee.yml new file mode 100644 index 000000000..7e5b2a3c8 --- /dev/null +++ b/.github/workflows/sync2gitee.yml @@ -0,0 +1,22 @@ +name: sync2gitee +on: [push, pull_request,create,delete] +jobs: + repo-sync: + env: + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + dst_token: ${{ secrets.GITEE_TOKEN }} + gitee_user: ${{ secrets.GITEE_USER }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + - name: sync github -> gitee + uses: Yikun/hub-mirror-action@master + if: env.dst_key && env.dst_token && env.gitee_user + with: + src: 'github/${{ github.repository_owner }}' + dst: 'gitee/${{ secrets.GITEE_USER }}' + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + dst_token: ${{ secrets.GITEE_TOKEN }} + static_list: ${{ github.event.repository.name }} From 1429126cfe67334345b7baa3d2fc3081c14968f7 Mon Sep 17 00:00:00 2001 From: qtwrk Date: Sat, 13 Nov 2021 21:20:34 +0100 Subject: [PATCH 2/7] Update sync2gitee.yml --- .github/workflows/sync2gitee.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync2gitee.yml b/.github/workflows/sync2gitee.yml index 7e5b2a3c8..fdeed850a 100644 --- a/.github/workflows/sync2gitee.yml +++ b/.github/workflows/sync2gitee.yml @@ -1,5 +1,17 @@ name: sync2gitee -on: [push, pull_request,create,delete] +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + create: + branches: + - '**' + delete: + branches: + - '**' jobs: repo-sync: env: From 5abbceca2b11f6cf80db0a58a5f9a032893c94c5 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 1 Dec 2021 13:18:33 +0500 Subject: [PATCH 3/7] bug fix: https://community.cyberpanel.net/t/error-message-local-variable-zone-referenced-before-assignment/20288/13 --- plogical/cPanelImporter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plogical/cPanelImporter.py b/plogical/cPanelImporter.py index 97f6bda5a..3283ff268 100644 --- a/plogical/cPanelImporter.py +++ b/plogical/cPanelImporter.py @@ -457,6 +457,8 @@ class cPanelImporter: zone = Domains(admin=admin, name=topLevelDomain, type="NATIVE") zone.save() except: + zone = Domains(admin=admin, name=topLevelDomain, type="NATIVE") + zone.save() pass content = "ns1." + topLevelDomain + " hostmaster." + topLevelDomain + " 1 10800 3600 604800 3600" From 17e6c63f2e4a38e48eb7900c493aee815d6c0bb5 Mon Sep 17 00:00:00 2001 From: Greenweb Bangladesh <51988436+bdgreenweb@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:02:37 +0600 Subject: [PATCH 4/7] enforce disk quotation limit only in public_html lock only public_html directory when user exceed disk usage limit. Openlitespeed keep restarting when it failed to write logs and cache file inside users home/domain.com/logs/ directory. moreover user cant remove files from trash folder after directory become immutable. It's better to lock only public_html directory upon exceeding the disk quota limit. --- plogical/IncScheduler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index c2c619f87..1bd4c365b 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -764,10 +764,10 @@ Automatic backup failed for %s on %s. if website.package.enforceDiskLimits: if config['DiskUsagePercentage'] >= 100: - command = 'chattr -R +i /home/%s' % (website.domain) + command = 'chattr -R +i /home/%s/public_html/' % (website.domain) ProcessUtilities.executioner(command) else: - command = 'chattr -R -i /home/%s' % (website.domain) + command = 'chattr -R -i /home/%s/public_html/' % (website.domain) ProcessUtilities.executioner(command) ## Calculate bw usage From 228a135b8bda53b92aa46147d940d91e0c942301 Mon Sep 17 00:00:00 2001 From: qtwrk Date: Sun, 12 Dec 2021 21:57:14 +0100 Subject: [PATCH 5/7] rc.local for ubuntu --- cyberpanel.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cyberpanel.sh b/cyberpanel.sh index ca12e6a51..427a69dca 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1112,9 +1112,16 @@ if ! grep -q "pid_max" /etc/rc.local 2>/dev/null ; then echo 1 > /sys/kernel/mm/ksm/run" >>/etc/rc.d/rc.local chmod +x /etc/rc.d/rc.local else + if [[ -f /etc/rc.local ]] ; then + echo -e "#!/bin/bash\n$(cat /etc/rc.local)" > /etc/rc.local + else + echo "#!/bin/bash" > /etc/rc.local + fi echo "echo 1000000 > /proc/sys/kernel/pid_max echo 1 > /sys/kernel/mm/ksm/run" >>/etc/rc.local chmod +x /etc/rc.local + systemctl enable rc-local >/dev/null 2>&1 + systemctl start rc-local >/dev/null 2>&1 fi if grep -q "nf_conntrack_max" /etc/sysctl.conf ; then sysctl -w net.netfilter.nf_conntrack_max=2097152 > /dev/null From 7c44aa2533f033ea9096f1a3afb071f82797dab7 Mon Sep 17 00:00:00 2001 From: Greenweb Bangladesh <51988436+bdgreenweb@users.noreply.github.com> Date: Wed, 22 Dec 2021 04:57:18 +0600 Subject: [PATCH 6/7] Update IncScheduler.py This will exclude log directory & backup directories from being immutable after exceeding disk quota limit. --- plogical/IncScheduler.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index 1bd4c365b..174a88ad4 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -764,8 +764,21 @@ Automatic backup failed for %s on %s. if website.package.enforceDiskLimits: if config['DiskUsagePercentage'] >= 100: - command = 'chattr -R +i /home/%s/public_html/' % (website.domain) + command = 'chattr -R +i /home/%s/' % (website.domain) ProcessUtilities.executioner(command) + + command = 'chattr -R -i /home/%s/logs/' % (website.domain) + ProcessUtilities.executioner(command) + + command = 'chattr -R -i /home/%s/.trash/' % (website.domain) + ProcessUtilities.executioner(command) + + command = 'chattr -R -i /home/%s/backup/' % (website.domain) + ProcessUtilities.executioner(command) + + command = 'chattr -R -i /home/%s/incbackup/' % (website.domain) + ProcessUtilities.executioner(command) + else: command = 'chattr -R -i /home/%s/public_html/' % (website.domain) ProcessUtilities.executioner(command) From cb4f7f59eb2b40345c7780e8811a85702b377a02 Mon Sep 17 00:00:00 2001 From: Greenweb Bangladesh <51988436+bdgreenweb@users.noreply.github.com> Date: Wed, 22 Dec 2021 05:00:12 +0600 Subject: [PATCH 7/7] Update IncScheduler.py --- plogical/IncScheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index 174a88ad4..8076103cc 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -780,7 +780,7 @@ Automatic backup failed for %s on %s. ProcessUtilities.executioner(command) else: - command = 'chattr -R -i /home/%s/public_html/' % (website.domain) + command = 'chattr -R -i /home/%s/' % (website.domain) ProcessUtilities.executioner(command) ## Calculate bw usage