Linux Build Guide
เนื้อหานี้ยังไม่มีในภาษาของคุณ
This guide will walk you through building and installing QSM.Web on your system.
Prerequisites
Section titled “Prerequisites”- Download & Install the .NET SDK (https://dotnet.microsoft.com/en-us/download)
- Git
Build Steps
Section titled “Build Steps”-
Use Git to clone the repository, go into the QSM.Web directory, and build the program
Terminal window git clone https://github.com/lines-of-codes/QSMSharp.gitcd QSM.Webdotnet publish -c Release -
Copy the build files in the
bin/Release/net10.0/publishfolder to/usr/local/lib/qsm-web/(or alternatively,/opt/qsm-web/)Terminal window sudo cp -r bin/Release/net10.0/publish/* /usr/local/lib/qsm-web/ -
Create the application data folder, by default is
/var/lib/qsm-web. See [QSMSharp/qsmweb/reference/application-data] on changing the location. -
(Recommended) Create a user for QSM and ensure the folders created in the previous step is writable
Terminal window sudo useradd -d /var/lib/qsm-web qsmwebsudo chown qsmweb:qsmweb /var/lib/qsm-web -
Run the
QSM.Webexecutable! You can usetmuxor use the following systemd unit file:/etc/systemd/system/qsm-web.service [Unit]Description=QSM Web consoleWants=network-online.targetAfter=network-online.target[Service]User=qsmwebGroup=qsmwebWorkingDirectory=/usr/local/lib/qsm-webExecStart=/usr/local/lib/qsm-web/QSM.WebStandardInput=null[Install]WantedBy=multi-user.target
By default, the web console will be started on port 5222 and will accept connections from anywhere. But do remember that if you want to access the console from other devices, you’ll need to configure your firewall if you have one.
The systemd unit will start QSM.Web under the qsmweb user with the
/usr/local/lib/qsm-web working directory. You’ll want to remove the User and Group
property if you did not create the qsmweb user (although that’s not recommended), and
change the ExecStart property if you did not place QSM.Web at /usr/local/lib/qsm-web
QSM.Web (or rather, the ASP.NET underneath) reads appconfig.json from the current
working directory, so if you wish to change where that config file is placed (for
example, to /var/lib/qsm-web), you’ll want to change the working directory.
OpenRC
Section titled “OpenRC”For users who uses OpenRC, such as running in Alpine containers, You can use the following OpenRC service script instead:
#!/sbin/openrc-runcommand=/usr/local/lib/qsm-web/QSM.Webcommand_background=truecommand_user="qsmweb:qsmweb"pidfile="/run/${RC_SVCNAME}.pid"
directory="/usr/local/lib/qsm-web"
depend() { need net}Then you can simply add the service to the default runlevel and start it.
rc-update add qsm-web defaultrc-service qsm-web start