Skip to content

CoolCat467/MineOS-Market-Server

Repository files navigation

MineOS-Market-Server

Python MineOS App Market Server Reimplementation

Tests

pre-commit.ci status pre-commit code style: black Ruff

Description

Python re-implementation of the server side of the MineOS App Market

Installation

Ensure Python 3 is installed on your computer, and use pip to install this project with the command listed below:

pip install git+https://github.com/CoolCat467/MineOS-Market-Server.git

Configuration

Configuration file locations follow the XDG Base Directory Specification. Main configuration file lives at $XDG_CONFIG_HOME/mineos_market_webserver/config.toml, or $HOME/.config/mineos_market_webserver/config.toml if unset. In the main configuration file you can change things like what port(s) the webserver is hosted on, hypercorn configuration, and enabling SSL support!

Database records live in $XDG_DATA_HOME/mineos_market_webserver/records/, or $HOME/.local/share/mineos_market_webserver/records/ if unset.

  • ids.json is for remembering what the next ID for publications and reviews should be.
  • login.json is for remembering login token -> username associations that expire after some time.
  • messages.json is for remembering messages sent between users.
  • publications.json is for remembering publication data.
  • reviews.json is for remembering reviews on publications and votes on reviews.
  • users.json is for remembering user data. Passwords are hashed with sha3_256.

Usage

Run the server:

mineos_market_server

Go to URL http://<IP_of_host>:3004, or whatever port you have set in the main configuration file.

Important Note: If you don't enable SSL support, login credentials are sent to server in clear text!

Enabling SSL Support

If you would like to enable SSL support, it's a bit tricky but it's doable, successfully tested in production, and completely free!

  1. Make sure your internet router is set to have the machine running the webserver to have a static ip address. This does not need to be a publicly accessible ip address.
  2. Create a free account with duckdns
  3. Add a domain with a name of your choice and set the ip to the static ip address of the machine running the webserver.
  4. Install certbot on the machine running the webserver. (https://certbot.eff.org/instructions) When it asks software, tell them other. For my installation, I ended up installing it with pip.
  5. Install the certbot duckdns plugin for certbot
  6. Either run certbot from duckdns plugin's README or run /scripts/cert_create.sh with your details.
  7. Setup autorenewal from certbot wiki or look at /scripts/cert_renew.sh
  8. Uncomment SSL lines in the webserver configuration file (see section above) and edit as needed for your particular setup.