https://github.com/afcms/luanti-skin-server

⚠️ WIP Skin server for the Luanti engine

https://github.com/afcms/luanti-skin-server

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.6%) to scientific vocabulary

Keywords

golang minetest minetest-tool react server
Last synced: 6 months ago · JSON representation

Repository

⚠️ WIP Skin server for the Luanti engine

Basic Info
  • Host: GitHub
  • Owner: AFCMS
  • License: gpl-3.0
  • Language: Go
  • Default Branch: master
  • Homepage:
  • Size: 1.76 MB
Statistics
  • Stars: 10
  • Watchers: 1
  • Forks: 0
  • Open Issues: 40
  • Releases: 0
Topics
golang minetest minetest-tool react server
Created about 3 years ago · Last pushed 7 months ago
Metadata Files
Readme License Code of conduct Security

README.md

Luanti Skin Server

GitHub Workflow Status

[!IMPORTANT] This server is still in development and is not ready for production use. Breaking changes may occur at any time.

This server is made for serving Luanti skins to Luanti servers. It is licensed under GPLv3.

Design

The server is build with the Go language on-top of the Fiber framework.

It uses also the GORM library for interacting with the database.

The frontend is build with the React library, the Vite framework and the following libraries:

Running Server

Development

While it's possible to develop the server without using Docker, it's much easier so only this method is documented.

1. Install Docker

Follow the official guide for your OS.

[!NOTE] The installation links are from Docker Engine, which works only under Linux.

Docker Desktop can be used on Windows, MacOS and Linux.

It runs a Linux VM in the background and isn't as performant as the native version, but it's easier to install and use.

[!WARNING] You need a BuildKit enabled version of Docker to build the image.

In general both the image and the included Compose files use modern features of Docker and Docker Compose.

2. Install NodeJS

Install NodeJS v22 (lts/jod) following the instructions for your system. I use nvm under Linux.

Then enable PNPM:

shell corepack enable pnpm

3. Download source code

shell git clone https://github.com/AFCMS/luanti-skin-server && cd luanti-skin-server

4. Configure server

shell cp exemple.env .env

Edit the .env file with the config you want.

A typical development config would be:

```ini MTSKINSERVERDATABASELOGGING=false

MTSKINSERVERDBHOST=db MTSKINSERVERDBUSER=user MTSKINSERVERDBPASSWORD=azerty MTSKINSERVERDBPORT=5432 MTSKINSERVERDBNAME=skin_server ```

5. Run services

Run backend:

shell COMPOSE_BAKE=true docker compose -f compose.dev.yml up --build --watch

Run frontend:

shell cd frontend && pnpm install --include=dev && pnpm run dev

You will now have access to the app (both frontend and API) at http://127.0.0.1:8080. Doing changes to the frontend files will trigger fast refresh without needing to restart the entire app.

Production

The supported method to run the server in production is using Docker Compose:

```yaml

services: db: image: "postgres:17.4-alpine" restart: unless-stopped environment: - POSTGRESUSER=${MTSKINSERVERDBUSER} - POSTGRESPASSWORD=${MTSKINSERVERDBPASSWORD} - POSTGRESDB=${MTSKINSERVERDBNAME} - DATABASEHOST=${MTSKINSERVERDBHOST} expose: - 5432 volumes: - db:/var/lib/postgresql/data

server:
    image: ghcr.io/afcms/luanti-skin-server:master
    environment:
        - MT_SKIN_SERVER_DB_USER=${MT_SKIN_SERVER_DB_USER}
        - MT_SKIN_SERVER_DB_PASSWORD=${MT_SKIN_SERVER_DB_PASSWORD}
        - MT_SKIN_SERVER_DB_NAME=${MT_SKIN_SERVER_DB_NAME}
        - MT_SKIN_SERVER_DB_HOST=${MT_SKIN_SERVER_DB_HOST}
        - MT_SKIN_SERVER_DB_PORT=${MT_SKIN_SERVER_DB_PORT}
        - MT_SKIN_SERVER_DATABASE_LOGGING=${MT_SKIN_SERVER_DATABASE_LOGGING}
        - MT_SKIN_SERVER_OAUTH_REDIRECT_HOST=${MT_SKIN_SERVER_OAUTH_REDIRECT_HOST}
        - MT_SKIN_SERVER_OAUTH_CONTENTDB_CLIENT_ID=${MT_SKIN_SERVER_OAUTH_CONTENTDB_CLIENT_ID}
        - MT_SKIN_SERVER_OAUTH_CONTENTDB_CLIENT_SECRET=${MT_SKIN_SERVER_OAUTH_CONTENTDB_CLIENT_SECRET}
        - MT_SKIN_SERVER_OAUTH_GITHUB_CLIENT_ID=${MT_SKIN_SERVER_OAUTH_GITHUB_CLIENT_ID}
        - MT_SKIN_SERVER_OAUTH_GITHUB_CLIENT_SECRET=${MT_SKIN_SERVER_OAUTH_GITHUB_CLIENT_SECRET}
        - MT_SKIN_SERVER_FRONTEND_DEV_MODE=false
        - MT_SKIN_SERVER_VERIFICATION_GOOGLE_SEARCH_CONSOLE=${MT_SKIN_SERVER_VERIFICATION_GOOGLE_SEARCH_CONSOLE}
    ports:
        - "8080:8080"
    depends_on:
        - db

volumes: db: ```

