Skip to content

Commit 0468296

Browse files
Updated the install script so that it only installs the Lua module and does not try to install HAProxy or the Lua runtime.
1 parent a6777be commit 0468296

File tree

1 file changed

+36
-38
lines changed

1 file changed

+36
-38
lines changed

Diff for: install.sh

+36-38
Original file line numberDiff line numberDiff line change
@@ -57,46 +57,44 @@ install_deb_lua() {
5757
apt-get install -y software-properties-common unzip build-essential libssl-dev lua5.3 liblua5.3-dev >/dev/null 2>&1
5858
}
5959

60-
download_luaoauth() {
61-
printf "\r[+] Downloading haproxy-lua-oauth\n"
62-
cd $SOURCE_DIR
63-
curl -sLO https://github.com/haproxytech/haproxy-lua-oauth/archive/master.zip
64-
unzip -qo master.zip && rm master.zip
65-
}
60+
install_luaoauth_deps() {
61+
printf "\r[+] Installing haproxy-lua-oauth dependencies\n"
62+
63+
if [ ! -e $lua_dep_dir ]; then
64+
mkdir -p $lua_dep_dir;
65+
fi;
66+
67+
apt-get update >/dev/null 2>&1
68+
apt-get install -y build-essential liblua5.3-dev libssl-dev unzip >/dev/null 2>&1
6669

67-
download_luaoauth_deps() {
68-
printf "\r[+] Downloading haproxy-lua-oauth dependencies\n"
6970
cd $SOURCE_DIR
70-
apt-get install -y unzip >/dev/null 2>&1
7171

72-
curl -sLO https://github.com/diegonehab/luasocket/archive/master.zip
73-
unzip -qo master.zip && mv luasocket-master luasocket && rm master.zip
72+
curl -sLO https://github.com/rxi/json.lua/archive/refs/heads/master.zip
73+
unzip -qo master.zip && rm master.zip
74+
mv json.lua-master/json.lua $lua_dep_dir
7475

75-
curl -sLO https://github.com/rxi/json.lua/archive/master.zip
76-
unzip -qo master.zip && mv json.lua-master json && rm master.zip
76+
curl -sLO https://github.com/lunarmodules/luasocket/archive/refs/heads/master.zip
77+
unzip -qo master.zip && rm master.zip
78+
cd luasocket-master/
79+
make clean all install-both LUAINC=/usr/include/lua5.3/ >/dev/null
80+
cd ..
7781

78-
curl -sLO https://github.com/wahern/luaossl/archive/rel-20181207.zip
79-
unzip -qo rel-20181207.zip && mv luaossl-rel-20181207 luaossl && rm rel-20181207.zip
82+
curl -sLO https://github.com/wahern/luaossl/archive/refs/heads/master.zip
83+
unzip -qo master.zip && rm master.zip
84+
cd luaossl-master/
85+
make install >/dev/null
86+
cd ..
8087
}
8188

8289
install_luaoauth() {
8390
printf "\r[+] Installing haproxy-lua-oauth\n"
8491
if [ ! -e $lua_dep_dir ]; then
8592
mkdir -p $lua_dep_dir;
8693
fi;
87-
mv $SOURCE_DIR/haproxy-lua-oauth-master/lib/*.lua $lua_dep_dir
88-
}
8994

90-
install_luaoauth_deps() {
91-
printf "\r[+] Installing haproxy-lua-oauth dependencies\n"
9295
cd $SOURCE_DIR
93-
cd luasocket/
94-
make clean all install-both LUAINC=/usr/include/lua5.3/ >/dev/null
95-
cd ..
96-
cd luaossl/
97-
make install >/dev/null
98-
cd ..
99-
mv json/json.lua $lua_dep_dir
96+
97+
mv ./lib/*.lua $lua_dep_dir
10098
}
10199

102100
case $1 in
@@ -109,18 +107,18 @@ esac
109107

110108
if $install_luaoauth_var; then
111109
# Install Lua JWT
112-
if ! $lua_installed; then
113-
if $rhel_based; then
114-
download_and_install_lua=(install_yum_deps download_rhel_lua build_lua install_rhel_lua)
115-
elif $debian_based; then
116-
download_and_install_lua=(install_deb_lua)
117-
fi
118-
for func in ${download_and_install_lua[*]}; do
119-
$func &
120-
display_working $!
121-
done
122-
fi
123-
download_and_install_luaoauth=(download_luaoauth_deps install_luaoauth_deps download_luaoauth install_luaoauth)
110+
# if ! $lua_installed; then
111+
# if $rhel_based; then
112+
# download_and_install_lua=(install_yum_deps download_rhel_lua build_lua install_rhel_lua)
113+
# elif $debian_based; then
114+
# download_and_install_lua=(install_deb_lua)
115+
# fi
116+
# for func in ${download_and_install_lua[*]}; do
117+
# $func &
118+
# display_working $!
119+
# done
120+
# fi
121+
download_and_install_luaoauth=(install_luaoauth_deps install_luaoauth)
124122
for func in ${download_and_install_luaoauth[*]}; do
125123
$func &
126124
display_working $!

0 commit comments

Comments
 (0)