Skip to content

Commit 0cd5ff3

Browse files
MickLeskhavardthom
andauthored
Add new LXC: Vikunja (#80)
* Add new LXC: Vikunja * Apply suggestions from code review Co-authored-by: Håvard Gjøby Thom <[email protected]> * Update vikunja.sh Signed-off-by: CanbiZ <[email protected]> * Update vikunja.sh Signed-off-by: CanbiZ <[email protected]> * Update vikunja-install.sh Signed-off-by: CanbiZ <[email protected]> * Spelling Signed-off-by: CanbiZ <[email protected]> --------- Signed-off-by: CanbiZ <[email protected]> Co-authored-by: Håvard Gjøby Thom <[email protected]>
1 parent 9c4bb59 commit 0cd5ff3

File tree

3 files changed

+141
-0
lines changed

3 files changed

+141
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ All LXC instances created using this repository come pre-installed with Midnight
1919

2020
- **Bookstack LXC** [(View Source)](https://github.com/community-scripts/ProxmoxVE/blob/main/install/bookstack-install.sh)
2121
- NEW Script
22+
- **Vikunja LXC** [(View Source)](https://github.com/community-scripts/ProxmoxVE/blob/main/install/vikunja-install.sh)
23+
- NEW Script
2224

2325
## 2024-11-04
2426

ct/vikunja.sh

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2024 community-scripts ORG
4+
# Author: MickLesk (Canbiz)
5+
# License: MIT
6+
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
7+
# Source: https://vikunja.io/
8+
9+
function header_info {
10+
clear
11+
cat <<"EOF"
12+
_ ___ __ _
13+
| | / (_) /____ ______ (_)___ _
14+
| | / / / //_/ / / / __ \ / / __ `/
15+
| |/ / / ,< / /_/ / / / / / / /_/ /
16+
|___/_/_/|_|\__,_/_/ /_/_/ /\__,_/
17+
/___/
18+
19+
EOF
20+
}
21+
header_info
22+
echo -e "Loading..."
23+
APP="Vikunja"
24+
var_disk="4"
25+
var_cpu="1"
26+
var_ram="1024"
27+
var_os="debian"
28+
var_version="12"
29+
variables
30+
color
31+
catch_errors
32+
33+
function default_settings() {
34+
CT_TYPE="1"
35+
PW=""
36+
CT_ID=$NEXTID
37+
HN=$NSAPP
38+
DISK_SIZE="$var_disk"
39+
CORE_COUNT="$var_cpu"
40+
RAM_SIZE="$var_ram"
41+
BRG="vmbr0"
42+
NET="dhcp"
43+
GATE=""
44+
APT_CACHER=""
45+
APT_CACHER_IP=""
46+
DISABLEIP6="no"
47+
MTU=""
48+
SD=""
49+
NS=""
50+
MAC=""
51+
VLAN=""
52+
SSH="no"
53+
VERB="no"
54+
echo_default
55+
}
56+
57+
function update_script() {
58+
header_info
59+
if [[ ! -d /opt/vikunja ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
60+
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
61+
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
62+
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
63+
fi
64+
RELEASE=$(curl -s https://dl.vikunja.io/vikunja/ | grep -oP 'href="/vikunja/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
65+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
66+
msg_info "Stopping ${APP}"
67+
systemctl stop vikunja
68+
msg_ok "Services ${APP}"
69+
70+
msg_info "Updating ${APP} to ${RELEASE}"
71+
cd /opt
72+
rm -rf /opt/*
73+
wget -q "https://dl.vikunja.io/vikunja/$RELEASE/vikunja-$RELEASE-amd64.deb"
74+
DEBIAN_FRONTEND=noninteractive dpkg -i vikunja-$RELEASE-amd64.deb &>/dev/null
75+
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
76+
msg_ok "Updated ${APP}"
77+
78+
msg_info "Starting ${APP}"
79+
systemctl start vikunja
80+
msg_ok "Started ${APP}"
81+
82+
msg_info "Cleaning Up"
83+
rm -rf /opt/vikunja-$RELEASE-amd64.deb
84+
msg_ok "Cleaned"
85+
msg_ok "Updated Successfully"
86+
else
87+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
88+
fi
89+
exit
90+
}
91+
92+
start
93+
build_container
94+
description
95+
96+
msg_ok "Completed Successfully!\n"
97+
echo -e "${APP} Setup should be reachable by going to the following URL.
98+
${BL}http://${IP}:3456${CL} \n"

install/vikunja-install.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2024 community-scripts ORG
4+
# Author: MickLesk (Canbiz)
5+
# License: MIT
6+
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
make \
21+
mc
22+
msg_ok "Installed Dependencies"
23+
24+
msg_info "Setup Vikunja (Patience)"
25+
cd /opt
26+
RELEASE=$(curl -s https://dl.vikunja.io/vikunja/ | grep -oP 'href="/vikunja/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
27+
wget -q "https://dl.vikunja.io/vikunja/$RELEASE/vikunja-$RELEASE-amd64.deb"
28+
$STD dpkg -i vikunja-$RELEASE-amd64.deb
29+
sudo sed -i 's/^ timezone: .*/ timezone: UTC/' /etc/vikunja/config.yml
30+
systemctl start vikunja.service
31+
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
32+
msg_ok "Installed Vikunja"
33+
34+
motd_ssh
35+
customize
36+
37+
msg_info "Cleaning up"
38+
rm -rf /opt/vikunja-$RELEASE-amd64.deb
39+
$STD apt-get autoremove
40+
$STD apt-get autoclean
41+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)