fixed install script
This commit is contained in:
parent
2fc4f8c963
commit
02b8970c1c
2 changed files with 16 additions and 9 deletions
|
|
@ -16,6 +16,11 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
day = time.Hour * 24
|
||||||
|
max = day * 90
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
userClaim = "user"
|
userClaim = "user"
|
||||||
totpClaim = "totp"
|
totpClaim = "totp"
|
||||||
|
|
|
||||||
|
|
@ -14,21 +14,23 @@ rc_cmd $1
|
||||||
EOF
|
EOF
|
||||||
chmod 555 /etc/rc.d/docstore
|
chmod 555 /etc/rc.d/docstore
|
||||||
rcctl enable docstore
|
rcctl enable docstore
|
||||||
rcctl set docstore flags server -c /var/wiki/docstore.conf
|
rcctl set docstore flags server -c /var/docstore/docstore.conf
|
||||||
|
|
||||||
# user
|
# user and group
|
||||||
useradd -m -b /var -s /sbin/nologin wiki
|
mkdir /var/docstore
|
||||||
|
groupadd docstore
|
||||||
|
useradd -d /var/docstore -s /sbin/nologin -g docstore docstore
|
||||||
|
chown docstore:docstore /var/docstore
|
||||||
|
|
||||||
# config
|
# config
|
||||||
cat <<EOF> /var/wiki/docstore.conf
|
cat <<EOF> /var/docstore/docstore.conf
|
||||||
{
|
{
|
||||||
"data_dir": "/var/wiki",
|
"data_dir": "/var/docstore",
|
||||||
"secret": "$(openssl rand -hex 32)",
|
"secret": "$(openssl rand -hex 32)"
|
||||||
"secure_cookie": true
|
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
chmod 640 /var/wiki/docstore.conf
|
chmod 640 /var/docstore/docstore.conf
|
||||||
chgrp wiki /var/wiki/docstore.conf
|
chgrp docstore /var/docstore/docstore.conf
|
||||||
|
|
||||||
# start
|
# start
|
||||||
rcctl start docstore
|
rcctl start docstore
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue