Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FinalClubManagementphp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
FinalClubManagementphp
Commits
8ce433a5
Commit
8ce433a5
authored
Mar 25, 2026
by
AGLANPC\aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fgjfgh jfyhg
parent
d2be0f62
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49591 additions
and
97 deletions
+49591
-97
Dockerfile
Dockerfile
+32
-21
codebase.md
codebase.md
+49282
-0
collectcodebase.ps1
collectcodebase.ps1
+93
-0
deploy.sh
deploy.sh
+62
-76
deployscript.txt
deployscript.txt
+122
-0
No files found.
Dockerfile
View file @
8ce433a5
...
...
@@ -4,42 +4,53 @@ FROM php:8.2-apache
RUN
apt-get update
&&
apt-get
install
-y
\
libpng-dev libjpeg-dev libfreetype6-dev
\
libzip-dev libonig-dev libxml2-dev
\
zip unzip curl
git
\
zip unzip curl
\
&&
docker-php-ext-configure gd
--with-freetype
--with-jpeg
\
&&
docker-php-ext-install pdo pdo_mysql mbstring zip gd xml opcache
\
&&
apt-get clean
&&
rm
-rf
/var/lib/apt/lists/
*
# ── Apache
: point DocumentRoot at public/ and enable mod_rewrite
─────────────
# ── Apache
config ───────────────────────────────────────────────
─────────────
ENV
APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN
sed
-i
's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g'
\
/etc/apache2/sites-available/000-default.conf
\
&&
sed
-i
'
s|<Directory /var/www/html>|<Directory /var/www/html/public>|g
'
\
/etc/apache2/apache2.conf
\
/etc/apache2/sites-available/000-default.conf
\
&&
sed
-i
'
/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/
'
\
/etc/apache2/apache2.conf
\
&&
echo
'<Directory /var/www/html/public>\n AllowOverride All\n Require all granted\n</Directory>'
\
>>
/etc/apache2/apache2.conf
\
>>
/etc/apache2/apache2.conf
\
&&
a2enmod rewrite
# ── PHP production settings ───────────────────────────────────────────────────
RUN
echo
"display_errors = Off
\n\
error_reporting = E_ALL
\n\
log_errors = On
\n\
error_log = /var/log/php_errors.log
\n\
upload_max_filesize = 20M
\n\
post_max_size = 22M
\n\
memory_limit = 256M
\n\
max_execution_time = 60
\n\
opcache.enable = 1
\n\
opcache.memory_consumption = 128
\n\
opcache.validate_timestamps = 0"
>
/usr/local/etc/php/conf.d/production.ini
# ── Copy application files ────────────────────────────────────────────────────
# ── PHP settings (errors ON for now so we can debug) ─────────────────────────
RUN
echo
"display_errors = On
\n\
error_reporting = E_ALL
\n\
log_errors = On
\n\
error_log = /proc/self/fd/2
\n\
upload_max_filesize = 20M
\n\
post_max_size = 22M
\n\
memory_limit = 256M
\n\
max_execution_time = 60
\n\
opcache.enable = 1
\n\
opcache.memory_consumption = 128
\n\
opcache.validate_timestamps = 1"
>
/usr/local/etc/php/conf.d/app.ini
WORKDIR
/var/www/html
COPY
. .
# ── Create required directories & set permissions ────────────────────────────
# ── Make sure public/.htaccess exists for routing ────────────────────────────
RUN if
[
!
-f
public/.htaccess
]
;
then
\
echo
'<IfModule mod_rewrite.c>\n
\
RewriteEngine On\n
\
RewriteCond %{REQUEST_FILENAME} !-f\n
\
RewriteCond %{REQUEST_FILENAME} !-d\n
\
RewriteRule ^(.*)$ index.php [QSA,L]\n
\
</IfModule>'
>
public/.htaccess
;
\
fi
# ── Directories & permissions ────────────────────────────────────────────────
RUN
mkdir
-p
storage/logs storage/uploads
\
&&
chown
-R
www-data:www-data /var/www/html
\
&&
chmod
-R
775 storage
EXPOSE
80
CMD
["apache2-foreground"]
\ No newline at end of file
codebase.md
0 → 100644
View file @
8ce433a5
This diff is collapsed.
Click to expand it.
collectcodebase.ps1
0 → 100644
View file @
8ce433a5
$outputFile
=
"codebase.md"
$projectRoot
=
Get-Location
$includeExtensions
=
@
(
"*.php"
,
"*.html"
,
"*.htm"
,
"*.css"
,
"*.js"
,
"*.json"
,
"*.sql"
,
"*.env"
,
"*.env.example"
,
"*.ini"
,
"*.conf"
,
"*.xml"
,
"*.yaml"
,
"*.yml"
,
"*.txt"
,
"*.md"
,
"*.sh"
,
"*.bash"
,
"*.py"
,
"*.twig"
,
"*.htaccess"
,
"*.config"
,
"*.lock"
,
"Dockerfile"
,
"docker-compose*"
,
"captain-definition"
)
$excludeDirs
=
@
(
"vendor"
,
"node_modules"
,
".git"
,
".idea"
,
".vscode"
,
"storage"
,
"cache"
,
".cache"
,
"tmp"
,
"temp"
,
"dist"
,
"build"
,
"public/build"
,
".docker"
,
"logs"
)
$excludeFiles
=
@
(
"codebase.md"
,
"codebase.txt"
,
"combine-codebase.ps1"
,
"collectcodebase.ps1"
,
"composer.lock"
,
"package-lock.json"
,
"yarn.lock"
)
$excludePattern
=
(
$excludeDirs
|
ForEach
-Object
{
[
regex]::Escape
(
$_
)
})
-join
"|"
$excludeRegex
=
"(\\|/)(
$excludePattern
)(\\|/|
$)
"
$allFiles
=
@
()
foreach
(
$ext
in
$includeExtensions
)
{
$found
=
Get-ChildItem
-Path
$projectRoot
-Filter
$ext
-Recurse -File -ErrorAction SilentlyContinue
$allFiles
+
=
$found
}
$specialFiles
=
@
(
"Dockerfile"
,
"Makefile"
,
"Procfile"
,
"captain-definition"
,
".htaccess"
,
".env.example"
)
foreach
(
$name
in
$specialFiles
)
{
$found
=
Get-ChildItem
-Path
$projectRoot
-Filter
$name
-Recurse -File -ErrorAction SilentlyContinue
$allFiles
+
=
$found
}
$allFiles
=
$allFiles
|
Sort-Object
FullName -Unique
$filtered
=
$allFiles
|
Where
-Object
{
$relativePath
=
$_
.FullName.Substring
(
$projectRoot
.Path.Length
)
$fileName
=
$_
.Name
(
$relativePath
-notmatch
$excludeRegex
)
-and
(
$fileName
-notin
$excludeFiles
)
}
$timestamp
=
Get-Date
-Format
"yyyy-MM-dd HH:mm:ss"
$header
=
@
"
# Full Codebase Export
Generated:
$timestamp
Project:
$projectRoot
Files:
$(
$filtered
.Count
)
---
"
@
Set-Content
-Path
$outputFile
-Value
$header
-Encoding UTF8
$fence
=
"
``````
"
$fileCount
=
0
foreach
(
$file
in
$filtered
)
{
$relativePath
=
$file
.FullName.Substring
(
$projectRoot
.Path.Length + 1
)
$extension
=
$file
.Extension.TrimStart
(
"."
)
if
(
-not
$extension
)
{
$extension
=
"text"
}
$fileCount
++
$separator
=
"
`n
## File:
$relativePath
`n
"
Add-Content
-Path
$outputFile
-Value
$separator
-Encoding UTF8
$openFence
=
"
${
fence
}${
extension
}
"
Add-Content
-Path
$outputFile
-Value
$openFence
-Encoding UTF8
try
{
$content
=
Get-Content
-Path
$file
.FullName -Raw -ErrorAction Stop
Add-Content
-Path
$outputFile
-Value
$content
-Encoding UTF8
}
catch
{
Add-Content
-Path
$outputFile
-Value
"[ERROR: Could not read file]"
-Encoding UTF8
}
Add-Content
-Path
$outputFile
-Value
$fence
-Encoding UTF8
Write-Host
"[
$fileCount
]
$relativePath
"
-ForegroundColor Green
}
$fileSize
=
[
math]::Round
((
Get-Item
$outputFile
)
.Length / 1KB, 1
)
Write-Host
"
`n
========================================"
-ForegroundColor Cyan
Write-Host
" Done!
$fileCount
files combined"
-ForegroundColor Cyan
Write-Host
" Output:
$outputFile
(
$fileSize
KB)"
-ForegroundColor Cyan
Write-Host
"========================================"
-ForegroundColor Cyan
\ No newline at end of file
deploy.sh
View file @
8ce433a5
#!/usr/bin/env bash
# =============================================================================
# Club Management System — Full CapRover Deploy Script
# Run this on a fresh Ubuntu 22.04 SSH session on your CapRover server,
# OR from any machine that has SSH + internet access.
#
# Usage:
# chmod +x deploy.sh
# ./deploy.sh
# Usage: chmod +x deploy.sh && ./deploy.sh
# =============================================================================
set
-e
# ─── CONFIGURATION ──────────────────────────────────────────────────────────
# Edit these before running
CAPROVER_URL
=
"http://captain.caprover.al-arcade.com"
# Your CapRover dashboard URL
CAPROVER_PASSWORD
=
"Alarcade123#"
# CapRover admin password
APP_NAME
=
"club-management-club"
# The CapRover app name to create/update
# ─── CONFIGURATION ───────────────────────────────────────────────────────────
CAPROVER_URL
=
"http://captain.caprover.al-arcade.com"
CAPROVER_PASSWORD
=
"Alarcade123#"
APP_NAME
=
"club-management-club"
GITLAB_REPO
=
"http://gitlab.caprover.al-arcade.com/root/finalclubmanagementphp.git"
GITLAB_USER
=
"root"
GITLAB_TOKEN
=
"vHATWUzqfUC1nkXkGkai"
# GitLab → Settings → Access Tokens
GITLAB_TOKEN
=
"vHATWUzqfUC1nkXkGkai"
#
DB config — your existing database
server
DB_HOST
=
"srv-captain--mysql-db"
# e.g. 192.168.1.10 or db.al-arcade.com
#
Existing DB
server
DB_HOST
=
"srv-captain--mysql-db"
DB_PORT
=
"3306"
DB_NAME
=
"club_management"
DB_USER
=
"root"
DB_PASS
=
"Alarcade123#"
APP_URL
=
"https://
${
APP_NAME
}
.caprover.al-arcade.com"
# or your custom domain
APP_URL
=
"https://
${
APP_NAME
}
.caprover.al-arcade.com"
# ─── COLORS ──────────────────────────────────────────────────────────────────
GREEN
=
'\033[0;32m'
;
YELLOW
=
'\033[1;33m'
;
RED
=
'\033[0;31m'
;
NC
=
'\033[0m'
...
...
@@ -38,98 +32,90 @@ info "Checking prerequisites..."
if
!
command
-v
node &>/dev/null
;
then
info
"Installing Node.js 20..."
curl
-fsSL
https://deb.nodesource.com/setup_20.x |
sudo
-E
bash -
sudo
apt-get
install
-y
nodejs
curl
-fsSL
https://deb.nodesource.com/setup_20.x | bash -
apt-get
install
-y
nodejs
fi
node
-v
if
!
command
-v
caprover &>/dev/null
;
then
info
"Installing CapRover CLI..."
sudo
npm
install
-g
caprover
npm
install
-g
caprover
fi
caprover
--version
if
!
command
-v
git &>/dev/null
;
then
sudo
apt-get update
&&
sudo
apt-get
install
-y
git
fi
command
-v
git &>/dev/null
||
{
apt-get update
&&
apt-get
install
-y
git
;
}
command
-v
curl &>/dev/null
||
{
apt-get update
&&
apt-get
install
-y
curl
;
}
# ─── 2. CLONE
OR PULL THE REPO
───────────────────────────────────────────────
# ─── 2. CLONE
REPO ────────────
───────────────────────────────────────────────
DEPLOY_DIR
=
"/tmp/club_deploy_
$(
date
+%s
)
"
info
"Cloning repository to
${
DEPLOY_DIR
}
..."
git clone
"http://
${
GITLAB_USER
}
:
${
GITLAB_TOKEN
}
@
$(
echo
$GITLAB_REPO
|
sed
's|http://||'
)
"
"
$DEPLOY_DIR
"
cd
"
$DEPLOY_DIR
"
# ─── 3. SAFETY CLEANUP ───────────────────────────────────────────────────────
info
"Removing sensitive
dev
files..."
info
"Removing sensitive
/dead
files..."
rm
-f
code.sql
rm
-f
core/App_112.php core/Database_110.php core/View_111.php core/helpers_109.php
rm
-rf
prompts/
# ─── 4.
CREATE CAPROVER APP (idempotent)
─────────────────────────────────────
info
"
Logging in to CapRover at
${
CAPROVER_URL
}
..."
caprover login
\
-
-caproverUrl
"
$CAPROVER_URL
"
\
-
-caproverPassword
"
$CAPROVER_PASSWORD
"
\
--name
"production"
# ─── 4.
GET CAPROVER JWT TOKEN ──────────
─────────────────────────────────────
info
"
Authenticating with CapRover API
..."
TOKEN
=
$(
curl
-sf
-X
POST
"
${
CAPROVER_URL
}
/api/v2/login"
\
-
H
"Content-Type: application/json
"
\
-
d
"{
\"
password
\"
:
\"
${
CAPROVER_PASSWORD
}
\"
}
"
\
|
grep
-o
'"token":"[^"]*"'
|
cut
-d
'"'
-f4
)
info
"Creating CapRover app '
${
APP_NAME
}
' (skips if already exists)..."
caprover api
\
--caproverUrl
"
$CAPROVER_URL
"
\
--caproverPassword
"
$CAPROVER_PASSWORD
"
\
--path
"/v2/user/apps/appDefinitions/register"
\
--method
"POST"
\
--data
"{
\"
appName
\"
:
\"
${
APP_NAME
}
\"
,
\"
hasPersistentData
\"
:false}"
2>/dev/null
||
true
[
-z
"
$TOKEN
"
]
&&
error
"Auth failed. Check CAPROVER_URL and CAPROVER_PASSWORD."
info
"Authenticated OK."
# ─── 5. SET ENVIRONMENT VARIABLES ON THE CAPROVER APP ───────────────────────
info
"Setting environment variables..."
ENV_VARS
=
$(
cat
<<
EOF
[
{"key":"APP_DEBUG", "value":"false"},
{"key":"APP_URL", "value":"
${
APP_URL
}
"},
{"key":"DB_HOST", "value":"
${
DB_HOST
}
"},
{"key":"DB_PORT", "value":"
${
DB_PORT
}
"},
{"key":"DB_NAME", "value":"
${
DB_NAME
}
"},
{"key":"DB_USER", "value":"
${
DB_USER
}
"},
{"key":"DB_PASS", "value":"
${
DB_PASS
}
"}
]
EOF
)
caprover api
\
--caproverUrl
"
$CAPROVER_URL
"
\
--caproverPassword
"
$CAPROVER_PASSWORD
"
\
--path
"/v2/user/apps/appDefinitions/update"
\
--method
"POST"
\
--data
"{
\"
appName
\"
:
\"
${
APP_NAME
}
\"
,
\"
envVars
\"
:
${
ENV_VARS
}
}"
# ─── 5. CREATE APP (idempotent — ignores error if already exists) ────────────
info
"Creating CapRover app '
${
APP_NAME
}
'..."
curl
-sf
-X
POST
"
${
CAPROVER_URL
}
/api/v2/user/apps/appDefinitions/register"
\
-H
"Content-Type: application/json"
\
-H
"x-captain-auth:
${
TOKEN
}
"
\
-d
"{
\"
appName
\"
:
\"
${
APP_NAME
}
\"
,
\"
hasPersistentData
\"
:false}"
>
/dev/null
||
true
info
"Environment variables set."
# ─── 6. ENABLE HTTPS ON THE APP ──────────────────────────────────────────────
info
"Enabling HTTPS (Let's Encrypt)..."
caprover api
\
--caproverUrl
"
$CAPROVER_URL
"
\
--caproverPassword
"
$CAPROVER_PASSWORD
"
\
--path
"/v2/user/apps/appDefinitions/enablebasedomainssl"
\
--method
"POST"
\
--data
"{
\"
appName
\"
:
\"
${
APP_NAME
}
\"
}"
2>/dev/null
||
warn
"HTTPS may already be enabled or domain not set yet."
# ─── 7. DEPLOY ───────────────────────────────────────────────────────────────
info
"Packaging and deploying to CapRover..."
# ─── 6. SET ENVIRONMENT VARIABLES ───────────────────────────────────────────
info
"Setting environment variables..."
curl
-sf
-X
POST
"
${
CAPROVER_URL
}
/api/v2/user/apps/appDefinitions/update"
\
-H
"Content-Type: application/json"
\
-H
"x-captain-auth:
${
TOKEN
}
"
\
-d
"{
\"
appName
\"
:
\"
${
APP_NAME
}
\"
,
\"
envVars
\"
: [
{
\"
key
\"
:
\"
APP_DEBUG
\"
,
\"
value
\"
:
\"
false
\"
},
{
\"
key
\"
:
\"
APP_URL
\"
,
\"
value
\"
:
\"
${
APP_URL
}
\"
},
{
\"
key
\"
:
\"
DB_HOST
\"
,
\"
value
\"
:
\"
${
DB_HOST
}
\"
},
{
\"
key
\"
:
\"
DB_PORT
\"
,
\"
value
\"
:
\"
${
DB_PORT
}
\"
},
{
\"
key
\"
:
\"
DB_NAME
\"
,
\"
value
\"
:
\"
${
DB_NAME
}
\"
},
{
\"
key
\"
:
\"
DB_USER
\"
,
\"
value
\"
:
\"
${
DB_USER
}
\"
},
{
\"
key
\"
:
\"
DB_PASS
\"
,
\"
value
\"
:
\"
${
DB_PASS
}
\"
}
]
}"
>
/dev/null
info
"Env vars set."
# ─── 7. ENABLE HTTPS ─────────────────────────────────────────────────────────
info
"Enabling HTTPS..."
curl
-sf
-X
POST
"
${
CAPROVER_URL
}
/api/v2/user/apps/appDefinitions/enablebasedomainssl"
\
-H
"Content-Type: application/json"
\
-H
"x-captain-auth:
${
TOKEN
}
"
\
-d
"{
\"
appName
\"
:
\"
${
APP_NAME
}
\"
}"
>
/dev/null
\
||
warn
"HTTPS may already be enabled."
# ─── 8. DEPLOY ───────────────────────────────────────────────────────────────
info
"Deploying to CapRover from current directory..."
caprover deploy
\
--caproverUrl
"
$CAPROVER_URL
"
\
--caproverPassword
"
$CAPROVER_PASSWORD
"
\
--appName
"
$APP_NAME
"
\
--branch
"main"
# ─── DONE ────────────────────────────────────────────────────────────────────
info
"Deploy complete!"
echo
""
echo
"─────────────────────────────────────────────"
echo
" App URL :
${
APP_URL
}
"
echo
" DB Pass :
${
DB_PASS
}
← SAVE THIS"
echo
"─────────────────────────────────────────────"
echo
" App URL :
${
APP_URL
}
"
echo
" DB Host :
${
DB_HOST
}
/
${
DB_NAME
}
"
echo
""
info
"App is pointing to your existing DB at:
${
DB_HOST
}
/
${
DB_NAME
}
"
warn
"Make sure your DB server allows connections from the CapRover container IP."
# ─── CLEANUP ─────────────────────────────────────────────────────────────────
cd
/tmp
&&
rm
-rf
"
$DEPLOY_DIR
"
...
...
deployscript.txt
0 → 100644
View file @
8ce433a5
#!/usr/bin/env bash
# =============================================================================
# Club Management System — Full CapRover Deploy Script
# Usage: chmod +x deploy.sh && ./deploy.sh
# =============================================================================
set -e
# ─── CONFIGURATION ───────────────────────────────────────────────────────────
CAPROVER_URL="http://captain.caprover.al-arcade.com"
CAPROVER_PASSWORD="Alarcade123#"
APP_NAME="club-management-club"
GITLAB_REPO="http://gitlab.caprover.al-arcade.com/root/finalclubmanagementphp.git"
GITLAB_USER="root"
GITLAB_TOKEN="vHATWUzqfUC1nkXkGkai"
# Existing DB server
DB_HOST="srv-captain--mysql-db"
DB_PORT="3306"
DB_NAME="club_management"
DB_USER="root"
DB_PASS="Alarcade123#"
APP_URL="https://${APP_NAME}.caprover.al-arcade.com"
# ─── COLORS ──────────────────────────────────────────────────────────────────
GREEN='\033[0;32m'; YELLOW='\033[1;33m'; RED='\033[0;31m'; NC='\033[0m'
info() { echo -e "${GREEN}[INFO]${NC} $*"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
error() { echo -e "${RED}[ERROR]${NC} $*"; exit 1; }
# ─── 1. PREREQUISITES ────────────────────────────────────────────────────────
info "Checking prerequisites..."
if ! command -v node &>/dev/null; then
info "Installing Node.js 20..."
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
fi
node -v
if ! command -v caprover &>/dev/null; then
info "Installing CapRover CLI..."
npm install -g caprover
fi
caprover --version
command -v git &>/dev/null || { apt-get update && apt-get install -y git; }
command -v curl &>/dev/null || { apt-get update && apt-get install -y curl; }
# ─── 2. CLONE REPO ───────────────────────────────────────────────────────────
DEPLOY_DIR="/tmp/club_deploy_$(date +%s)"
info "Cloning repository to ${DEPLOY_DIR}..."
git clone "http://${GITLAB_USER}:${GITLAB_TOKEN}@$(echo $GITLAB_REPO | sed 's|http://||')" "$DEPLOY_DIR"
cd "$DEPLOY_DIR"
# ─── 3. SAFETY CLEANUP ───────────────────────────────────────────────────────
info "Removing sensitive/dead files..."
rm -f code.sql
rm -f core/App_112.php core/Database_110.php core/View_111.php core/helpers_109.php
rm -rf prompts/
# ─── 4. GET CAPROVER JWT TOKEN ───────────────────────────────────────────────
info "Authenticating with CapRover API..."
TOKEN=$(curl -sf -X POST "${CAPROVER_URL}/api/v2/login" \
-H "Content-Type: application/json" \
-d "{\"password\":\"${CAPROVER_PASSWORD}\"}" \
| grep -o '"token":"[^"]*"' | cut -d'"' -f4)
[ -z "$TOKEN" ] && error "Auth failed. Check CAPROVER_URL and CAPROVER_PASSWORD."
info "Authenticated OK."
# ─── 5. CREATE APP (idempotent — ignores error if already exists) ────────────
info "Creating CapRover app '${APP_NAME}'..."
curl -sf -X POST "${CAPROVER_URL}/api/v2/user/apps/appDefinitions/register" \
-H "Content-Type: application/json" \
-H "x-captain-auth: ${TOKEN}" \
-d "{\"appName\":\"${APP_NAME}\",\"hasPersistentData\":false}" > /dev/null || true
# ─── 6. SET ENVIRONMENT VARIABLES ───────────────────────────────────────────
info "Setting environment variables..."
curl -sf -X POST "${CAPROVER_URL}/api/v2/user/apps/appDefinitions/update" \
-H "Content-Type: application/json" \
-H "x-captain-auth: ${TOKEN}" \
-d "{
\"appName\": \"${APP_NAME}\",
\"envVars\": [
{\"key\":\"APP_DEBUG\", \"value\":\"false\"},
{\"key\":\"APP_URL\", \"value\":\"${APP_URL}\"},
{\"key\":\"DB_HOST\", \"value\":\"${DB_HOST}\"},
{\"key\":\"DB_PORT\", \"value\":\"${DB_PORT}\"},
{\"key\":\"DB_NAME\", \"value\":\"${DB_NAME}\"},
{\"key\":\"DB_USER\", \"value\":\"${DB_USER}\"},
{\"key\":\"DB_PASS\", \"value\":\"${DB_PASS}\"}
]
}" > /dev/null
info "Env vars set."
# ─── 7. ENABLE HTTPS ─────────────────────────────────────────────────────────
info "Enabling HTTPS..."
curl -sf -X POST "${CAPROVER_URL}/api/v2/user/apps/appDefinitions/enablebasedomainssl" \
-H "Content-Type: application/json" \
-H "x-captain-auth: ${TOKEN}" \
-d "{\"appName\":\"${APP_NAME}\"}" > /dev/null \
|| warn "HTTPS may already be enabled."
# ─── 8. DEPLOY ───────────────────────────────────────────────────────────────
info "Deploying to CapRover from current directory..."
caprover deploy \
--caproverUrl "$CAPROVER_URL" \
--caproverPassword "$CAPROVER_PASSWORD" \
--appName "$APP_NAME" \
--branch "main"
# ─── DONE ────────────────────────────────────────────────────────────────────
info "Deploy complete!"
echo ""
echo " App URL : ${APP_URL}"
echo " DB Host : ${DB_HOST}/${DB_NAME}"
echo ""
# ─── CLEANUP ─────────────────────────────────────────────────────────────────
cd /tmp && rm -rf "$DEPLOY_DIR"
info "Temp files cleaned up."
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment