-
Notifications
You must be signed in to change notification settings - Fork 57
/
start.py
34 lines (31 loc) · 912 Bytes
/
start.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import json
import os
import subprocess
CONFIG_FILE = 'projects/config.json'
try:
with open(CONFIG_FILE, 'r') as fp:
json.load(fp)
except Exception:
config = {
'downloader': os.getenv('DOWNLOADER', ''),
'http_username': os.getenv('HTTP_USERNAME', ''),
'http_password': os.getenv('HTTP_PASSWORD', ''),
'selected_project': os.getenv('SELECTED_PROJECT', ''),
'shared:rsync_threads': os.getenv('SHARED_RSYNC_THREADS', ''),
'warrior_id': os.getenv('WARRIOR_ID', ''),
'concurrent_items': os.getenv('CONCURRENT_ITEMS', ''),
}
with open(CONFIG_FILE, 'w') as fp:
json.dump(config, fp)
subprocess.run([
"run-warrior3",
"--projects-dir",
"/home/warrior/projects",
"--data-dir",
"/home/warrior/data",
"--warrior-hq",
"https://warriorhq.archiveteam.org",
"--port",
"8001",
"--real-shutdown"
])