nextcloud 上查詢支援onlyoffice的版本
https://apps.nextcloud.com/apps/onlyoffice/releases?platform=14
避免與不相容的版本起衝突
目前2022/5/13 我升級到nextcloud 22.2.7 , 但因為docker上面的onlyoffice 最新的是7.1.0,
onlyoffice 只有支援7.2以上才支援 nextcloud 23 , 所以我就無法升級到nextcloud 23囉
https://apps.nextcloud.com/apps/onlyoffice/releases?platform=14
避免與不相容的版本起衝突
目前2022/5/13 我升級到nextcloud 22.2.7 , 但因為docker上面的onlyoffice 最新的是7.1.0,
onlyoffice 只有支援7.2以上才支援 nextcloud 23 , 所以我就無法升級到nextcloud 23囉
'trusted_proxies' =>
array (
0 => '反向代理server的host ip',
1 => 'docker local ip',
),
'trusted_proxies' => array ( 0 => 'x.x.x.x', 1 => '172.0.0.1/8', ),
修改 config.php
過了31天清除
'trashbin_retention_obligation' => 'auto,31',
'versions_retention_obligation' => 'auto,31',
若使用docker安裝, 建議停用容器內建的排程, 改用外面主機, 設定排程自行刪除垃圾桶
# 停用背景排程
docker exec -t -u www-data <container> php occ config:app:set --value=no files_trashbin background_job_expire_trash
docker exec -t -u www-data nextcloud php occ config:app:set --value=no files_versions background_job_expire_versions
# 停用容器內建排程後,改用外面主機定期清除
docker exec -t -u www-data <container> php occ trashbin:expire --quiet
docker run restic/restic 參數
## 例如
docker run restic/restic version
#例如建立repository
docker run -v /root:/root restic/restic --repo /root/repo --password-file=/root/password init
export GODEBUG=asyncpreemptoff=1
docker run -v /root:/root restic/restic --repo /root/repo --password-file=/root/password backup /root/a
現在安裝docker 跟喝水一樣, 完全沒難度阿
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf update -y
dnf install -y docker-ce docker-ce-cli containerd.io
docker --version
#########
#ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecStart=/usr/bin/dockerd --data-root /docker -H fd:// --containerd=/run/containerd/containerd.sock
#########
systemctl daemon-reload
systemctl enable docker
systemctl start docker
docker ps
docker container產出log有兩種方式, 一種丟給docker輸出, 另一種是自己產出log檔案
長時間使用, volume就會莫名越來越肥, 讓備分增加難度, 有必要把這些檔案抓出來,
最簡單就是利用linux的指令, 抓出大的檔案, 再寫shell另外處理
find /docker-volume-dir -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
#抓出超過100M的檔案
之前一直維護的是 postfix + M$ 的AD 認證 , 這也可以拿來取代google 代管的mail , 但是沒事還要生出windows server , 這錢花了就算了, 就怕一直要更新… 因此花了5天時間,認真研究 , 讓postfix + openldap 認證 , 做成docker images , 也提供範例架設docker openldap server .
值得注意的是 openldap 必須要吃進去 postfix 的 ldap schema 才能跟postfix整合(aliases) .
docker image還沒正式啟用變成container , 那裏面的資料如何抓出來呢? 答案應該也是暫時執行一下下, 趕緊複製後就刪掉該暫時container.
docker run -v $PWD:/opt/mount --rm --entrypoint cat inmethod/docker-postfix-ad:1.2 /etc/postfix/main.cf > main.cf
#將images裏面的/etc/postfix 複製到目前目錄下
docker run -v $PWD:/opt/mount --rm -ti inmethod/docker-postfix-ad:1.2 bash -c "cp /etc/postfix/* /opt/mount/"
這把年紀了,還在用ldif ,金害!
因為我有需求, 將postfix aliases屬性加到openldap裏面, 只找到schema , 因此又找到 fuck-openldap.sh , 看來這位老兄對openldap很不爽
root@6fa88f73c061:/# ./fuck-openldap.sh postfix.schema
./fuck-openldap.sh: converting /postfix.schema to LDIF //postfix.ldif
config file testing succeeded
./fuck-openldap.sh: LDIF file successfully created as //postfix.ldif
若你要玩postfix + ldap , 正好該ldap server是openldap server , 你就必須把這個ldif加到 openldap 裏面去, 檔案我準備好了,請按這裡下載postfix.ldif
Rspamd 讓我非常驚豔, 設定容易, 可以用來取代老牌amavisd-new套件
centos 7 系統簡易安裝如下:
curl https://rspamd.com/rpm-stable/centos-7/rspamd.repo > /etc/yum.repos.d/rspamd.repo # For Centos-7
rpm --import https://rspamd.com/rpm-stable/gpg.key
yum -y update
yum -y install ca-certificates unbound redis rspamd clamav clamav-devel clamav-scanner-systemd clamav-update clamav-data clamav-server clamav-server-systemd clamav-scanner
port 7379
bind 127.0.0.1 ::1
systemctl enable redis
systemctl start redis
##########################################
LocalSocket /run/clamd.scan/clamd.sock
LocalSocketMode 666
FixStaleSocket yes
##########################################
systemctl enable clamav-freshclam
systemctl enable clamd\@scan
https://kafeiou.pw/wp-content/uploads/2022/02/rspamd.zip
usermod -aG clamscan _rspamd
usermod -aG virusgroup _rspamd
systemctl enable rspamd
chown -R _rspamd:_rspamd /etc/rspamd/override.d
systemctl start rspamd
smtpd_milters = inet:127.0.0.1:11332
non_smtpd_milters = $smtpd_milters
milter_default_action = accept
postfix reload
<VirtualHost *:443> ServerName mail.test.com ErrorLog /var/log/httpd/ssl_error_log TransferLog /var/log/httpd/ssl_access_log SSLEngine On SSLCertificateFile /etc/letsencrypt/live/mail.test.com/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/mail.test.com/privkey.pem SSLCACertificateFile /etc/letsencrypt//live/mail.test.com/fullchain.pem SSLProxyEngine On ProxyRequests Off ProxyPreserveHost On RequestHeader set X-Forwarded-Proto "https" ProxyPass /rspamd/ http://localhost:11334/ ProxyPassReverse /rspamd/ http://localhost:11334/ <Location /> Order allow,deny Allow from all </Location> <Location /rspamd> Require all granted </Location> RewriteEngine On RewriteRule ^/rspamd$ /rspamd/ [R,L] RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P] </VirtualHost>
rspamadm pw