Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/new_setup/config.json → config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"site_name": "erp.erpnext.com",
"admin_password": "admin",
"mariadb_root_password": "root",
"swap_size": "2",
"innodb_buffer_pool_size": "0",
"dns_multitenant": "on",
"ssh_port": 22,
"dependencies": {
Expand Down Expand Up @@ -33,5 +35,6 @@
"authorized_keys": {
"smit": "ssh_key",
"lakshit": "lakshit_keys"
}
}
},
"ssl_email": "test@gmail.com"
}
60 changes: 60 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# main file for task selection
from utils import *

"""
This file will be executed on the server after the server is created.

Requirements:
=============
1. Python 3.6 or above
2. Git
3. Tested on Ubuntu 22.04

Steps for Running This Script:
==============================
1. Create a new user on the server (make sure its same as the username in config.json)
2. Add the user to sudoers
3. Login as the new user
4. Install git
5. Clone this repo
6. Go to the repo directory
7. Run this script after updating the config.json file

eg for a new user named `frappe`
```sh
sudo adduser frappe
sudo usermod -aG sudo frappe
su - frappe

sudo apt-get update && sudo apt-get install git -y
git clone https://github.com/vorasmit/installer.git
cd installer/scripts/new_setup
python3 main.py
```

"""
if __name__ == "__main__":
while True:
print("Select Task", end="\n\n\n")
task_list = {
"Update Server Config": update_server_config,
"Update System for MariaDB": update_system_for_mariadb,
"Install Bench": install_bench,
"Initialize Bench with Apps": intialize_bench_with_apps,
"Create Site with App": create_site_with_app,
"Setup Production": setup_production_server,
"Setup SSL": setup_ssl,
}

for key, value in enumerate(task_list.items()):
print(f"{key + 1}. {value[0]}")

print("Enter 'q' to quit")
task = input("\n\nEnter the task number: ")

try:
if task == "q":
break
task_list[list(task_list.keys())[int(task) - 1]]()
except Exception as e:
print(e)
64 changes: 0 additions & 64 deletions scripts/new_setup/erpnext.cnf

This file was deleted.

Loading