From ab572844241873b467fa4c6943787a8fac3f6c77 Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 20 Jan 2019 21:32:26 +0100 Subject: [PATCH] Add everything needed to build a deb file for vikunja --- Makefile | 5 +++++ build/after-install.sh | 8 ++++++++ config.yml.sample | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 build/after-install.sh diff --git a/Makefile b/Makefile index 9c32aa522..2fd86b74e 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,11 @@ release-os-package: release-zip: $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),cd $(file); zip -r ../../zip/$(shell basename $(file)).zip *; cd ../../../; ) +# Builds a deb package using fpm from a previously created binary (using make build) +.PHONY: build-deb +build-deb: + fpm -s dir -t deb -n vikunja -v $(VERSION) --license GPLv3 --directories /opt/vikunja --after-install ./build/after-install.sh --description 'Vikunja is an open-source todo application, written in Go. It lets you create lists,tasks and share them via teams or directly between users.' -m maintainers@vikunja.io ./$(EXECUTABLE)=/opt/vikunja/vikunja ./templates=/opt/vikunja ./config.yml.sample=/etc/vikunja/config.yml + .PHONY: got-swag got-swag: do-the-swag @diff=$$(git diff docs/swagger/swagger.json); \ diff --git a/build/after-install.sh b/build/after-install.sh new file mode 100644 index 000000000..8e0097605 --- /dev/null +++ b/build/after-install.sh @@ -0,0 +1,8 @@ +#!/bin/bash +ln -s /opt/vikunja/vikunja /usr/bin/vikunja + +# Fix the config to contain proper values +NEW_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) +sed -i "s//$NEW_SECRET/g" /etc/vikunja/config.yml +sed -i "s//\/opt\/vikunja\//g" /etc/vikunja/config.yml +sed -i "s/Path: \"\.\/vikunja.db\"/Path: \"\\/opt\/vikunja\/vikunja.db\"/g" /etc/vikunja/config.yml diff --git a/config.yml.sample b/config.yml.sample index fd9071918..d2203d35c 100644 --- a/config.yml.sample +++ b/config.yml.sample @@ -2,7 +2,7 @@ service: # This token is used to verify issued JWT tokens. # Default is a random token which will be generated at each startup of vikunja. # (This means all already issued tokens will be invalid once you restart vikunja) - JWTSecret: "cei6gaezoosah2bao3ieZohkae5aicah" + JWTSecret: "" # The interface on which to run the webserver interface: ":3456" # The URL of the frontend, used to send password reset emails. @@ -10,7 +10,7 @@ service: # The base path on the file system where the binary and assets are. # Vikunja will also look in this path for a config file, so you could provide only this variable to point to a folder # with a config file which will then be used. - rootpath: + rootpath: # The number of items which gets returned per page pagecount: 50 # If set to true, enables a /metrics endpoint for prometheus to collect metrics about the system