better manual setup guide from HailStorm32

This commit is contained in:
Aaron Kimbre 2022-05-11 13:28:55 -05:00
parent 07136ef283
commit 7b4e11d65b

135
README.md
View File

@ -69,6 +69,8 @@
# Deployment # Deployment
> **NOTE: This tutorial assumes you have a working DLU server instance and**
> **some knowledge of Linux**
## Docker ## Docker
```bash ```bash
@ -100,25 +102,120 @@ Please Reference `app/settings_exmaple.py` to see all the variables
* Everything else is optional and has defaults * Everything else is optional and has defaults
## Manual ## Manual
* Install `imagemagick` or `libmagickwand-dev` for dds-to-png conversion
* Copy `app/settings_exmaple.py` to `app/settings.py` and adjust the settings you would like. Thanks to [HailStorm32](https://github.com/HailStorm32) for this manual install guide!
* Provide `APP_SECRET_KEY` and `APP_DATABASE_URI` in `app/settings.py` ### Setting Up The Environment
* app/luclient must contian a copy of an unpacked client First you will want to install the following packages by executing the following commands
* you only need `res/` and `locale/` from the client, but dropping the whole client in there won't hurt `sudo apt-get update`
* Use `fdb_to_sqlite.py` in lcdr's utilities on `res/cdclient.fdb` in the unpacked client to convert the client database to `cdclient.sqlite` `sudo apt-get install -y python3 python3-pip sqlite3 git unzip libmagickwand-dev`
* Put the resulting `cdclient.sqlite` in the res folder: `res/cdclient.sqlite`
* unzip `res/brickdb.zip` in-place > *Note: If you are having issues with installing `sqlite3`, change it to `sqlite`*
* you should have new folders and files in the following places:
* `res/Assemblies/../..` with a bunch of sub folders <br>
* `res/Primitives/../..` with a bunch of sub folders Next we will clone the repository. You can clone it anywhere, but for the purpose of this tutorial, we will be cloning it to the home directory.
* `res/info.xml`
* `res/Materials.xml` `cd` *make sure you are in the home directory*
* Run: `git clone https://github.com/DarkflameUniverse/NexusDashboard.git`
* `pip install -r requirements.txt`
* `pip install gunicorn` You should now have a directory called `NexusDashboard`
* `flask db upgrade`
* `gunicorn -b :8000 -w 4 wsgi:app` ### Setting up
* Preferably, you want to setup a systemd service or something to keey this running
Rename the example settings file
`cp ~/NexusDashboard/app/settings_example.py ~/NexusDashboard/app/settings.py`
Now let's open the settings file we just created and configure some of the settings
`vim ~/NexusDashboard/app/settings.py`
>*Feel free to use any text editor you are more comfortable with instead of vim*
<br>
Inside this file is where you can change certain settings like user registration, email support and other things. In this tutorial I will only be focusing on the bare minimum to get up and running, but feel free to adjust what you would like
>*Note: Enabling the email option will require further setup that is outside the scope of this tutorial*
The two important settings to configure are `APP_SECRET_KEY` and `APP_DATABASE_URI`
For `APP_SECRET_KEY`, fill in any random 32 character string
For `APP_DATABASE_URI`, fill in the respective fields
```
<username> --> database username
<password> --> database password
<host> --> database address
(this will most likely be localhost if you are running the database on the same machine
<port> --> port number of the database
(this can most likely be left out if you are running the database on the same machine)
<database> --> database name
```
>*If you are omitting `<port>`, make sure to also omit the `:`*
For a configuration where the database is running on the same machine, it would similar to this
```
APP_SECRET_KEY = "abcdefghijklmnopqrstuvwxyz123456"
APP_DATABASE_URI = "mysql+pymysql://DBusername:DBpassword@localhost/DBname"
```
The rest of the file is left at the default values
Once you are done making the changes, save and close the file
##### Client related files
We will need the following folders from the client
```
locale (all of the files inside)
res
|_BrickModels
|_brickprimitives
|_textures
|_ui
|_brickdb.zip
```
Put the two folders in `~/NexusDashboard/app/luclient`
Unzip the `brickdb.zip` in place
`unzip brickdb.zip`
Remove the `.zip` after you have unzipped it
`rm brickdb.zip`
In the `luclient` directory you should now have a file structure that looks like this
```
local
|_locale.xml
res
|_BrickModels
|_...
|_brickprimitives
|_...
|_textures
|_...
|_ui
|_...
|_Assemblies
|_...
|_Primitives
|_...
|_Materials.xml
|_info.xml
```
We will also need to copy the `CDServer.sqlite` database file from the server to the `~/NexusDashboard/app/luclient/res` folder
Once the file is moved over, you will need to rename it to `cdclient.sqlite`
`mv ~/NexusDashboard/app/luclient/res/CDServer.sqlite ~/NexusDashboard/app/luclient/res/cdclient.sqlite`
##### Remaining Setup
Run the following commands one at a time
`cd ~/NexusDashboard`
`pip install -r requirements.txt`
`pip install gunicorn`
`flask db upgrade`
##### Running the site
You can run the site with
`gunicorn -b :8000 -w 4 wsgi:app`
# Development # Development