Initial commit

This commit is contained in:
Tyler Hale 2023-04-04 15:33:23 -06:00
parent 6f25b090be
commit 9586bc600b
Signed by: Tyler
GPG key ID: C7CC4B910D88EF96
16 changed files with 619 additions and 0 deletions

View file

@ -0,0 +1,5 @@
[Unit]
Description=Certbot Renewal Service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/certbot renew

View file

@ -0,0 +1,9 @@
[Unit]
Description=Certbot Renewal Timer
[Timer]
WakeSystem=false
OnCalendar=*-*-* 01:00
RandomizedDelaySec=600
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,11 @@
/* Set text black for better readability while dealing with ticket creation */
.page-content .formGroup-label label {
color: black;
}
/* Remove Zammad default branding */
.poweredBy {
visibility: hidden;
}

View file

@ -0,0 +1,5 @@
[Unit]
Description=Repair Elastic Seach Failure due to ingest plugin
[Service]
ExecStart=/bin/zammadUtilites/ingest-attachment-fix.sh

View file

@ -0,0 +1,9 @@
[Unit]
OnFailure=elasticsearch-fail.service
StartLimitIntervalSec=600
StartLimitBurst=5
[Service]
Restart=on-failure
RestartSec=5s
TimeoutStartSec=240

View file

@ -0,0 +1,6 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}

View file

@ -0,0 +1,15 @@
#!/bin/bash
date | tee -a /var/log/zammad/ingest.log
if systemctl is-failed --quiet elasticsearch; then
echo Elastic Search is failed | tee -a /var/log/zammad/ingest.log
if tail --line=20 /var/log/elasticsearch/elasticsearch.log | grep "Plugin \[ingest-attachment\] was built for Elasticsearch version"; then
echo Ingest-Attachment needs to be reinstalled | tee -a /var/log/zammad/ingest.log
/usr/share/elasticsearch/bin/elasticsearch-plugin remove ingest-attachment
sleep 10
/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment --batch
systemctl start elasticsearch
fi
fi

View file

@ -0,0 +1,68 @@
#
# this is the nginx config for zammad
#
upstream zammad-railsserver {
server 127.0.0.1:3000;
}
upstream zammad-websocket {
server 127.0.0.1:6042;
}
server {
listen 443 ssl http2;
server_name {{ zammad_url }};
ssl_certificate {{ zammad_certificate }};
ssl_certificate_key {{ zammad_certificate_key }};
#uncomment this if dhparams where generated above.
#ssl_dhparam /etc/nginx/ssl/dhparam.pem;
ssl_protocols TLSv1.2;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 180m;
root /opt/zammad/public;
# security - prevent information disclosure about server version
server_tokens off;
access_log /var/log/nginx/zammad.access.log;
error_log /var/log/nginx/zammad.error.log;
client_max_body_size 50M;
location ~ ^/(assets/|robots.txt|humans.txt|favicon.ico) {
expires max;
}
location /ws {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header CLIENT_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
proxy_pass http://zammad-websocket;
}
location / {
proxy_set_header Host $http_host;
proxy_set_header CLIENT_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 300;
proxy_pass http://zammad-railsserver;
gzip on;
gzip_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;
gzip_proxied any;
}
}

View file

@ -0,0 +1,3 @@
[Service]
ExecStartPre=zammad run rake assets:precompile
TimeoutStartSec=240