Merge branch 'v2.1.2' into v2.1.2-dev

This commit is contained in:
Usman Nasir
2021-12-23 18:32:24 +05:00
4 changed files with 58 additions and 2 deletions

34
.github/workflows/sync2gitee.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: sync2gitee
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
create:
branches:
- '**'
delete:
branches:
- '**'
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 }}

View File

@@ -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

View File

@@ -764,10 +764,23 @@ 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/' % (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' % (website.domain)
command = 'chattr -R -i /home/%s/' % (website.domain)
ProcessUtilities.executioner(command)
## Calculate bw usage

View File

@@ -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"