| .. | ||
| docs | ||
| src | ||
| ghost-writer.service | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| template.toml | ||
| tsconfig.json | ||
Setup:
cdinto thisserverdirectory.- Run
pnpm installto install all of the required dependencies. - Create a copy of the
template.tomlfile, and name itserver.toml. - Edit the
server.tomlfile to adjust the - Run
tscto compile the TypeScript into Javascript. This should create adistdirectory.
Using systemd to manage the server: (Not currently implemented)
This app comes with a ghost-writer.service file which is already set up to
manage the server, it just requires a little bit of additional setup. If you
change any of the symlinking in the steps below, it is your responsibility to
figure it out, I will not guarantee support for people who attempt to modify
the service file.
- Create a symlink named
serverin the server root (/) pointing to the server folder in the Ghost Writer git repository. (Ex:sudo ln -s ~/Ghost-Writer-Online/server /server) - Create a symlink named
ghost-writer.servicein/etc/systemd/systempointing to the service file in theserverfolder of the Ghost Writer Online repository. (Ex:sudo ln -s /server/ghost-writer.service /etc/systemd/system/ghost-writer.service) - Start the websocket server with
sudo systemctl start ghost-writer. - Make sure the server is started by running
systemctl status ghost-writer
- To restart the server, run
sudo systemctl restart ghost-writer. - To stop the server, run
sudo systemctl stop ghost-writer. - To access the server logs, run
sudo journalctl -u ghost-writer
Using a detached terminal:
If you would prefer that the server does not automatically restart and you can more easily output log output to a file, you can run the server by following the below steps:
- Make sure you know how to invoke a single command with your preferred method of detaching terminals.
- Have the detached terminal's working directory be in the
serverfolder of this repository. - Run
node dist/main.jsfor logging directly to the CLI, ornode dist/main.js > output.logfor logging to a file namedoutput.log. - Detach your terminal.
Configuration:
All of the configuration for the server is done in the server.toml with
explanations in the file. When a value is changed in the config, you will need
to restart the server. This is either through systemd
(sudo systemctl restart ghost-writer) or through your preferred terminal
detacher, by stopping then re-starting the process.