dsfx/docs/hosting.md

3.1 KiB

Hosting

Installation

Due to the maturity of the project, we haven't yet created a release strategy. In order to install DSFX, we recommend building the project from source.

Dependencies

In order to build the project from source, you will need to have git installed on your system, as well as the go compiler. You can install these dependencies using your system's package manager. For example, on Ubuntu, you can run:

sudo apt-get install git golang

Git Setup

Currently we are hosted on gitea cloud, which hides everything from the public internet by default. This means that you will need to authenticate with your gitea account as if you were cloning a private repository, even though our repository is public. An easy way to do this is with the .netrc file combined with a personal access token. You can create a .netrc file in your home directory with the following contents:

machine koti.casa login <your username> password <gitea personal access token>

Finally, you'll need to set the GOPRIVATE environment variable to allow go to fetch private repositories. You can do this by running the following command:

export GOPRIVATE=koti.casa

If you want to persist this setting across sessions, you can add the above line to your ~/.bashrc or ~/.bash_profile.

Installation

Now that you have the go toolchain set up with access to our repository, you can simply install the project by using the go install command.

go install koti.casa/numenorlabs/dsfx/cmd/dsfx@main

Running

You can run the DSFX server using the dsfx command, which will be available in your $GOPATH/bin directory after installation. If you have added $GOPATH/bin to your PATH, you can run the server directly from the command line:

dsfx

Optionally, you can run the command directly via the go run command if you prefer not to install the project globally. This can be done with the following command:

go run koti.casa/numenorlabs/dsfx/cmd/dsfx@main

Environment Variables

DSFX uses the following environment variables to configure its behavior:

Variable Description Default Value
DSFX_HOST The host on which the DSFX server will run 0.0.0.0
DSFX_PORT The port on which the DSFX server will listen 8000
DSFX_LOG_LEVEL The log level to use. One of (error, warn, info, debug) info
DSFX_DATA_DIR The directory where the DSFX data files are stored /etc/dsfx/data
DSFX_CONFIG_DIR The directory where the DSFX configuration files are stored /etc/dsfx/config

Local Files

The DSFX server uses local files for configuration and storage. The default directories for these files are specified in the DSFX_CONFIG_DIR and DSFX_DATA_DIR environment variables. You can change these directories by setting the corresponding environment variables before starting the server.