ok
This commit is contained in:
parent
896299aedf
commit
a39be2339d
@ -13,9 +13,7 @@ var_disk="${var_disk:-5}"
|
|||||||
var_os="${var_os:-debian}"
|
var_os="${var_os:-debian}"
|
||||||
var_version="${var_version:-13}"
|
var_version="${var_version:-13}"
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
|
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
catch_errors
|
||||||
|
|||||||
@ -12,12 +12,10 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
NODE_VERSION="22" setup_nodejs
|
setup_nodejs
|
||||||
|
|
||||||
cd /opt
|
cd /opt
|
||||||
msg_info "Downloading"
|
|
||||||
fetch_and_deploy_gh_release "snowshare" "TuroYT/snowshare"
|
fetch_and_deploy_gh_release "snowshare" "TuroYT/snowshare"
|
||||||
msg_ok "Snowshare Downloaded"
|
|
||||||
|
|
||||||
msg_info "Setting up PostgreSQL Database"
|
msg_info "Setting up PostgreSQL Database"
|
||||||
setup_postgresql
|
setup_postgresql
|
||||||
@ -29,14 +27,15 @@ $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCO
|
|||||||
$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 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 default_transaction_isolation TO 'read committed';"
|
||||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
|
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
|
||||||
echo "" >>~/snowshare.creds
|
{
|
||||||
echo -e "Database Username: $DB_USER" >>~/snowshare.creds
|
echo "SnowShare-Database-Credentials"
|
||||||
echo -e "Database Password: $DB_PASS" >>~/snowshare.creds
|
echo "Database Username: $DB_USER"
|
||||||
echo -e "Database Name: $DB_NAME" >>~/snowshare.creds
|
echo "Database Password: $DB_PASS"
|
||||||
|
echo "Database Name: $DB_NAME"
|
||||||
|
} >>~/snowshare.creds
|
||||||
msg_ok "Set up PostgreSQL Database"
|
msg_ok "Set up PostgreSQL Database"
|
||||||
|
|
||||||
msg_info "Installing SnowShare (Patience)"
|
msg_info "Installing SnowShare (Patience)"
|
||||||
APP="snowshare"
|
|
||||||
cd /opt/snowshare
|
cd /opt/snowshare
|
||||||
$STD npm ci
|
$STD npm ci
|
||||||
cat <<EOF >/opt/snowshare/.env
|
cat <<EOF >/opt/snowshare/.env
|
||||||
@ -46,11 +45,9 @@ NEXTAUTH_SECRET="$(openssl rand -base64 32)"
|
|||||||
ALLOW_SIGNUP=true
|
ALLOW_SIGNUP=true
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
$STD npx prisma generate
|
$STD npx prisma generate
|
||||||
$STD npx prisma migrate deploy
|
$STD npx prisma migrate deploy
|
||||||
$STD npm run build
|
$STD npm run build
|
||||||
|
|
||||||
cat <<EOF >/etc/systemd/system/snowshare.service
|
cat <<EOF >/etc/systemd/system/snowshare.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=SnowShare - Modern File Sharing Platform
|
Description=SnowShare - Modern File Sharing Platform
|
||||||
@ -69,7 +66,7 @@ RestartSec=10
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
systemctl enable -q --now snowshare.service
|
systemctl enable -q --now snowshare
|
||||||
msg_ok "Installed SnowShare"
|
msg_ok "Installed SnowShare"
|
||||||
|
|
||||||
msg_info "Setting up Cleanup Cron Job"
|
msg_info "Setting up Cleanup Cron Job"
|
||||||
@ -77,8 +74,10 @@ cat <<EOF >/etc/cron.d/snowshare-cleanup
|
|||||||
0 2 * * * root cd /opt/snowshare && /usr/bin/npm run cleanup:expired >> /var/log/snowshare-cleanup.log 2>&1
|
0 2 * * * root cd /opt/snowshare && /usr/bin/npm run cleanup:expired >> /var/log/snowshare-cleanup.log 2>&1
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Set up Cleanup Cron Job"
|
msg_ok "Set up Cleanup Cron Job"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
$STD apt -y autoremove
|
$STD apt -y autoremove
|
||||||
$STD apt -y autoclean
|
$STD apt -y autoclean
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user