Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HOST_URL="http://localhost:40500"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
.env
data/**
92 changes: 92 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"psi-header.config": {
"forceToTop": true,
"blankLinesAfter": 1,
"spacesBetweenYears": false,
"license": "MIT",
"company": "OpenMinerva",
"creationDateZero": "asIs",
},
"psi-header.lang-config": [
{
"language": "javascript",
"begin": "/* --- License",
"prefix": "* ",
"lineLength": 80,
"end": "* --- License */",
"forceToTop": true,
"blankLinesAfter": 1,
"beforeHeader": [],
"afterHeader": [],
"rootDirFileName": "session-server",
"modAuthor": "Modified By:",
"modDate": "Last Modified:",
"modDateFormat": "dd/MM/yyyy hh:nn:ss",
"replace": [
"Filename:",
"Project"
],
"ignoreLines": []
},
{
"language": "scss",
"begin": "/* --- License",
"prefix": "* ",
"lineLength": 80,
"end": "* --- License */",
"forceToTop": true,
"blankLinesAfter": 1,
"beforeHeader": [],
"afterHeader": [],
"rootDirFileName": "session-server",
"modAuthor": "Modified By:",
"modDate": "Last Modified:",
"modDateFormat": "dd/MM/yyyy hh:nn:ss",
"replace": [
"Filename:",
"Project"
],
"ignoreLines": []
}
],
"psi-header.templates": [
{
"language": "javascript",
"template": [
"File: <<filerelativepath>>",
"Project: <<projectname>>",
"Created Date: <<filecreated('DD MMMM YYYY')>>",
"Copyright (c) <<yeartoyear(fc, now)>> <<company>>",
"License: <<licensename>>",
"Authors: <<author>>",
],
"changeLogCaption": "HISTORY",
"changeLogHeaderLineCount": 2,
"changeLogEntryTemplate": [
"",
"<<dateformat(DD-MM-YYYY)>>\t<<initials>>\t"
],
"changeLogNaturalOrder": false,
"changeLogFooterLineCount": 0
},
{
"language": "scss",
"template": [
"File: <<filerelativepath>>",
"Project: <<projectname>>",
"Created Date: <<filecreated('DD MMMM YYYY')>>",
"Copyright (c) <<yeartoyear(fc, now)>> <<company>>",
"License: <<licensename>>",
"Authors: <<author>>",
],
"changeLogCaption": "HISTORY",
"changeLogHeaderLineCount": 2,
"changeLogEntryTemplate": [
"",
"<<dateformat(DD-MM-YYYY)>>\t<<initials>>\t"
],
"changeLogNaturalOrder": false,
"changeLogFooterLineCount": 0
}
]
}
9 changes: 9 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:24-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
EXPOSE 40500
CMD sh -c 'npx drizzle-kit generate \
&& npx drizzle-kit migrate \
&& node server.js'
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# session-server
The server for listing and advertising active sessions
> [!WARNING]
> This repository is currently pre-alpha, breaking changes happen frequently, there have not been any security audits, and data loss is expected.

<p align="center">
<img height="150" src="https://github.com/openminerva/session-server/blob/alpha/docs/logos/om-logo-big.webp?raw=true" />
</p>

[![](https://dcbadge.limes.pink/api/server/https://discord.gg/Kx6avB52gK)](https://discord.gg/Kx6avB52gK)

# Session Server

Session Server is the session discovery service for the OpenMinerva client.

## Overview

Session Server is a self hostable microservice for the OpenMinerva project that allows users to advertise their open sessions, and have their sessions be found by others. This service only serves as an advertisement board for open sessions, and does not facilitate any connection between any parties.

## Quick Start
Installation and running on Linux.
```bash
# Clone this repository.
git clone https://github.com/OpenMinerva/session-server

# Navigate to the repository.
cd session-server

# Create the .env file from the template.
cp .env.template .env
```
From here you have two directions. For production use, you probably want to run the command
```bash
./podman-run.sh # For production environments.
```
This will firstly compile all [SASS](https://sass-lang.com/) files to regular css, then it will use [Podman](https://podman.io/) to build a container using the [Containerfile](https://github.com/OpenMinerva/session-server/blob/alpha/Containerfile) using the default port `40500`.

Alternatively for development, you can simply run
```bash
node server.js # For development.
```
to start the server on your local machine without a container.

## Contributing
See [CONTRIBUTING.md](https://github.com/OpenMinerva/session-server/blob/alpha/CONTRIBUTING.md) for guidelines, and information.
Binary file added docs/logos/om-logo-big.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions drizzle.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { defineConfig } = require("drizzle-kit");

module.exports = defineConfig({
dialect: "sqlite",
schema: "./src/db/schema.js",
out: "./data/drizzle",
dbCredentials: { url: "./data/openminerva-session-server.db" },
});
14 changes: 14 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from "eslint/config";

export default defineConfig([
{
"rules": {
"no-unused-vars": ["error"],
"indent": ["error", "tab"],
"no-extra-semi": ["error"],
"semi": ["error"],
"semi-spacing": ["error"],
"semi-style": ["error"],
}
}
]);
Loading