-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·143 lines (133 loc) · 3.3 KB
/
run.sh
File metadata and controls
executable file
·143 lines (133 loc) · 3.3 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
# Main run script for Isabelle Core
# Author: Maxim Menshikov
# Change into base directory of the project
TOP_DIR="$(cd "$(dirname "$(which "$0")")" ; pwd -P)"
cd "$TOP_DIR"
# Find the core binary
binary="${BINARY:-./target/debug/isabelle-core}"
if [ ! -f "${binary}" ] ; then
binary="./isabelle-core"
fi
if [ ! -f "${binary}" ] ; then
echo "Binary is not found: ${binary}" >&2
exit 1
fi
# Fix up Python path on MacOS
if [ "$(uname)" == "Darwin" ] ; then
py_path="/opt/homebrew/bin/python3"
else
py_path="$(which python3)"
fi
if [ ! -f "${py_path}" ] ; then
echo "Python binary is not found: ${py_path}" >&2
exit 1
fi
# Parse arguments
first_run="${FIRST_RUN:+--first-run}"
port="8090"
pub_url="http://localhost:8081"
pub_fqdn="localhost"
data_path="$(pwd)/data-equestrian"
py_path=""
gc_path="$6"
database="isabelle"
gh_login=""
gh_password=""
plugin_dir=""
cookie_http_insecure=""
db_url="mongodb://localhost:27017"
while test -n "$1" ; do
case "$1" in
--port)
port="$2"
shift 1
;;
--pub-url)
pub_url="$2"
shift 1
;;
--pub-fqdn)
pub_fqdn="$2"
shift 1
;;
--data-path)
data_path="$2"
shift 1
;;
--py-path)
py_path="$2"
shift 1
;;
--gc-path)
gc_path="$2"
shift 1
;;
--first-run)
first_run="--first-run"
;;
--database)
database="$2"
shift 1
;;
--gh-login)
gh_login="$2"
shift 1
;;
--gh-password)
gh_password="$2"
shift 1
;;
--plugin-dir)
plugin_dir="$2"
shift 1
;;
--cookie-http-insecure)
cookie_http_insecure="true"
;;
--db-url)
db_url="$2"
shift 1
;;
*)
echo "Unknown argument: $1" >&2
exit 1
;;
esac
shift 1
done
# Download and install Google Calendar integration
if [ "$gc_path" == "" ] ; then
if [ ! -d isabelle-gc ] ; then
creds=""
if [ "$gh_login" != "" ] && [ "$gh_password" != "" ] ; then
creds="${gh_login}:${gh_password}@"
fi
git clone https://${creds}github.com/isabelle-platform/isabelle-gc.git
pushd isabelle-gc
./install.sh
popd
fi
gc_path="$(pwd)/isabelle-gc"
fi
# Sign with temporary entitlements
if [ "$(uname)" == "Darwin" ] ; then
/usr/libexec/PlistBuddy -c "Add :com.apple.security.get-task-allow bool true" tmp.entitlements
for file in ${binary} $(ls libisabelle_plugin*) ; do
codesign -s - -f --entitlements tmp.entitlements "$file"
done
fi
echo Starting Isabelle Core...
# Run the binary
RUST_LOG=info RUST_BACKTRACE=1 "${binary}" \
--port "${port}" \
--pub-url "${pub_url}" \
--pub-fqdn "${pub_fqdn}" \
--data-path "${data_path}" \
--gc-path "${gc_path}" \
--database "${database}" \
--db-url "${db_url}" \
--py-path "${py_path}" \
${cookie_http_insecure:+--cookie-http-insecure} \
${plugin_dir+--plugin-dir} ${plugin_dir:+"${plugin_dir}"} \
${first_run}