mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 10:22:50 +00:00 
			
		
		
		
	planka (#5277)
* 'Add new script' * Update planka.sh * Update planka.sh * Update planka.json --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							1c42a2016e
						
					
				
				
					commit
					bada204f64
				
			
							
								
								
									
										6
									
								
								ct/headers/planka
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								ct/headers/planka
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
           __            __        
 | 
			
		||||
    ____  / /___ _____  / /______ _
 | 
			
		||||
   / __ \/ / __ `/ __ \/ //_/ __ `/
 | 
			
		||||
  / /_/ / / /_/ / / / / ,< / /_/ / 
 | 
			
		||||
 / .___/_/\__,_/_/ /_/_/|_|\__,_/  
 | 
			
		||||
/_/                                
 | 
			
		||||
							
								
								
									
										77
									
								
								ct/planka.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								ct/planka.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,77 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/refs/heads/main/misc/build.func)
 | 
			
		||||
# Copyright (c) 2021-2025 community-scripts ORG
 | 
			
		||||
# Author: Slaviša Arežina (tremor021)
 | 
			
		||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
 | 
			
		||||
# Source: https://github.com/plankanban/planka
 | 
			
		||||
 | 
			
		||||
APP="PLANKA"
 | 
			
		||||
var_tags="${var_tags:-Arr}"
 | 
			
		||||
var_cpu="${var_cpu:-1}"
 | 
			
		||||
var_ram="${var_ram:-1024}"
 | 
			
		||||
var_disk="${var_disk:-4}"
 | 
			
		||||
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 [[ ! -f /etc/systemd/system/planka.service ]]; then
 | 
			
		||||
    msg_error "No ${APP} Installation Found!"
 | 
			
		||||
    exit
 | 
			
		||||
  fi
 | 
			
		||||
  RELEASE=$(curl -s https://api.github.com/repos/plankanban/planka/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
 | 
			
		||||
  if [[ "${RELEASE}" != "$(cat ~/.planka 2>/dev/null)" ]] || [[ ! -f ~/.planka ]]; then
 | 
			
		||||
    msg_info "Stopping $APP"
 | 
			
		||||
    systemctl stop planka
 | 
			
		||||
    msg_ok "Stopped $APP"
 | 
			
		||||
 | 
			
		||||
    msg_info "Updating $APP to ${RELEASE}"
 | 
			
		||||
    mkdir -p /opt/planka-backup
 | 
			
		||||
    mkdir -p /opt/planka-backup/favicons
 | 
			
		||||
    mkdir -p /opt/planka-backup/user-avatars
 | 
			
		||||
    mkdir -p /opt/planka-backup/background-images
 | 
			
		||||
    mkdir -p /opt/planka-backup/attachments
 | 
			
		||||
    mv /opt/planka/planka/.env /opt/planka-backup
 | 
			
		||||
    mv /opt/planka/planka/public/favicons/* /opt/planka-backup/favicons/
 | 
			
		||||
    mv /opt/planka/planka/public/user-avatars/* /opt/planka-backup/user-avatars/
 | 
			
		||||
    mv /opt/planka/planka/public/background-images/* /opt/planka-backup/background-images/
 | 
			
		||||
    mv /opt/planka/planka/private/attachments/* /opt/planka-backup/attachments/
 | 
			
		||||
    rm -rf /opt/planka
 | 
			
		||||
    fetch_and_deploy_gh_release "planka" "plankanban/planka" "prebuild" "latest" "/opt/planka" "planka-prebuild.zip"
 | 
			
		||||
    cd /opt/planka/planka
 | 
			
		||||
    $STD npm install
 | 
			
		||||
    mv /opt/planka-backup/.env /opt/planka/planka/
 | 
			
		||||
    mv /opt/planka-backup/favicons/* /opt/planka/planka/public/favicons/
 | 
			
		||||
    mv /opt/planka-backup/user-avatars/* /opt/planka/planka/public/user-avatars/
 | 
			
		||||
    mv /opt/planka-backup/background-images/* /opt/planka/planka/public/background-images/
 | 
			
		||||
    mv /opt/planka-backup/attachments/* /opt/planka/planka/private/attachments/
 | 
			
		||||
    msg_ok "Updated $APP to ${RELEASE}"
 | 
			
		||||
 | 
			
		||||
    msg_info "Starting $APP"
 | 
			
		||||
    systemctl start planka
 | 
			
		||||
    msg_ok "Started $APP"
 | 
			
		||||
 | 
			
		||||
    msg_ok "Update Successful"
 | 
			
		||||
  else
 | 
			
		||||
    msg_ok "No update required. ${APP} is already at ${RELEASE}"
 | 
			
		||||
  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}:1337${CL}"
 | 
			
		||||
							
								
								
									
										40
									
								
								frontend/public/json/planka.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								frontend/public/json/planka.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,40 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "PLANKA",
 | 
			
		||||
  "slug": "planka",
 | 
			
		||||
  "categories": [
 | 
			
		||||
    12
 | 
			
		||||
  ],
 | 
			
		||||
  "date_created": "2025-06-09",
 | 
			
		||||
  "type": "ct",
 | 
			
		||||
  "updateable": true,
 | 
			
		||||
  "privileged": false,
 | 
			
		||||
  "interface_port": 1337,
 | 
			
		||||
  "documentation": "https://docs.planka.cloud/",
 | 
			
		||||
  "website": "https://planka.app/",
 | 
			
		||||
  "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/planka.webp",
 | 
			
		||||
  "config_path": "/opt/planka/planka/.env",
 | 
			
		||||
  "description": "Planka is a powerful, project management platform that transforms how teams collaborate. Create projects with multiple boards, organize tasks with intuitive drag-and-drop cards, attach files, write rich markdown descriptions, set due dates, assign team members, and keep conversations flowing with comments and labels—all with seamless real-time updates and smart notifications.",
 | 
			
		||||
  "install_methods": [
 | 
			
		||||
    {
 | 
			
		||||
      "type": "default",
 | 
			
		||||
      "script": "ct/planka.sh",
 | 
			
		||||
      "resources": {
 | 
			
		||||
        "cpu": 1,
 | 
			
		||||
        "ram": 1024,
 | 
			
		||||
        "hdd": 4,
 | 
			
		||||
        "os": "debian",
 | 
			
		||||
        "version": "12"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "default_credentials": {
 | 
			
		||||
    "username": null,
 | 
			
		||||
    "password": null
 | 
			
		||||
  },
 | 
			
		||||
  "notes": [
 | 
			
		||||
    {
 | 
			
		||||
      "text": "Type `cat ~/planka.creds` inside LXC to see admin user and database credentials.",
 | 
			
		||||
      "type": "info"
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										103
									
								
								install/planka-install.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								install/planka-install.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,103 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
# Copyright (c) 2021-2025 community-scripts ORG
 | 
			
		||||
# Author: Slaviša Arežina (tremor021)
 | 
			
		||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
 | 
			
		||||
# Source: https://github.com/plankanban/planka
 | 
			
		||||
 | 
			
		||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
 | 
			
		||||
color
 | 
			
		||||
verb_ip6
 | 
			
		||||
catch_errors
 | 
			
		||||
setting_up_container
 | 
			
		||||
network_check
 | 
			
		||||
update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
  unzip \
 | 
			
		||||
  build-essential \
 | 
			
		||||
  python3-venv
 | 
			
		||||
msg_ok "Installed dependencies"
 | 
			
		||||
 | 
			
		||||
NODE_VERSION="22" setup_nodejs
 | 
			
		||||
PG_VERSION="16" setup_postgresql
 | 
			
		||||
 | 
			
		||||
msg_info "Setting up PostgreSQL Database"
 | 
			
		||||
DB_NAME=planka
 | 
			
		||||
DB_USER=planka
 | 
			
		||||
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
 | 
			
		||||
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
 | 
			
		||||
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
 | 
			
		||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
 | 
			
		||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
 | 
			
		||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
 | 
			
		||||
{
 | 
			
		||||
  echo "PLANKA DB Credentials"
 | 
			
		||||
  echo "PLANKA Database User: $DB_USER"
 | 
			
		||||
  echo "PLANKA Database Password: $DB_PASS"
 | 
			
		||||
  echo "PLANKA Database Name: $DB_NAME"
 | 
			
		||||
} >>~/planka.creds
 | 
			
		||||
msg_ok "Set up PostgreSQL Database"
 | 
			
		||||
 | 
			
		||||
fetch_and_deploy_gh_release "planka" "plankanban/planka" "prebuild" "latest" "/opt/planka" "planka-prebuild.zip"
 | 
			
		||||
 | 
			
		||||
msg_info "Configuring PLANKA"
 | 
			
		||||
LOCAL_IP=$(hostname -I | awk '{print $1}')
 | 
			
		||||
SECRET_KEY=$(openssl rand -hex 64)
 | 
			
		||||
cd /opt/planka/planka
 | 
			
		||||
$STD npm install
 | 
			
		||||
cp .env.sample .env
 | 
			
		||||
sed -i "s#http://localhost:1337#http://$LOCAL_IP:1337#g" /opt/planka/planka/.env
 | 
			
		||||
sed -i "s#postgres@localhost#planka:$DB_PASS@localhost#g" /opt/planka/planka/.env
 | 
			
		||||
sed -i "s#notsecretkey#$SECRET_KEY#g" /opt/planka/planka/.env
 | 
			
		||||
$STD npm run db:init
 | 
			
		||||
msg_ok "Configured PLANKA"
 | 
			
		||||
 | 
			
		||||
msg_info "Creating Admin User"
 | 
			
		||||
ADMIN_EMAIL="admin@planka.local"
 | 
			
		||||
ADMIN_PASSWORD="$(openssl rand -base64 12)"
 | 
			
		||||
ADMIN_NAME="Administrator"
 | 
			
		||||
ADMIN_USERNAME="admin"
 | 
			
		||||
echo "" >>.env
 | 
			
		||||
echo "# Temporary admin user creation settings" >>.env
 | 
			
		||||
echo "DEFAULT_ADMIN_EMAIL=$ADMIN_EMAIL" >>.env
 | 
			
		||||
echo "DEFAULT_ADMIN_PASSWORD=$ADMIN_PASSWORD" >>.env
 | 
			
		||||
echo "DEFAULT_ADMIN_NAME=$ADMIN_NAME" >>.env
 | 
			
		||||
echo "DEFAULT_ADMIN_USERNAME=$ADMIN_USERNAME" >>.env
 | 
			
		||||
$STD npm run db:seed
 | 
			
		||||
sed -i '/# Temporary admin user creation settings/,$d' .env
 | 
			
		||||
{
 | 
			
		||||
  echo ""
 | 
			
		||||
  echo "PLANKA Admin Credentials"
 | 
			
		||||
  echo "Admin Email: $ADMIN_EMAIL"
 | 
			
		||||
  echo "Admin Password: $ADMIN_PASSWORD"
 | 
			
		||||
  echo "Admin Name: $ADMIN_NAME"
 | 
			
		||||
  echo "Admin Username: $ADMIN_USERNAME"
 | 
			
		||||
} >>~/planka.creds
 | 
			
		||||
msg_ok "Created Admin User"
 | 
			
		||||
 | 
			
		||||
msg_info "Creating Service"
 | 
			
		||||
cat <<EOF >/etc/systemd/system/planka.service
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=planka Service
 | 
			
		||||
After=network.target
 | 
			
		||||
 | 
			
		||||
[Service]
 | 
			
		||||
WorkingDirectory=/opt/planka/planka
 | 
			
		||||
ExecStart=/usr/bin/npm start --prod
 | 
			
		||||
Restart=always
 | 
			
		||||
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=multi-user.target
 | 
			
		||||
EOF
 | 
			
		||||
systemctl enable -q --now planka
 | 
			
		||||
msg_ok "Created Service"
 | 
			
		||||
 | 
			
		||||
motd_ssh
 | 
			
		||||
customize
 | 
			
		||||
 | 
			
		||||
msg_info "Cleaning up"
 | 
			
		||||
$STD apt-get -y autoremove
 | 
			
		||||
$STD apt-get -y autoclean
 | 
			
		||||
msg_ok "Cleaned"
 | 
			
		||||
		Reference in New Issue
	
	Block a user