From f58698789f3a08719aa49f398ed95f877792e919 Mon Sep 17 00:00:00 2001 From: hhf Date: Mon, 2 Dec 2024 14:50:07 +0530 Subject: [PATCH] Add README.md --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d646d5f --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ + +1. **Initial Setup**: + - The script first checks if it's running as root (administrator), which is required for system changes + - It defines important variables like ports and file paths that will be used + +2. **ZeroTier Installation**: + - Installs ZeroTier One client using their official installer + - Joins your ZeroTier network (you'll need to put in ssh with your actual network ID) + +3. **Network Configuration**: + - Waits for the ZeroTier network connection to establish + - Gets your ZeroTier IP address (the address assigned to your server on the ZeroTier network) + +4. **Backup Creation**: + - Creates backup copies of your nginx configuration and database + - This is a safety measure in case you need to revert changes + +5. **Service Configuration**: + - Modifies the nginx configuration to only listen on your ZeroTier IP address + - Updates the firewall rules in the SQLite database to: + - Remove existing rules for SSH and CloudPanel ports + - Add new rules that only allow access from your ZeroTier IP + +6. **Service Restart**: + - Restarts nginx and SSH services to apply the changes + - Verifies ZeroTier connection status + +To use this script: + +1. Save it to a file (e.g., `setup-zerotier.sh`) +2. Replace `YOUR_NETWORK_ID_HERE` with your actual ZeroTier network ID +3. Make it executable: `chmod +x setup-zerotier.sh` +4. Run it as root: `sudo ./setup-zerotier.sh` + +Important Notes: +- Keep your backup files safe in case you need to restore +- After running this script, you'll only be able to access SSH and CloudPanel through ZeroTier +- Double-check your ZeroTier network ID before running +- Make sure you have access to your server through ZeroTier before running this script +- Test the connection through ZeroTier before logging out of your current session