-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New Script: Paymenter #1827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
michelroegl-brunner
merged 10 commits into
community-scripts:main
from
opastorello:main
Jan 31, 2025
Merged
New Script: Paymenter #1827
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9268b44
Create paymenter.json
opastorello 03d44f9
Create paymenter.sh
opastorello 1455f9e
Create paymenter-install.sh
opastorello 1873eba
Update paymenter-install.sh
opastorello d2b2ffa
Update install/paymenter-install.sh
opastorello 5ccff2a
Update paymenter.sh
opastorello 66d8080
Update paymenter-install.sh
opastorello 10b3dd8
Update install/paymenter-install.sh
opastorello 24cd5bf
Update ct/paymenter.sh
opastorello 6014726
Update paymenter.json
opastorello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env bash | ||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) | ||
|
||
# Copyright (c) 2021-2025 community-scripts ORG | ||
# Author: Nícolas Pastorello (opastorello) | ||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE | ||
|
||
# App Default Values | ||
APP="Paymenter" | ||
var_tags="hosting;ecommerce;marketplace;" | ||
var_cpu="2" | ||
var_ram="1024" | ||
var_disk="5" | ||
var_os="Debian" | ||
var_version="12" | ||
var_unprivileged="1" | ||
|
||
# App Output & Base Settings | ||
header_info "$APP" | ||
base_settings | ||
|
||
# Core | ||
variables | ||
color | ||
catch_errors | ||
|
||
function update_script() { | ||
header_info | ||
check_container_storage | ||
check_container_resources | ||
|
||
if [[ ! -d /opt/paymenter ]]; then | ||
msg_error "No ${APP} Installation Found!" | ||
exit | ||
fi | ||
RELEASE=$(curl -s https://api.github.com/repos/paymenter/paymenter/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/') | ||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then | ||
msg_info "Updating ${APP} to ${RELEASE}" | ||
echo "${RELEASE}" >/opt/${APP}_version.txt | ||
cd /opt/paymenter | ||
php artisan p:upgrade --no-interaction &>/dev/null | ||
msg_ok "Updated Successfully" | ||
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}:80${CL}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright (c) 2021-2025 community-scripts ORG | ||
# Author: Nícolas Pastorello (opastorello) | ||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE | ||
|
||
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 \ | ||
curl \ | ||
sudo \ | ||
mc \ | ||
git \ | ||
software-properties-common \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
gnupg \ | ||
php8.2 \ | ||
php8.2-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip} \ | ||
mariadb-server \ | ||
nginx \ | ||
redis-server | ||
$STD curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
msg_ok "Installed Dependencies" | ||
|
||
msg_info "Installing Paymenter" | ||
RELEASE=$(curl -s https://api.github.com/repos/paymenter/paymenter/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/') | ||
echo "${RELEASE}" >/opt/${APP}_version.txt | ||
mkdir -p /opt/paymenter | ||
cd /opt/paymenter | ||
wget -q "https://github.com/paymenter/paymenter/releases/download/${RELEASE}/paymenter.tar.gz" | ||
$STD tar -xzvf paymenter.tar.gz | ||
chmod -R 755 storage/* bootstrap/cache/ | ||
msg_ok "Installed Paymenter" | ||
|
||
msg_info "Setting up database" | ||
DB_NAME=paymenter | ||
DB_USER=paymenter | ||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) | ||
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql | ||
mysql -u root -e "CREATE DATABASE $DB_NAME;" | ||
mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" | ||
mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost' WITH GRANT OPTION;" | ||
{ | ||
echo "Paymenter Database Credentials" | ||
echo "Database: $DB_NAME" | ||
echo "Username: $DB_USER" | ||
echo "Password: $DB_PASS" | ||
} >> ~/paymenter_db.creds | ||
cp .env.example .env | ||
$STD composer install --no-dev --optimize-autoloader --no-interaction | ||
$STD php artisan key:generate --force | ||
$STD php artisan storage:link | ||
sed -i "s/^DB_DATABASE=.*/DB_DATABASE=${DB_NAME}/" .env | ||
sed -i "s/^DB_USERNAME=.*/DB_USERNAME=${DB_USER}/" .env | ||
sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=${DB_PASS}/" .env | ||
$STD php artisan migrate --force --seed | ||
msg_ok "Set up database" | ||
|
||
msg_info "Creating Admin User" | ||
$STD php artisan p:user:create <<EOF | ||
[email protected] | ||
paymenter | ||
admin | ||
paymenter | ||
0 | ||
EOF | ||
msg_ok "Created Admin User" | ||
|
||
msg_info "Configuring Nginx" | ||
cat <<EOF >/etc/nginx/sites-available/paymenter.conf | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name localhost; | ||
root /opt/paymenter/public; | ||
|
||
index index.php; | ||
|
||
location / { | ||
try_files \$uri \$uri/ /index.php?\$query_string; | ||
} | ||
|
||
location ~ \.php\$ { | ||
include snippets/fastcgi-php.conf; | ||
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; | ||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
|
||
location ~ /\.ht { | ||
deny all; | ||
} | ||
} | ||
EOF | ||
ln -s /etc/nginx/sites-available/paymenter.conf /etc/nginx/sites-enabled/ | ||
rm -f /etc/nginx/sites-enabled/default | ||
$STD systemctl reload nginx | ||
chown -R www-data:www-data /opt/paymenter/* | ||
msg_ok "Configured Nginx" | ||
|
||
msg_info "Setting up Cronjob" | ||
echo "* * * * * php /opt/paymenter/artisan schedule:run >> /dev/null 2>&1" | crontab - | ||
msg_ok "Setup Cronjob" | ||
|
||
msg_info "Setting up Service" | ||
cat <<EOF >/etc/systemd/system/paymenter.service | ||
[Unit] | ||
Description=Paymenter Queue Worker | ||
|
||
[Service] | ||
User=www-data | ||
Group=www-data | ||
Restart=always | ||
ExecStart=/usr/bin/php /opt/paymenter/artisan queue:work | ||
StartLimitInterval=180 | ||
StartLimitBurst=30 | ||
RestartSec=5s | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
EOF | ||
$STD systemctl enable --now paymenter.service | ||
msg_ok "Setup Service" | ||
|
||
msg_info "Cleaning up" | ||
rm -rf /opt/paymenter/paymenter.tar.gz | ||
$STD apt-get -y autoremove | ||
$STD apt-get -y autoclean | ||
msg_ok "Cleaned" | ||
|
||
motd_ssh | ||
customize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "Paymenter", | ||
"slug": "paymenter", | ||
"categories": [ | ||
21 | ||
], | ||
"date_created": "2025-01-28", | ||
"type": "ct", | ||
"updateable": true, | ||
"privileged": false, | ||
"interface_port": 80, | ||
"documentation": "https://paymenter.org/docs", | ||
"website": "https://paymenter.org/", | ||
"logo": "https://avatars.githubusercontent.com/u/115177786?s=200&v=4", | ||
"description": "Paymenter is an open source webshop solution for hosting companies. It's developed to provide an more easy way to manage your hosting company.", | ||
"install_methods": [ | ||
{ | ||
"type": "default", | ||
"script": "ct/paymenter.sh", | ||
"resources": { | ||
"cpu": 2, | ||
"ram": 1024, | ||
"hdd": 5, | ||
"os":"Debian", | ||
"version":"12" | ||
} | ||
} | ||
], | ||
"default_credentials": { | ||
"username": "[email protected]", | ||
"password": "paymenter" | ||
}, | ||
"notes": [] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.