Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
03c38bf
Update renew.sls
mycelium3 Jan 21, 2022
1a640bd
Merge branch 'opensourcewebsite-org:master' into master
mycelium3 Jan 21, 2022
e76867f
Update init.sls
mycelium3 Jan 21, 2022
12696f0
Update php74.sls
mycelium3 Jan 21, 2022
9fe12a6
Update php74.sls
mycelium3 Jan 21, 2022
4713c4a
Update backup_site.sh
mycelium3 Jan 26, 2022
afd75a4
Change xml to modules
mycelium3 Jan 26, 2022
a29713d
Update php74.sls
mycelium3 Jan 26, 2022
09df1ab
SSL certificate check in HTTP mode too (error in soft)
mycelium3 Jan 26, 2022
6e16fef
Update init.sls
mycelium3 Jan 26, 2022
40c3e27
Merge pull request #1 from mycelium3/patch-1
mycelium3 Jan 28, 2022
53fac62
Update users.sls
mycelium3 Jan 30, 2022
1446e5a
Update init.sls
mycelium3 Jan 30, 2022
f3309c0
Update init.sls
mycelium3 Jan 30, 2022
00f6eec
Update init.sls
mycelium3 Jan 30, 2022
8679b1f
Update git-auto-deploy-opensourcewebsite.org.conf.json
mycelium3 Jan 30, 2022
87bc660
Delete .keep
mycelium3 Jan 30, 2022
17ecc0c
Create htdocs.sls
mycelium3 Jan 30, 2022
43c01c6
Update init.sls
mycelium3 Jan 30, 2022
d7643bf
Update top.sls
mycelium3 Jan 30, 2022
4fa9b6e
Update and rename htdocs.sls to directory.sls
mycelium3 Jan 30, 2022
b3268a9
Delete .keep
mycelium3 Jan 30, 2022
dbe6fd5
Delete .keep
mycelium3 Jan 30, 2022
667b537
Update top.sls
mycelium3 Jan 30, 2022
f160f54
Update init.sls
mycelium3 Jan 30, 2022
e18f8cd
Update users.sls
mycelium3 Jan 30, 2022
8fd0a56
Update directory.sls
mycelium3 Jan 30, 2022
1462d0c
Update users.sls
mycelium3 Jan 30, 2022
6621e36
Update directory.sls
mycelium3 Jan 30, 2022
3fde6d5
Update directory.sls
mycelium3 Jan 30, 2022
7e4e769
Create .gitignore
mycelium3 Jan 30, 2022
4f73952
Create .gitignore
mycelium3 Jan 30, 2022
c96ce56
Delete .gitignore
mycelium3 Jan 30, 2022
c4ee90f
Delete .gitignore
mycelium3 Jan 30, 2022
6212028
Update supervisor.sls
mycelium3 Jan 30, 2022
d8f29bd
Update init.sls
mycelium3 Jan 30, 2022
77ac381
Update php81.sls
mycelium3 Feb 9, 2022
2c631aa
Update php81.sls
mycelium3 Feb 9, 2022
6f8791c
Update php80.sls
mycelium3 Feb 9, 2022
26b2d5e
remove php's version dependent pkg
mycelium3 Feb 9, 2022
6bb5e02
Add support php 8.0 and 8.1
mycelium3 Feb 9, 2022
ff5d840
Different version php support add
mycelium3 Feb 9, 2022
d9d778b
Update nginx.sls
mycelium3 Feb 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pillar/prod/logrotate.sls
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,26 @@ logrotate:
- postrotate
- /usr/lib/php/php7.4-fpm-reopenlogs
- endscript
php8.0-fpm:
path:
- /var/log/php8.0-fpm.log
config:
- missingok
- notifempty
- sharedscripts
- postrotate
- /usr/lib/php/php8.0-fpm-reopenlogs
- endscript
php8.1-fpm:
path:
- /var/log/php8.1-fpm.log
config:
- missingok
- notifempty
- sharedscripts
- postrotate
- /usr/lib/php/php8.1-fpm-reopenlogs
- endscript
salt-common:
path:
- /var/log/salt/master
Expand Down
6 changes: 3 additions & 3 deletions pillar/prod/php74.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ php:
cli:
- php7.4-cli
- php7.4-common
xml:
modules:
- php7.4-xml
- php7.4-soap
- php7.4-bcmath
- php7.4-soap
- php7.4-bcmath

fpm:
conf: /etc/php/7.4/fpm/php-fpm.conf
Expand Down
6 changes: 4 additions & 2 deletions pillar/prod/php80.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ php:
cli:
- php8.0-cli
- php8.0-common
xml:
modules:
- php8.0-xml

- php8.0-soap
- php8.0-bcmath

fpm:
conf: /etc/php/8.0/fpm/php-fpm.conf
ini: /etc/php/8.0/fpm/php.ini
Expand Down
6 changes: 4 additions & 2 deletions pillar/prod/php81.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ php:
cli:
- php8.1-cli
- php8.1-common
xml:
modules:
- php8.1-xml

- php8.1-soap
- php8.1-bcmath

fpm:
conf: /etc/php/8.1/fpm/php-fpm.conf
ini: /etc/php/8.1/fpm/php.ini
Expand Down
4 changes: 2 additions & 2 deletions pillar/prod/supervisor.sls
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ supervisor:
command: '/usr/bin/php -q /www/opensourcewebsite.org/htdocs/yii cron > runtime/logs/cron.log'
numprocs: '1'
directory: '/www/opensourcewebsite.org'
stdout_logfile: '/www/opensourcewebsite.org/htdocs/runtime/logs/cron-stdout.log'
stderr_logfile: '/www/opensourcewebsite.org/htdocs/runtime/logs/cron-stderr.log'
stdout_logfile: '/www/opensourcewebsite.org/logs/cron-stdout.log'
stderr_logfile: '/www/opensourcewebsite.org/logs/cron-stderr.log'
user: 'opensourcewebsite.org'
stopsignal: 'KILL'

Expand Down
3 changes: 3 additions & 0 deletions pillar/prod/users.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ users:
www-data:
groups:
- opensourcewebsite.org
git-auto-deploy:
groups:
- opensourcewebsite.org

opensourcewebsite.org:
fullname: opensourcewebsite org
Expand Down
2 changes: 1 addition & 1 deletion salt/backup/files/backup_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ done

tar czf ${BACKUP_DIR}/configs.tgz -C / `echo ${CONFIGS} | paste`

find ${BACKUP_DIR}/ -maxdepth 1 -type d -ctime +${ROTATE} -exec rm -rf {} \;
find ${BACKUP_DIR}/ -maxdepth 1 -type d -mtime +${ROTATE} -exec rm -rf {} \;
39 changes: 24 additions & 15 deletions salt/backup/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@
backup_site_list: {{pillar['backup_sites'] | join(' ') }}
backup_config_list: {{pillar['backup_configs'] | join(' ')}}

#backup-mysql:
# cron.present:
# - name: /root/backup_mysql.sh
# - user: root
# - minute: random
# - hour: 1
# - identifier: backup-mysql

backup-mysql:
cron.present:
cron.absent:
- name: /root/backup_mysql.sh
- user: root
- minute: random
- hour: 1
- identifier: backup-mysql

backup-site:
cron.present:
Expand All @@ -36,18 +41,22 @@ backup-site:
- hour: 2
- identifier: backup-site

{{pillar['backup_dir']}}/mysql:
file.directory:
- user: root
- group: root
- dir_mode: 750
- file_mode: 640
- makedirs: True
- recurse:
- user
- group
- mode
#{{pillar['backup_dir']}}/mysql:
# file.directory:
# - user: root
# - group: root
# - dir_mode: 750
# - file_mode: 640
# - makedirs: True
# - recurse:
# - user
# - group
# - mode

{{pillar['backup_dir']}}/mysql:
file.absent:
- name: {{pillar['backup_dir']}}/mysql

{{pillar['backup_dir']}}/sites:
file.directory:
- user: root
Expand Down
2 changes: 1 addition & 1 deletion salt/certbot/renew.sls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cerbot-renew-cert:
file.append:
- name: /etc/letsencrypt/cli.ini
- text: deploy-hook = systemctl reload nginx
- text: deploy-hook = nginx -s reload
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"http-host": "0.0.0.0",
"http-port": 8005,
"pid-file": "/www/opensourcewebsite.org/tmp/.gitautodeploy.pid",
"ssl-cert": "/etc/git-auto-deploy/cert.pem",

"repositories": [{
"url": "git@github.com:opensourcewebsite-org/opensourcewebsite-org.git",
"url": "https://github.com/opensourcewebsite-org/opensourcewebsite-org.git",
"branch": "master",
"remote": "origin",
"path": "/www/opensourcewebsite.org/htdocs/",
Expand Down
2 changes: 0 additions & 2 deletions salt/packages/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ packages:
- python3.7
- apache2-utils
- php-xdebug
- php7.4-soap
- php7.4-bcmath

#NAME:
# pkg.purged
4 changes: 2 additions & 2 deletions salt/supervisord/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ include:

chown_log_file:
file.managed:
- name: /www/opensourcewebsite.org/htdocs/runtime/logs/cron-stdout.log
- name: /www/opensourcewebsite.org/logs/cron-stdout.log
- user: opensourcewebsite.org
- group: opensourcewebsite.org
- mode: 644
- create: False

chown_log_file2:
file.managed:
- name: /www/opensourcewebsite.org/htdocs/runtime/logs/cron-stderr.log
- name: /www/opensourcewebsite.org/logs/cron-stderr.log
- user: opensourcewebsite.org
- group: opensourcewebsite.org
- mode: 644
Expand Down
1 change: 1 addition & 0 deletions salt/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ base:
- users.log_acl
- update_motd_d
- users.selected_editor
- users.directory
'opensourcewebsite.org':
- nginx
- php.fpm
Expand Down
20 changes: 20 additions & 0 deletions salt/users/directory.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/www/opensourcewebsite.org/htdocs/:
file.directory:
- mode: 770
- user: opensourcewebsite.org
- group: opensourcewebsite.org
- makedirs: True

/www/opensourcewebsite.org/logs/:
file.directory:
- mode: 770
- user: opensourcewebsite.org
- group: opensourcewebsite.org
- makedirs: True

/www/opensourcewebsite.org/tmp/:
file.directory:
- mode: 770
- user: opensourcewebsite.org
- group: opensourcewebsite.org
- makedirs: True
Empty file.
Empty file.
Empty file.