Skip to content

Commit

Permalink
Added contact domain registrant module
Browse files Browse the repository at this point in the history
  • Loading branch information
getpinga committed Oct 30, 2024
1 parent 0b4d33c commit 4128e90
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 4 deletions.
15 changes: 12 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,21 +407,30 @@ mv fossbilling-whois/check.php /var/www/

- Edit the `/var/www/check.php` file and set your WHOIS and RDAP server URLs by replacing the placeholder values with your actual server addresses.

## 16. Installing FOSSBilling EPP-RFC Extensions:
## 16. Domain Registrant Contact:

```bash
git clone https://github.com/getnamingo/fossbilling-contact
mv fossbilling-contact/Contact /var/www/modules/
```

- Go to Extensions > Overview in the admin panel and activate "Domain Registrant Contact".

## 17. Installing FOSSBilling EPP-RFC Extensions:

For each registry you support, you will need to install a FOSSBilling EPP-RFC extension.

Navigate to https://github.com/getpinga/fossbilling-epp-rfc and follow the installation instructions specific to each registry.

To execute the required OT&E tests by various registries, you can use our Tembo client at https://github.com/getpinga/tembo

## 17. Installing FOSSBilling DNS Hosting Extensions:
## 18. Installing FOSSBilling DNS Hosting Extensions:

To offer DNS hosting to your customers, you will need to install the FOSSBilling DNS Hosting extension.

Navigate to https://github.com/getnamingo/fossbilling-dns and follow the installation instructions.

## 18. Further Settings:
## 19. Further Settings:

1. You will need to link to various ICANN documents in your footer, and also provide your terms and conditions and privacy policy.

Expand Down
6 changes: 5 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,12 @@ if [[ "$install_rdap_whois" == "Y" || "$install_rdap_whois" == "y" ]]; then
git clone https://github.com/getnamingo/fossbilling-whois
mv fossbilling-whois/Whois /var/www/modules/
mv fossbilling-whois/check.php /var/www/

sed -i "s|\$whoisServer = 'whois.example.com';|\$whoisServer = 'whois.$domain_name';|g" /var/www/check.php
sed -i "s|\$rdap_url = 'rdap.example.com';|\$rdap_url = 'rdap.$domain_name';|g" /var/www/check.php

git clone https://github.com/getnamingo/fossbilling-contact
mv fossbilling-contact/Contact /var/www/modules/

git clone https://github.com/getnamingo/fossbilling-registrar
mv fossbilling-registrar/Registrar /var/www/modules/
Expand Down Expand Up @@ -471,6 +474,7 @@ echo "7. In the FOSSBilling admin panel, go to Extensions > Overview and activat
echo " - Domain Contact Verification"
echo " - TMCH Claims Notice Support"
echo " - WHOIS & RDAP Client"
echo " - Domain Registrant Contact"
echo " - ICANN Registrar Accreditation"
echo
echo "8. Install FOSSBilling extensions for EPP and DNS as outlined in steps 16 and 17 of install.md."
Expand Down
117 changes: 117 additions & 0 deletions update104.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#!/bin/bash

# Prompt the user for confirmation
echo "This will update Namingo Registrar from v1.0.3 to v1.0.4."
echo "Make sure you have a backup of the database, /var/www, and /opt/registrar."
read -p "Are you sure you want to proceed? (y/n): " confirm

# Check user input
if [[ "$confirm" != "y" ]]; then
echo "Upgrade aborted."
exit 0
fi

# Create backup directory
backup_dir="/opt/backup"
mkdir -p "$backup_dir"

# Backup directories
echo "Creating backups..."
tar -czf "$backup_dir/panel_backup_$(date +%F).tar.gz" -C / var/www
tar -czf "$backup_dir/registrar_backup_$(date +%F).tar.gz" -C / opt/registrar

# Database credentials
config_file="/opt/registrar/whois/config.php"
db_user=$(grep "'db_username'" "$config_file" | awk -F "=> '" '{print $2}' | sed "s/',//")
db_pass=$(grep "'db_password'" "$config_file" | awk -F "=> '" '{print $2}' | sed "s/',//")
db_host=$(grep "'db_host'" "$config_file" | awk -F "=> '" '{print $2}' | sed "s/',//")

# List of databases to back up
databases=("registrar")

# Backup specific databases
for db_name in "${databases[@]}"; do
echo "Backing up database $db_name..."
sql_backup_file="$backup_dir/db_${db_name}_backup_$(date +%F).sql"
mysqldump -u"$db_user" -p"$db_pass" -h"$db_host" "$db_name" > "$sql_backup_file"

# Compress the SQL backup file
echo "Compressing database backup $db_name..."
tar -czf "${sql_backup_file}.tar.gz" -C "$backup_dir" "$(basename "$sql_backup_file")"

# Remove the uncompressed SQL file
rm "$sql_backup_file"
done

# Stop services
echo "Stopping services..."
systemctl stop nginx
systemctl stop whois
systemctl stop rdap

# Clone the new version of the repository
echo "Cloning v1.0.4 from the repository..."
git clone https://github.com/getnamingo/registrar /opt/registrar104

# Copy files from the new version to the appropriate directories
echo "Copying files..."

# Function to copy files and maintain directory structure
copy_files() {
src_dir=$1
dest_dir=$2

if [[ -d "$src_dir" ]]; then
echo "Copying from $src_dir to $dest_dir..."
cp -R "$src_dir/." "$dest_dir/"
else
echo "Source directory $src_dir does not exist. Skipping..."
fi
}

# Copy specific directories
copy_files "/opt/registrar104/automation" "/opt/registrar/automation"
copy_files "/opt/registrar104/whois" "/opt/registrar/whois"
copy_files "/opt/registrar104/rdap" "/opt/registrar/rdap"

# Run composer update in copied directories (excluding docs)
echo "Running composer update..."

composer_update() {
dir=$1
if [[ -d "$dir" ]]; then
echo "Updating composer in $dir..."
cd "$dir" && composer update
else
echo "Directory $dir does not exist. Skipping composer update..."
fi
}

# Update composer in relevant directories
composer_update "/opt/registrar/automation"
composer_update "/opt/registrar/whois"
composer_update "/opt/registrar/rdap"

git clone https://github.com/getnamingo/fossbilling-contact
mv fossbilling-contact/Contact /var/www/modules/

# Start services
echo "Starting services..."
systemctl start nginx
systemctl start whois
systemctl start rdap

# Check if services started successfully
if [[ $? -eq 0 ]]; then
echo "Services started successfully. Deleting /opt/registrar104..."
rm -rf /opt/registrar104
else
echo "There was an issue starting the services. /opt/registrar104 will not be deleted."
fi

# Final instructions to the user
echo "Upgrade to v1.0.4 is almost complete. Please follow the final step below to finish the process:"
echo
echo "1. Open your browser and log in to the admin panel."
echo "2. Navigate to System -> Update to apply the changes."
echo

0 comments on commit 4128e90

Please sign in to comment.