Skip to content

Commit

Permalink
Luanti rename (partial)
Browse files Browse the repository at this point in the history
  • Loading branch information
AFCMS committed Jan 24, 2025
1 parent a9068ec commit 6c15f6b
Show file tree
Hide file tree
Showing 43 changed files with 112 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ frontend/dist
.prettierrc
LICENSE
# Build output
minetest-skin-server
luanti-skin-server
*.md
.env
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea
.env
minetest-skin-server
database.db
luanti-skin-server
database.db
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL org.opencontainers.image.title="Minetest Skin Server"
LABEL org.opencontainers.image.description="Skin server for the Minetest engine"
LABEL org.opencontainers.image.authors="AFCM <afcm.contact@gmail.com>"
LABEL org.opencontainers.image.licenses="GPL-3.0"
LABEL org.opencontainers.image.source="https://github.com/AFCMS/minetest-skin-server"
LABEL org.opencontainers.image.source="https://github.com/AFCMS/luanti-skin-server"

ARG TARGETOS
ARG TARGETARCH
Expand All @@ -29,7 +29,7 @@ COPY . ./
# https://dev.to/jacktt/20x-faster-golang-docker-builds-289n
RUN --mount=type=cache,id=gomod,target="/go/pkg/mod" \
--mount=type=cache,id=gobuild,target="/root/.cache/go-build" \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o minetest-skin-server .
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o luanti-skin-server .

# Build Frontend
FROM --platform=$BUILDPLATFORM node:20-alpine3.21 AS frontend-builder
Expand All @@ -56,7 +56,7 @@ RUN adduser \
--uid "10001" \
"appuser"

COPY --from=builder /app/minetest-skin-server /app/
COPY --from=builder /app/luanti-skin-server /app/
COPY --from=builder /app/index.gohtml /app/
COPY --from=frontend-builder /frontend/dist /app/frontend/dist

Expand All @@ -65,4 +65,4 @@ USER appuser:appuser
WORKDIR /app

EXPOSE 8080
CMD ["/app/minetest-skin-server"]
CMD ["/app/luanti-skin-server"]
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Minetest Skin Server
# Luanti Skin Server

