From 393a5b8d4e8a2ca14688691774ca1eecabeb5fc5 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sun, 25 Mar 2018 20:12:26 -0700 Subject: [PATCH] redhat: Use goreleaser to generate .rpm package for #89 --- .goreleaser.yml | 1 + CHANGELOG.md | 1 + etc/redhat/README | 3 - etc/redhat/httpd-vhost.conf | 17 ----- etc/redhat/inbucket-init.sh | 117 ---------------------------------- etc/redhat/inbucket.logrotate | 8 --- etc/redhat/inbucket.service | 20 ------ 7 files changed, 2 insertions(+), 165 deletions(-) delete mode 100644 etc/redhat/README delete mode 100644 etc/redhat/httpd-vhost.conf delete mode 100755 etc/redhat/inbucket-init.sh delete mode 100644 etc/redhat/inbucket.logrotate delete mode 100644 etc/redhat/inbucket.service diff --git a/.goreleaser.yml b/.goreleaser.yml index 864d60f..03764a7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -61,6 +61,7 @@ nfpm: license: MIT formats: - deb + - rpm files: "ui/**/*": "/usr/local/share/inbucket/ui" config_files: diff --git a/CHANGELOG.md b/CHANGELOG.md index fd77963..888adb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Store size is now calculated during retention scan and displayed on the Status page. - Debian `.deb` package generation to release process. +- RedHat `.rpm` package generation to release process. ### Changed - Massive refactor of back-end code. Inbucket should now be both easier and diff --git a/etc/redhat/README b/etc/redhat/README deleted file mode 100644 index 26bac7a..0000000 --- a/etc/redhat/README +++ /dev/null @@ -1,3 +0,0 @@ -Please see the RedHat installation guide on our website: - -http://www.inbucket.org/installation/redhat.html diff --git a/etc/redhat/httpd-vhost.conf b/etc/redhat/httpd-vhost.conf deleted file mode 100644 index 02eff5c..0000000 --- a/etc/redhat/httpd-vhost.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Inbucket reverse proxy, Apache will forward requests from port 80 -# to Inbucket's built in web server on port 9000 -# -# Replace SERVERFQDN with your servers fully qualified domain name - - ServerName SERVERFQDN - ProxyRequests off - - - Order allow,deny - Allow from all - - - RewriteRule ^/$ http://SERVERFQDN:9000 - ProxyPass / http://SERVERFQDN:9000/ - ProxyPassReverse / http://SERVERFQDN:9000/ - diff --git a/etc/redhat/inbucket-init.sh b/etc/redhat/inbucket-init.sh deleted file mode 100755 index 504a3a7..0000000 --- a/etc/redhat/inbucket-init.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -# -# inbucket Inbucket email testing service -# -# chkconfig: 2345 80 30 -# description: Inbucket is a disposable email service for testing email -# functionality of other applications. -# processname: inbucket -# pidfile: /var/run/inbucket/inbucket.pid - -### BEGIN INIT INFO -# Provides: Inbucket service -# Required-Start: $local_fs $network $remote_fs -# Required-Stop: $local_fs $network $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: start and stop inbucket -# Description: Inbucket is a disposable email service for testing email -# functionality of other applications. -# moves mail from one machine to another. -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -RETVAL=0 -program=/opt/inbucket/inbucket -prog=${program##*/} -config=/etc/opt/inbucket.conf -runas=inbucket - -lockfile=/var/lock/subsys/$prog -pidfile=/var/run/$prog/$prog.pid -logfile=/var/log/$prog.log - -conf_check() { - [ -x $program ] || exit 5 - [ -f $config ] || exit 6 -} - -perms_check() { - mkdir -p /var/run/$prog - chown $runas: /var/run/$prog - touch $logfile - chown $runas: $logfile - # Allow bind to ports under 1024 - setcap 'cap_net_bind_service=+ep' $program -} - -start() { - [ "$EUID" != "0" ] && exit 4 - # Check that networking is up. - [ ${NETWORKING} = "no" ] && exit 1 - # Check config sanity - conf_check - perms_check - # Start daemon - echo -n $"Starting $prog: " - daemon --user $runas --pidfile $pidfile $program \ - -pidfile $pidfile -logfile $logfile $config \& - RETVAL=$? - [ $RETVAL -eq 0 ] && touch $lockfile - echo - return $RETVAL -} - -stop() { - [ "$EUID" != "0" ] && exit 4 - conf_check - # Stop daemon - echo -n $"Shutting down $prog: " - killproc -p "$pidfile" -d 15 "$program" - RETVAL=$? - [ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile - echo - return $RETVAL -} - -reload() { - [ "$EUID" != "0" ] && exit 4 - echo -n $"Reloading $prog: " - killproc -p "$pidfile" "$program" -HUP - RETVAL=$? - echo - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - [ -e $lockfile ] && exit 0 - start - ;; - stop) - [ -e $lockfile ] || exit 0 - stop - ;; - reload) - [ -e $lockfile ] || exit 0 - reload - ;; - restart|force-reload) - stop - start - ;; - status) - status -p $pidfile -l $(basename $lockfile) $prog - ;; - *) - echo $"Usage: $0 {start|stop|restart|status}" - exit 2 -esac - -exit $? diff --git a/etc/redhat/inbucket.logrotate b/etc/redhat/inbucket.logrotate deleted file mode 100644 index 04ec439..0000000 --- a/etc/redhat/inbucket.logrotate +++ /dev/null @@ -1,8 +0,0 @@ -/var/log/inbucket.log { - missingok - notifempty - create 0644 inbucket inbucket - postrotate - [ -x /bin/systemctl ] && /bin/systemctl reload inbucket >/dev/null 2>&1 || true - endscript -} diff --git a/etc/redhat/inbucket.service b/etc/redhat/inbucket.service deleted file mode 100644 index 5480a45..0000000 --- a/etc/redhat/inbucket.service +++ /dev/null @@ -1,20 +0,0 @@ -[Unit] -Description=Inbucket Disposable Email Service -After=network.target - -[Service] -Type=simple -User=inbucket -Group=inbucket - -ExecStart=/opt/inbucket/inbucket -logfile /var/log/inbucket.log /etc/opt/inbucket.conf - -# Re-open log file after rotation -ExecReload=/bin/kill -HUP $MAINPID - -# Give SMTP connections time to drain -TimeoutStopSec=20 -KillMode=mixed - -[Install] -WantedBy=multi-user.target