It uses the production image built by the GitHub Actions workflow, which is based on scratch and supports amd64 and arm64 architectures.

shell docker compose up

You can verify that the image have been really built by the GitHub Actions workflow and find the build log using the GitHub CLI:

shell gh attestation verify oci://ghcr.io/afcms/luanti-skin-server:master --repo AFCMS/luanti-skin-server

[!NOTE] The server doesn't have TLS support, to keep it as minimal as possible. Fiber don't support HTTP/2 and HTTP/3 yet anyways.

TLS should be handled by a reverse proxy like Caddy or Traefik, which support HTTP/3 and allow easy use of Let's Encrypt, Cloudflare certificates, etc.

Configuration

For production the server supports some more configuration variables.

Google Search Console Verification

The server can use the HTML tag verification method for the Google Search Console (URL prefix).

You can set the MT_SKIN_SERVER_VERIFICATION_GOOGLE_SEARCH_CONSOLE environment variable to Google's verification token.

You can also use the DNS record method if you want, please checkout Google's documentation for more information.

OAuth2

The server supports OAuth2 for authentication, you can set the following environment variables to enable it.

If one of the two variables (client id, client secret) for a provider are not set, OAuth2 will be disabled for that provider.

  • MT_SKIN_SERVER_OAUTH_REDIRECT_HOST: the host where the OAuth2 callback will be redirected to
  • ContentDB:
    • MT_SKIN_SERVER_OAUTH_CONTENTDB_CLIENT_ID: the OAuth2 client ID for the ContentDB API
    • MT_SKIN_SERVER_OAUTH_CONTENTDB_CLIENT_SECRET the OAuth2 client secret for the ContentDB API
    • MT_SKIN_SERVER_OAUTH_CONTENTDB_URL: the URL of the ContentDB instance, default to https://content.luanti.org
    • Create Application
  • GitHub:
    • MT_SKIN_SERVER_OAUTH_GITHUB_CLIENT_ID: the OAuth2 client ID for the GitHub API
    • MT_SKIN_SERVER_OAUTH_GITHUB_CLIENT_SECRET the OAuth2 client secret for the GitHub API
    • Create Application

Development Tools

I recommand using either VSCode or GoLand.

There are multiple VSCode extensions marked as recommended for the workspace.

Owner

  • Login: AFCMS
  • Kind: user
  • Location: France

👨‍🎓 16 years old french student

GitHub Events

Total
  • Issues event: 10
  • Watch event: 3
  • Delete event: 64
  • Issue comment event: 66
  • Push event: 55
  • Pull request event: 144
  • Create event: 79
Last Year
  • Issues event: 10
  • Watch event: 3
  • Delete event: 64
  • Issue comment event: 66
  • Push event: 55
  • Pull request event: 144
  • Create event: 79

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 6
  • Total pull requests: 167
  • Average time to close issues: about 1 year
  • Average time to close pull requests: 21 days
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 0.33
  • Average comments per pull request: 0.61
  • Merged pull requests: 34
  • Bot issues: 1
  • Bot pull requests: 167
Past Year
  • Issues: 5
  • Pull requests: 108
  • Average time to close issues: 15 days
  • Average time to close pull requests: 20 days
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.49
  • Merged pull requests: 29
  • Bot issues: 1
  • Bot pull requests: 108
Top Authors
Issue Authors
  • AFCMS (5)
  • dependabot[bot] (1)
Pull Request Authors
  • dependabot[bot] (167)
Top Labels
Issue Labels
enhancement (5) dependencies (1) javascript (1)
Pull Request Labels
dependencies (167) javascript (64) github_actions (59) go (30) docker (14)