'Add new script' (#7414)

This commit is contained in:
push-app-to-main[bot] 2025-09-06 08:36:01 +02:00 committed by GitHub
parent b62adc2c5c
commit a9b02b3e9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 181 additions and 0 deletions

6
ct/headers/leantime Normal file
View File

@ -0,0 +1,6 @@
__ __ _
/ / ___ ____ _____ / /_(_)___ ___ ___
/ / / _ \/ __ `/ __ \/ __/ / __ `__ \/ _ \
/ /___/ __/ /_/ / / / / /_/ / / / / / / __/
/_____/\___/\__,_/_/ /_/\__/_/_/ /_/ /_/\___/

62
ct/leantime.sh Normal file
View File

@ -0,0 +1,62 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: Stroopwafe1
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://leantime.io
APP="Leantime"
var_tags="${var_tags:-productivity}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-20}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/leantime ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "leantime" "Leantime/leantime"; then
msg_info "Creating Backup"
mariadb-dump leantime >"/opt/${APP}_db_backup_$(date +%F).sql"
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/opt/${APP}"
mv /opt/leantime /opt/leantime_bak
msg_ok "Backup Created"
fetch_and_deploy_gh_release "leantime" "Leantime/leantime" "prebuild" "latest" "/opt/leantime" Leantime*.tar.gz
msg_info "Restoring Config & Permissions"
mv /opt/leantime_bak/config/.env /opt/leantime/config/.env
chown -R www-data:www-data "/opt/leantime"
chmod -R 750 "/opt/leantime"
msg_ok "Restored Config & Permissions"
msg_info "Removing Backup"
rm -rf /opt/leantime_bak
msg_ok "Removed Backup"
msg_ok "Updated Successfully"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}/install${CL}"

View File

@ -0,0 +1,35 @@
{
"name": "Leantime",
"slug": "leantime",
"categories": [
12
],
"date_created": "2025-06-27",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 80,
"documentation": "https://docs.leantime.io/",
"config_path": "/opt/Leantime/config/.env",
"website": "https://leantime.io",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/leantime.webp",
"description": "Leantime is a goals focused project management system for non-project managers. Building with ADHD, Autism, and dyslexia in mind. ",
"install_methods": [
{
"type": "default",
"script": "ct/leantime.sh",
"resources": {
"cpu": 2,
"ram": 2048,
"hdd": 20,
"os": "Debian",
"version": "12"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": []
}

View File

@ -0,0 +1,78 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: Stroopwafe1
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://leantime.io
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
PHP_VERSION="8.4" PHP_MODULE="mysql" PHP_APACHE="YES" PHP_FPM="YES" setup_php
setup_mariadb
msg_info "Setting up Database"
DB_NAME=leantime
DB_USER=leantime
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
$STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
{
echo "Leantime Credentials"
echo "Database User: $DB_USER"
echo "Database Password: $DB_PASS"
echo "Database Name: $DB_NAME"
} >>~/leantime.creds
msg_ok "Set up Database"
fetch_and_deploy_gh_release "leantime" "Leantime/leantime" "prebuild" "latest" "/opt/leantime" Leantime*.tar.gz
msg_info "Setup Leantime"
chown -R www-data:www-data "/opt/leantime"
chmod -R 750 "/opt/leantime"
cat <<EOF >/etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /opt/leantime/public
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml
Options +ExecCGI
<Directory /opt/leantime/>
Options FollowSymLinks
Require all granted
AllowOverride All
</Directory>
<Location />
Require all granted
</Location>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
EOF
mv "/opt/leantime/config/sample.env" "/opt/leantime/config/.env"
sed -i -e "s|^LEAN_DB_DATABASE.*|LEAN_DB_DATABASE = '$DB_NAME'|" \
-e "s|^LEAN_DB_USER.*|LEAN_DB_USER = '$DB_USER'|" \
-e "s|^LEAN_DB_PASSWORD.*|LEAN_DB_PASSWORD = '$DB_PASS'|" \
-e "s|^LEAN_SESSION_PASSWORD.*|LEAN_SESSION_PASSWORD = '$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)'|" \
"/opt/leantime/config/.env"
$STD a2enmod -q proxy_fcgi setenvif rewrite
$STD a2enconf -q "php8.4-fpm"
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"
systemctl restart apache2
msg_ok "Setup leantime"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"