Editing
WikiJS
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== WikiJS Setup === https://docs.requarks.io/install/macos === wiki install === <pre> pkg install -i node npm sqlite3 fetch https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz mkdir /wiki tar xzf wiki-js.tar.gz -C /wiki cd /wiki fetch https://github.com/requarks/wiki/raw/refs/heads/main/dev/build/config.yml npm rebuild sqlite3 DB_TYPE=sqlite DB_FILELPATH=wiki.sqlite node server </pre> === startup script === <syntaxhighlight lang="bash" copy class="mw-collapsible mw-collapsed"> echo '#!/bin/sh # PROVIDE: wikijs # REQUIRE: DAEMON # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable wikijs: # wikijs_enable="YES" # # wikijs_enable (bool): Set to "NO" by default. # Set it to "YES" to enable Wiki.js # wikijs_user (str): User to run Wiki.js as # Default: "www" # wikijs_group (str): Group to run Wiki.js as # Default: "www" # wikijs_dir (str): Directory where Wiki.js is installed # Default: "/wiki" . /etc/rc.subr name="wikijs" rcvar=wikijs_enable load_rc_config $name : ${wikijs_enable:="NO"} : ${wikijs_user:="www"} : ${wikijs_group:="www"} : ${wikijs_dir:="/wiki"} pidfile="/var/run/${name}.pid" command="/usr/local/bin/node" command_args="server" procname="node" start_cmd="${name}_start" stop_cmd="${name}_stop" # environment variables . /etc/profile.d/jail-env.sh wikijs_start() { echo "Starting ${name} on port 3000..." cd ${wikijs_dir} || exit 1 /usr/sbin/daemon -P ${pidfile} -r -S -t ${name} -T ${name} -u ${wikijs_user} \ env DB_TYPE="${DB_TYPE}" DB_FILEPATH="${DB_FILEPATH}" ${command} ${command_args} } wikijs_stop() { if [ -f "${pidfile}" ]; then echo "Stopping ${name}..." pkill -F ${pidfile} 2>/dev/null rm -f ${pidfile} else echo "${name} is not running" fi } run_rc_command "$1" ' > /usr/local/etc/rc.d/wikijs chmod +x /usr/local/etc/rc.d/wikijs </syntaxhighlight> === jail setup === environment variables are setup like Docker, so we can use the docker .yml file <pre> echo '#!/bin/sh export DB_TYPE="sqlite" export DB_FILEPATH="wiki.sqlite"' > /etc/profile.d/jail-env.sh </pre> === jail HOST setup === load environment variables on jail startup <pre> finch:/usr/local/etc/qjail.config# grep start wikijs #exec.start = "/bin/sh -c '. /etc/profile.d/jail-env.sh ; /bin/sh /etc/rc'"; exec.start = "/bin/sh /etc/rc"; # simpler to have /usrlocal/etc/rc.d/wikijs just source /etc/profile.d/jail-env.sh </pre> === enable service === <pre> sysrc wikijs_enable=YES service wikijs start </pre>
Summary:
Please note that all contributions to pega.life may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Pega.life:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information