diff --git a/docs/hosting.md b/docs/hosting.md index e06865b..12cb85d 100644 --- a/docs/hosting.md +++ b/docs/hosting.md @@ -2,44 +2,66 @@ ## Installation -We currently support two installation methods for DSFX: Docker and manual 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. -### Docker +### Dependencies -**pre-requisites**: - -- docker - -To run DSFX using Docker, you first need to log into the gitea registry. You can do this with the -following command. +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: ```bash -export GITEA_PAT="hex string of pat created in gitea console" - -echo $GITEA_PAT | docker login koti.casa -u --password-stdin +sudo apt-get install git golang ``` -Then, you can pull the DSFX image from the registry and run it. +### Git Setup -```bash -docker run -d --name dsfx -p 8000:8000 koti.casa/numenorlabs/dsfx:latest +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: + +```plaintext +machine koti.casa login password ``` -### Manual Installation - -**pre-requisites**: - -- go - -To install DSFX manually, you need to clone the repository and compile the code. You can do this with -the following commands: +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: ```bash -git clone https://koti.casa/numenor-labs/dsfx.git +export GOPRIVATE=koti.casa +``` -cd dsfx +If you want to persist this setting across sessions, you can add the above line to your +`~/.bashrc` or `~/.bash_profile`. -go build -o ./cmd/dsfx +### 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. + +```bash +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: + +```bash +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: + +```bash +go run koti.casa/numenorlabs/dsfx/cmd/dsfx@main ``` ## Environment Variables @@ -59,15 +81,3 @@ DSFX uses the following environment variables to configure its behavior: 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. - -For docker installations, it is recommended to mount the local directories to the container -using the `-v` flag. For example: - -```bash -docker run -d \ - --name dsfx \ - -p 8000:8000 \ - -v /path/to/local/config:/etc/dsfx/config \ - -v /path/to/local/data:/etx/dsfx/data \ - koti.casa/numenorlabs/dsfx:latest -```