From c2612c815cce06bbdabc730dc4db06b832399b97 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 17 Aug 2023 13:10:12 +1000 Subject: [PATCH] worker: Added new-site --- worker/install.sh | 5 ++++- worker/main.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/worker/install.sh b/worker/install.sh index 3865c73..310d0ea 100644 --- a/worker/install.sh +++ b/worker/install.sh @@ -18,4 +18,7 @@ sudo apt install docker-compose -y sudo apt install nginx -y # Install python prerequisites -python3 -m pip install -r requirements.txt \ No newline at end of file +sudo apt install python3-pip -y +python3 -m pip install -r requirements.txt +cp .env.example .env +chmod +x wp.sh \ No newline at end of file diff --git a/worker/main.py b/worker/main.py index 09980f7..9f8ebd7 100644 --- a/worker/main.py +++ b/worker/main.py @@ -23,6 +23,10 @@ def new_site(): sites_file = open('sites.txt', 'a') sites_file.write(domain + '\n') + # Setup site run wp.sh + # Get num sites + os.system('bash wp.sh ' + domain + ' '+ count) + # Return the domain and the number of sites return jsonify({'domain': domain, 'count': count})