{"id":16130507,"url":"https://github.com/AFCMS/luanti-skin-server","last_synced_at":"2025-03-16T09:32:33.994Z","repository":{"id":103042224,"uuid":"579942974","full_name":"AFCMS/minetest-skin-server","owner":"AFCMS","description":"⚠️ WIP Skin server for the Minetest engine","archived":false,"fork":false,"pushed_at":"2024-10-09T21:57:00.000Z","size":1379,"stargazers_count":8,"open_issues_count":42,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-10T22:16:25.771Z","etag":null,"topics":["golang","minetest","minetest-tool","react","server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AFCMS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-19T10:28:28.000Z","updated_at":"2024-07-15T22:35:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"38e6c3e1-59cb-4e7e-b1b4-f5ce4e7bf88c","html_url":"https://github.com/AFCMS/minetest-skin-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AFCMS%2Fminetest-skin-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AFCMS%2Fminetest-skin-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AFCMS%2Fminetest-skin-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AFCMS%2Fminetest-skin-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AFCMS","download_url":"https://codeload.github.com/AFCMS/minetest-skin-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221661502,"owners_count":16859536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","minetest","minetest-tool","react","server"],"created_at":"2024-10-09T22:16:28.239Z","updated_at":"2025-03-16T09:32:33.985Z","avatar_url":"https://github.com/AFCMS.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Luanti Skin Server\n\n![GitHub Workflow Status](https://img.shields.io/github/checks-status/AFCMS/luanti-skin-server/master?style=flat-square)\n\n\u003e [!IMPORTANT]\n\u003e This server is still in development and is not ready for production use.\n\u003e Breaking changes may occur at any time.\n\nThis server is made for serving Luanti skins to Luanti servers. It is licensed under GPLv3.\n\n- ✅ Easy to use and powerful **API**\n- ✅ Skins compatible with both **VoxeLibre** and **Minetest Game**\n- ✅ Fast and reliable, thanks to **Docker**, **Golang**, **Fiber** and **PostgreSQL**\n- ✅ Optimised images using **Oxipng**\n\n## Design\n\nThe server is build with the [**Go**](https://go.dev) language on-top of the [**Fiber**](https://gofiber.io) framework.\n\nIt uses also the [**GORM**](https://gorm.io) library for interacting with the database.\n\nThe frontend is build with the [**React**](https://reactjs.org) library, the [**Vite**](https://vitejs.dev) framework\nand the following libraries:\n\n- [**TailwindCSS**](https://tailwindcss.com) for styling\n- [**HeadlessUI**](https://headlessui.com) for dialogs, combobox, etc\n- [**Heroicons**](https://heroicons.com) for most icons\n- [**React Router**](https://reactrouter.com)\n- [**React Three Fiber**](https://github.com/pmndrs/react-three-fiber) for the 3D preview of skins\n\n## Running Server\n\n### Development (Docker)\n\n#### 1. Install `docker`\n\nFollow the official guide for your OS.\n\n- [Ubuntu](https://docs.docker.com/engine/install/ubuntu)\n- [Debian](https://docs.docker.com/engine/install/debian)\n- [Fedora](https://docs.docker.com/engine/install/fedora)\n- [RHEL/CentOS](https://docs.docker.com/engine/install/centos)\n\n\u003e [!NOTE]\n\u003e The installation links are from Docker Engine, which works only under Linux.\n\u003e\n\u003e [Docker Desktop](https://www.docker.com/products/docker-desktop) can be used on Windows, MacOS and Linux.\n\u003e\n\u003e It runs a Linux VM in the background and isn't as performant as the native version, but it's easier to install and\n\u003e use.\n\n\u003e [!WARNING]\n\u003e You need a [BuildKit](https://docs.docker.com/build/buildkit) enabled version of Docker to build the image.\n\n#### 2. Download source code\n\n```shell\ngit clone https://github.com/AFCMS/luanti-skin-server \u0026\u0026 cd luanti-skin-server\n```\n\n#### 3. Configure server\n\n```shell\ncp exemple.env .env\n```\n\nEdit the `.env` file with the config you want.\n\nA typical production config would be:\n\n```ini\nMT_SKIN_SERVER_DATABASE_LOGGING=false\nMT_SKIN_SERVER_ENABLE_OPTIPNG=true\n\nMT_SKIN_SERVER_DB_HOST=db\nMT_SKIN_SERVER_DB_USER=user\nMT_SKIN_SERVER_DB_PASSWORD=azerty\nMT_SKIN_SERVER_DB_PORT=5432\nMT_SKIN_SERVER_DB_NAME=skin_server\n```\n\n#### 4. Run services\n\n```shell\ndocker compose -f compose.dev.yml up --build\n```\n\nYou will now have access to the app (both frontend and API) at `http://localhost:8080`. Doing changes to the frontend\nfiles will trigger fast refresh without needing to restart the entire app.\n\n### Development (host, not recommended)\n\nIt's possible to run the server without Docker, but it's not recommended.\n\n#### 1. Install Go and NodeJS\n\nFollow the official guides for you OS.\n\nI recommend using NodeJS v20 installed using [**nvm**](https://github.com/nvm-sh/nvm) under linux.\n\n#### 2. (Optional) Install Oxipng\n\nIf you want to enable [Oxipng](https://github.com/shssoichiro/oxipng), you need to install it.\n\n#### 3. Download source code\n\n```shell\ngit clone https://github.com/AFCMS/luanti-skin-server \u0026\u0026 cd luanti-skin-server\n```\n\n#### 4. Install Go dependencies\n\n```shell\ngo mod download\n```\n\n#### 5. Install NodeJS dependencies\n\n```shell\ncd frontend \u0026\u0026 npm install --include=dev \u0026\u0026 cd ..\n```\n\n#### 6. Configure server\n\n```shell\ncp exemple.env .env\n```\n\nEdit the `.env` file with the config you want.\n\nA typical development config would be:\n\n```ini\nMT_SKIN_SERVER_DATABASE_LOGGING=false\nMT_SKIN_SERVER_ENABLE_OPTIPNG=true\n\nMT_SKIN_SERVER_DB_HOST=db\nMT_SKIN_SERVER_DB_USER=user\nMT_SKIN_SERVER_DB_PASSWORD=azerty\nMT_SKIN_SERVER_DB_PORT=5432\nMT_SKIN_SERVER_DB_NAME=skin_server\n```\n\nYou need a PostgreSQL database running on the given host and port.\n\n#### 7. Frontend\n\nThe frontend served by the Fiber backend can be build before running the app and served statically, the Vite development\nserver can also be proxied by the backend to avoid rebuilding everytime.\n\nStatic files can be built like this before launching the server:\n\n```shell\ncd frontend \u0026\u0026 npm run build \u0026\u0026 cd ..\n```\n\nIf you want to use Vite's development server, you can run it like this:\n\n```shell\ncd frontend \u0026\u0026 npm run dev\n```\n\nWith the following additional configuration in the `.env` file:\n\n```ini\nMT_SKIN_SERVER_FRONTEND_DEV_MODE=true\nMT_SKIN_SERVER_FRONTEND_URL=http://localhost:5173\n```\n\n\u003e [!CAUTION]\n\u003e The Vite server configuation makes it exposed on your local network by default to make it accessible in Docker, you\n\u003e can change this\n\u003e behaviour in the Vite configuration.\n\n#### 8. Build and run backend\n\n```shell\ngo build \u0026\u0026 ./luanti-skin-server\n```\n\n### Production\n\nThere is an [exemple](https://github.com/AFCMS/luanti-skin-server/blob/master/compose.prod.yml) production Docker\nCompose file in the repository.\n\nIt uses the [production image](https://github.com/AFCMS/luanti-skin-server/pkgs/container/luanti-skin-server) built\nby the GitHub Actions workflow, which supports `amd64` and `arm64` architectures.\n\n```shell\ndocker pull ghcr.io/afcms/luanti-skin-server:master\ndocker compose -f compose.prod.yml up\n```\n\nYou can verify that the image have been really built by the GitHub Actions workflow and find the build log using the GitHub CLI:\n```shell\ngh attestation verify oci://ghcr.io/afcms/luanti-skin-server:master --repo AFCMS/luanti-skin-server\n```\n\n#### Configuration\n\nFor production the server supports some more configuration variables.\n\n##### Google Search Console Verification\n\nThe server can use the HTML tag verification method for\nthe [Google Search Console](https://search.google.com/search-console) (URL prefix).\n\nYou can set the `MT_SKIN_SERVER_VERIFICATION_GOOGLE_SEARCH_CONSOLE` environment variable to Google's verification token.\n\nYou can also use the DNS record method if you want, please\ncheckout [Google's documentation](https://support.google.com/webmasters/answer/9008080) for more information.\n\n##### OAuth2\n\nThe server supports OAuth2 for authentication, you can set the following environment variables to enable it.\n\nIf one of the two variables (client id, client secret) for a provider are not set, OAuth2 will be disabled for that\nprovider.\n\n- `MT_SKIN_SERVER_OAUTH_REDIRECT_HOST`: the host where the OAuth2 callback will be redirected to\n- ContentDB:\n    - `MT_SKIN_SERVER_OAUTH_CONTENTDB_CLIENT_ID`: the OAuth2 client ID for the ContentDB API\n    - `MT_SKIN_SERVER_OAUTH_CONTENTDB_CLIENT_SECRET` the OAuth2 client secret for the ContentDB API\n    - `MT_SKIN_SERVER_OAUTH_CONTENTDB_URL`: the URL of the ContentDB instance, default to `https://content.luanti.org`\n    - [Create Application](https://content.luanti.org/user/apps/)\n- GitHub:\n    - `MT_SKIN_SERVER_OAUTH_GITHUB_CLIENT_ID`: the OAuth2 client ID for the GitHub API\n    - `MT_SKIN_SERVER_OAUTH_GITHUB_CLIENT_SECRET` the OAuth2 client secret for the GitHub API\n    - [Create Application](https://github.com/settings/applications/new)\n\n## Development Tools\n\nI recommand using either **VSCode** or **GoLand**.\n\nThere are multiple VSCode extensions marked as recommended for the workspace.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAFCMS%2Fluanti-skin-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAFCMS%2Fluanti-skin-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAFCMS%2Fluanti-skin-server/lists"}