feat(wiki): v0.1.0-beta getting started

This commit is contained in:
DecDuck
2024-12-25 18:32:54 +11:00
commit 9c04de805d
15 changed files with 1503 additions and 0 deletions

66
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,66 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy VitePress site to Pages
on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm
# with:
# version: 9 # Not needed if you've set "packageManager" in package.json
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci # or pnpm install / yarn install / bun install
- name: Build with VitePress
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
docs/.vitepress/cache

View File

@ -0,0 +1,56 @@
import { defineConfig } from 'vitepress'
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Drop",
description: "Drop is an open-source, self-hosted game distribution platform. Like Steam!",
head: [['link', { rel: 'icon', href: '/drop.svg' }]],
themeConfig: {
logo: "/drop.svg",
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'GitHub', link: 'https://github.com/Drop-OSS' }
],
sidebar: [
{ text: "What is Drop?", link: "/about" },
{
text: 'Admin Guides',
items: [
{ text: 'Quickstart', link: '/guides/quickstart' },
{ text: "Exposing your instance", link: "/guides/exposing" },
{ text: "Create your admin account", link: "/guides/create-admin-account" }
]
},
{
text: 'User Guides',
items: [
{ text: "Getting started with Drop", link: "/guides/client" }
]
},
{
text: "Metadata",
items: [
{ text: "GiantBomb", link: "/metadata/giantbomb" }
]
},
{
text: "Documentation",
items: [
{ text: "Library", link: "/docs/library" }
]
}
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/Drop-OSS' },
{ icon: 'discord', link: "https://discord.gg/NHx46XKJWA" }
],
outline: {
level: [2, 3],
},
}
})

33
docs/about.md Normal file
View File

