110 lines
3 KiB
Markdown
110 lines
3 KiB
Markdown
# Setup
|
|
|
|
## I. Dependencies
|
|
|
|
Before the actual setup, you have to satisfy the following dependencies:
|
|
|
|
|
|
### System
|
|
|
|
- `pg_config`
|
|
- Ubuntu: `libpq-dev`
|
|
- Fedora/RHEL: `libpq-devel`
|
|
- `Caddy` 2.4.3+ (HTTP Reverse Proxy & Static File Server)
|
|
- `gcc`, `gettext`
|
|
- `Python` 3.9+ with pip
|
|
- `Python` header files
|
|
- Fedora/RHEL: `python3-devel`
|
|
- Ubuntu: `python3-dev`
|
|
|
|
|
|
### Python Packages (pip)
|
|
|
|
All required python packages are listed in [pip-dependencies.txt](/pip-dependencies.txt)
|
|
|
|
You can install the required python packages with
|
|
```bash
|
|
./install-pip-dependencies.sh
|
|
```
|
|
|
|
## II.A Installation
|
|
|
|
You can get the latest version with git:
|
|
|
|
```
|
|
git clone --branch release-x https://gitlab.com/W13R/drinks-manager.git
|
|
```
|
|
(replace x with the latest version)
|
|
|
|
Alternatively, you can download the [latest release](https://gitlab.com/W13R/drinks-manager/-/releases) and extract the files to your prefered destination.
|
|
|
|
<u>**Warning:**</u>
|
|
|
|
Make shure that you set the correct file permissions, especially for the config files !!
|
|
|
|
The following should be sufficient:
|
|
|
|
```bash
|
|
chmod -R u+rw,g+r,g-w,o-rwx <drinks_manager_directory>
|
|
```
|
|
|
|
|
|
## II.B Update
|
|
|
|
If you installed the application with git, you can run the following in the drinks-manager directory to update to the new version:
|
|
|
|
```
|
|
git fetch
|
|
git checkout x
|
|
```
|
|
(replace x with the new version)
|
|
|
|
If you downloaded the application from the releases page, you can download the new release in the same manner, and overwrite the old files with the new ones.
|
|
|
|
You have to restart the application server to apply the changes.
|
|
WARNING: The auto-upgrade mechanism may expect you to input information. Therefore, you should start the application from the command-line the first time after an update.
|
|
|
|
Further upgrading-instructions may be provided in the Release Notes on the Releases Page of this Project (Deployments -> Releases).
|
|
|
|
|
|
## III. Database
|
|
|
|
This project is using PostgreSQL. You have to set up a database:
|
|
|
|
```sql
|
|
create user drinksmanager password '<a safe password>';
|
|
create database drinksmgr owner drinksmanager;
|
|
```
|
|
|
|
After creating the user, you have to edit your `pg_hba.conf` (see https://www.postgresql.org/docs/current/auth-pg-hba-conf.html).
|
|
Add the following line:
|
|
```
|
|
host drinksmgr drinksmanager 127.0.0.1/32 md5
|
|
```
|
|
|
|
Now you can configure your database connection in `config/config.sh`.
|
|
|
|
|
|
## IV. HTTPS & TLS Certificates
|
|
|
|
A TLS/SSL certificate and key is required.
|
|
Filepaths:
|
|
|
|
- `config/tls/server.pem` for the certificate
|
|
- `config/tls/server-key.pem` for the key
|
|
|
|
You can set another filepath for those files in your caddy configuration at [config/Caddyfile](/config/Caddyfile).
|
|
|
|
|
|
## V. Configuration
|
|
|
|
see [Configuration](Configuration.md)
|
|
|
|
|
|
## VI. Run Setup Command
|
|
|
|
run `./run.sh setup`
|
|
|
|
This will automatically set up database tables, views and entries, set up Django and let you create a admin user.
|
|
|
|
After this, start the server with `./run.sh server` and navigate to `https://your.ip.add.ress:port/admin/`.
|