Skip to content

Commit a9b02b3

Browse files
'Add new script' (#7414)
1 parent b62adc2 commit a9b02b3

File tree

4 files changed

+181
-0
lines changed

4 files changed

+181
-0
lines changed

ct/headers/leantime

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__ __ _
2+
/ / ___ ____ _____ / /_(_)___ ___ ___
3+
/ / / _ \/ __ `/ __ \/ __/ / __ `__ \/ _ \
4+
/ /___/ __/ /_/ / / / / /_/ / / / / / / __/
5+
/_____/\___/\__,_/_/ /_/\__/_/_/ /_/ /_/\___/
6+

ct/leantime.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Stroopwafe1
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://leantime.io
7+
8+
APP="Leantime"
9+
var_tags="${var_tags:-productivity}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-2048}"
12+
var_disk="${var_disk:-20}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -d /opt/leantime ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit
30+
fi
31+
32+
if check_for_gh_release "leantime" "Leantime/leantime"; then
33+
msg_info "Creating Backup"
34+
mariadb-dump leantime >"/opt/${APP}_db_backup_$(date +%F).sql"
35+
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/opt/${APP}"
36+
mv /opt/leantime /opt/leantime_bak
37+
msg_ok "Backup Created"
38+
39+
fetch_and_deploy_gh_release "leantime" "Leantime/leantime" "prebuild" "latest" "/opt/leantime" Leantime*.tar.gz
40+
41+
msg_info "Restoring Config & Permissions"
42+
mv /opt/leantime_bak/config/.env /opt/leantime/config/.env
43+
chown -R www-data:www-data "/opt/leantime"
44+
chmod -R 750 "/opt/leantime"
45+
msg_ok "Restored Config & Permissions"
46+
47+
msg_info "Removing Backup"
48+
rm -rf /opt/leantime_bak
49+
msg_ok "Removed Backup"
50+
msg_ok "Updated Successfully"
51+
fi
52+
exit
53+
}
54+
55+
start
56+
build_container
57+
description
58+
59+
msg_ok "Completed Successfully!\n"
60+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
61+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
62+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}/install${CL}"

frontend/public/json/leantime.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "Leantime",
3+
"slug": "leantime",
4+
"categories": [
5+
12
6+
],
7+
"date_created": "2025-06-27",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 80,
12+
"documentation": "https://docs.leantime.io/",
13+
"config_path": "/opt/Leantime/config/.env",
14+
"website": "https://leantime.io",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/leantime.webp",
16+
"description": "Leantime is a goals focused project management system for non-project managers. Building with ADHD, Autism, and dyslexia in mind. ",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/leantime.sh",
21+
"resources": {
22+
"cpu": 2,
23+
"ram": 2048,
24+
"hdd": 20,
25+
"os": "Debian",
26+
"version": "12"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": []
35+
}

install/leantime-install.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: Stroopwafe1
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://leantime.io
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+
PHP_VERSION="8.4" PHP_MODULE="mysql" PHP_APACHE="YES" PHP_FPM="YES" setup_php
17+
setup_mariadb
18+
19+
msg_info "Setting up Database"
20+
DB_NAME=leantime
21+
DB_USER=leantime
22+
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
23+
$STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
24+
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
25+
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
26+
{
27+
echo "Leantime Credentials"
28+
echo "Database User: $DB_USER"
29+
echo "Database Password: $DB_PASS"
30+
echo "Database Name: $DB_NAME"
31+
} >>~/leantime.creds
32+
msg_ok "Set up Database"
33+
34+
fetch_and_deploy_gh_release "leantime" "Leantime/leantime" "prebuild" "latest" "/opt/leantime" Leantime*.tar.gz
35+
36+
msg_info "Setup Leantime"
37+
chown -R www-data:www-data "/opt/leantime"
38+
chmod -R 750 "/opt/leantime"
39+
cat <<EOF >/etc/apache2/sites-enabled/000-default.conf
40+
<VirtualHost *:80>
41+
ServerAdmin webmaster@localhost
42+
DocumentRoot /opt/leantime/public
43+
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml
44+
Options +ExecCGI
45+
46+
<Directory /opt/leantime/>
47+
Options FollowSymLinks
48+
Require all granted
49+
AllowOverride All
50+
</Directory>
51+
52+
<Location />
53+
Require all granted
54+
</Location>
55+
56+
ErrorLog /var/log/apache2/error.log
57+
CustomLog /var/log/apache2/access.log combined
58+
</VirtualHost>
59+
EOF
60+
mv "/opt/leantime/config/sample.env" "/opt/leantime/config/.env"
61+
sed -i -e "s|^LEAN_DB_DATABASE.*|LEAN_DB_DATABASE = '$DB_NAME'|" \
62+
-e "s|^LEAN_DB_USER.*|LEAN_DB_USER = '$DB_USER'|" \
63+
-e "s|^LEAN_DB_PASSWORD.*|LEAN_DB_PASSWORD = '$DB_PASS'|" \
64+
-e "s|^LEAN_SESSION_PASSWORD.*|LEAN_SESSION_PASSWORD = '$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)'|" \
65+
"/opt/leantime/config/.env"
66+
$STD a2enmod -q proxy_fcgi setenvif rewrite
67+
$STD a2enconf -q "php8.4-fpm"
68+
sed -i -e "s/^;extension.\(curl\|fileinfo\|gd\|intl\|ldap\|mbstring\|exif\|mysqli\|odbc\|openssl\|pdo_mysql\)/extension=\1/g" "/etc/php/8.4/apache2/php.ini"
69+
systemctl restart apache2
70+
msg_ok "Setup leantime"
71+
72+
motd_ssh
73+
customize
74+
75+
msg_info "Cleaning up"
76+
$STD apt-get -y autoremove
77+
$STD apt-get -y autoclean
78+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)