From e71a001c15871eb23d26e169a982ec102814d0cc Mon Sep 17 00:00:00 2001 From: John Norwood Date: Mon, 11 Oct 2021 16:16:20 +0000 Subject: [PATCH] feat: cleans up deb installation a bit moving files to more sensible places for hashbash --- debian/dirs | 3 +-- .../hashbash-backend.hashbash-engine.service | 6 ++---- .../hashbash-backend.hashbash-webapp.service | 5 ++--- .../hashbash-backend.hashbash-webapp.socket | 3 ++- debian/hashbash-backend.logrotate | 19 ------------------- debian/install | 9 ++++----- hashbash.env | 2 +- 7 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 debian/hashbash-backend.logrotate diff --git a/debian/dirs b/debian/dirs index 93c1624..291abb5 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,2 +1 @@ -opt/hashbash/logs -opt/hashbash/sockets +etc/hashbash diff --git a/debian/hashbash-backend.hashbash-engine.service b/debian/hashbash-backend.hashbash-engine.service index e0c15f2..c3178f6 100644 --- a/debian/hashbash-backend.hashbash-engine.service +++ b/debian/hashbash-backend.hashbash-engine.service @@ -3,14 +3,12 @@ Description=hashbash engine service Requires=hashbash-engine-management.socket [Service] -ExecStart=/opt/hashbash/bin/hashbash-engine +ExecStart=/usr/bin/hashbash-engine Restart=always KillSignal=SIGQUIT Type=simple -StandardError=syslog -StandardOutput=/opt/hashbash/logs/engine.log NotifyAccess=all -EnvironmentFile=/opt/hashbash/hashbash.env +EnvironmentFile=/opt/secrets/hashbash/hashbash.env Environment=HASHBASH_MANAGEMENT_NAME=hashbash-engine-management Sockets=hashbash-engine-management.socket User=hashbash diff --git a/debian/hashbash-backend.hashbash-webapp.service b/debian/hashbash-backend.hashbash-webapp.service index 3c59266..437f106 100644 --- a/debian/hashbash-backend.hashbash-webapp.service +++ b/debian/hashbash-backend.hashbash-webapp.service @@ -4,13 +4,12 @@ Requires=hashbash-webapp.socket Requires=hashbash-webapp-management.socket [Service] -ExecStart=/opt/hashbash/bin/hashbash-webapp +ExecStart=/usr/bin/hashbash-webapp Restart=always KillSignal=SIGQUIT Type=simple -StandardError=syslog NotifyAccess=all -EnvironmentFile=/opt/hashbash/hashbash.env +EnvironmentFile=/opt/secrets/hashbash/hashbash.env Environment=HASHBASH_HTTP_NAME=hashbash-webapp Environment=HASHBASH_MANAGEMENT_NAME=hashbash-webapp-management Sockets=hashbash-webapp.socket diff --git a/debian/hashbash-backend.hashbash-webapp.socket b/debian/hashbash-backend.hashbash-webapp.socket index 55ece83..df7a8fd 100644 --- a/debian/hashbash-backend.hashbash-webapp.socket +++ b/debian/hashbash-backend.hashbash-webapp.socket @@ -3,8 +3,9 @@ Description=hashbash webapp listen socket PartOf=hashbash-webapp.service [Socket] -ListenStream=/opt/hashbash/sockets/hashbash-webapp.sock +ListenStream=/run/hashbash/webapp.sock FileDescriptorName=hashbash-webapp +Service=hashbash-webapp.service SocketUser=hashbash SocketGroup=hashbash diff --git a/debian/hashbash-backend.logrotate b/debian/hashbash-backend.logrotate deleted file mode 100644 index 6a17f62..0000000 --- a/debian/hashbash-backend.logrotate +++ /dev/null @@ -1,19 +0,0 @@ -/opt/hashbash/logs/engine.log { - daily - rotate 7 - compress - delaycompress - missingok - notifempty - dateext -} - -/opt/hashbash/logs/webapp.log { - daily - rotate 7 - compress - delaycompress - missingok - notifempty - dateext -} diff --git a/debian/install b/debian/install index 428f66f..dd33ec4 100644 --- a/debian/install +++ b/debian/install @@ -1,5 +1,4 @@ -frontend /opt/hashbash -hashbash.env /opt/hashbash -hashbash-cli /opt/hashbash/bin -hashbash-engine /opt/hashbash/bin -hashbash-webapp /opt/hashbash/bin +frontend /etc/hashbash +hashbash-cli /usr/bin +hashbash-engine /usr/bin +hashbash-webapp /usr/bin diff --git a/hashbash.env b/hashbash.env index ef4cba9..1880d5f 100644 --- a/hashbash.env +++ b/hashbash.env @@ -1,6 +1,6 @@ HASHBASH_DATABASE_HOST=0p0 HASHBASH_DATABASE_USERNAME=hashbash-rw -HASHBASH_FRONTEND_TEMPLATE_PATH=/opt/hashbash/frontend +HASHBASH_FRONTEND_TEMPLATE_PATH=/etc/hashbash/frontend HASHBASH_GENERATE_NUM_THREADS=4 HASHBASH_RABBITMQ_HOST=0p0 HASHBASH_RABBITMQ_USERNAME=hashbash-rw