@ -0,0 +1,33 @@
# About Drop
Drop is an open-source, self-hosted game distribution platform. It's designed offer all the same features of a platform like Steam.
Don't know what any of that means? Keep reading.
## Open source
Open source means you are free to view and re-use the source code of Drop (in accordance with it's license).
Drop is also open-contribution, and we encourage technical users to contribute back to the Drop source code, especially if there are features they want that are missing or are planned for later.
If you want to start contributing, check out our GitHub: [Drop OSS organization](https://github.com/Drop-OSS).
We also recommend join our Discord: [Drop-OSS invite](https://discord.gg/NHx46XKJWA). However, there is a lot of drama around open-source projects using Discord, so we also encourage using GitHub issues or discussions to ask for support or talk about new features.
## Self hosted
Self hosted means there **is no central server.** Unlike many of the services which dominate the Internet today, Drop isn't a website you go to, it's software you download and run yourself. That means every person that uses Drop **has their own, independent copy**, which has it's own **own, independent URL or way to access it.**
Or, if you're lucky, one of your friends or family has already set up an instance, and provided you with a URL, in which case you can just head over to [Getting started with Drop](/guides/client).
## Game distribution
A game distribution service is one that... distributes games. Think of Steam, GOG or Epic Games. You can view, buy and download games from these sites. That's what Drop is.
Instead however, instead of a massive centralized website, each admin runs their own copy, and adds *their own games* to their own copy of Drop. Also, there's no payment processing, nothing has a price.
## Platform
Drop does a lot more than just game distribution. As of `v0.1.0-beta`, a lot hasn't been implemented. But, in future, Drop will be able to handle things such as:
- Dedicated servers
- Matchmaking & P2P games
- Achievements & items
- Cloud saves
- Modding

42
docs/docs/library.md Normal file
View File

@ -0,0 +1,42 @@
# Library
## Structuring your library
Drop uses a very particular structure to organise your games library. Generally, to get started, you need to create two folders for a game:
1. `{LIBRARY}/My Game Name` - The game folder. This contains **only** folders, as described as below.
2. `{LIBRARY}/My Game Name/my-version-name` - The version folder. This folder contains all the files for the game.
Once in the UI, you'll be prompted to "import" each folder separately:
- Importing the **game folder** will link the folder to a game in the metadata database, and pulls the data (images, descriptions, that sort of thing) from one of your configured metadata providers. **This only happens once for each game you have.**
- Importing **version folder** will read the entirety of the game files and generate checksums and metadata that clients need to download the games with. **This happens for each new version you add.**
::: warning
Importing the version may take very long, depending on the size of the game and the speed of the drive. CPU is rarely the bottleneck.
:::
### Game vs. Version
A "game" in Drop is associated with all the metadata, and doesn't have to changed if the game updates.
A "version" in Drop is associated with the files, and a new one will have to be created every time the game updates.
## Importing more versions
So your game has gotten an update and you've got new files. All you need to do is create a new version folder inside the game folder, and move all the files you have into that folder. Then, import it within the Drop admin UI.
If you have files that you're supposed to **paste over the previous version**, Drop supports that! Read [Version delta & ordering](#version-deltas--ordering) to find out more.
## Version deltas & ordering
Version deltas are a way to avoid storing copies of files on the server. Delta are, very simply, pasted over the top of previous versions (but much more efficiently, to avoid excess downloading).
To create a delta version, simply select the toggle in the admin UI. Once created, you can drag around the priority of your versions in the admin view of a game. Higher priority versions will have their files used over lower priority. For example, consider three versions:
1. **v1**
1. Game.exe
2. Data.bin
2. **v2** (delta)
1. Game.exe
3. **v3** (delta)
1. Data.bin
If the user decides to download **v3**, Drop will download the 'Data.bin' from **v3**, and the 'Game.exe' from **v2**. It won't download any files from **v1**, because they have all been overwritten by higher priority versions.

1
docs/guides/client.md Normal file
View File

@ -0,0 +1 @@
# Getting started with Drop

View File

@ -0,0 +1,9 @@
# Create your admin account
A freshly set up Drop instance will have an 'admin invitation' created. This allows you to create your admin account without having to copy credentials from the command line, or similar.
To use the invitation, go to:
```
{Drop instance URL}/register?id=admin
```
Once used, the invitation will be deleted. If you are unsure how to access your Drop instance, read through [Exposing your instance](/guides/exposing)

20
docs/guides/exposing.md Normal file
View File

@ -0,0 +1,20 @@
# Exposing your instance
Exposing your instance allows it to be accessible from other computers than the one you're hosting it on.
## LAN
The `compose.yaml` provided in the [Quickstart guide](/guides/quickstart.md) already exposes the Drop instance on port 3000. If you're on the same LAN as your Drop instance, you can find it's IP and then use:
```
http://[instance IP]:3000
```
as the connection URL when setting up your Drop client.
## Reverse Proxy
If you are unsure how to set up a reverse proxy, or even what one is, this guide isn't for you. There are far better guides out there, so follow them to set up your reverse proxy.
As of `v0.1.0-beta` there is no special configuration required to run Drop behind a reverse proxy.
## VPN
If you are unsure how to setup a VPN for remote access, please find and follow a far better guide than this one.
Accessing Drop over a VPN works very similarly to [accessing via LAN](#lan), so follow those steps.

68
docs/guides/quickstart.md Normal file
View File

@ -0,0 +1,68 @@
# Quickstart
This guide quickly runs through how to get set up with Drop in about five minutes, depending on your experience.
## Setting up the instance
The easiest way to get Drop running is using our pre-built Docker container.
```yaml compose.yaml
services:
postgres:
image: postgres:14-alpine
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "postgres"]
interval: 30s
timeout: 60s
retries: 5
start_period: 10s
volumes:
- ./db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=drop
- POSTGRES_USER=drop
- POSTGRES_DB=drop
drop:
image: registry.deepcore.dev/drop-oss/drop/main:latest
depends_on:
postgres:
condition: service_healthy
ports:
- 3000:3000
volumes:
- ./library:/library
- ./certs:/certs
- ./objects:/objects
environment:
- DATABASE_URL=postgres://drop:drop@postgres:5432/drop
- FS_BACKEND_PATH=/objects
- CLIENT_CERTIFICATES=/certs
- LIBRARY=/library
- GIANT_BOMB_API_KEY=REPLACE_WITH_YOUR_KEY
```
**The main things in this `compose.yaml` is the volumes attached to the `drop` service:**
1. `./library` is where you will put your games to be imported into Drop. See '[Structuring your library](/docs/library.md#structuring-your-library)' once you're set up.
2. `./certs` is where Drop will store cryptographic certificates relating to the function of Drop end clients and the connections between them. In order to make sure the traffic isn't being snooped on, keep this directory safe.
3. `./objects` is where Drop will store uploaded & downloaded files (from metadata providers)
**In addition, configure your chosen metadata provider:**
- [GiantBomb](/metadata/giantbomb.md) (only one supported as of v0.1.0-beta)
::: tip
If you want to, you can generate a more secure PostgreSQL username & password.
:::
Once your instance is running, [create your admin account](/guides/create-admin-account.md).
## Setting up a client
To set up a client, your Drop instance will have to be accessible from it. See [Exposing your instance](/guides/exposing.md) for information on how to do that.
First, download the latest client for your platform from [the GitHub releases page](https://github.com/Drop-OSS/drop-app/releases). Then, install it for your platform. If we don't have a binary available for your platform, please create an issue on [the Drop app repository](https://github.com/Drop-OSS/drop-app) and we'll investigate it.
Once installed, open the Drop app for the first time. There is an automated wizard that'll walk you through the steps of signing into your Drop instance.

24
docs/index.md Normal file
View File

@ -0,0 +1,24 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home
hero:
name: "Drop OSS"
tagline: Drop is an open-source, self-hosted game distribution platform. Like Steam!
actions:
- theme: brand
text: Quick start
link: /guides/quickstart
- theme: alt
text: Guides ->
link: /guides/
features:
- title: Feature A
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature B
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature C
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
---

View File

@ -0,0 +1,9 @@
# GiantBomb
GiantBomb is a community-driven open game database. It is accessible at [https://www.giantbomb.com/](https://www.giantbomb.com/).
## Creating an account
To get an API key, you must sign up for an account. Head over to [GiantBomb's Login or Signup](https://www.giantbomb.com/login-signup/) page to create your account, and follow the prompts.
## Getting an API key
Head over to the [GiantBomb API page](https://www.giantbomb.com/api/) and copy your API key from the box at the top of the page. Then, set this in your environment variables with a key of `GIANT_BOMB_API_KEY`

5
docs/public/drop.svg Normal file
View File

@ -0,0 +1,5 @@
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M4 13.5C4 11.0008 5.38798 8.76189 7.00766 7C8.43926 5.44272 10.0519 4.25811 11.0471 3.5959C11.6287 3.20893 12.3713 3.20893 12.9529 3.5959C13.9481 4.25811 15.5607 5.44272 16.9923 7C18.612 8.76189 20 11.0008 20 13.5C20 17.9183 16.4183 21.5 12 21.5C7.58172 21.5 4 17.9183 4 13.5Z"
stroke="#60a5fa" stroke-width="2" />
</svg>

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

14
package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "drop-docs",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"vitepress": "^1.5.0"
},
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
}
}

1154
yarn.lock Normal file

File diff suppressed because it is too large Load Diff