![GitHub Workflow Status](https://img.shields.io/github/checks-status/AFCMS/minetest-skin-server/master?style=flat-square)
![GitHub Workflow Status](https://img.shields.io/github/checks-status/AFCMS/luanti-skin-server/master?style=flat-square)

> [!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 Minetest skins to Minetest servers. It is licensed under GPLv3.
This server is made for serving Luanti skins to Luanti servers. It is licensed under GPLv3.

- ✅ Easy to use and powerful **API**
- ✅ Skins compatible with both **MineClone2** and **Minetest Game**
- ✅ Skins compatible with both **VoxeLibre** and **Minetest Game**
- ✅ Fast and reliable, thanks to **Docker**, **Golang**, **Fiber** and **PostgreSQL**
- ✅ Optimised images using **OptiPNG**

Expand Down Expand Up @@ -55,7 +55,7 @@ Follow the official guide for your OS.
#### 2. Download source code

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

#### 3. Configure server
Expand Down Expand Up @@ -117,7 +117,7 @@ sudo dnf install optipng
#### 3. Download source code

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

#### 4. Install Go dependencies
Expand Down Expand Up @@ -187,25 +187,25 @@ MT_SKIN_SERVER_FRONTEND_URL=http://localhost:5173
#### 8. Build and run backend

```shell
go build && ./minetest-skin-server
go build && ./luanti-skin-server
```

### Production

There is an [exemple](https://github.com/AFCMS/minetest-skin-server/blob/master/compose.prod.yml) production Docker
There is an [exemple](https://github.com/AFCMS/luanti-skin-server/blob/master/compose.prod.yml) production Docker
Compose file in the repository.

It uses the [production image](https://github.com/AFCMS/minetest-skin-server/pkgs/container/minetest-skin-server) built
by the GitHub Actions workflow, which supports `amd64`, `arm64`, `ppc64le`, `s390x`, `386` architectures.
It uses the [production image](https://github.com/AFCMS/luanti-skin-server/pkgs/container/luanti-skin-server) built
by the GitHub Actions workflow, which supports `amd64` and `arm64` architectures.

```shell
docker pull ghcr.io/afcms/minetest:master
docker pull ghcr.io/afcms/luanti-skin-server:master
docker compose -f compose.prod.yml 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/minetest-skin-server:master --repo AFCMS/minetest-skin-server
gh attestation verify oci://ghcr.io/afcms/luanti-skin-server:master --repo AFCMS/luanti-skin-server
```

#### Configuration
Expand Down Expand Up @@ -233,8 +233,8 @@ provider.
- 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.minetest.net`
- [Create Application](https://content.minetest.net/user/apps/)
- `MT_SKIN_SERVER_OAUTH_CONTENTDB_URL`: the URL of the ContentDB instance, default to `https://content.luanti.org`
- [Create Application](https://content.luanti.org/user/apps/)
- 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
Expand Down
4 changes: 2 additions & 2 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/gofiber/fiber/v3/middleware/session"
"github.com/gofiber/storage/memory/v2"

"minetest-skin-server/database"
"minetest-skin-server/models"
"luanti-skin-server/database"
"luanti-skin-server/models"
)

var SessionStore *session.Store
Expand Down
6 changes: 3 additions & 3 deletions auth/oauth_contentdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/gofiber/fiber/v3"
"github.com/gofiber/fiber/v3/client"

"minetest-skin-server/database"
"minetest-skin-server/models"
"minetest-skin-server/utils"
"luanti-skin-server/database"
"luanti-skin-server/models"
"luanti-skin-server/utils"
)

func CDBRedirectURL() string {
Expand Down
2 changes: 1 addition & 1 deletion auth/oauth_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/gofiber/fiber/v3"
"github.com/gofiber/fiber/v3/client"

"minetest-skin-server/utils"
"luanti-skin-server/utils"
)

type GitHubTokenResponse struct {
Expand Down
2 changes: 1 addition & 1 deletion compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- db:/var/lib/postgresql/data

server:
image: ghcr.io/afcms/minetest-skin-server:master
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}
Expand Down
2 changes: 1 addition & 1 deletion database/account_count.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

// AccountCount Count accounts registered
func AccountCount() (int64, error) {
Expand Down
2 changes: 1 addition & 1 deletion database/account_delete.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

// AccountDelete Delete account
func AccountDelete(name string) error {
Expand Down
2 changes: 1 addition & 1 deletion database/account_from_id.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

// AccountFromID Get account from ID
func AccountFromID(id uint) (models.Account, error) {
Expand Down
2 changes: 1 addition & 1 deletion database/account_from_username.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

// AccountFromUsername Get account from name
func AccountFromUsername(username string) (models.Account, error) {
Expand Down
2 changes: 1 addition & 1 deletion database/account_from_username_cdb.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

// AccountFromCDBUsername Get account from CDB username
func AccountFromCDBUsername(cdbUsername string) (models.Account, error) {
Expand Down
2 changes: 1 addition & 1 deletion database/account_list.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

// AccountList Return users that are not banned
func AccountList() ([]models.Account, error) {
Expand Down
2 changes: 1 addition & 1 deletion database/account_list_banned.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

// AccountListBanned Return users that are banned
func AccountListBanned() ([]models.Account, error) {
Expand Down
2 changes: 1 addition & 1 deletion database/account_set_last_connection.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package database

import (
"minetest-skin-server/models"
"luanti-skin-server/models"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion database/account_set_permission.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package database

import (
"minetest-skin-server/models"
"luanti-skin-server/models"
)

func AccountSetPermission(a *models.Account, level int8) error {
Expand Down
4 changes: 2 additions & 2 deletions database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"gorm.io/gorm"
"gorm.io/gorm/logger"
"log"
"minetest-skin-server/models"
"minetest-skin-server/utils"
"luanti-skin-server/models"
"luanti-skin-server/utils"
"os"
)

Expand Down
2 changes: 1 addition & 1 deletion database/skin_approval.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

func SkinApproval(s *models.Skin, state bool) error {
if err := DB.Model(&s).Update("approved", state).Error; err != nil {
Expand Down
2 changes: 1 addition & 1 deletion database/skin_count.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

// SkinCount Count skins in database
func SkinCount() (int64, error) {
Expand Down
2 changes: 1 addition & 1 deletion database/skin_from_uuid.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package database

import (
"minetest-skin-server/models"
"luanti-skin-server/models"

"github.com/google/uuid"
)
Expand Down
2 changes: 1 addition & 1 deletion database/skin_recent.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package database

import "minetest-skin-server/models"
import "luanti-skin-server/models"

// SkinRecent Return the `count` recently published skins
func SkinRecent(count uint8) ([]models.Skin, error) {
Expand Down
51 changes: 24 additions & 27 deletions frontend/src/pages/About/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@ import { CodeBracketIcon } from "@heroicons/react/24/outline";

function About() {
return (
<div className="flex justify-center align-middle">
<div className=" container m-10 max-w-prose rounded bg-slate-50 p-8 shadow-md">
<h1 className="panel-text-heading">About</h1>
<p className="mt-2">
Minetest Skin Server is a service to upload Minetest skins
and let servers retreive them. It is licensed under GPLv3.
</p>
<a
className="panel-text-link"
href="https://github.com/AFCMS/minetest-skin-server"
>
Source Code
</a>
<br/>
<section className="my-4 ml-6">
<ul className="flex flex-col">
<li className="align-baseline text-lg font-medium text-slate-800">
<CodeBracketIcon className="mr-2 inline h-8"/>
Licensed under GPLv3
</li>
<li className="align-baseline text-lg font-medium text-slate-800">
<CodeBracketIcon className="mr-2 inline h-8"/>
Supports MineClone2, skindb, etc
</li>
</ul>
</section>
</div>
<div className="flex justify-center align-middle">
<div className=" container m-10 max-w-prose rounded bg-slate-50 p-8 shadow-md">
<h1 className="panel-text-heading">About</h1>
<p className="mt-2">
Minetest Skin Server is a service to upload Minetest skins and let servers retreive them. It is
licensed under GPLv3.
</p>
<a className="panel-text-link" href="https://github.com/AFCMS/luanti-skin-server">
Source Code
</a>
<br />
<section className="my-4 ml-6">
<ul className="flex flex-col">
<li className="align-baseline text-lg font-medium text-slate-800">
<CodeBracketIcon className="mr-2 inline h-8" />
Licensed under GPLv3
</li>
<li className="align-baseline text-lg font-medium text-slate-800">
<CodeBracketIcon className="mr-2 inline h-8" />
Supports MineClone2, skindb, etc
</li>
</ul>
</section>
</div>
</div>
);
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module minetest-skin-server
module luanti-skin-server

go 1.23

Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
flogger "github.com/gofiber/fiber/v3/middleware/logger"
"github.com/gofiber/template/html/v2"

"minetest-skin-server/auth"
"minetest-skin-server/database"
"minetest-skin-server/routes"
"minetest-skin-server/utils"
"luanti-skin-server/auth"
"luanti-skin-server/database"
"luanti-skin-server/routes"
"luanti-skin-server/utils"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions middleware/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package middleware
import (
"github.com/gofiber/fiber/v3"

"minetest-skin-server/auth"
"minetest-skin-server/database"
"luanti-skin-server/auth"
"luanti-skin-server/database"
)

// AuthHandler Check if the user is authenticated
Expand Down
2 changes: 1 addition & 1 deletion middleware/permission.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package middleware

import (
"minetest-skin-server/models"
"luanti-skin-server/models"

"github.com/gofiber/fiber/v3"
)
Expand Down
Loading

0 comments on commit 6c15f6b

Please sign in to comment.