Impove installer
This commit is contained in:
parent
59a5f48780
commit
5147307d65
19
install.lua
19
install.lua
@ -71,7 +71,14 @@ else
|
||||
baad = true
|
||||
end
|
||||
|
||||
os.execute"adduser --shell /bin/sh --disabled-password ikibooru"
|
||||
if baad then
|
||||
return
|
||||
end
|
||||
|
||||
if not os.execute"adduser --shell /bin/sh --disabled-password ikibooru" then
|
||||
print"Failed to create user ikibooru."
|
||||
return
|
||||
end
|
||||
|
||||
io.stdout:write"MySQL host: "
|
||||
local mysqladdr = io.read"*l"
|
||||
@ -161,11 +168,11 @@ os.execute"rm /home/ikibooru/ikibooru/install.lua"
|
||||
-- Not /dev/urandom. System might be new and unseeded.
|
||||
os.execute"dd if=/dev/random of=/home/ikibooru/ikibooru/objkey bs=16 count=1"
|
||||
os.execute"chown -R ikibooru:ikibooru /home/ikibooru/*"
|
||||
os.execute"find /home/ikibooru/ -type f -exec chmod 444 {} \;"
|
||||
os.execute"find /home/ikibooru/ -type d -exec chmod 555 {} \;"
|
||||
os.execute"find /home/ikibooru/ -type f -exec chmod 444 {} \\;"
|
||||
os.execute"find /home/ikibooru/ -type d -exec chmod 555 {} \\;"
|
||||
os.execute"chmod 440 /home/ikibooru/ikibooru/objkey"
|
||||
-- # These files need writability
|
||||
os.execute"find /home/ikibooru/ikibooru/objd/ -type d -exec chmod 755 {} \;"
|
||||
-- These files need writability
|
||||
os.execute"find /home/ikibooru/ikibooru/objd/ -type d -exec chmod 755 {} \\;"
|
||||
os.execute"chmod 644 /home/ikibooru/ikibooru/static/tagcats.css"
|
||||
|
||||
local cfg = io.open("/home/ikibooru/ikibooru/cfg.lua", "wb")
|
||||
@ -175,7 +182,7 @@ cfg:close() cfg = nil
|
||||
|
||||
os.execute"chmod 640 /home/ikibooru/ikibooru/cfg.lua"
|
||||
|
||||
os.execute"chown -R root:root /home/ikibooru/ikibooru/uninstall.lua"
|
||||
os.execute"chown root:root /home/ikibooru/ikibooru/uninstall.lua"
|
||||
|
||||
SQLConn:execute[[CREATE DATABASE ikibooru CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;]]
|
||||
SQLConn:execute[[USE ikibooru;]]
|
||||
|
Loading…
Reference in New Issue
Block a user