www-apps/misskey: Fix pkg_{preinst,postinst,config}
Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
parent
731b23d81c
commit
eca5e011d4
@ -96,18 +96,27 @@ src_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkg_preinst() {
|
pkg_preinst() {
|
||||||
pushd "${EROOT}"/opt/misskey/misskey || die
|
# Clean up changes that were made after installation
|
||||||
ebegin "Cleaning ${EROOT}/opt/misskey/misskey"
|
if [[ -d "${EROOT}"/opt/misskey/misskey ]]; then
|
||||||
yarn cleanall || die
|
cd "${EROOT}"/opt/misskey/misskey || die
|
||||||
eend
|
|
||||||
ebegin "Removing ${EROOT}/opt/misskey/misskey/{built,node_modules,packages}"
|
ebegin "Running 'yarn cleanall' in ${EROOT}/opt/misskey/misskey"
|
||||||
rm -rf {built,node_modules,packages} || die
|
su -s /bin/bash -c "yarn cleanall" misskey
|
||||||
eend
|
eend ${?}
|
||||||
|
|
||||||
|
ebegin "Removing ${EROOT}/opt/misskey/misskey/{built,node_modules,packages}"
|
||||||
|
rm -rf {built,node_modules,packages} || die
|
||||||
|
eend ${?}
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
elog "Run emerge --config ${CATEGORY}/${PN} to initialise the PostgreSQL database"
|
elog "Run emerge --config ${CATEGORY}/${PN} to initialise the PostgreSQL database"
|
||||||
elog "Run 'su -c \"yarn migrate\" misskey' in ${EROOT}/opt/misskey/misskey and restart the service to apply changes"
|
|
||||||
|
ebegin "Running 'yarn migrate'"
|
||||||
|
cd "${EROOT}"/opt/misskey/misskey || die
|
||||||
|
su -s /bin/bash -c "yarn migrate" misskey
|
||||||
|
eend ${?}
|
||||||
|
|
||||||
if use nginx; then
|
if use nginx; then
|
||||||
einfo "An nginx example config can be found at <https://misskey-hub.net/en/docs/admin/nginx.html>"
|
einfo "An nginx example config can be found at <https://misskey-hub.net/en/docs/admin/nginx.html>"
|
||||||
@ -123,8 +132,8 @@ pkg_config() {
|
|||||||
echo "create database misskey; create user misskey with encrypted password '${MY_PASSWORD}'; grant all privileges on database misskey to misskey; \q" \
|
echo "create database misskey; create user misskey with encrypted password '${MY_PASSWORD}'; grant all privileges on database misskey to misskey; \q" \
|
||||||
| su -lc psql postgres || die "database creation failed"
|
| su -lc psql postgres || die "database creation failed"
|
||||||
|
|
||||||
cd "${EROOT}/opt/misskey/misskey"
|
cd "${EROOT}"/opt/misskey/misskey || die
|
||||||
yarn run init || die "database initialisation failed"
|
su -s /bin/bash -c "yarn run init" misskey || die "database initialisation failed"
|
||||||
|
|
||||||
ewarn "When you first start Misskey you will be asked to add an admin account via the web interface, and registrations are enabled."
|
ewarn "When you first start Misskey you will be asked to add an admin account via the web interface, and registrations are enabled."
|
||||||
ewarn "Do not expose the web interface to the public until after you configured your instance\!"
|
ewarn "Do not expose the web interface to the public until after you configured your instance\!"
|
Reference in New Issue
Block a user