Skip to content

Commit c6c026e

Browse files
authored
New script: ProjectSend (#1616)
* New Script: ProjectSend * Update projectsend.json * Update projectsend-install.sh
1 parent 4dcf0dc commit c6c026e

File tree

3 files changed

+201
-0
lines changed

3 files changed

+201
-0
lines changed

ct/projectsend.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: bvdberg01
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://www.projectsend.org/
7+
8+
# App Default Values
9+
APP="ProjectSend"
10+
var_tags="media"
11+
var_cpu="1"
12+
var_ram="1024"
13+
var_disk="8"
14+
var_os="debian"
15+
var_version="12"
16+
var_unprivileged="1"
17+
18+
# App Output & Base Settings
19+
header_info "$APP"
20+
base_settings
21+
22+
# Core
23+
variables
24+
color
25+
catch_errors
26+
27+
function update_script() {
28+
header_info
29+
check_container_storage
30+
check_container_resources
31+
if [[ ! -d /opt/projectsend ]]; then
32+
msg_error "No ${APP} Installation Found!"
33+
exit
34+
fi
35+
RELEASE=$(curl -s https://api.github.com/repos/projectsend/projectsend/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
36+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
37+
msg_info "Stopping Service"
38+
systemctl stop apache2
39+
msg_ok "Stopped Service"
40+
41+
msg_info "Updating ${APP} to v${RELEASE}"
42+
cd /opt
43+
wget -q "https://github.com/projectsend/projectsend/releases/download/r${RELEASE}/projectsend-r${RELEASE}.zip"
44+
unzip -o -q "projectsend-r${RELEASE}.zip" -d projectsend
45+
chown -R www-data:www-data /opt/projectsend
46+
chmod -R 775 /opt/projectsend
47+
echo "${RELEASE}" >/opt/${APP}_version.txt
48+
msg_ok "Updated $APP to v${RELEASE}"
49+
50+
msg_info "Starting Service"
51+
systemctl start apache2
52+
msg_ok "Started Service"
53+
54+
msg_info "Cleaning up"
55+
rm -rf "/opt/projectsend-r${RELEASE}.zip"
56+
msg_ok "Cleaned"
57+
msg_ok "Updated Successfully"
58+
else
59+
msg_ok "No update required. ${APP} is already at v${RELEASE}"
60+
fi
61+
exit
62+
}
63+
64+
start
65+
build_container
66+
description
67+
68+
msg_ok "Completed Successfully!\n"
69+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
70+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
71+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"

install/projectsend-install.sh

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: bvdberg01
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
7+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
8+
color
9+
verb_ip6
10+
catch_errors
11+
setting_up_container
12+
network_check
13+
update_os
14+
15+
msg_info "Installing Dependencies"
16+
$STD apt-get install -y \
17+
curl \
18+
sudo \
19+
mc \
20+
mariadb-server \
21+
apache2 \
22+
libapache2-mod-php \
23+
php8.2-{pdo,mysql,mbstring,gettext,fileinfo,gd,xml,zip}
24+
msg_ok "Installed Dependencies"
25+
26+
msg_info "Setting up MariaDB"
27+
DB_NAME=projectsend
28+
DB_USER=projectsend
29+
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
30+
$STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
31+
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
32+
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
33+
{
34+
echo "projectsend-Credentials"
35+
echo "projectsend Database User: $DB_USER"
36+
echo "projectsend Database Password: $DB_PASS"
37+
echo "projectsend Database Name: $DB_NAME"
38+
} >> ~/projectsend.creds
39+
msg_ok "Set up MariaDB"
40+
41+
msg_info "Installing projectsend"
42+
RELEASE=$(curl -s https://api.github.com/repos/projectsend/projectsend/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
43+
cd /opt
44+
wget -q "https://github.com/projectsend/projectsend/releases/download/r${RELEASE}/projectsend-r${RELEASE}.zip"
45+
mkdir projectsend
46+
unzip -q "projectsend-r${RELEASE}.zip" -d projectsend
47+
mv /opt/projectsend/includes/sys.config.sample.php /opt/projectsend/includes/sys.config.php
48+
chown -R www-data:www-data /opt/projectsend
49+
chmod -R 775 /opt/projectsend
50+
chmod 644 /opt/projectsend/includes/sys.config.php
51+
sed -i -e "s/\(define('DB_NAME', \).*/\1'$DB_NAME');/" \
52+
-e "s/\(define('DB_USER', \).*/\1'$DB_USER');/" \
53+
-e "s/\(define('DB_PASSWORD', \).*/\1'$DB_PASS');/" \
54+
/opt/projectsend/includes/sys.config.php
55+
sed -i -e "s/^\(memory_limit = \).*/\1 256M/" \
56+
-e "s/^\(post_max_size = \).*/\1 256M/" \
57+
-e "s/^\(upload_max_filesize = \).*/\1 256M/" \
58+
-e "s/^\(max_execution_time = \).*/\1 300/" \
59+
/etc/php/8.2/apache2/php.ini
60+
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
61+
msg_ok "Installed projectsend"
62+
63+
msg_info "Creating Service"
64+
cat <<EOF >/etc/apache2/sites-available/projectsend.conf
65+
<VirtualHost *:80>
66+
ServerName projectsend
67+
DocumentRoot /opt/projectsend
68+
<Directory /opt/projectsend>
69+
Options FollowSymLinks
70+
AllowOverride All
71+
Require all granted
72+
</Directory>
73+
74+
ErrorLog /var/log/apache2/projectsend_error.log
75+
CustomLog /var/log/apache2/projectsend_access.log combined
76+
</VirtualHost>
77+
EOF
78+
$STD a2ensite projectsend
79+
$STD a2enmod rewrite
80+
$STD a2dissite 000-default.conf
81+
$STD systemctl reload apache2
82+
msg_ok "Created Service"
83+
84+
motd_ssh
85+
customize
86+
87+
msg_info "Cleaning up"
88+
rm -rf "/opt/projectsend-r${RELEASE}.zip"
89+
$STD apt-get -y autoremove
90+
$STD apt-get -y autoclean
91+
msg_ok "Cleaned"

json/projectsend.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "ProjectSend",
3+
"slug": "projectsend",
4+
"categories": [
5+
12
6+
],
7+
"date_created": "2025-01-20",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 80,
12+
"documentation": "https://docs.projectsend.org/",
13+
"website": "https://projectsend.org/",
14+
"logo": "https://camo.githubusercontent.com/378a455e1cf6f36c5427b2bdfd78b0defd829be9b8c6b073f83931693e1665d5/68747470733a2f2f7777772e70726f6a65637473656e642e6f72672f70726f6a65637473656e642d6c6f676f2d6e65772e706e67",
15+
"description": "ProjectSend is a free, open source software that lets you share files with your clients, focused on ease of use and privacy. It supports clients groups, system users roles, statistics, multiple languages, detailed logs... and much more!",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/projectsend.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 1024,
23+
"hdd": 8,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "After running the update script, logging in as a system user in ProjectSend is necessary to upgrade the database.",
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)