Compare commits
270 commits
archive/v8
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77dbccfc7e | ||
|
|
b80f4bd053 | ||
|
|
14e1f1f935 | ||
|
|
527221462b | ||
|
|
009836647b | ||
|
|
8b25af88e0 | ||
|
|
de2cde4541 | ||
|
|
8240668a5c | ||
|
|
8a79e063e8 | ||
|
|
fdc0246c0a | ||
|
|
4cb20539fd | ||
|
|
06d02c42f1 | ||
|
|
660e4c34d9 | ||
|
|
d17d008d7e | ||
|
|
c5799fb986 | ||
|
|
39f49aa54c | ||
|
|
abd87fafd2 | ||
|
|
b462e42d33 | ||
|
|
2c4ea3ebad | ||
|
|
389ad9e5ec | ||
|
|
0d8fc89bf5 | ||
|
|
ce0781536c | ||
|
|
58a6de3a5d | ||
|
|
eb3a44a759 | ||
|
|
b0f7eb1922 | ||
|
|
1a6a5828dc | ||
|
|
76375ad02a | ||
|
|
ddca0f3038 | ||
|
|
4fe4efd95a | ||
|
|
833b323267 | ||
|
|
c1b1a9de4c | ||
|
|
72b0d4bbac | ||
|
|
91199d3460 | ||
|
|
c04c83c22a | ||
|
|
82e169150e | ||
|
|
1bd272ec8d | ||
|
|
1616fa21f2 | ||
|
|
920d9f198f | ||
|
|
f82c2de301 | ||
|
|
1e0508ac85 | ||
|
|
84f8605269 | ||
|
|
ef0f7055a0 | ||
|
|
5b578806c7 | ||
|
|
b06c338c20 | ||
|
|
9c3ffcc58e | ||
|
|
3ca47ce108 | ||
|
|
702bc64bc3 | ||
|
|
b34b24e783 | ||
|
|
5bd87033e2 | ||
|
|
927b68dab7 | ||
|
|
5aa0169e81 | ||
|
|
9ff01d1d7d | ||
|
|
16f1976e28 | ||
|
|
3d4a8f43aa | ||
|
|
5b335d2bff | ||
|
|
8736491818 | ||
|
|
037a2bf8c3 | ||
|
|
fcbf8d2e3a | ||
|
|
cc8a8bf801 | ||
|
|
bab09be364 | ||
|
|
7a0167f31b | ||
|
|
47fb761c71 | ||
|
|
18980488c6 | ||
|
|
3e844696b0 | ||
|
|
4bbe97f887 | ||
|
|
a9b94c27d4 | ||
|
|
d2b05a1b1b | ||
|
|
a03f7d111b | ||
|
|
87ce59dab6 | ||
|
|
77ec7e5a56 | ||
|
|
6de99225c4 | ||
|
|
6c0cbf2737 | ||
|
|
b0fca23a20 | ||
|
|
96a904db0d | ||
|
|
41c109416f | ||
|
|
208b37ce75 | ||
|
|
9bd33020ae | ||
|
|
e506f5e37e | ||
|
|
89179de230 | ||
|
|
d235862eb2 | ||
|
|
2226483ed3 | ||
|
|
ed7455985a | ||
|
|
42a9018e87 | ||
|
|
2e9584e39e | ||
|
|
4ab3de409e | ||
|
|
aab156560f | ||
|
|
3e09ab61a5 | ||
|
|
cad7ad2ceb | ||
|
|
af5352eba2 | ||
|
|
20cb82ec7b | ||
|
|
c9e92d92f8 | ||
|
|
9bc00baa38 | ||
|
|
0d1d6e5490 | ||
|
|
32a7cc3b7c | ||
|
|
35f212056f | ||
|
|
70bca2737c | ||
|
|
3d57ffe3c2 | ||
|
|
267432bb28 | ||
|
|
9a97b7937e | ||
|
|
0c2011f070 | ||
|
|
d662a38ac7 | ||
|
|
826d37a374 | ||
|
|
c1b9432a2b | ||
|
|
366eca019d | ||
|
|
fcf0bbb1d9 | ||
|
|
2519ed3d8c | ||
|
|
feb8f6d0f5 | ||
|
|
8a1a8abae7 | ||
|
|
105b58a5c4 | ||
|
|
382d5d0030 | ||
|
|
50a33d4f8d | ||
|
|
e0899932b1 | ||
|
|
b077371d1f | ||
|
|
037d9cf26c | ||
|
|
064a868d62 | ||
|
|
bf52d776ff | ||
|
|
fc1a07b129 | ||
|
|
19a3856768 | ||
|
|
fc414951d1 | ||
|
|
835cb237d7 | ||
|
|
af9494ecce | ||
|
|
eabf4254b1 | ||
|
|
e05f146b28 | ||
|
|
a0cd959a93 | ||
|
|
4e398bc9fd | ||
|
|
0eb1582f7d | ||
|
|
c5124db29f | ||
|
|
e2566121d9 | ||
|
|
2dac102f3e | ||
|
|
26255f8995 | ||
|
|
bc23ccc1aa | ||
|
|
b2ca3f6c0b | ||
|
|
fc2f38543c | ||
|
|
154eda0aa2 | ||
|
|
095908302f | ||
|
|
30509de370 | ||
|
|
0fae05e33a | ||
|
|
5dc222a0df | ||
|
|
202b9946e2 | ||
|
|
5d4397d38b | ||
|
|
7a0695ac9c | ||
|
|
ff7eb81e87 | ||
|
|
4d4ebf2d09 | ||
|
|
aae0bd2420 | ||
|
|
952337be6e | ||
|
|
fff4d0b286 | ||
|
|
4f1a8960f1 | ||
|
|
4c35560f6c | ||
|
|
b456823df3 | ||
|
|
4cbc02a2d3 | ||
|
|
bd39e6fba7 | ||
|
|
d9d7e79f0e | ||
|
|
b4e4252d5c | ||
|
|
ab37a135af | ||
|
|
bd28f8590b | ||
|
|
162a2fbac3 | ||
|
|
4d66649ff8 | ||
|
|
a2e67033c8 | ||
|
|
d6ff02f284 | ||
|
|
187859b1c9 | ||
|
|
4887562cc7 | ||
|
|
643fbbe90d | ||
|
|
5c45c17992 | ||
|
|
7616e93dae | ||
|
|
155051c5fe | ||
|
|
82edb6b284 | ||
|
|
c18f175b08 | ||
|
|
7d325d424a | ||
|
|
6d2ab6e0f9 | ||
|
|
71ec6f76cc | ||
|
|
a385089fe8 | ||
|
|
05051ea9f9 | ||
|
|
d495678ac2 | ||
|
|
06dbe99cae | ||
|
|
0b5bc42587 | ||
|
|
35680e719b | ||
|
|
620ad25c61 | ||
|
|
deda273eda | ||
|
|
fd8aaf543e | ||
|
|
8cb2513610 | ||
|
|
a68f0c7e42 | ||
|
|
c63662f602 | ||
|
|
6b227f241b | ||
|
|
1a9e4097fb | ||
|
|
f16ae279e2 | ||
|
|
c4d2c5b408 | ||
|
|
70bff6156a | ||
|
|
5fe93963f3 | ||
|
|
2425f07d6b | ||
|
|
66ba178ea7 | ||
|
|
5f8c941d0b | ||
|
|
f6026c6977 | ||
|
|
a10592a031 | ||
|
|
e571cc301c | ||
|
|
ce5c4e5345 | ||
|
|
3fd603667d | ||
|
|
df96ced6d9 | ||
|
|
8f1feb8cff | ||
|
|
8d726133bc | ||
|
|
10992aad3c | ||
|
|
88b24b55e6 | ||
|
|
22b0c1ebf9 | ||
|
|
ac3154e334 | ||
|
|
d313ac55d9 | ||
|
|
e96af1f6fb | ||
|
|
f0c9b7eb82 | ||
|
|
c654694603 | ||
|
|
8817a12ede | ||
|
|
b38dcc09aa | ||
|
|
dcbde420a4 | ||
|
|
c8a07a5777 | ||
|
|
9a2306a9a8 | ||
|
|
b716dc5b35 | ||
|
|
4a4a430b47 | ||
|
|
c5a73a13ea | ||
|
|
3511d7b32f | ||
|
|
6854ba70e2 | ||
|
|
b5e9bdb1d5 | ||
|
|
68b1b4c2e2 | ||
|
|
9b6caebfa6 | ||
|
|
b3947909a0 | ||
|
|
709c2f3f7b | ||
|
|
344fbdea9f | ||
|
|
26fb0486fd | ||
|
|
c9a02c2351 | ||
|
|
e0805868a6 | ||
|
|
69a86b5a14 | ||
|
|
e78eb63e4e | ||
|
|
948611f434 | ||
|
|
52d47b4247 | ||
|
|
6c6452c126 | ||
|
|
3b00a749b5 | ||
|
|
5ae0aad1d6 | ||
|
|
1979bae370 | ||
|
|
bdea8efb53 | ||
|
|
315204e5d7 | ||
|
|
053f2c1e66 | ||
|
|
088071fa38 | ||
|
|
607adcf737 | ||
|
|
d3b3f1f676 | ||
|
|
441248f737 | ||
|
|
ad195b22db | ||
|
|
99efa86c58 | ||
|
|
c8a88b837f | ||
|
|
a2b21a141a | ||
|
|
634c88d8d1 | ||
|
|
a38f1b20ec | ||
|
|
6014409d3d | ||
|
|
ee0306cda8 | ||
|
|
5c492410be | ||
|
|
e606fc9985 | ||
|
|
471dca4661 | ||
|
|
5d6b7b74c4 | ||
|
|
e91a913b62 | ||
|
|
f8a6d2bc3d | ||
|
|
0738579074 | ||
|
|
7909244e95 | ||
|
|
7f6b5638de | ||
|
|
68a8be1427 | ||
|
|
0262ee9ff0 | ||
|
|
721fa7bcda | ||
|
|
98cf07b676 | ||
|
|
2b7380ba57 | ||
|
|
6162b3e27f | ||
|
|
8d7cc2cec1 | ||
|
|
e52c45b345 | ||
|
|
ed919b2f21 | ||
|
|
781a31d3bb | ||
|
|
a62534618b | ||
|
|
b38a597b7e |
11
.astro/astro/env.d.ts
vendored
|
|
@ -1,11 +0,0 @@
|
|||
declare module 'astro:env/client' {
|
||||
export const VERSION: string;
|
||||
export const MARKETPLACE_ENABLED: boolean;
|
||||
|
||||
}
|
||||
|
||||
declare module 'astro:env/server' {
|
||||
|
||||
|
||||
export const getSecret: (key: string) => string | undefined;
|
||||
}
|
||||
9167
.astro/icon.d.ts
vendored
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"_variables": {
|
||||
"lastUpdateCheck": 1730783343720
|
||||
}
|
||||
}
|
||||
2
.astro/types.d.ts
vendored
|
|
@ -1,2 +0,0 @@
|
|||
/// <reference types="astro/client" />
|
||||
/// <reference path="astro/env.d.ts" />
|
||||
12
.changeset/config.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
|
||||
"changelog": ["@changesets/changelog-github", { "repo": "nebulaservices/nebula" }],
|
||||
"commit": false,
|
||||
"fixed": [],
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "main",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": [],
|
||||
"privatePackages": { "version": true, "tag": true }
|
||||
}
|
||||
|
|
@ -3,3 +3,15 @@ node_modules/
|
|||
npm-debug.log
|
||||
yarn-error.log
|
||||
.github/
|
||||
.env.example
|
||||
.env
|
||||
dist/
|
||||
.git/
|
||||
.astro/
|
||||
~/
|
||||
.gitignore
|
||||
biome.json
|
||||
docker-compose.yml
|
||||
Dockerfile
|
||||
README.md
|
||||
db/
|
||||
|
|
|
|||
1
.env
|
|
@ -1 +0,0 @@
|
|||
MASQR=1
|
||||
50
.github/workflows/docker.yml
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
name: Build Docker image
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
name: Build and push Docker image to registry
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'nebulaservices'
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Setup docker buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login To registry ${{ env.REGISTRY }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ github.token }}
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/nebulaservice/nebula
|
||||
- name: Build and push
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
file: ./Dockerfile
|
||||
name: nebula
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
50
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
FORCE_COLOR: true
|
||||
|
||||
jobs:
|
||||
changelog:
|
||||
name: Release TAG
|
||||
if: ${{ github.repository_owner == 'nebulaservices' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 9.1.1
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
|
||||
- name: Create Release Pull Request or Publish
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
version: pnpm run version
|
||||
publish: pnpm exec changeset publish
|
||||
commit: "[ci] release"
|
||||
title: "[ci] release"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
52
.gitignore
vendored
|
|
@ -1,25 +1,43 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
# build output
|
||||
dist/
|
||||
server/*.js
|
||||
|
||||
# generated types
|
||||
.astro/
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
package-lock.json
|
||||
|
||||
#external assets
|
||||
database_assets/*
|
||||
!database_assets/com.nebula.gruvbox/
|
||||
!database_assets/com.nebula.lightTheme/
|
||||
!database_assets/com.nebula.oled/
|
||||
!database_assets/com.nebula.retro/
|
||||
|
||||
# logs
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
package-lock.json
|
||||
# environment variables
|
||||
.env
|
||||
.env.production
|
||||
|
||||
dist-ssr
|
||||
dist
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
# macOS-specific files
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# jetbrains setting folder
|
||||
.idea/
|
||||
|
||||
# nebula catalog database
|
||||
database.sqlite
|
||||
|
||||
|
||||
# YOUR config
|
||||
config.toml
|
||||
|
||||
# Goofy PNPM problem
|
||||
~/
|
||||
|
|
|
|||
3
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "workerware"]
|
||||
path = workerware
|
||||
url = https://github.com/mercuryworkshop/workerware
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# Build artifacts
|
||||
dist/
|
||||
|
||||
# Other things that don't need to be reformatted
|
||||
public/uv/
|
||||
public/dynamic/
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
package.json
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"singleQuote": false,
|
||||
"endOfLine": "crlf",
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"trailingComma": "none",
|
||||
"plugins": ["prettier-plugin-tailwindcss"]
|
||||
}
|
||||
4
.vscode/extensions.json
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"recommendations": ["astro-build.astro-vscode"],
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
11
.vscode/launch.json
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "./node_modules/.bin/astro dev",
|
||||
"name": "Development server",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
12
.vscode/settings.json
vendored
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"editor.tabSize": 2,
|
||||
"editor.insertSpaces": true,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"files.autoSave": "afterDelay",
|
||||
"files.autoSaveDelay": 0,
|
||||
"css.lint.unknownAtRules": "ignore",
|
||||
"editor.linkedEditing": true,
|
||||
"css.lint.unknownProperties": "ignore"
|
||||
}
|
||||
36
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# v9.0.0
|
||||
|
||||
- The first release of Nebula V9! And with it bring a whole host of changes:
|
||||
- More stable the V8
|
||||
- Adds a Marketplace where users can create their own themes & plugins
|
||||
- Switches to Astro for speed
|
||||
- Other general bug fixes
|
||||
|
||||
# v9.0.1
|
||||
|
||||
- Bumps dependencies
|
||||
- Fixes bugs
|
||||
|
||||
# 9.0.2
|
||||
|
||||
- Adds the ability for a custom wisp server back
|
||||
- Increases upload fileSize capacity in hopes that bigger files can now be uploaded
|
||||
|
||||
# 9.0.3
|
||||
|
||||
- Bugfix: themes with caps don't uninstall - fixed
|
||||
- Rewrite: InstalledThemes and InstalledPlugins are now in Astro instead of Svelte
|
||||
|
||||
# 9.0.4
|
||||
|
||||
- General Bugfixes
|
||||
- Removes Svelte except for 2 componenents
|
||||
- Scramjet :rocket:
|
||||
|
||||
# 9.1.0
|
||||
|
||||
- Rewrites everything in the [utils/](./src/utils) folder
|
||||
- Bugfixes
|
||||
- Better logging
|
||||
- Mobile nav jank is gone
|
||||
- Component cleanup
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Welcome to nginx!</title>
|
||||
<style>
|
||||
html {
|
||||
color-scheme: light dark;
|
||||
}
|
||||
body {
|
||||
width: 35em;
|
||||
margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to nginx!</h1>
|
||||
<p>
|
||||
If you see this page, the nginx web server is successfully installed and
|
||||
working. Further configuration is required. If you are expecting another
|
||||
page, please check your network or
|
||||
<a href="/" id="rcheck"><b>Refresh this page</b></a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For online documentation and support please refer to
|
||||
<a href="http://nginx.org/">nginx.org</a>.<br />
|
||||
Commercial support is available at
|
||||
<a href="http://nginx.com/">nginx.com</a>.
|
||||
</p>
|
||||
|
||||
<p><em>Thank you for using nginx.</em></p>
|
||||
<script>
|
||||
if (!localStorage["auth"] && new URL(document.all.rcheck.href).password) {
|
||||
window.location.reload();
|
||||
localStorage["auth"] = 1;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
13
Dockerfile
|
|
@ -1,14 +1,19 @@
|
|||
FROM node:21-alpine
|
||||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json .
|
||||
COPY . .
|
||||
|
||||
RUN apk update
|
||||
RUN apk add python3 py3-pip alpine-sdk openssl-dev build-base python3-dev
|
||||
RUN python3 -m pip install setuptools --break-system-packages
|
||||
RUN cp -n config.example.toml config.toml
|
||||
RUN npm i -g pnpm
|
||||
RUN pnpm install
|
||||
RUN pnpm run build
|
||||
|
||||
RUN export TERM=xterm-256color
|
||||
VOLUME /app
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["pnpm", "start"]
|
||||
ENTRYPOINT ["pnpm"]
|
||||
CMD ["start", "--color"]
|
||||
|
|
|
|||
661
LICENSE
Normal file
|
|
@ -0,0 +1,661 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
390
README.md
|
|
@ -1,67 +1,371 @@
|
|||
# Nebula
|
||||
<div align="center">
|
||||
|
||||
NebulaWeb is an official flagship of Nebula Services and Nebula Developer Labs. NebulaWeb is a stunning, sleek, and functional web-proxy with support for thousands of popular sites. With NebulaWeb, the sky is the limit.
|
||||
<img src="https://socialify.git.ci/nebulaservices/nebula/image?description=1&font=Inter&forks=1&issues=1&language=1&name=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark" alt="ruby" width="640" height="320" />
|
||||
|
||||

|
||||
<img alt="repo size" src="https://img.shields.io/github/repo-size/nebulaservices/nebula?style=for-the-badge"></img>
|
||||
<img alt="website status" src="https://img.shields.io/website?url=https%3A%2F%2Fnebulaproxy.io&style=for-the-badge"></img>
|
||||
<img alt="commit a week" src="https://img.shields.io/github/commit-activity/w/nebulaservices/nebula?style=for-the-badge"></img>
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
<h2>Get Started</h2>
|
||||
<a>To get started, press one of the buttons below to deploy Nebula</a>
|
||||
<br />
|
||||
<br />
|
||||
<a href="#terminal">
|
||||
<img src="https://img.shields.io/badge/terminal-%23121011.svg?style=for-the-badge&logo=gnu-bash&logoColor=white" alt="Terminal">
|
||||
</img>
|
||||
</a>
|
||||
<a href="#docker">
|
||||
<img src="https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white" alt="Docker">
|
||||
</img>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
## NOTE:
|
||||
|
||||
- This will **NOT** deploy on GitHub Pages, Netlify, Vercel, Gitlab Pages, or any other _static_ host
|
||||
- This will **NOT** work on Render
|
||||
---
|
||||
|
||||
## How to get links
|
||||
|
||||
[](https://discord.gg/unblocker)
|
||||
[](https://discord.gg/unblock)
|
||||
|
||||
---
|
||||
|
||||
## Features
|
||||
|
||||
- Stunning and highly functional UI
|
||||
- 3 different backend proxies
|
||||
- Hides your IP from sites
|
||||
- [List of officially supported sites](https://github.com/NebulaServices/Nebula/blob/dev/docs/officially-supported-sites.md)
|
||||
- Full mobile support
|
||||
- `about:blank` cloaking)
|
||||
- Multiple Proxy "Backends":
|
||||
- [Ultraviolet](https://github.com/titaniumnetwork-dev/ultraviolet)
|
||||
- [RammerHead](https://github.com/binary-person/rammerhead)
|
||||
---
|
||||
|
||||
# Deployment
|
||||
## Contributors
|
||||
|
||||
Table of contents
|
||||
- [Rifting](https://github.com/rifting) - Owner & Maintainer
|
||||
- [MotorTruck1221](https://motortruck1221.com) - Maintainer
|
||||
---
|
||||
|
||||
- Deployment
|
||||
## Tech Stack
|
||||
|
||||
- [Astro](https://astro.build)
|
||||
- [Fastify](https://fastify.dev)
|
||||
- [Ultraviolet](https://github.com/titaniumnetwork-dev/ultraviolet)
|
||||
- [RammerHead](https://github.com/binary-person/rammerhead)
|
||||
- [Epoxy](https://github.com/mercuryworkshop/epoxy-tls)
|
||||
- [Libcurl.js](https://github.com/ading2210/libcurl.js)
|
||||
- HTML, CSS, and JavaScript (DUH)
|
||||
---
|
||||
|
||||
## Catalog/Marketplace
|
||||
|
||||
- By default, the marketplace is enabled and uses SQLite
|
||||
- If you would like to disable the catalog, see [#config](#config)
|
||||
- For big production instances, I recommend using PostgreSQL rather than SQLite. To do this see [#config](#config)
|
||||
- To use PostgreSQL via the provided docker-compose files, see [#docker](#docker)
|
||||
|
||||
### How to make a theme
|
||||
|
||||
- Themes allow you to customize Nebula's *look*.
|
||||
|
||||
#### Prerequisites:
|
||||
- Make sure you have our [Discord server](https://discord.gg/unblocker) so you can submit your theme
|
||||
|
||||
##### Making the themes:
|
||||
|
||||
1. Firstly, copy the CSS vars:
|
||||
```css
|
||||
:root {
|
||||
--background-primary: /*Your stuff here */;
|
||||
--background-lighter: ;
|
||||
--navbar-color: ;
|
||||
--navbar-text-color: ;
|
||||
--navbar-link-color: ;
|
||||
--navbar-link-hover-color: ;
|
||||
--input-text-color: ;
|
||||
--input-placeholder-color: ;
|
||||
--input-background-color: ;
|
||||
--input-border-color: ;
|
||||
--tab-color: ;
|
||||
--border-color: ;
|
||||
}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> You can add a custom font as well! To do so, add this to your `:root`
|
||||
>
|
||||
> ```css
|
||||
> --font-family: /* Font family name */;
|
||||
> ```
|
||||
>
|
||||
> And this to the bottom of your CSS file/submission:
|
||||
> ```css
|
||||
> @font-face {
|
||||
> font-family: /* Name */;
|
||||
> src: url(/* Where the font is located! Local or external work! */);
|
||||
> }
|
||||
> ```
|
||||
>
|
||||
> A good example of using a custom font is the built-in `retro` theme [here](./database_assets/com.nebula.retro)
|
||||
|
||||
2. Add your colors and test! (Either with a self-hosted version of Nebula OR via a live preview (no clue when this will happen)
|
||||
|
||||
3. Once you're satisfied with the colors, submit your theme to the [Discord Server](https://discord.gg/unblocker)!
|
||||
|
||||
---
|
||||
### How to make a plugin
|
||||
|
||||
- Plugins extend the functionality of either the proxied page(s) or the service worker.
|
||||
- This guide provides an incredibly basic example of how to make either.
|
||||
|
||||
#### Prerequisites:
|
||||
- Make sure you have joined our [Discord server](https://discord.gg/unblocker) so you can submit your plugin.
|
||||
- Some knowledge of JS/TS
|
||||
|
||||
##### Serviceworker plugin:
|
||||
|
||||
- These plugins are handled by Workerware see [here](https://github.com/mercuryworkshop/workerware) for docs.
|
||||
|
||||
1. Create an index.js (or other file name) file:
|
||||
```bash
|
||||
touch index.js
|
||||
```
|
||||
|
||||
2. Edit that file to include either of these:
|
||||
- Code encased in a string:
|
||||
```js
|
||||
function setup() {
|
||||
// This function MUST return the following attributes:
|
||||
return {
|
||||
function: `console.log('Example code.')`,
|
||||
name: 'com.example', // Technically, it could be named anything. It is recommended to use the same name for everything (name when submitting and this)
|
||||
events: ['fetch'] // See: https://github.com/mercuryworkshop/workerware for the event types you can use. (Also typed if you are using typescript)
|
||||
}
|
||||
}
|
||||
|
||||
//This can be named anything. However, it's recommended to use `entryFunc` (with types, the naming IS enforced)
|
||||
self.entryFunc = setup; //DO NOT call the function here. Only assign the reference otherwise, it will error.
|
||||
```
|
||||
- Code in an arrow function:
|
||||
```js
|
||||
const example = () => {
|
||||
console.log('Example code')
|
||||
}
|
||||
|
||||
function setup() {
|
||||
//This function MUST return the following attributes:
|
||||
return {
|
||||
function: example, //Do not call the function, only assign the reference to the function.
|
||||
name: 'com.example', // Technicall could be name anything. Recommended to use the same name for everything (name when submitting and this)
|
||||
event: ['fetch'] // Se https://github.com/mercuryworkshop/workerware for the event types you can use. (Also typed if using typescript)
|
||||
}
|
||||
}
|
||||
|
||||
//This can be named anything. However, it's recommended to use `entryFunc` (with types, the naming IS enforced)
|
||||
self.entryFunc = setup; //DO NOT call the function here. Only assign the reference; otherwise, it will result in an error.
|
||||
```
|
||||
|
||||
> [!WARNING]
|
||||
> The only *allowed* way to pass code to the `function` param is either a string or an arrow function. Named functions ***WILL NOT WORK***.
|
||||
>
|
||||
> Example of a named function: `function example() {/* Some form of code */}`.
|
||||
>
|
||||
> If a named function is used where it shouldn't be, your plugin will not be approved, nor will it work properly.
|
||||
|
||||
3. Submit your plugin in the [Discord](https://discord.gg/unblocker)!
|
||||
|
||||
##### Proxied page plugins
|
||||
|
||||
- They allow modification of websites that UV proxies, (EX: you could add Vencord to Discord with this)
|
||||
|
||||
1. Create an index.js file (or another file name)
|
||||
```bash
|
||||
touch index.js
|
||||
```
|
||||
|
||||
2. Edit that file with your code and the following:
|
||||
```js
|
||||
//Name this whatever.
|
||||
function example() {
|
||||
//You MUST return the following
|
||||
return {
|
||||
host: "example.com", //The host to match (so if the user visits example.com it will inject the html below.
|
||||
html: "<script>console.log('Example')</script>", //Must return a string (and be valid HTML or your plugin will break). How you get that string is up to you
|
||||
injectTo: "head" // Can be "head" or "body"
|
||||
}
|
||||
}
|
||||
|
||||
// Technically, this could be named anything, it is recommended to call it `entryFunc`
|
||||
self.entryFunc = example; //DO NOT run the function here. That will cause errors. Only assign the reference to the function here.
|
||||
```
|
||||
|
||||
3. Submit it in our [Discord](https://discord.gg/unblocker)!
|
||||
|
||||
---
|
||||
|
||||
## Deployment
|
||||
|
||||
Run these commands on your server:
|
||||
`git clone https://github.com/NebulaServices/Nebula.git`
|
||||
`pnpm i`
|
||||
`npm run bstart`
|
||||
### Terminal
|
||||
|
||||
You may also need to run `npm i -g pnpm tsx`
|
||||
Thanks for using Nebula!
|
||||
Prerequisites:
|
||||
- Node & npm
|
||||
- Git
|
||||
|
||||
## Tech Stack
|
||||
1. Clone the repo:
|
||||
```bash
|
||||
git clone https://github.com/nebulaservices/nebula --recursive && cd nebula
|
||||
```
|
||||
|
||||
- TypeScript, Tailwind
|
||||
- Fastify
|
||||
- TSX
|
||||
- Framer motion
|
||||
- react-i18next
|
||||
- Ultraviolet (proxy)
|
||||
- Dynamic (proxy)
|
||||
- Rammerhead (proxy)
|
||||
- TompHTTP Bare Server Node
|
||||
2. Install all of the dependencies:
|
||||
```bash
|
||||
npm i
|
||||
```
|
||||
|
||||
## Support
|
||||
3. Create a `config.toml` file
|
||||
```bash
|
||||
cp config.example.toml config.toml
|
||||
```
|
||||
|
||||
For support, join our discord: discord.gg/unblocker
|
||||
4. Modify the `config.toml` file to your liking (docs [here](#environment))
|
||||
```
|
||||
nano config.toml
|
||||
```
|
||||
|
||||
## Demo
|
||||
5. Build the front end & server:
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
[Click here to see a demo of Nebula](https://nebulaproxy.io/)
|
||||
6. Start the server
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
## Acknowledgements
|
||||
> [!NOTE]
|
||||
> You can run `npm run bstart` to build and start together
|
||||
---
|
||||
|
||||
- [UV (one of the proxies we use)](https://github.com/titaniumnetwork-dev/Ultraviolet)
|
||||
- [Dynamic (one of the proxies we use)](https://github.com/NebulaServices/Dynamic)
|
||||
- [Rammerhead (one of the proxies we use)](https://github.com/binary-person/rammerhead)
|
||||
- [Bare Server Node](https://github.com/tomphttp/bare-server-node)
|
||||
- [Catppuccin (for the themes)](https://github.com/catppuccin/catppuccin)
|
||||
### Docker
|
||||
|
||||
## License
|
||||
- There are two ways to deploy with docker:
|
||||
- [Normal docker](#normal-docker)
|
||||
- [Docker Compose](#docker-compose)
|
||||
|
||||
(Nebula's license is now GNU AGPL V3 as of v7.10)
|
||||
Copyright Nebula Services 2021 - Present
|
||||
<br>
|
||||
This project uses the AGLP GNU V3 license.
|
||||
#### Normal Docker
|
||||
|
||||
Prerequisites:
|
||||
- Git
|
||||
- Docker
|
||||
|
||||
1. Clone the repo (skip if using a prebuilt image):
|
||||
```bash
|
||||
git clone https://github.com/nebulaservices/nebula --recursive && cd nebula
|
||||
```
|
||||
|
||||
2. Create an `config.toml` file (if using prebuilt image, copy the example from the repo):
|
||||
```bash
|
||||
cp config.example.toml config.toml
|
||||
```
|
||||
|
||||
3. Modify the `config.toml` file to your liking (docs [here](#environment))
|
||||
```bash
|
||||
nano config.toml
|
||||
```
|
||||
|
||||
4. Build the docker image (skip if using prebuilt):
|
||||
```bash
|
||||
docker build nebula:latest
|
||||
```
|
||||
5. Run the docker images:
|
||||
|
||||
- Prebuilt:
|
||||
```bash
|
||||
docker run -v ./config.toml:/app/config.toml ghcr.io/nebulaservices/nebula:latest
|
||||
```
|
||||
- Image you built yourself:
|
||||
```bash
|
||||
docker run -v ./config.toml:/app/config.toml nebula:latest
|
||||
```
|
||||
|
||||
#### Docker Compose
|
||||
|
||||
Prerequisites:
|
||||
- Git
|
||||
- Docker w/compose
|
||||
|
||||
1. Clone the repo (skip if using a prebuilt image):
|
||||
```bash
|
||||
git clone https://github.com/nebulaservices/nebula --recursive
|
||||
```
|
||||
|
||||
2. Create an `config.toml` file (if using prebuilt image, copy the example from the repo):
|
||||
```bash
|
||||
cp config.example.toml config.toml
|
||||
```
|
||||
|
||||
3. Modify the `config.toml` file to your liking (docs on that [here](#environment)]
|
||||
```bash
|
||||
nano config.toml
|
||||
```
|
||||
|
||||
4. Build the docker image (skip if using prebuilt):
|
||||
```bash
|
||||
docker compose -f ./docker-compose.build.yml build
|
||||
```
|
||||
|
||||
5. Run the docker image:
|
||||
|
||||
- Prebuilt:
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
- Image you built yourself:
|
||||
```bash
|
||||
docker compose -f ./docker-compose.build.yml up
|
||||
```
|
||||
#### Extra (Postgres)
|
||||
|
||||
- To use Postgres over SQLite, uncomment the DB section in the `docker-compose` file (or use your own Postgres DB!). Then, modify the `config.toml` (See: [#config](#config) for knowledge on how to do this)
|
||||
- To use Postgres over SQLite in a normal docker environment (no compose), you'll have to set one up and then modify the `config.toml` to use it. (See: [#config](#config) for knowledge on how to do this)
|
||||
|
||||
---
|
||||
|
||||
## Config
|
||||
|
||||
There are a couple of configuration options for Nebula. The defaults are fine most of the time, but there are instances where you may not want certain options enabled or certain things running.
|
||||
- An example config file is located [here](./config.example.toml).
|
||||
- Config format is in TOML
|
||||
|
||||
| Variable | Description | Type | Default |
|
||||
|:----------:|:-------------:|:------:|:---------:|
|
||||
| `marketplace` | The options below are for the marketplace section | `object` | N/A |
|
||||
| `enabled` | Enable marketplace functionality | `boolean` | `true` |
|
||||
| `psk` | The password and authentication key for the marketplace. ***CHANGE FROM DEFAULT*** | `string` | `CHANGEME` |
|
||||
|----------------------------| ----------------------------------------------------------------------------|------------|--------------|
|
||||
| `db` | The below options are for the db (database) section | `object` | N/A |
|
||||
| `name` | The database name to use | `string` | `database` |
|
||||
| `username` | The username for the DB | `string` | `username` |
|
||||
| `password` | The database password. ***CHANGE FROM DEFAULT VALUE*** | `string` | `password` |
|
||||
| `postgres` | Whether to use postgres over sqlite *(recommended for large production instances)* | `boolean` | `false` |
|
||||
|----------------------------| ----------------------------------------------------------------------------|------------|--------------|
|
||||
| `postgres` | The below options are for the postgres section. (Only worry about this if you enabled postgres in the db section.) | `object` | N/A |
|
||||
| `domain` | Either the TLD or the IP address of your postgres server. | `string` | `''` |
|
||||
| `port` | The port your postgres server is listening on | `number` | `5432` |
|
||||
|----------------------------| ----------------------------------------------------------------------------|------------|--------------|
|
||||
| `server.server` | The below options are to configure the server. | `object` | N/A |
|
||||
| `port` | What port the server should listen on. *(Note: Can also be configured via environment variable `PORT`)* | `number` | `8080` |
|
||||
| `wisp` | Whether the server should use the inbuilt wisp server. (Disabled if your using an external wisp server) | `boolean` | `true` |
|
||||
| `logging` | Whether or not to enable logging. *Note: Logs are massive* | `boolean` | `true` |
|
||||
|----------------------------| ----------------------------------------------------------------------------|------------|--------------|
|
||||
|
||||
## Deploying
|
||||
### Koyeb
|
||||
- First setup the config.toml file with the docker-compose instructions!
|
||||
- Fork this repo
|
||||
- Create new koyeb service, and select webservice
|
||||
- Select import from github and import your forked repo
|
||||
- Change package to dockerfile and press deploy!
|
||||
|
|
|
|||
133
astro.config.ts
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
import { fileURLToPath } from "node:url";
|
||||
import node from "@astrojs/node";
|
||||
import svelte from "@astrojs/svelte";
|
||||
import tailwind from "@astrojs/tailwind";
|
||||
import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
|
||||
import { epoxyPath } from "@mercuryworkshop/epoxy-transport";
|
||||
import { libcurlPath } from "@mercuryworkshop/libcurl-transport";
|
||||
import playformCompress from "@playform/compress";
|
||||
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
|
||||
import { scramjetPath } from "@mercuryworkshop/scramjet";
|
||||
import icon from "astro-icon";
|
||||
import { defineConfig, envField } from "astro/config";
|
||||
import { viteStaticCopy } from "vite-plugin-static-copy";
|
||||
import { version } from "./package.json";
|
||||
import { parsedDoc } from "./server/config.js";
|
||||
const workerwarePath = fileURLToPath(new URL("./workerware/src", import.meta.url));
|
||||
|
||||
export default defineConfig({
|
||||
site: parsedDoc.seo.enabled ? parsedDoc.seo.domain || process.env.SITE : 'http://localhost:4321',
|
||||
env: {
|
||||
schema: {
|
||||
VERSION: envField.string({
|
||||
context: "client",
|
||||
access: "public",
|
||||
optional: true,
|
||||
default: version
|
||||
}),
|
||||
MARKETPLACE_ENABLED: envField.boolean({
|
||||
context: "client",
|
||||
access: "public",
|
||||
optional: true,
|
||||
default: parsedDoc.marketplace.enabled
|
||||
}),
|
||||
SEO: envField.string({
|
||||
context: "client",
|
||||
access: "public",
|
||||
optional: true,
|
||||
default: JSON.stringify({
|
||||
enabled: parsedDoc.seo.enabled,
|
||||
domain: new URL(parsedDoc.seo.domain).host
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
integrations: [
|
||||
tailwind(),
|
||||
//sitemap(),
|
||||
icon(),
|
||||
svelte(),
|
||||
playformCompress({
|
||||
CSS: false,
|
||||
HTML: true,
|
||||
Image: true,
|
||||
JavaScript: true,
|
||||
SVG: true
|
||||
})
|
||||
],
|
||||
vite: {
|
||||
plugins: [
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
{
|
||||
src: `${uvPath}/**/*`.replace(/\\/g, "/"),
|
||||
dest: "uv",
|
||||
overwrite: false
|
||||
},
|
||||
{
|
||||
src: `${epoxyPath}/**/*`.replace(/\\/g, "/"),
|
||||
dest: "epoxy",
|
||||
overwrite: false
|
||||
},
|
||||
{
|
||||
src: `${libcurlPath}/**/*`.replace(/\\/g, "/"),
|
||||
dest: "libcurl",
|
||||
overwrite: false
|
||||
},
|
||||
{
|
||||
src: `${scramjetPath}/**/*`.replace(/\\/g, "/"),
|
||||
dest: "scram",
|
||||
overwrite: false
|
||||
},
|
||||
{
|
||||
src: `${baremuxPath}/**/*`.replace(/\\/g, "/"),
|
||||
dest: "baremux",
|
||||
overwrite: false
|
||||
},
|
||||
{
|
||||
src: `${workerwarePath}/**/*`.replace(/\\/g, "/"),
|
||||
dest: "workerware",
|
||||
overwrite: false
|
||||
}
|
||||
]
|
||||
})
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
"/api/catalog-stats": {
|
||||
target: "http://localhost:8080/api/catalog-stats",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api\/catalog-stats/, "")
|
||||
},
|
||||
"/api/catalog-assets": {
|
||||
target: "http://localhost:8080/api/catalog-assets",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api\/catalog-assets/, "")
|
||||
},
|
||||
"/api/packages": {
|
||||
target: "http://localhost:8080/api/packages",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api\/packages/, "")
|
||||
},
|
||||
"/packages": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true
|
||||
},
|
||||
"/wisp/": {
|
||||
target: "ws://localhost:8080/wisp/",
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
rewrite: (path) => path.replace(/^\/wisp\//, "")
|
||||
},
|
||||
"/styles": {
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
output: "server",
|
||||
adapter: node({
|
||||
mode: "middleware"
|
||||
})
|
||||
});
|
||||
32
biome.json
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
|
||||
"files": {
|
||||
"ignore": ["~/", "**/dist/**", ".github/**"],
|
||||
"include": ["**/**", "server/**"]
|
||||
},
|
||||
"formatter": {
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 4,
|
||||
"lineWidth": 100,
|
||||
"ignore": ["pnpm-lock.yaml", "package.json"]
|
||||
},
|
||||
"organizeImports": { "enabled": true },
|
||||
"linter": { "enabled": false },
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"trailingCommas": "none",
|
||||
"quoteStyle": "double",
|
||||
"semicolons": "always"
|
||||
}
|
||||
},
|
||||
"json": {
|
||||
"parser": {
|
||||
"allowComments": true,
|
||||
"allowTrailingCommas": true
|
||||
},
|
||||
"formatter": {
|
||||
"indentStyle": "space",
|
||||
"trailingCommas": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,14 @@
|
|||
[marketplace]
|
||||
enabled = true # Turn on or off the marketplace entirely
|
||||
enabled = false # Turn on or off the marketplace entirely
|
||||
psk = "CHANGEME" # Change this to something more secure.
|
||||
level = 1
|
||||
|
||||
[seo]
|
||||
enabled = false
|
||||
domain = "https://nebulaproxy.io"
|
||||
|
||||
[db]
|
||||
name = "database" # Your databsae name
|
||||
name = "database" # Your database name
|
||||
username = "username" # The username of your DB (SQLITE just ignores this)
|
||||
password = "password" # The password to your DB (SQLITE ignores this)
|
||||
postgres = false # Enable to use postgres over sqlite (recommended for large prod instances)
|
||||
|
|
@ -17,8 +21,3 @@ port = 5432
|
|||
port = 8080
|
||||
wisp = true
|
||||
logging = true # Disable for the tons & tons of logs to go away (useful for debugging but otherwise eh)
|
||||
|
||||
[server.rammerhead] # Don't touch this section unless you KNOW what you are doing
|
||||
reverseproxy = true
|
||||
localstorage_sync = true
|
||||
http2 = true
|
||||
BIN
database.sqlite
22
database_assets/com.nebula.gruvbox/gruvbox.css
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
:root {
|
||||
--background-primary: #282828;
|
||||
--background-lighter: #3c3836;
|
||||
--navbar-color: #504945;
|
||||
--navbar-height: 60px;
|
||||
--navbar-text-color: #fbf1c7;
|
||||
--navbar-link-color: #ebdbb2;
|
||||
--navbar-link-hover-color: #fabd2f;
|
||||
--navbar-font: "Roboto", sans-serif;
|
||||
--input-text-color: #b8bb26;
|
||||
--input-placeholder-color: #928374;
|
||||
--input-background-color: #1d2021;
|
||||
--input-border-color: #b8bb26;
|
||||
--input-border-size: 1.3px;
|
||||
--navbar-logo-filter: none;
|
||||
--dropdown-option-hover-color: #665c54;
|
||||
--tab-color: #1d2021;
|
||||
--border-color: #b8bb26;
|
||||
--highlight-color: #fe8019;
|
||||
--accent-color: #83a598;
|
||||
--secondary-text-color: #d3869b;
|
||||
}
|
||||
BIN
database_assets/com.nebula.gruvbox/gruvbox.jpg
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
18
database_assets/com.nebula.lightTheme/light.css
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
:root {
|
||||
--background-primary: hsl(310 50% 90%);
|
||||
--background-lighter: hsl(310 50% 90%);
|
||||
--navbar-color: hsl(310 50% 100%);
|
||||
--navbar-height: 60px;
|
||||
--navbar-text-color: hsl(310 50% 15%);
|
||||
--navbar-link-color: hsl(310 50% 15%);
|
||||
--navbar-link-hover-color: hsl(310 50% 90%);
|
||||
--navbar-font: "Roboto";
|
||||
--input-text-color: hsl(310 50% 15%);
|
||||
--input-placeholder-color: white;
|
||||
--input-background-color: hsl(310 50% 100%);
|
||||
--input-border-color: hsl(310 50% 25%);
|
||||
--input-border-size: 1.3px;
|
||||
--navbar-logo-filter: none;
|
||||
--tab-color: var(--black);
|
||||
--border-color: hsl(310 50% 25%);
|
||||
}
|
||||
BIN
database_assets/com.nebula.lightTheme/light.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
19
database_assets/com.nebula.oled/oled.css
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
:root {
|
||||
--background-primary: #000000;
|
||||
--background-lighter: #000000;
|
||||
--navbar-color: #00000f;
|
||||
--navbar-height: 60px;
|
||||
--navbar-text-color: #4763ff;
|
||||
--navbar-link-color: #4763ff;
|
||||
--navbar-link-hover-color: gray;
|
||||
--navbar-font: "Roboto";
|
||||
--input-text-color: #4763ff;
|
||||
--input-placeholder-color: white;
|
||||
--input-background-color: #000000;
|
||||
--input-border-color: #4763ff;
|
||||
--input-border-size: 1.3px;
|
||||
--navbar-logo-filter: none;
|
||||
--dropdown-option-hover-color: #000000;
|
||||
--tab-color: #000000;
|
||||
--border-color: #4763ff;
|
||||
}
|
||||
BIN
database_assets/com.nebula.oled/oled.jpg
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
24
database_assets/com.nebula.retro/retro.css
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
:root {
|
||||
--background-primary: #000000;
|
||||
--background-lighter: #000000;
|
||||
--navbar-color: #020805;
|
||||
--navbar-height: 60px;
|
||||
--navbar-text-color: #3cb371;
|
||||
--navbar-link-color: #3cb371;
|
||||
--navbar-link-hover-color: white;
|
||||
--input-text-color: #3cb371;
|
||||
--input-placeholder-color: white;
|
||||
--input-background-color: #000000;
|
||||
--input-border-color: #3cb371;
|
||||
--input-border-size: 1.3px;
|
||||
--navbar-logo-filter: none;
|
||||
--dropdown-option-hover-color: #000000;
|
||||
--tab-color: #000000;
|
||||
--border-color: #3cb371;
|
||||
--font-family: "terminal";
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: terminal;
|
||||
src: url("./terminal.ttf");
|
||||
}
|
||||
BIN
database_assets/com.nebula.retro/retro.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
database_assets/com.nebula.retro/terminal.ttf
Normal file
21
docker-compose.build.yml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
services:
|
||||
nebula:
|
||||
image: ghcr.io/nebulaservices/nebula:latest
|
||||
container_name: nebula
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
# HOST:CONTAINER (DO NOT CHANGE THE CONTAINER PORT, UNLESS EDITED IN THE config.toml FILE)
|
||||
- 8080:8080
|
||||
volumes:
|
||||
- ./config.toml:/app/config.toml
|
||||
# Uncomment the the below stuff to use POSTGRES!
|
||||
# db:
|
||||
# image: postgres
|
||||
# restart: unless-stopped
|
||||
# environment:
|
||||
# POSTGRES_PASSWORD: password #CHANGE THIS
|
||||
# POSTGRES_USER: username
|
||||
# POSTGRES_DB: db
|
||||
# volumes:
|
||||
# - ./db:/var/lib/postgresql/data
|
||||
|
|
@ -1,13 +1,20 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
nebula:
|
||||
image: nebula:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: ghcr.io/nebulaservices/nebula:latest
|
||||
container_name: nebula
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
# Host:Container (DO NOT MODIFY THE CONTAINER PORT)
|
||||
- "8081:8080"
|
||||
# HOST:CONTAINER (DO NOT CHANGE THE CONTAINER PORT, UNLESS EDITED IN THE config.toml FILE)
|
||||
- 8080:8080
|
||||
volumes:
|
||||
- ./config.toml:/app/config.toml
|
||||
# Uncomment the the below stuff to use POSTGRES!
|
||||
# db:
|
||||
# image: postgres
|
||||
# restart: unless-stopped
|
||||
# environment:
|
||||
# POSTGRES_PASSWORD: password #CHANGE THIS
|
||||
# POSTGRES_USER: username
|
||||
# POSTGRES_DB: db
|
||||
# volumes:
|
||||
# - ./db:/var/lib/postgresql/data
|
||||
|
|
|
|||
7
framer-motion.d.ts
vendored
|
|
@ -1,7 +0,0 @@
|
|||
import * as React from "preact/compat";
|
||||
|
||||
declare module "framer-motion" {
|
||||
export interface AnimatePresenceProps {
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
}
|
||||
33
index.html
|
|
@ -1,33 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<script src="/uv/uv.bundle.js" defer></script>
|
||||
<script src="/uv/uv.config.js" defer></script>
|
||||
<script src="/dynamic/dynamic.config.js" defer></script>
|
||||
<script src="/localforage/localforage.min.js" defer></script>
|
||||
</head>
|
||||
<body style="margin: 0">
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/index.tsx"></script>
|
||||
<script>
|
||||
if (
|
||||
new URL(Object.assign(document.createElement("a"), { href: "/" }).href)
|
||||
.password
|
||||
)
|
||||
window.location.href = window.location.href;
|
||||
</script>
|
||||
<script>
|
||||
try {
|
||||
if (
|
||||
!localStorage["auth"] &&
|
||||
new URL(document.all.rcheck.href).password
|
||||
) {
|
||||
window.location.reload();
|
||||
localStorage["auth"] = 1;
|
||||
}
|
||||
} catch {}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
75
masqr.js
|
|
@ -1,75 +0,0 @@
|
|||
import fp from "fastify-plugin";
|
||||
import fs from "fs";
|
||||
const failureFile = fs.readFileSync("Checkfailed.html", "utf8");
|
||||
const LICENSE_SERVER_URL = "https://license.mercurywork.shop/validate?license=";
|
||||
const whiteListedDomain = ["nebulaproxy.io"];
|
||||
async function licenseCheck(req, pass) {
|
||||
try {
|
||||
const resp = await fetch(
|
||||
`${LICENSE_SERVER_URL}${pass}&host=${req.headers.host}`
|
||||
);
|
||||
const data = await resp.json();
|
||||
if (data.status === "License valid") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const plugin = (fastify, opts, done) => {
|
||||
fastify.addHook("onRequest", function (req, reply, next) {
|
||||
if (
|
||||
req.cookies.authcheck === "true" ||
|
||||
whiteListedDomain.includes(req.headers.host)
|
||||
) {
|
||||
return next();
|
||||
}
|
||||
const authHeader = req.headers.authorization;
|
||||
if (req.cookies.refreshcheck != "true") {
|
||||
reply
|
||||
.setCookie("refreshcheck", "true", { maxAge: 1000 })
|
||||
.type("text/html")
|
||||
.send(failureFile);
|
||||
return;
|
||||
}
|
||||
if (!authHeader) {
|
||||
reply
|
||||
.code(401)
|
||||
.header("WWW-Authenticate", "Basic")
|
||||
.type("text/html")
|
||||
.send(failureFile);
|
||||
return;
|
||||
}
|
||||
const auth = Buffer.from(authHeader.split(" ")[1], "base64")
|
||||
.toString()
|
||||
.split(":");
|
||||
const user = auth[0];
|
||||
const pass = auth[1];
|
||||
licenseCheck(req, pass).then((data) => {
|
||||
if (!data) {
|
||||
reply
|
||||
.status(401)
|
||||
.header("WWW-Authenticate", "Basic")
|
||||
.type("text/html")
|
||||
.send(failureFile);
|
||||
return;
|
||||
} else {
|
||||
reply
|
||||
.setCookie("authcheck", "true")
|
||||
.type("text/html")
|
||||
.send("<script>window.location.href = window.location.href</script>");
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
done();
|
||||
};
|
||||
|
||||
const masqr = fp(plugin, {
|
||||
fastify: "4.x",
|
||||
name: "masqr"
|
||||
});
|
||||
|
||||
export default masqr;
|
||||
113
package.json
|
|
@ -1,67 +1,66 @@
|
|||
{
|
||||
"name": "nebula",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "9.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "concurrently \"vite\" \"tsx server.ts\"",
|
||||
"build": "vite build",
|
||||
"bstart": "npm run build && tsx server.ts",
|
||||
"start": "tsx server.ts",
|
||||
"preview": "vite preview",
|
||||
"format": "prettier --write ."
|
||||
"dev": "astro dev --host 0.0.0.0 & tsx --watch server/server.ts",
|
||||
"start": "node server/server.js",
|
||||
"build:server": "tsc -p server",
|
||||
"build:client": "astro check && astro build",
|
||||
"build": "npm run build:server & npm run build:client",
|
||||
"bstart": "npm run build && npm run start",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro",
|
||||
"format:code": "biome format . --write",
|
||||
"format:imports": "biome check . --write",
|
||||
"format": "npm run format:code && npm run format:imports",
|
||||
"version": "changeset version"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fastify/compress": "^6.5.0",
|
||||
"@fastify/cookie": "^9.3.1",
|
||||
"@fastify/static": "^6.12.0",
|
||||
"@mercuryworkshop/bare-mux": "^2.0.9",
|
||||
"@mercuryworkshop/epoxy-transport": "^2.1.11",
|
||||
"@mercuryworkshop/libcurl-transport": "^1.3.10",
|
||||
"@nebula-services/dynamic": "0.7.2-patch.2",
|
||||
"@titaniumnetwork-dev/ultraviolet": "^3.2.7",
|
||||
"@mercuryworkshop/bare-as-module3": "^2.2.2",
|
||||
"@nebula-services/bare-server-node": "^2.0.4",
|
||||
"@tsparticles/engine": "^3.4.0",
|
||||
"@tsparticles/react": "^3.0.0",
|
||||
"@tsparticles/slim": "^3.4.0",
|
||||
"chalk": "^5.3.0",
|
||||
"classnames": "^2.5.1",
|
||||
"compression": "^1.7.4",
|
||||
"cookie-parser": "^1.4.6",
|
||||
"crypto-js": "^4.2.0",
|
||||
"fastify": "^4.28.1",
|
||||
"fastify-plugin": "^4.5.1",
|
||||
"framer-motion": "^10.18.0",
|
||||
"i18next": "^23.11.5",
|
||||
"i18next-browser-languagedetector": "^7.2.1",
|
||||
"localforage": "^1.10.0",
|
||||
"million": "^2.6.4",
|
||||
"preact": "^10.22.1",
|
||||
"preact-iso": "^2.6.3",
|
||||
"preact-render-to-string": "^6.5.5",
|
||||
"preact-router": "^4.1.2",
|
||||
"rammerhead": "https://github.com/NebulaServices/rammerhead/releases/download/rammerhead-1.2.41-nebula.8/rammerhead-1.2.41-nebula.7.tgz",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-i18next": "^13.5.0",
|
||||
"react-icons": "^4.12.0",
|
||||
"react-toastify": "^9.1.3",
|
||||
"tsx": "^4.16.0",
|
||||
"vite-plugin-static-copy": "^1.0.5",
|
||||
"vite-plugin-vsharp": "^1.8.1",
|
||||
"wisp-server-node": "^1.1.0",
|
||||
"ws": "^8.17.1"
|
||||
"@astrojs/check": "^0.9.4",
|
||||
"@astrojs/node": "^9.0.0",
|
||||
"@astrojs/sitemap": "^3.2.1",
|
||||
"@astrojs/svelte": "^7.0.2",
|
||||
"@astrojs/tailwind": "^5.1.4",
|
||||
"@fastify/compress": "^8.0.1",
|
||||
"@fastify/helmet": "^13.0.0",
|
||||
"@fastify/middie": "^9.0.2",
|
||||
"@fastify/multipart": "^9.0.1",
|
||||
"@fastify/static": "^8.0.3",
|
||||
"@iconify-json/ph": "^1.2.2",
|
||||
"@mercuryworkshop/bare-mux": "^2.1.7",
|
||||
"@mercuryworkshop/epoxy-transport": "^2.1.27",
|
||||
"@mercuryworkshop/libcurl-transport": "^1.3.15",
|
||||
"@playform/compress": "^0.1.6",
|
||||
"@titaniumnetwork-dev/ultraviolet": "^3.2.10",
|
||||
"@mercuryworkshop/scramjet": "https://github.com/MercuryWorkshop/scramjet/releases/download/latest/mercuryworkshop-scramjet-1.0.2-dev.tgz",
|
||||
"@types/node": "^22.10.2",
|
||||
"@types/sequelize": "^4.28.20",
|
||||
"astro": "^5.1.1",
|
||||
"astro-icon": "^1.1.5",
|
||||
"astro-seo": "^0.8.4",
|
||||
"chalk": "^5.4.1",
|
||||
"fastify": "^5.2.0",
|
||||
"gradient-string": "^3.0.0",
|
||||
"pg": "^8.13.1",
|
||||
"pg-hstore": "^2.3.4",
|
||||
"sequelize": "^6.37.5",
|
||||
"smol-toml": "^1.3.1",
|
||||
"sqlite3": "^5.1.7",
|
||||
"svelte": "^5.16.0",
|
||||
"svelte-french-toast": "^1.2.0",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "^5.7.2",
|
||||
"vite-plugin-static-copy": "^2.2.0",
|
||||
"wisp-server-node": "^1.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@preact/preset-vite": "^2.8.3",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"concurrently": "^8.2.2",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-preact": "^1.4.0",
|
||||
"postcss": "^8.4.39",
|
||||
"prettier": "^3.3.2",
|
||||
"prettier-plugin-tailwindcss": "^0.5.14",
|
||||
"tailwindcss": "^3.4.4",
|
||||
"typescript": "^5.5.2",
|
||||
"vite": "^5.3.2"
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@changesets/cli": "^2.27.11",
|
||||
"bufferutil": "^4.0.9",
|
||||
"ora": "^8.1.1",
|
||||
"sharp": "^0.33.5",
|
||||
"tsx": "^4.19.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
9583
pnpm-lock.yaml
generated
|
|
@ -1,6 +0,0 @@
|
|||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {}
|
||||
}
|
||||
};
|
||||
BIN
public/404.png
|
Before Width: | Height: | Size: 39 KiB |
BIN
public/bg.mp4
BIN
public/classic_theme.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
public/cloaks/canvas.ico
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
public/cloaks/classroom.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/cloaks/google.png
Normal file
|
After Width: | Height: | Size: 615 B |
BIN
public/cloaks/ps.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
public/cloaks/wikipedia.ico
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 166 KiB |
|
|
@ -1,110 +0,0 @@
|
|||
{
|
||||
"particles": {
|
||||
"number": {
|
||||
"value": 300,
|
||||
"density": {
|
||||
"enable": true,
|
||||
"value_area": 800
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"value": "#ffffff"
|
||||
},
|
||||
"shape": {
|
||||
"type": "circle",
|
||||
"stroke": {
|
||||
"width": 0,
|
||||
"color": "#000000"
|
||||
},
|
||||
"polygon": {
|
||||
"nb_sides": 5
|
||||
},
|
||||
"image": {
|
||||
"src": "img/github.svg",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
}
|
||||
},
|
||||
"opacity": {
|
||||
"value": 0.5,
|
||||
"random": false,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 1,
|
||||
"opacity_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"value": 1.5,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 40,
|
||||
"size_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"line_linked": {
|
||||
"enable": false,
|
||||
"distance": 150,
|
||||
"color": "#ffffff",
|
||||
"opacity": 0.4,
|
||||
"width": 1
|
||||
},
|
||||
"move": {
|
||||
"enable": true,
|
||||
"speed": 6.3974410235905665,
|
||||
"direction": "bottom-right",
|
||||
"random": false,
|
||||
"straight": false,
|
||||
"out_mode": "out",
|
||||
"bounce": false,
|
||||
"attract": {
|
||||
"enable": false,
|
||||
"rotateX": 600,
|
||||
"rotateY": 1200
|
||||
}
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"detect_on": "canvas",
|
||||
"events": {
|
||||
"onhover": {
|
||||
"enable": false,
|
||||
"mode": "repulse"
|
||||
},
|
||||
"onclick": {
|
||||
"enable": false,
|
||||
"mode": "push"
|
||||
},
|
||||
"resize": true
|
||||
},
|
||||
"modes": {
|
||||
"grab": {
|
||||
"distance": 400,
|
||||
"line_linked": {
|
||||
"opacity": 1
|
||||
}
|
||||
},
|
||||
"bubble": {
|
||||
"distance": 400,
|
||||
"size": 40,
|
||||
"duration": 2,
|
||||
"opacity": 8,
|
||||
"speed": 3
|
||||
},
|
||||
"repulse": {
|
||||
"distance": 200,
|
||||
"duration": 0.4
|
||||
},
|
||||
"push": {
|
||||
"particles_nb": 4
|
||||
},
|
||||
"remove": {
|
||||
"particles_nb": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"retina_detect": true
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
// See documentation for more information
|
||||
|
||||
self.__dynamic$config = {
|
||||
prefix: '/~/dynamic/',
|
||||
encoding: 'aes',
|
||||
mode: 'production',
|
||||
logLevel: 0,
|
||||
bare: {
|
||||
version: 2,
|
||||
path: '/bare/',
|
||||
},
|
||||
tab: {
|
||||
title: 'Service',
|
||||
icon: null,
|
||||
ua: null,
|
||||
},
|
||||
assets: {
|
||||
prefix: '/dynamic/',
|
||||
files: {
|
||||
handler: 'dynamic.handler.js',
|
||||
client: 'dynamic.client.js',
|
||||
worker: 'dynamic.worker.js',
|
||||
config: 'dynamic.config.js',
|
||||
inject: null,
|
||||
}
|
||||
},
|
||||
block: [
|
||||
|
||||
]
|
||||
};
|
||||
16
public/favicon.svg
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<svg
|
||||
version="1.2"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 400 400"
|
||||
width="400"
|
||||
height="400"
|
||||
fill="#7967dd"
|
||||
style="width: 100%; height: 100%;"
|
||||
><title>nebula</title><g id="svgg"
|
||||
><path
|
||||
id="path0"
|
||||
fill="#7967dd"
|
||||
d="m213.6 84c1 0.3 3.4 0.7 5.1 1 1.8 0.2 4.1 0.7 5.2 1 13.2 4.1 20.3 6.8 24.5 9.1 0.6 0.3 2.3 1.2 3.8 2 2.8 1.4 13.1 8 14.4 9.2 0.5 0.3 2.3 1.9 4.2 3.5 6.7 5.5 15.5 14.9 19.2 20.4 1 1.4 2 2.7 2.2 2.8 0.3 0.1 0.5 0.5 0.5 0.8 0 0.3 1.2 2.2 2.5 4.3 2.3 3.4 7.8 14.3 9.8 19.3 0.8 2.1 0.9 2.2 10 4.9 5.6 1.6 11.1 3.4 11.7 3.8 0.3 0.2 2.4 1.1 4.7 1.9 11.1 4.1 23 12.5 27.3 19.4 5.5 8.7 3.6 20.5-4.5 28.5-3.1 3-7.5 6.4-8.4 6.4-0.3 0-0.7 0.2-0.8 0.5-1.1 2.3-23.3 11.2-35.9 14.3-3.2 0.9-3.5 1.2-5.7 6.8-7.5 19-25.5 40.6-42.3 51.1-1.6 1-3.1 2-3.3 2.2-0.1 0.2-0.9 0.7-1.7 1.2-0.8 0.4-2.2 1.2-2.9 1.6-0.8 0.4-1.6 1-1.8 1.1-0.5 0.5-4.1 2.2-8.1 3.9-1.8 0.8-3.8 1.6-4.5 2-0.7 0.3-3.1 1.1-5.2 1.8-8.3 2.6-9.8 3-21 4.9-6.4 1.1-25.3 1.3-30.5 0.3-1.9-0.3-5.8-1.1-8.6-1.6-6.8-1.3-12.7-3-20-5.7-3.3-1.2-18-8.8-19.7-10.1-0.9-0.7-4.1-3.1-7.1-5.2-5.7-4.1-17.9-15.9-20.7-20-0.9-1.2-2-2.7-2.5-3.2-3.2-3.3-13.7-21.7-13.7-24.1 0-0.6-0.2-1.2-0.6-1.4-0.3-0.2-0.8-1.2-1-2.3-0.4-1.9-1.7-2.7-6.5-3.8-23.2-5.6-43.1-17.2-48.6-28.5-7.1-14.4 4.5-31.3 27.3-39.7 1.8-0.7 4.1-1.6 5.2-2 3.7-1.5 8-2.9 19.5-6.2 1.6-0.5 2.8-1.2 2.8-1.7 0-2.4 9.8-21.6 13.1-25.7 0.2-0.4 1.4-1.8 2.5-3.2 13.8-18.1 30.2-30.6 50.6-38.8 4.3-1.7 6-2.3 14.3-4.5 5.5-1.6 11.2-2.4 18.4-2.9 7.9-0.5 24-0.2 26.8 0.6zm-29.7 17.3c-0.2 0.1-7.3 1.7-12.9 2.7-1.7 0.4-4.3 1.2-5.8 1.9-1.5 0.6-3.9 1.5-5.5 2-1.5 0.4-3.3 1.3-4 2-0.7 0.7-1.7 1.2-2.3 1.2-1.2 0-9.5 4.5-9.8 5.3-0.2 0.3-0.5 0.6-0.9 0.6-1.9 0-19.6 16-23.8 21.6-9.3 12.2-16.1 27.4-19.2 42.7-2 10.1-1.1 37.5 1.4 41.4 0 0.1 3.7 0.9 8.1 1.8 9.5 1.9 12.8 2.4 34.6 4.9 38.5 4.5 107.9 2.2 138.3-4.5 1.4-0.3 4.1-0.9 6.1-1.3 4.2-0.8 3.4 0.2 4.9-7.1 1.6-8.3 1.7-27 0.1-34.6-1.5-7.1-3.2-13.4-3.7-14.2-0.3-0.4-0.7-1.5-0.9-2.6-2.8-12.1-19.2-34.1-33-44.3-2.9-2.1-5.5-4-5.8-4.3-2.8-2.2-4.9-3.1-7.2-3.1-2.1 0-2.6-0.2-2.7-1.3-0.2-1.5-5.7-4.5-6.3-3.5-0.7 1.1-2.4 0.6-2.7-0.7-0.4-1.3-1.2-1.6-5.8-2.1-1.6-0.2-4-0.9-5.5-1.6-3.9-1.8-5.3-2.2-10.2-2.6-4.6-0.4-25.2-0.7-25.5-0.3zm74.3 42.2c7.4 9.8 4.8 23.5-4.6 24.9-6.9 1-20.9-5.8-21-10.2 0-0.2-0.3-0.8-0.8-1.3-6.4-6.8-5-20.8 2.4-24.1 6.7-2.9 17.2 1.8 24 10.7zm-176.4 36.4c-0.1-0.1-4.6 1.1-5.9 1.6-0.7 0.3-3 1.2-5.1 2-9.9 3.8-15.1 6.8-19.6 11.5-3.4 3.5-3.3 4.5 0.5 8.7 1 1 11.3 7.6 12 7.6 0.2 0 1.7 0.6 3.4 1.3 1.6 0.8 3.6 1.6 4.3 1.9 1.8 0.8 9.3 3.3 9.9 3.3 0.3 0 0.3-2 0-4.4-0.6-5.6-0.6-24.5 0.1-29.6 0.3-2.1 0.5-3.9 0.4-3.9zm229.3-0.3c-0.2 0 0 1 0.2 2.1 0.6 2.8 0.6 31.3 0 34-0.5 2.2-0.4 2.2 1.3 1.8 3.1-0.7 12.9-4.5 18.3-7 8.5-4 14.3-10.1 12.6-13.3-1.1-2.1-6.7-7.2-7.9-7.2-0.4 0-0.9-0.2-1-0.5-0.4-1.1-11.8-6.1-19.2-8.5-2.3-0.7-4.2-1.4-4.3-1.4zm-199.4 63.4l-3.1-0.4 1.8 3.2c0.9 1.8 1.9 3.4 2.2 3.5 0.3 0.1 0.5 0.6 0.5 1.1 0 0.4 0.6 1.5 1.3 2.3 0.7 0.9 1.5 1.9 1.8 2.2 0.3 0.4 0.8 1.2 1.1 1.7 6.2 10.7 35.6 33.5 43.3 33.5 0.2 0 1.3 0.4 2.5 0.9 2.5 1.2 10.6 3.4 15.3 4.2 9.5 1.8 11.6 2.1 17.4 2.1 6.6 0 16.4-1.3 22.9-3 2.2-0.5 5.2-1.3 6.8-1.7 1.6-0.3 3.2-0.9 3.5-1.2 0.4-0.3 1.1-0.6 1.6-0.6 2.3 0 22-10.6 24-12.9 0.2-0.2 2.2-1.9 4.5-3.7 5.7-4.5 11.8-11 17.1-18.4 1.6-2.3 3.2-4.5 3.6-4.9 0.4-0.4 0.7-1 0.7-1.2 0-0.2 0.8-1.9 1.9-3.6 1.1-1.7 1.9-3.2 1.9-3.4 0-0.2-3.8 0.4-11 1.6-31.7 5.4-85.1 6.7-126.9 3.1-9.6-0.8-23.1-2.3-27.8-3.2-2.2-0.4-5.3-0.9-6.9-1.2z"
|
||||
class="s0"></path></g
|
||||
></svg
|
||||
>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 12 KiB |
19
public/nebula.css
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
:root {
|
||||
--background-primary: #191724;
|
||||
--background-lighter: #16121f;
|
||||
--navbar-color: #26233a;
|
||||
--navbar-height: 60px;
|
||||
--navbar-text-color: #7967dd;
|
||||
--navbar-link-color: #e0def4;
|
||||
--navbar-link-hover-color: gray;
|
||||
--navbar-font: "Roboto";
|
||||
--input-text-color: #e0def4;
|
||||
--input-placeholder-color: white;
|
||||
--input-background-color: #1f1d2e;
|
||||
--input-border-color: #eb6f92;
|
||||
--input-border-size: 1.3px;
|
||||
--navbar-logo-filter: none;
|
||||
--dropdown-option-hover-color: #312a49;
|
||||
--tab-color: var(--black);
|
||||
--border-color: #16121f;
|
||||
}
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
{
|
||||
"particles": {
|
||||
"number": {
|
||||
"value": 80,
|
||||
"density": {
|
||||
"enable": true,
|
||||
"value_area": 800
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"value": "#ffffff"
|
||||
},
|
||||
"shape": {
|
||||
"type": "circle",
|
||||
"stroke": {
|
||||
"width": 0,
|
||||
"color": "#000000"
|
||||
},
|
||||
"polygon": {
|
||||
"nb_sides": 5
|
||||
},
|
||||
"image": {
|
||||
"src": "img/github.svg",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
}
|
||||
},
|
||||
"opacity": {
|
||||
"value": 0.5,
|
||||
"random": false,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 1,
|
||||
"opacity_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"value": 3,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 40,
|
||||
"size_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"line_linked": {
|
||||
"enable": true,
|
||||
"distance": 150,
|
||||
"color": "#ffffff",
|
||||
"opacity": 0.4,
|
||||
"width": 1
|
||||
},
|
||||
"move": {
|
||||
"enable": true,
|
||||
"speed": 6,
|
||||
"direction": "none",
|
||||
"random": false,
|
||||
"straight": false,
|
||||
"out_mode": "out",
|
||||
"bounce": false,
|
||||
"attract": {
|
||||
"enable": false,
|
||||
"rotateX": 600,
|
||||
"rotateY": 1200
|
||||
}
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"detect_on": "canvas",
|
||||
"events": {
|
||||
"onhover": {
|
||||
"enable": true,
|
||||
"mode": "repulse"
|
||||
},
|
||||
"onclick": {
|
||||
"enable": true,
|
||||
"mode": "push"
|
||||
},
|
||||
"resize": true
|
||||
},
|
||||
"modes": {
|
||||
"grab": {
|
||||
"distance": 400,
|
||||
"line_linked": {
|
||||
"opacity": 1
|
||||
}
|
||||
},
|
||||
"bubble": {
|
||||
"distance": 400,
|
||||
"size": 40,
|
||||
"duration": 2,
|
||||
"opacity": 8,
|
||||
"speed": 3
|
||||
},
|
||||
"repulse": {
|
||||
"distance": 200,
|
||||
"duration": 0.4
|
||||
},
|
||||
"push": {
|
||||
"particles_nb": 4
|
||||
},
|
||||
"remove": {
|
||||
"particles_nb": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"retina_detect": true
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
User-agent: *
|
||||
Disallow: /settings
|
||||
Disallow: /~/
|
||||
Disallow: /go/
|
||||
Disallow: /games
|
||||
|
Before Width: | Height: | Size: 22 KiB |
91
public/sw.js
|
|
@ -1,46 +1,75 @@
|
|||
importScripts("/uv/uv.bundle.js");
|
||||
importScripts("/uv/uv.config.js");
|
||||
importScripts('/scram/scramjet.wasm.js');
|
||||
importScripts('/scram/scramjet.shared.js');
|
||||
importScripts('/scram/scramjet.worker.js');
|
||||
importScripts("/workerware/workerware.js");
|
||||
importScripts(__uv$config.sw || "/uv/uv.sw.js");
|
||||
importScripts("/dynamic/dynamic.config.js");
|
||||
importScripts("/dynamic/dynamic.worker.js");
|
||||
//import our IDB lib
|
||||
importScripts("/localforage/localforage.min.js");
|
||||
localforage.config({
|
||||
driver: localforage.INDEXEDDB,
|
||||
name: "Nebula",
|
||||
version: 1.0,
|
||||
storeName: "nebula_config",
|
||||
description: "Nebula Config for things reliant on IndexedDB"
|
||||
});
|
||||
|
||||
const uv = new UVServiceWorker();
|
||||
const dynPromise = new Promise(async (resolve) => {
|
||||
try {
|
||||
const bare =
|
||||
(await localforage.getItem("bare")) || location.origin + "/bare/";
|
||||
self.__dynamic$config.bare.path = bare;
|
||||
self.dynamic = new Dynamic(self.__dynamic$config);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
const ww = new WorkerWare({ debug: false });
|
||||
const sj = new ScramjetServiceWorker();
|
||||
(async function () {
|
||||
await sj.loadConfig();
|
||||
})();
|
||||
//me when Firefox (thanks vk6)
|
||||
if (navigator.userAgent.includes("Firefox")) {
|
||||
Object.defineProperty(globalThis, "crossOriginIsolated", {
|
||||
value: true,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
resolve();
|
||||
|
||||
//where we handle our plugins!!!
|
||||
self.addEventListener("message", function (event) {
|
||||
console.log(event.data);
|
||||
uv.config.inject = [];
|
||||
//loop over the required data (we don't verify here as types will take care of us :D)
|
||||
event.data.forEach((data) => {
|
||||
if (data.remove) {
|
||||
if (data.type === "page") {
|
||||
const idx = uv.config.inject.indexOf(data.host);
|
||||
uv.config.inject.splice(idx, 1);
|
||||
} else if (data.type === "serviceWorker") {
|
||||
ww.deleteByName(data.name);
|
||||
}
|
||||
} else {
|
||||
if (data.type === "page") {
|
||||
uv.config.inject.push({
|
||||
host: data.host,
|
||||
html: data.html,
|
||||
injectTo: data.injectTo
|
||||
});
|
||||
} else if (data.type === "serviceWorker") {
|
||||
const wwFunction = eval(data.function);
|
||||
ww.use({
|
||||
function: wwFunction ? wwFunction : new Function(data.function),
|
||||
name: data.name,
|
||||
events: data.events
|
||||
});
|
||||
} else {
|
||||
console.error("NO type exists for that. Only serviceWorker & page exist.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (event) => {
|
||||
self.addEventListener("fetch", function (event) {
|
||||
event.respondWith(
|
||||
(async function () {
|
||||
if (uv.route(event)) {
|
||||
(async () => {
|
||||
const wwRes = await ww.run(event)();
|
||||
if (wwRes.includes(null)) {
|
||||
return;
|
||||
}
|
||||
if (event.request.url.startsWith(location.origin + __uv$config.prefix)) {
|
||||
return await uv.fetch(event);
|
||||
}
|
||||
if (await dynamic.route(event)) {
|
||||
try {
|
||||
await dynPromise;
|
||||
} catch (e) {
|
||||
console.error(error)
|
||||
}
|
||||
return await dynamic.fetch(event);
|
||||
else if (sj.route(event)) {
|
||||
return await sj.fetch(event);
|
||||
}
|
||||
else {
|
||||
return await fetch(event.request);
|
||||
}
|
||||
})()
|
||||
);
|
||||
});
|
||||
|
|
@ -1,28 +1,25 @@
|
|||
self.__uv$config = {
|
||||
prefix: "/~/uv/",
|
||||
bare: "/bare/",
|
||||
encodeUrl: function encode(str) {
|
||||
if (!str) return str;
|
||||
return encodeURIComponent(
|
||||
str
|
||||
.toString()
|
||||
.split('')
|
||||
.map((char, ind) =>
|
||||
ind % 2 ? String.fromCharCode(char.charCodeAt() ^ 3) : char
|
||||
)
|
||||
.join('')
|
||||
.split("")
|
||||
.map((char, ind) => (ind % 2 ? String.fromCharCode(char.charCodeAt() ^ 3) : char))
|
||||
.join("")
|
||||
);
|
||||
},
|
||||
decodeUrl: function decode(str) {
|
||||
if (!str) return str;
|
||||
let [input, ...search] = str.split('?');
|
||||
let [input, ...search] = str.split("?");
|
||||
|
||||
return (
|
||||
decodeURIComponent(input)
|
||||
.split('')
|
||||
.map((char, ind) =>
|
||||
ind % 2 ? String.fromCharCode(char.charCodeAt(0) ^ 3) : char
|
||||
)
|
||||
.join('') + (search.length ? '?' + search.join('?') : '')
|
||||
.split("")
|
||||
.map((char, ind) => (ind % 2 ? String.fromCharCode(char.charCodeAt(0) ^ 3) : char))
|
||||
.join("") + (search.length ? "?" + search.join("?") : "")
|
||||
);
|
||||
},
|
||||
handler: "/uv/uv.handler.js",
|
||||
|
|
|
|||
171
public/workerware/workerware.js
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
importScripts("/workerware/WWError.js");
|
||||
const dbg = console.log.bind(console, "[WorkerWare]");
|
||||
const time = console.time.bind(console, "[WorkerWare]");
|
||||
const timeEnd = console.timeEnd.bind(console, "[WorkerWare]");
|
||||
|
||||
/*
|
||||
OPTS:
|
||||
debug - Enables debug logging.
|
||||
randomNames - Generate random names for middlewares.
|
||||
timing - Logs timing for each middleware.
|
||||
*/
|
||||
|
||||
const defaultOpt = {
|
||||
debug: false,
|
||||
randomNames: false,
|
||||
timing: false
|
||||
};
|
||||
|
||||
const validEvents = [
|
||||
"abortpayment",
|
||||
"activate",
|
||||
"backgroundfetchabort",
|
||||
"backgroundfetchclick",
|
||||
"backgroundfetchfail",
|
||||
"backgroundfetchsuccess",
|
||||
"canmakepayment",
|
||||
"contentdelete",
|
||||
"cookiechange",
|
||||
"fetch",
|
||||
"install",
|
||||
"message",
|
||||
"messageerror",
|
||||
"notificationclick",
|
||||
"notificationclose",
|
||||
"paymentrequest",
|
||||
"periodicsync",
|
||||
"push",
|
||||
"pushsubscriptionchange",
|
||||
"sync"
|
||||
];
|
||||
|
||||
class WorkerWare {
|
||||
constructor(opt) {
|
||||
this._opt = Object.assign({}, defaultOpt, opt);
|
||||
this._middlewares = [];
|
||||
}
|
||||
info() {
|
||||
return {
|
||||
version: "0.1.0",
|
||||
middlewares: this._middlewares,
|
||||
options: this._opt
|
||||
};
|
||||
}
|
||||
use(middleware) {
|
||||
let validateMW = this.validateMiddleware(middleware);
|
||||
if (validateMW.error) throw new WWError(validateMW.error);
|
||||
// This means the middleware is an anonymous function, or the user is silly and named their function "function"
|
||||
if (middleware.function.name == "function") middleware.name = crypto.randomUUID();
|
||||
if (!middleware.name) middleware.name = middleware.function.name;
|
||||
if (this._opt.randomNames) middleware.name = crypto.randomUUID();
|
||||
if (this._opt.debug) dbg("Adding middleware:", middleware.name);
|
||||
this._middlewares.push(middleware);
|
||||
}
|
||||
// Run all middlewares for the event type passed in.
|
||||
run(event) {
|
||||
const middlewares = this._middlewares;
|
||||
const returnList = [];
|
||||
let fn = async () => {
|
||||
for (let i = 0; i < middlewares.length; i++) {
|
||||
if (middlewares[i].events.includes(event.type)) {
|
||||
if (this._opt.timing) console.time(middlewares[i].name);
|
||||
// Add the configuration to the event object.
|
||||
event.workerware = {
|
||||
config: middlewares[i].configuration || {}
|
||||
};
|
||||
if (!middlewares[i].explicitCall) {
|
||||
let res = await middlewares[i].function(event);
|
||||
if (this._opt.timing) console.timeEnd(middlewares[i].name);
|
||||
returnList.push(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnList;
|
||||
};
|
||||
return fn;
|
||||
}
|
||||
deleteByName(middlewareID) {
|
||||
if (this._opt.debug) dbg("Deleting middleware:", middlewareID);
|
||||
this._middlewares = this._middlewares.filter((mw) => mw.name !== middlewareID);
|
||||
}
|
||||
deleteByEvent(middlewareEvent) {
|
||||
if (this._opt.debug) dbg("Deleting middleware by event:", middlewareEvent);
|
||||
this._middlewares = this._middlewares.filter((mw) => !mw.events.includes(middlewareEvent));
|
||||
}
|
||||
get() {
|
||||
return this._middlewares;
|
||||
}
|
||||
/*
|
||||
Run a single middleware by ID.
|
||||
This assumes that the user knows what they're doing, and is running the middleware on an event that it's supposed to run on.
|
||||
*/
|
||||
runMW(name, event) {
|
||||
const middlewares = this._middlewares;
|
||||
if (this._opt.debug) dbg("Running middleware:", name);
|
||||
// if (middlewares.includes(name)) {
|
||||
// return middlewares[name](event);
|
||||
// } else {
|
||||
// throw new WWError("Middleware not found!");
|
||||
// }
|
||||
let didCall = false;
|
||||
for (let i = 0; i < middlewares.length; i++) {
|
||||
if (middlewares[i].name == name) {
|
||||
didCall = true;
|
||||
event.workerware = {
|
||||
config: middlewares[i].configuration || {}
|
||||
};
|
||||
if (this._opt.timing) console.time(middlewares[i].name);
|
||||
let call = middlewares[i].function(event);
|
||||
if (this._opt.timing) console.timeEnd(middlewares[i].name);
|
||||
return call;
|
||||
}
|
||||
}
|
||||
if (!didCall) {
|
||||
throw new WWError("Middleware not found!");
|
||||
}
|
||||
}
|
||||
// type middlewareManifest = {
|
||||
// function: Function,
|
||||
// name?: string,
|
||||
// events: string[], // Should be a union of validEvents.
|
||||
// configuration?: Object // Optional configuration for the middleware.
|
||||
// }
|
||||
validateMiddleware(middleware) {
|
||||
if (!middleware.function)
|
||||
return {
|
||||
error: "middleware.function is required"
|
||||
};
|
||||
if (typeof middleware.function !== "function")
|
||||
return {
|
||||
error: "middleware.function must be typeof function"
|
||||
};
|
||||
if (
|
||||
typeof middleware.configuration !== "object" &&
|
||||
middleware.configuration !== undefined
|
||||
) {
|
||||
return {
|
||||
error: "middleware.configuration must be typeof object"
|
||||
};
|
||||
}
|
||||
if (!middleware.events)
|
||||
return {
|
||||
error: "middleware.events is required"
|
||||
};
|
||||
if (!Array.isArray(middleware.events))
|
||||
return {
|
||||
error: "middleware.events must be an array"
|
||||
};
|
||||
if (middleware.events.some((ev) => !validEvents.includes(ev)))
|
||||
return {
|
||||
error: "Invalid event type! Must be one of the following: " + validEvents.join(", ")
|
||||
};
|
||||
if (middleware.explicitCall && typeof middleware.explicitCall !== "boolean") {
|
||||
return {
|
||||
error: "middleware.explicitCall must be typeof boolean"
|
||||
};
|
||||
}
|
||||
return {
|
||||
error: undefined
|
||||
};
|
||||
}
|
||||
}
|
||||
115
server.ts
|
|
@ -1,115 +0,0 @@
|
|||
import fastify from "fastify";
|
||||
import fastifyStatic from "@fastify/static";
|
||||
import { fileURLToPath } from "url";
|
||||
import path from "path";
|
||||
import cookieParser from "@fastify/cookie";
|
||||
import { createServer } from "http";
|
||||
import { createBareServer } from "@tomphttp/bare-server-node";
|
||||
import createRammerhead from "rammerhead/src/server/index.js";
|
||||
import wisp from "wisp-server-node";
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const bare = createBareServer("/bare/");
|
||||
const rh = createRammerhead();
|
||||
import chalk from "chalk";
|
||||
import masqr from "./masqr.js";
|
||||
|
||||
const rammerheadScopes = [
|
||||
"/rammerhead.js",
|
||||
"/hammerhead.js",
|
||||
"/transport-worker.js",
|
||||
"/task.js",
|
||||
"/iframe-task.js",
|
||||
"/worker-hammerhead.js",
|
||||
"/messaging",
|
||||
"/sessionexists",
|
||||
"/deletesession",
|
||||
"/newsession",
|
||||
"/editsession",
|
||||
"/needpassword",
|
||||
"/syncLocalStorage",
|
||||
"/api/shuffleDict",
|
||||
"/mainport"
|
||||
];
|
||||
|
||||
const rammerheadSession = /^\/[a-z0-9]{32}/;
|
||||
|
||||
function shouldRouteRh(req) {
|
||||
const url = new URL(req.url, "http://0.0.0.0");
|
||||
return (
|
||||
rammerheadScopes.includes(url.pathname) ||
|
||||
rammerheadSession.test(url.pathname)
|
||||
);
|
||||
}
|
||||
|
||||
function routeRhRequest(req, res) {
|
||||
rh.emit("request", req, res);
|
||||
}
|
||||
|
||||
function routeRhUpgrade(req, socket, head) {
|
||||
rh.emit("upgrade", req, socket, head);
|
||||
}
|
||||
const port = parseInt(process.env.PORT) || 8080;
|
||||
const serverFactory = (handler, opts) => {
|
||||
return createServer()
|
||||
.on("request", (req, res) => {
|
||||
if (bare.shouldRoute(req)) {
|
||||
bare.routeRequest(req, res);
|
||||
} else if (shouldRouteRh(req)) {
|
||||
routeRhRequest(req, res);
|
||||
} else {
|
||||
handler(req, res);
|
||||
}
|
||||
})
|
||||
.on("upgrade", (req, socket, head) => {
|
||||
if (bare.shouldRoute(req)) {
|
||||
bare.routeUpgrade(req, socket, head);
|
||||
} else if (shouldRouteRh(req)) {
|
||||
routeRhUpgrade(req, socket, head);
|
||||
} else if (req.url.endsWith("/wisp/")) {
|
||||
wisp.routeRequest(req, socket, head);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const app = fastify({ logger: false, serverFactory });
|
||||
|
||||
app.register(cookieParser);
|
||||
await app.register(import("@fastify/compress"));
|
||||
//Uncomment the following line to enable masqr
|
||||
//app.register(masqr);
|
||||
|
||||
app.register(fastifyStatic, {
|
||||
root: path.join(__dirname, "dist"),
|
||||
prefix: "/",
|
||||
serve: true,
|
||||
wildcard: false
|
||||
});
|
||||
|
||||
app.get("/search=:query", async (req, res) => {
|
||||
const { query } = req.params as { query: string }; // Define the type for req.params
|
||||
|
||||
const response = await fetch(
|
||||
`http://api.duckduckgo.com/ac?q=${query}&format=json`
|
||||
).then((apiRes) => apiRes.json());
|
||||
|
||||
res.send(response);
|
||||
});
|
||||
|
||||
app.setNotFoundHandler((req, res) => {
|
||||
res.sendFile("index.html"); // SPA catch-all
|
||||
});
|
||||
|
||||
console.log(
|
||||
chalk.green(`Server listening on ${chalk.bold(`http://localhost:${port}`)}`)
|
||||
);
|
||||
console.log(
|
||||
chalk.magenta(
|
||||
`Server also listening on ${chalk.bold(`http://0.0.0.0:${port}`)}`
|
||||
)
|
||||
);
|
||||
|
||||
app.listen({
|
||||
port: port,
|
||||
host: "0.0.0.0"
|
||||
});
|
||||
|
|
@ -1,16 +1,60 @@
|
|||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import chalk from "chalk";
|
||||
import { parse } from "smol-toml";
|
||||
import { TomlPrimitive, parse } from "smol-toml";
|
||||
|
||||
interface TomlData {
|
||||
marketplace: {
|
||||
enabled: boolean;
|
||||
psk: String;
|
||||
};
|
||||
server: {
|
||||
server: {
|
||||
port: number;
|
||||
wisp: boolean;
|
||||
logging: boolean;
|
||||
};
|
||||
};
|
||||
seo: {
|
||||
enabled: boolean;
|
||||
domain: string;
|
||||
};
|
||||
db: {
|
||||
name: string;
|
||||
username: string;
|
||||
password: string;
|
||||
postgres: boolean;
|
||||
};
|
||||
postgres: {
|
||||
domain: string;
|
||||
port: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface Verify {
|
||||
name: string;
|
||||
typeOF: any;
|
||||
type: any;
|
||||
verifyExtras?: () => boolean | Error;
|
||||
}
|
||||
|
||||
let doc = readFileSync(fileURLToPath(new URL("../config.toml", import.meta.url))).toString();
|
||||
const parsedDoc = parse(doc);
|
||||
function verify(t) {
|
||||
for (let i = 0; i !== t.length; i++) {
|
||||
const parsedDoc = parse(doc) as unknown as TomlData;
|
||||
|
||||
function verify(t: Verify[]) {
|
||||
for (let i: number = 0; i !== t.length; i++) {
|
||||
if (typeof t[i].typeOF !== t[i].type) {
|
||||
throw new Error(`Invalid structure: "${t[i].name}" should be a(n) ${t[i].type}`);
|
||||
}
|
||||
if (t[i].verifyExtras) {
|
||||
const extra = t[i].verifyExtras();
|
||||
if (extra !== true) {
|
||||
throw extra;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
verify([
|
||||
{ name: "marketplace", typeOF: parsedDoc.marketplace, type: "object" },
|
||||
{ name: "marketplace.enabled", typeOF: parsedDoc.marketplace.enabled, type: "boolean" },
|
||||
|
|
@ -20,6 +64,17 @@ verify([
|
|||
{ name: "server.server.port", typeOF: parsedDoc.server.server.port, type: "number" },
|
||||
{ name: "server.server.wisp", typeOF: parsedDoc.server.server.wisp, type: "boolean" },
|
||||
{ name: "server.server.logging", typeOF: parsedDoc.server.server.logging, type: "boolean" },
|
||||
{ name: "seo", typeOF: parsedDoc.seo, type: "object" },
|
||||
{ name: "seo.enabled", typeOF: parsedDoc.seo.enabled, type: "boolean" },
|
||||
{ name: "seo.domain", typeOF: parsedDoc.seo.domain, type: "string", verifyExtras: () => {
|
||||
try {
|
||||
new URL(parsedDoc.seo.domain);
|
||||
}
|
||||
catch (e) {
|
||||
return Error(e);
|
||||
}
|
||||
return true;
|
||||
}},
|
||||
{ name: "db", typeOF: parsedDoc.db, type: "object" },
|
||||
{ name: "db.name", typeOF: parsedDoc.db.name, type: "string" },
|
||||
{ name: "db.username", typeOF: parsedDoc.db.username, type: "string" },
|
||||
|
|
@ -29,10 +84,12 @@ verify([
|
|||
{ name: "postgres.domain", typeOF: parsedDoc.postgres.domain, type: "string" },
|
||||
{ name: "postgres.port", typeOF: parsedDoc.postgres.port, type: "number" }
|
||||
]);
|
||||
|
||||
if (parsedDoc.marketplace.psk === "CHANGEME") {
|
||||
console.warn(chalk.yellow.bold('PSK should be changed from "CHANGEME"'));
|
||||
}
|
||||
if (parsedDoc.db.password === "password") {
|
||||
console.warn(chalk.red.bold("You should change your DB password!!"));
|
||||
}
|
||||
export { parsedDoc };
|
||||
|
||||
export { TomlData, parsedDoc };
|
||||
|
|
@ -1,6 +1,15 @@
|
|||
import { fileURLToPath } from "node:url";
|
||||
import chalk from "chalk";
|
||||
import ora from "ora";
|
||||
async function installItems(db, items) {
|
||||
import { ModelStatic } from "sequelize";
|
||||
import { Catalog, CatalogModel } from "./marketplace.js";
|
||||
|
||||
interface Items extends Omit<Catalog, "background_video" | "background_image"> {
|
||||
background_video?: string;
|
||||
background_image?: string;
|
||||
}
|
||||
|
||||
async function installItems(db: ModelStatic<CatalogModel>, items: Items[]) {
|
||||
items.forEach(async (item) => {
|
||||
await db.create({
|
||||
package_name: item.package_name,
|
||||
|
|
@ -17,13 +26,14 @@ async function installItems(db, items) {
|
|||
});
|
||||
});
|
||||
}
|
||||
async function setupDB(db) {
|
||||
|
||||
async function setupDB(db: ModelStatic<CatalogModel>) {
|
||||
//We have some packages that need to be installed if they aren't.
|
||||
const items = [
|
||||
const items: Items[] = [
|
||||
{
|
||||
package_name: "com.nebula.gruvbox",
|
||||
title: "Gruvbox",
|
||||
image: "gruvbox.jpeg",
|
||||
image: "gruvbox.jpg",
|
||||
author: "Nebula Services",
|
||||
version: "1.0.0",
|
||||
description: "The gruvbox theme",
|
||||
|
|
@ -63,7 +73,18 @@ async function setupDB(db) {
|
|||
tags: ["Theme", "Simple", "Dark", "Retro"],
|
||||
payload: "retro.css",
|
||||
type: "theme"
|
||||
}
|
||||
},
|
||||
/* {
|
||||
package_name: 'gyatt',
|
||||
title: 'gyatt',
|
||||
image: 'gyatt',
|
||||
author: "nebuka",
|
||||
version: "2",
|
||||
description: "e",
|
||||
tags: [ "e" ],
|
||||
payload: "gyatt.js",
|
||||
type: "plugin-page"
|
||||
} */
|
||||
//To add plugins: plugin types consist of plugin-sw (workerware) & plugin-page (uv.config.inject)
|
||||
];
|
||||
const dbItems = await db.findAll();
|
||||
|
|
@ -73,4 +94,5 @@ async function setupDB(db) {
|
|||
spinner.succeed(chalk.hex("#eb6f92")("DB setup complete!"));
|
||||
}
|
||||
}
|
||||
|
||||
export { setupDB };
|
||||
1
server/env.d.ts
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
declare module "@rubynetwork/rammerhead/src/server/index.js";
|
||||
|
|
@ -2,8 +2,10 @@ import { createWriteStream } from "node:fs";
|
|||
import { constants, access, mkdir } from "node:fs/promises";
|
||||
import { pipeline } from "node:stream/promises";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { DataTypes, Sequelize } from "sequelize";
|
||||
import { FastifyInstance, FastifyRequest } from "fastify";
|
||||
import { DataTypes, InferAttributes, InferCreationAttributes, Model, Sequelize } from "sequelize";
|
||||
import { parsedDoc } from "./config.js";
|
||||
|
||||
const db = new Sequelize(parsedDoc.db.name, parsedDoc.db.username, parsedDoc.db.password, {
|
||||
host: parsedDoc.db.postgres ? `${parsedDoc.postgres.domain}` : "localhost",
|
||||
port: parsedDoc.db.postgres ? parsedDoc.postgres.port : undefined,
|
||||
|
|
@ -11,7 +13,28 @@ const db = new Sequelize(parsedDoc.db.name, parsedDoc.db.username, parsedDoc.db.
|
|||
logging: parsedDoc.server.server.logging,
|
||||
storage: "database.sqlite" //this is sqlite only
|
||||
});
|
||||
const catalogAssets = db.define("catalog_assets", {
|
||||
|
||||
type CatalogType = "theme" | "plugin-page" | "plugin-sw";
|
||||
|
||||
interface Catalog {
|
||||
package_name: string;
|
||||
title: string;
|
||||
description: string;
|
||||
author: string;
|
||||
image: string;
|
||||
tags: object;
|
||||
version: string;
|
||||
background_image: string;
|
||||
background_video: string;
|
||||
payload: string;
|
||||
type: CatalogType;
|
||||
}
|
||||
|
||||
interface CatalogModel
|
||||
extends Catalog,
|
||||
Model<InferAttributes<CatalogModel>, InferCreationAttributes<CatalogModel>> {}
|
||||
|
||||
const catalogAssets = db.define<CatalogModel>("catalog_assets", {
|
||||
package_name: { type: DataTypes.STRING, unique: true },
|
||||
title: { type: DataTypes.TEXT },
|
||||
description: { type: DataTypes.TEXT },
|
||||
|
|
@ -24,7 +47,8 @@ const catalogAssets = db.define("catalog_assets", {
|
|||
payload: { type: DataTypes.TEXT },
|
||||
type: { type: DataTypes.TEXT }
|
||||
});
|
||||
function marketplaceAPI(app) {
|
||||
|
||||
function marketplaceAPI(app: FastifyInstance) {
|
||||
app.get("/api/catalog-stats/", (request, reply) => {
|
||||
reply.send({
|
||||
version: "1.0.0",
|
||||
|
|
@ -32,10 +56,15 @@ function marketplaceAPI(app) {
|
|||
enabled: true
|
||||
});
|
||||
});
|
||||
app.get("/api/catalog-assets/", async (request, reply) => {
|
||||
|
||||
// This API returns a list of the assets in the database (SW plugins and themes).
|
||||
// It also returns the number of pages in the database.
|
||||
// It can take a `?page=x` argument to display a different page, with a limit of 20 assets per page.
|
||||
type CatalogAssetsReq = FastifyRequest<{ Querystring: { page: string } }>;
|
||||
app.get("/api/catalog-assets/", async (request: CatalogAssetsReq, reply) => {
|
||||
try {
|
||||
const { page } = request.query;
|
||||
const pageNum = parseInt(page, 10) || 1;
|
||||
const pageNum: number = parseInt(page, 10) || 1;
|
||||
if (pageNum < 1) {
|
||||
reply.status(400).send({ error: "Page must be a positive number!" });
|
||||
}
|
||||
|
|
@ -58,18 +87,18 @@ function marketplaceAPI(app) {
|
|||
return acc;
|
||||
}, {});
|
||||
return reply.send({ assets, pages: Math.ceil(totalItems / 20) });
|
||||
}
|
||||
catch (error) {
|
||||
} catch (error) {
|
||||
return reply.status(500).send({ error: "An error occured" });
|
||||
}
|
||||
});
|
||||
app.get("/api/packages/:package", async (request, reply) => {
|
||||
|
||||
type PackageReq = FastifyRequest<{ Params: { package: string } }>;
|
||||
app.get("/api/packages/:package", async (request: PackageReq, reply) => {
|
||||
try {
|
||||
const packageRow = await catalogAssets.findOne({
|
||||
where: { package_name: request.params.package }
|
||||
});
|
||||
if (!packageRow)
|
||||
return reply.status(404).send({ error: "Package not found!" });
|
||||
if (!packageRow) return reply.status(404).send({ error: "Package not found!" });
|
||||
const details = {
|
||||
title: packageRow.get("title"),
|
||||
description: packageRow.get("description"),
|
||||
|
|
@ -83,36 +112,67 @@ function marketplaceAPI(app) {
|
|||
type: packageRow.get("type")
|
||||
};
|
||||
reply.send(details);
|
||||
}
|
||||
catch (error) {
|
||||
} catch (error) {
|
||||
reply.status(500).send({ error: "An unexpected error occured" });
|
||||
}
|
||||
});
|
||||
async function verifyReq(request, upload, data) {
|
||||
|
||||
type UploadReq = FastifyRequest<{ Headers: { psk: string; packagename: string } }>;
|
||||
type CreateReq = FastifyRequest<{
|
||||
Headers: { psk: string };
|
||||
Body: {
|
||||
uuid: string;
|
||||
title: string;
|
||||
image: string;
|
||||
author: string;
|
||||
version: string;
|
||||
description: string;
|
||||
tags: object | any;
|
||||
payload: string;
|
||||
background_video: string;
|
||||
background_image: string;
|
||||
type: CatalogType;
|
||||
};
|
||||
}>;
|
||||
interface VerifyStatus {
|
||||
status: number;
|
||||
error?: Error;
|
||||
}
|
||||
async function verifyReq(
|
||||
request: UploadReq | CreateReq,
|
||||
upload: Boolean,
|
||||
data: any
|
||||
): Promise<VerifyStatus> {
|
||||
if (request.headers.psk !== parsedDoc.marketplace.psk) {
|
||||
return { status: 403, error: new Error("PSK isn't correct!") };
|
||||
}
|
||||
else if (upload && !request.headers.packagename) {
|
||||
} else if (upload && !request.headers.packagename) {
|
||||
return { status: 500, error: new Error("No packagename defined!") };
|
||||
}
|
||||
else if (upload && !data) {
|
||||
} else if (upload && !data) {
|
||||
return { status: 400, error: new Error("No file uploaded!") };
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return { status: 200 };
|
||||
}
|
||||
}
|
||||
app.post("/api/upload-asset", async (request, reply) => {
|
||||
|
||||
app.post("/api/upload-asset", async (request: UploadReq, reply) => {
|
||||
const data = await request.file();
|
||||
const verify = await verifyReq(request, true, data);
|
||||
const verify: VerifyStatus = await verifyReq(request, true, data);
|
||||
if (verify.error !== undefined) {
|
||||
reply.status(verify.status).send({ status: verify.error.message });
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
try {
|
||||
await pipeline(data.file, createWriteStream(fileURLToPath(new URL(`../database_assets/${request.headers.packagename}/${data.filename}`, import.meta.url))));
|
||||
}
|
||||
catch (error) {
|
||||
await pipeline(
|
||||
data.file,
|
||||
createWriteStream(
|
||||
fileURLToPath(
|
||||
new URL(
|
||||
`../database_assets/${request.headers.packagename}/${data.filename}`,
|
||||
import.meta.url
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
} catch (error) {
|
||||
return reply.status(500).send({
|
||||
status: `File couldn't be uploaded! (Package most likely doesn't exist)`
|
||||
});
|
||||
|
|
@ -120,13 +180,13 @@ function marketplaceAPI(app) {
|
|||
return reply.status(verify.status).send({ status: "File uploaded successfully!" });
|
||||
}
|
||||
});
|
||||
app.post("/api/create-package", async (request, reply) => {
|
||||
const verify = await verifyReq(request, false, undefined);
|
||||
|
||||
app.post("/api/create-package", async (request: CreateReq, reply) => {
|
||||
const verify: VerifyStatus = await verifyReq(request, false, undefined);
|
||||
if (verify.error !== undefined) {
|
||||
reply.status(verify.status).send({ status: verify.error.message });
|
||||
}
|
||||
else {
|
||||
const body = {
|
||||
} else {
|
||||
const body: Catalog = {
|
||||
package_name: request.body.uuid,
|
||||
title: request.body.title,
|
||||
image: request.body.image,
|
||||
|
|
@ -137,7 +197,7 @@ function marketplaceAPI(app) {
|
|||
payload: request.body.payload,
|
||||
background_video: request.body.background_video,
|
||||
background_image: request.body.background_image,
|
||||
type: request.body.type
|
||||
type: request.body.type as CatalogType
|
||||
};
|
||||
await catalogAssets.create({
|
||||
package_name: body.package_name,
|
||||
|
|
@ -156,8 +216,7 @@ function marketplaceAPI(app) {
|
|||
try {
|
||||
await access(`${assets}/${body.package_name}/`, constants.F_OK);
|
||||
return reply.status(500).send({ status: "Package already exists!" });
|
||||
}
|
||||
catch (err) {
|
||||
} catch (err) {
|
||||
await mkdir(`${assets}/${body.package_name}/`);
|
||||
return reply
|
||||
.status(verify.status)
|
||||
|
|
@ -166,4 +225,5 @@ function marketplaceAPI(app) {
|
|||
}
|
||||
});
|
||||
}
|
||||
export { marketplaceAPI, db, catalogAssets };
|
||||
|
||||
export { marketplaceAPI, db, catalogAssets, Catalog, CatalogModel };
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
import { createWriteStream } from "node:fs";
|
||||
import { constants, access, mkdir } from "node:fs/promises";
|
||||
import { pipeline } from "node:stream/promises";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import fastifyCompress from "@fastify/compress";
|
||||
import fastifyHelmet from "@fastify/helmet";
|
||||
|
|
@ -5,7 +8,7 @@ import fastifyMiddie from "@fastify/middie";
|
|||
import fastifyMultipart from "@fastify/multipart";
|
||||
import fastifyStatic from "@fastify/static";
|
||||
import chalk from "chalk";
|
||||
import Fastify from "fastify";
|
||||
import Fastify, { FastifyReply, FastifyRequest } from "fastify";
|
||||
import gradient from "gradient-string";
|
||||
//@ts-ignore WHY would I want this typechecked AT ALL
|
||||
import { handler as ssrHandler } from "../dist/server/entry.mjs";
|
||||
|
|
@ -13,25 +16,36 @@ import { parsedDoc } from "./config.js";
|
|||
import { setupDB } from "./dbSetup.js";
|
||||
import { catalogAssets, marketplaceAPI } from "./marketplace.js";
|
||||
import { serverFactory } from "./serverFactory.js";
|
||||
|
||||
const app = Fastify({
|
||||
logger: parsedDoc.server.server.logging,
|
||||
ignoreDuplicateSlashes: true,
|
||||
ignoreTrailingSlash: true,
|
||||
serverFactory: serverFactory
|
||||
});
|
||||
|
||||
await app.register(fastifyCompress, {
|
||||
encodings: ["br", "gzip", "deflate"]
|
||||
});
|
||||
await app.register(fastifyMultipart);
|
||||
|
||||
await app.register(fastifyMultipart, {
|
||||
limits: {
|
||||
fileSize: 25 * 1024 * 1024,
|
||||
parts: Infinity
|
||||
},
|
||||
});
|
||||
|
||||
await app.register(fastifyHelmet, {
|
||||
xPoweredBy: false,
|
||||
crossOriginEmbedderPolicy: true,
|
||||
crossOriginOpenerPolicy: true,
|
||||
contentSecurityPolicy: false //Disabled because astro DOES NOT LIKE IT
|
||||
});
|
||||
|
||||
await app.register(fastifyStatic, {
|
||||
root: fileURLToPath(new URL("../dist/client", import.meta.url))
|
||||
});
|
||||
|
||||
//Our marketplace API. Not middleware as I don't want to deal with that LOL. Just a function that passes our app to it.
|
||||
if (parsedDoc.marketplace.enabled) {
|
||||
await app.register(fastifyStatic, {
|
||||
|
|
@ -41,9 +55,13 @@ if (parsedDoc.marketplace.enabled) {
|
|||
});
|
||||
marketplaceAPI(app);
|
||||
}
|
||||
|
||||
await app.register(fastifyMiddie);
|
||||
|
||||
app.use(ssrHandler);
|
||||
const port = parseInt(process.env.PORT) || parsedDoc.server.server.port || parseInt("8080");
|
||||
|
||||
const port: number =
|
||||
parseInt(process.env.PORT as string) || parsedDoc.server.server.port || parseInt("8080");
|
||||
const titleText = `
|
||||
_ _ _ _ ____ _
|
||||
| \\ | | ___| |__ _ _| | __ _ / ___| ___ _ ____ _(_) ___ ___ ___
|
||||
|
|
@ -55,10 +73,19 @@ const titleColors = {
|
|||
purple: "#7967dd",
|
||||
pink: "#eb6f92"
|
||||
};
|
||||
console.log(gradient(Object.values(titleColors)).multiline(titleText));
|
||||
|
||||
console.log(gradient(Object.values(titleColors)).multiline(titleText as string));
|
||||
app.listen({ port: port, host: "0.0.0.0" }).then(async () => {
|
||||
console.log(chalk.hex("#7967dd")(`Server listening on ${chalk.hex("#eb6f92").bold("http://localhost:" + port + "/")}`));
|
||||
console.log(chalk.hex("#7967dd")(`Server also listening on ${chalk.hex("#eb6f92").bold("http://0.0.0.0:" + port + "/")}`));
|
||||
console.log(
|
||||
chalk.hex("#7967dd")(
|
||||
`Server listening on ${chalk.hex("#eb6f92").bold("http://localhost:" + port + "/")}`
|
||||
)
|
||||
);
|
||||
console.log(
|
||||
chalk.hex("#7967dd")(
|
||||
`Server also listening on ${chalk.hex("#eb6f92").bold("http://0.0.0.0:" + port + "/")}`
|
||||
)
|
||||
);
|
||||
if (parsedDoc.marketplace.enabled) {
|
||||
await catalogAssets.sync();
|
||||
await setupDB(catalogAssets);
|
||||
|
|
@ -1,12 +1,17 @@
|
|||
import { createServer } from "node:http";
|
||||
import { FastifyServerFactory, FastifyServerFactoryHandler, RawServerDefault } from "fastify";
|
||||
import wisp from "wisp-server-node";
|
||||
import { LOG_LEVEL } from "wisp-server-node/dist/Types.js";
|
||||
import { LOG_LEVEL, WispOptions } from "wisp-server-node/dist/Types.js";
|
||||
import { parsedDoc } from "./config.js";
|
||||
const wispOptions = {
|
||||
|
||||
const wispOptions: WispOptions = {
|
||||
logLevel: parsedDoc.server.server.logging ? LOG_LEVEL.DEBUG : LOG_LEVEL.NONE,
|
||||
pingInterval: 30,
|
||||
pingInterval: 30
|
||||
};
|
||||
const serverFactory = (handler) => {
|
||||
|
||||
const serverFactory: FastifyServerFactory = (
|
||||
handler: FastifyServerFactoryHandler
|
||||
): RawServerDefault => {
|
||||
const httpServer = createServer();
|
||||
httpServer.on("request", (req, res) => {
|
||||
handler(req, res);
|
||||
|
|
@ -14,10 +19,11 @@ const serverFactory = (handler) => {
|
|||
httpServer.on("upgrade", (req, socket, head) => {
|
||||
if (parsedDoc.server.server.wisp) {
|
||||
if (req.url?.endsWith("/wisp/")) {
|
||||
wisp.routeRequest(req, socket, head, wispOptions);
|
||||
wisp.routeRequest(req, socket as any, head, wispOptions);
|
||||
}
|
||||
}
|
||||
});
|
||||
return httpServer;
|
||||
};
|
||||
|
||||
export { serverFactory };
|
||||
11
server/tsconfig.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"noEmit": false,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"paths": {}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { LoadSuspense } from "./LoadSuspense";
|
||||
|
||||
export function AboutBlank(props: { url: string }) {
|
||||
var newWindow = window.open("about:blank");
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.src = window.location.origin + props.url;
|
||||
iframe.style.width = "100%";
|
||||
iframe.style.height = "100%";
|
||||
iframe.style.border = "none";
|
||||
iframe.style.overflow = "hidden";
|
||||
iframe.style.margin = "0";
|
||||
iframe.style.padding = "0";
|
||||
iframe.style.position = "fixed";
|
||||
iframe.style.top = "0";
|
||||
iframe.style.bottom = "0";
|
||||
iframe.style.left = "0";
|
||||
iframe.style.right = "0";
|
||||
newWindow.document.body.appendChild(iframe);
|
||||
window.location.replace("https://google.com");
|
||||
return (
|
||||
<div>
|
||||
<LoadSuspense />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
.suspenseContainer {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #191724;
|
||||
}
|
||||
|
||||
@keyframes pulse-brighter {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.animate-pulse-brighter {
|
||||
animation: pulse-brighter 2s infinite;
|
||||
height: 11rem;
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import { useRef, useEffect } from "preact/hooks";
|
||||
|
||||
export default function Video({ src, isMuted }) {
|
||||
const refVideo = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!refVideo.current) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMuted) {
|
||||
//open bug since 2017 that you cannot set muted in video element https://github.com/facebook/react/issues/10389
|
||||
refVideo.current.defaultMuted = true;
|
||||
refVideo.current.muted = true;
|
||||
}
|
||||
|
||||
refVideo.current.srcObject = src;
|
||||
}, [src]);
|
||||
|
||||
return (
|
||||
<video
|
||||
ref={refVideo}
|
||||
autoPlay
|
||||
playsInline //FIX iOS black screen
|
||||
className="relative z-10 h-screen w-full"
|
||||
>
|
||||
<source src={src} type="video/mp4" />
|
||||
</video>
|
||||
);
|
||||
}
|
||||
745
src/aes.ts
|
|
@ -1,745 +0,0 @@
|
|||
var Nr = 14,
|
||||
Nk = 8,
|
||||
Decrypt = false,
|
||||
enc_utf8 = function (s) {
|
||||
try {
|
||||
return unescape(encodeURIComponent(s));
|
||||
} catch (e) {
|
||||
throw "Error on UTF-8 encode";
|
||||
}
|
||||
},
|
||||
dec_utf8 = function (s) {
|
||||
try {
|
||||
return decodeURIComponent(escape(s));
|
||||
} catch (e) {
|
||||
throw "Bad Key";
|
||||
}
|
||||
},
|
||||
padBlock = function (byteArr) {
|
||||
var array = [],
|
||||
cpad,
|
||||
i;
|
||||
if (byteArr.length < 16) {
|
||||
cpad = 16 - byteArr.length;
|
||||
array = [
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad,
|
||||
cpad
|
||||
];
|
||||
}
|
||||
for (i = 0; i < byteArr.length; i++) {
|
||||
array[i] = byteArr[i];
|
||||
}
|
||||
return array;
|
||||
},
|
||||
block2s = function (block, lastBlock) {
|
||||
var string = "",
|
||||
padding,
|
||||
i;
|
||||
if (lastBlock) {
|
||||
padding = block[15];
|
||||
if (padding > 16) {
|
||||
throw "Decryption error: Maybe bad key";
|
||||
}
|
||||
if (padding === 16) {
|
||||
return "";
|
||||
}
|
||||
for (i = 0; i < 16 - padding; i++) {
|
||||
string += String.fromCharCode(block[i]);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 16; i++) {
|
||||
string += String.fromCharCode(block[i]);
|
||||
}
|
||||
}
|
||||
return string;
|
||||
},
|
||||
a2h = function (numArr) {
|
||||
var string = "",
|
||||
i;
|
||||
for (i = 0; i < numArr.length; i++) {
|
||||
string += (numArr[i] < 16 ? "0" : "") + numArr[i].toString(16);
|
||||
}
|
||||
return string;
|
||||
},
|
||||
h2a = function (s) {
|
||||
var ret = [];
|
||||
s.replace(/(..)/g, function (s) {
|
||||
ret.push(parseInt(s, 16));
|
||||
});
|
||||
return ret;
|
||||
},
|
||||
s2a = function (string, binary) {
|
||||
var array = [],
|
||||
i;
|
||||
|
||||
if (!binary) {
|
||||
string = enc_utf8(string);
|
||||
}
|
||||
|
||||
for (i = 0; i < string.length; i++) {
|
||||
array[i] = string.charCodeAt(i);
|
||||
}
|
||||
|
||||
return array;
|
||||
},
|
||||
size = function (newsize) {
|
||||
switch (newsize) {
|
||||
case 128:
|
||||
Nr = 10;
|
||||
Nk = 4;
|
||||
break;
|
||||
case 192:
|
||||
Nr = 12;
|
||||
Nk = 6;
|
||||
break;
|
||||
case 256:
|
||||
Nr = 14;
|
||||
Nk = 8;
|
||||
break;
|
||||
default:
|
||||
throw "Invalid Key Size Specified:" + newsize;
|
||||
}
|
||||
},
|
||||
randArr = function (num) {
|
||||
var result = [],
|
||||
i;
|
||||
for (i = 0; i < num; i++) {
|
||||
result = result.concat(Math.floor(Math.random() * 256));
|
||||
}
|
||||
return result;
|
||||
},
|
||||
openSSLKey = function (passwordArr, saltArr) {
|
||||
var rounds = Nr >= 12 ? 3 : 2,
|
||||
key = [],
|
||||
iv = [],
|
||||
md5_hash = [],
|
||||
result = [],
|
||||
data00 = passwordArr.concat(saltArr),
|
||||
i;
|
||||
md5_hash[0] = MD5(data00);
|
||||
result = md5_hash[0];
|
||||
for (i = 1; i < rounds; i++) {
|
||||
md5_hash[i] = MD5(md5_hash[i - 1].concat(data00));
|
||||
result = result.concat(md5_hash[i]);
|
||||
}
|
||||
key = result.slice(0, 4 * Nk);
|
||||
iv = result.slice(4 * Nk, 4 * Nk + 16);
|
||||
return {
|
||||
key: key,
|
||||
iv: iv
|
||||
};
|
||||
},
|
||||
rawEncrypt = function (plaintext, key, iv) {
|
||||
key = expandKey(key);
|
||||
var numBlocks = Math.ceil(plaintext.length / 16),
|
||||
blocks = [],
|
||||
i,
|
||||
cipherBlocks = [];
|
||||
for (i = 0; i < numBlocks; i++) {
|
||||
blocks[i] = padBlock(plaintext.slice(i * 16, i * 16 + 16));
|
||||
}
|
||||
if (plaintext.length % 16 === 0) {
|
||||
blocks.push([
|
||||
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
|
||||
]);
|
||||
numBlocks++;
|
||||
}
|
||||
for (i = 0; i < blocks.length; i++) {
|
||||
blocks[i] =
|
||||
i === 0
|
||||
? xorBlocks(blocks[i], iv)
|
||||
: xorBlocks(blocks[i], cipherBlocks[i - 1]);
|
||||
cipherBlocks[i] = encryptBlock(blocks[i], key);
|
||||
}
|
||||
return cipherBlocks;
|
||||
},
|
||||
rawDecrypt = function (cryptArr, key, iv, binary) {
|
||||
key = expandKey(key);
|
||||
var numBlocks = cryptArr.length / 16,
|
||||
cipherBlocks = [],
|
||||
i,
|
||||
plainBlocks = [],
|
||||
string = "";
|
||||
for (i = 0; i < numBlocks; i++) {
|
||||
cipherBlocks.push(cryptArr.slice(i * 16, (i + 1) * 16));
|
||||
}
|
||||
for (i = cipherBlocks.length - 1; i >= 0; i--) {
|
||||
plainBlocks[i] = decryptBlock(cipherBlocks[i], key);
|
||||
plainBlocks[i] =
|
||||
i === 0
|
||||
? xorBlocks(plainBlocks[i], iv)
|
||||
: xorBlocks(plainBlocks[i], cipherBlocks[i - 1]);
|
||||
}
|
||||
for (i = 0; i < numBlocks - 1; i++) {
|
||||
string += block2s(plainBlocks[i], false);
|
||||
}
|
||||
string += block2s(plainBlocks[i], true);
|
||||
return binary ? string : dec_utf8(string);
|
||||
},
|
||||
encryptBlock = function (block, words) {
|
||||
Decrypt = false;
|
||||
var state = addRoundKey(block, words, 0),
|
||||
round;
|
||||
for (round = 1; round < Nr + 1; round++) {
|
||||
state = subBytes(state);
|
||||
state = shiftRows(state);
|
||||
if (round < Nr) {
|
||||
state = mixColumns(state);
|
||||
}
|
||||
state = addRoundKey(state, words, round);
|
||||
}
|
||||
|
||||
return state;
|
||||
},
|
||||
decryptBlock = function (block, words) {
|
||||
Decrypt = true;
|
||||
var state = addRoundKey(block, words, Nr),
|
||||
round;
|
||||
for (round = Nr - 1; round > -1; round--) {
|
||||
state = shiftRows(state);
|
||||
state = subBytes(state);
|
||||
state = addRoundKey(state, words, round);
|
||||
if (round > 0) {
|
||||
state = mixColumns(state);
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
},
|
||||
subBytes = function (state) {
|
||||
var S = Decrypt ? SBoxInv : SBox,
|
||||
temp = [],
|
||||
i;
|
||||
for (i = 0; i < 16; i++) {
|
||||
temp[i] = S[state[i]];
|
||||
}
|
||||
return temp;
|
||||
},
|
||||
shiftRows = function (state) {
|
||||
var temp = [],
|
||||
shiftBy = Decrypt
|
||||
? [0, 13, 10, 7, 4, 1, 14, 11, 8, 5, 2, 15, 12, 9, 6, 3]
|
||||
: [0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11],
|
||||
i;
|
||||
for (i = 0; i < 16; i++) {
|
||||
temp[i] = state[shiftBy[i]];
|
||||
}
|
||||
return temp;
|
||||
},
|
||||
mixColumns = function (state) {
|
||||
var t = [],
|
||||
c;
|
||||
if (!Decrypt) {
|
||||
for (c = 0; c < 4; c++) {
|
||||
t[c * 4] =
|
||||
G2X[state[c * 4]] ^
|
||||
G3X[state[1 + c * 4]] ^
|
||||
state[2 + c * 4] ^
|
||||
state[3 + c * 4];
|
||||
t[1 + c * 4] =
|
||||
state[c * 4] ^
|
||||
G2X[state[1 + c * 4]] ^
|
||||
G3X[state[2 + c * 4]] ^
|
||||
state[3 + c * 4];
|
||||
t[2 + c * 4] =
|
||||
state[c * 4] ^
|
||||
state[1 + c * 4] ^
|
||||
G2X[state[2 + c * 4]] ^
|
||||
G3X[state[3 + c * 4]];
|
||||
t[3 + c * 4] =
|
||||
G3X[state[c * 4]] ^
|
||||
state[1 + c * 4] ^
|
||||
state[2 + c * 4] ^
|
||||
G2X[state[3 + c * 4]];
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 4; c++) {
|
||||
t[c * 4] =
|
||||
GEX[state[c * 4]] ^
|
||||
GBX[state[1 + c * 4]] ^
|
||||
GDX[state[2 + c * 4]] ^
|
||||
G9X[state[3 + c * 4]];
|
||||
t[1 + c * 4] =
|
||||
G9X[state[c * 4]] ^
|
||||
GEX[state[1 + c * 4]] ^
|
||||
GBX[state[2 + c * 4]] ^
|
||||
GDX[state[3 + c * 4]];
|
||||
t[2 + c * 4] =
|
||||
GDX[state[c * 4]] ^
|
||||
G9X[state[1 + c * 4]] ^
|
||||
GEX[state[2 + c * 4]] ^
|
||||
GBX[state[3 + c * 4]];
|
||||
t[3 + c * 4] =
|
||||
GBX[state[c * 4]] ^
|
||||
GDX[state[1 + c * 4]] ^
|
||||
G9X[state[2 + c * 4]] ^
|
||||
GEX[state[3 + c * 4]];
|
||||
}
|
||||
}
|
||||
|
||||
return t;
|
||||
},
|
||||
addRoundKey = function (state, words, round) {
|
||||
var temp = [],
|
||||
i;
|
||||
for (i = 0; i < 16; i++) {
|
||||
temp[i] = state[i] ^ words[round][i];
|
||||
}
|
||||
return temp;
|
||||
},
|
||||
xorBlocks = function (block1, block2) {
|
||||
var temp = [],
|
||||
i;
|
||||
for (i = 0; i < 16; i++) {
|
||||
temp[i] = block1[i] ^ block2[i];
|
||||
}
|
||||
return temp;
|
||||
},
|
||||
expandKey = function (key) {
|
||||
var w = [],
|
||||
temp = [],
|
||||
i,
|
||||
r,
|
||||
t,
|
||||
flat = [],
|
||||
j;
|
||||
|
||||
for (i = 0; i < Nk; i++) {
|
||||
r = [key[4 * i], key[4 * i + 1], key[4 * i + 2], key[4 * i + 3]];
|
||||
w[i] = r;
|
||||
}
|
||||
|
||||
for (i = Nk; i < 4 * (Nr + 1); i++) {
|
||||
w[i] = [];
|
||||
for (t = 0; t < 4; t++) {
|
||||
temp[t] = w[i - 1][t];
|
||||
}
|
||||
if (i % Nk === 0) {
|
||||
temp = subWord(rotWord(temp));
|
||||
temp[0] ^= Rcon[i / Nk - 1];
|
||||
} else if (Nk > 6 && i % Nk === 4) {
|
||||
temp = subWord(temp);
|
||||
}
|
||||
for (t = 0; t < 4; t++) {
|
||||
w[i][t] = w[i - Nk][t] ^ temp[t];
|
||||
}
|
||||
}
|
||||
for (i = 0; i < Nr + 1; i++) {
|
||||
flat[i] = [];
|
||||
for (j = 0; j < 4; j++) {
|
||||
flat[i].push(
|
||||
w[i * 4 + j][0],
|
||||
w[i * 4 + j][1],
|
||||
w[i * 4 + j][2],
|
||||
w[i * 4 + j][3]
|
||||
);
|
||||
}
|
||||
}
|
||||
return flat;
|
||||
},
|
||||
subWord = function (w) {
|
||||
for (var i = 0; i < 4; i++) {
|
||||
w[i] = SBox[w[i]];
|
||||
}
|
||||
return w;
|
||||
},
|
||||
rotWord = function (w) {
|
||||
var tmp = w[0],
|
||||
i;
|
||||
for (i = 0; i < 3; i++) {
|
||||
w[i] = w[i + 1];
|
||||
}
|
||||
w[3] = tmp;
|
||||
return w;
|
||||
},
|
||||
strhex = function (str, size) {
|
||||
var i,
|
||||
ret = [];
|
||||
for (i = 0; i < str.length; i += size) {
|
||||
ret[i / size] = parseInt(str.substr(i, size), 16);
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
invertArr = function (arr) {
|
||||
var i,
|
||||
ret = [];
|
||||
for (i = 0; i < arr.length; i++) {
|
||||
ret[arr[i]] = i;
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
Gxx = function (a, b) {
|
||||
var i, ret;
|
||||
|
||||
ret = 0;
|
||||
for (i = 0; i < 8; i++) {
|
||||
ret = (b & 1) === 1 ? ret ^ a : ret;
|
||||
a = a > 0x7f ? 0x11b ^ (a << 1) : a << 1;
|
||||
b >>>= 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
},
|
||||
Gx = function (x) {
|
||||
var i,
|
||||
r = [];
|
||||
for (i = 0; i < 256; i++) {
|
||||
r[i] = Gxx(x, i);
|
||||
}
|
||||
return r;
|
||||
},
|
||||
SBox = strhex(
|
||||
"637c777bf26b6fc53001672bfed7ab76ca82c97dfa5947f0add4a2af9ca472c0b7fd9326363ff7cc34a5e5f171d8311504c723c31896059a071280e2eb27b27509832c1a1b6e5aa0523bd6b329e32f8453d100ed20fcb15b6acbbe394a4c58cfd0efaafb434d338545f9027f503c9fa851a3408f929d38f5bcb6da2110fff3d2cd0c13ec5f974417c4a77e3d645d197360814fdc222a908846eeb814de5e0bdbe0323a0a4906245cc2d3ac629195e479e7c8376d8dd54ea96c56f4ea657aae08ba78252e1ca6b4c6e8dd741f4bbd8b8a703eb5664803f60e613557b986c11d9ee1f8981169d98e949b1e87e9ce5528df8ca1890dbfe6426841992d0fb054bb16",
|
||||
2
|
||||
),
|
||||
SBoxInv = invertArr(SBox),
|
||||
Rcon = strhex(
|
||||
"01020408102040801b366cd8ab4d9a2f5ebc63c697356ad4b37dfaefc591",
|
||||
2
|
||||
),
|
||||
G2X = Gx(2),
|
||||
G3X = Gx(3),
|
||||
G9X = Gx(9),
|
||||
GBX = Gx(0xb),
|
||||
GDX = Gx(0xd),
|
||||
GEX = Gx(0xe),
|
||||
enc = function (string, pass, binary) {
|
||||
var salt = randArr(8),
|
||||
pbe = openSSLKey(s2a(pass, binary), salt),
|
||||
key = pbe.key,
|
||||
iv = pbe.iv,
|
||||
cipherBlocks,
|
||||
saltBlock = [[83, 97, 108, 116, 101, 100, 95, 95].concat(salt)];
|
||||
string = s2a(string, binary);
|
||||
cipherBlocks = rawEncrypt(string, key, iv);
|
||||
|
||||
cipherBlocks = saltBlock.concat(cipherBlocks);
|
||||
// @ts-ignore
|
||||
return Base64.encode(cipherBlocks);
|
||||
},
|
||||
dec = function (string, pass, binary) {
|
||||
var cryptArr = Base64.decode(string),
|
||||
salt = cryptArr.slice(8, 16),
|
||||
pbe = openSSLKey(s2a(pass, binary), salt),
|
||||
key = pbe.key,
|
||||
iv = pbe.iv;
|
||||
cryptArr = cryptArr.slice(16, cryptArr.length);
|
||||
|
||||
string = rawDecrypt(cryptArr, key, iv, binary);
|
||||
return string;
|
||||
},
|
||||
MD5 = function (numArr) {
|
||||
function rotateLeft(lValue, iShiftBits) {
|
||||
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
|
||||
}
|
||||
|
||||
function addUnsigned(lX, lY) {
|
||||
var lX4, lY4, lX8, lY8, lResult;
|
||||
lX8 = lX & 0x80000000;
|
||||
lY8 = lY & 0x80000000;
|
||||
lX4 = lX & 0x40000000;
|
||||
lY4 = lY & 0x40000000;
|
||||
lResult = (lX & 0x3fffffff) + (lY & 0x3fffffff);
|
||||
if (lX4 & lY4) {
|
||||
return lResult ^ 0x80000000 ^ lX8 ^ lY8;
|
||||
}
|
||||
if (lX4 | lY4) {
|
||||
if (lResult & 0x40000000) {
|
||||
return lResult ^ 0xc0000000 ^ lX8 ^ lY8;
|
||||
} else {
|
||||
return lResult ^ 0x40000000 ^ lX8 ^ lY8;
|
||||
}
|
||||
} else {
|
||||
return lResult ^ lX8 ^ lY8;
|
||||
}
|
||||
}
|
||||
|
||||
function f(x, y, z) {
|
||||
return (x & y) | (~x & z);
|
||||
}
|
||||
function g(x, y, z) {
|
||||
return (x & z) | (y & ~z);
|
||||
}
|
||||
function h(x, y, z) {
|
||||
return x ^ y ^ z;
|
||||
}
|
||||
function funcI(x, y, z) {
|
||||
return y ^ (x | ~z);
|
||||
}
|
||||
|
||||
function ff(a, b, c, d, x, s, ac) {
|
||||
a = addUnsigned(a, addUnsigned(addUnsigned(f(b, c, d), x), ac));
|
||||
return addUnsigned(rotateLeft(a, s), b);
|
||||
}
|
||||
|
||||
function gg(a, b, c, d, x, s, ac) {
|
||||
a = addUnsigned(a, addUnsigned(addUnsigned(g(b, c, d), x), ac));
|
||||
return addUnsigned(rotateLeft(a, s), b);
|
||||
}
|
||||
|
||||
function hh(a, b, c, d, x, s, ac) {
|
||||
a = addUnsigned(a, addUnsigned(addUnsigned(h(b, c, d), x), ac));
|
||||
return addUnsigned(rotateLeft(a, s), b);
|
||||
}
|
||||
|
||||
function ii(a, b, c, d, x, s, ac) {
|
||||
a = addUnsigned(a, addUnsigned(addUnsigned(funcI(b, c, d), x), ac));
|
||||
return addUnsigned(rotateLeft(a, s), b);
|
||||
}
|
||||
|
||||
function convertToWordArray(numArr) {
|
||||
var lWordCount,
|
||||
lMessageLength = numArr.length,
|
||||
lNumberOfWords_temp1 = lMessageLength + 8,
|
||||
lNumberOfWords_temp2 =
|
||||
(lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64,
|
||||
lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16,
|
||||
lWordArray = [],
|
||||
lBytePosition = 0,
|
||||
lByteCount = 0;
|
||||
while (lByteCount < lMessageLength) {
|
||||
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
||||
lBytePosition = (lByteCount % 4) * 8;
|
||||
lWordArray[lWordCount] =
|
||||
lWordArray[lWordCount] | (numArr[lByteCount] << lBytePosition);
|
||||
lByteCount++;
|
||||
}
|
||||
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
||||
lBytePosition = (lByteCount % 4) * 8;
|
||||
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
|
||||
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
|
||||
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
|
||||
return lWordArray;
|
||||
}
|
||||
|
||||
function wordToHex(lValue) {
|
||||
var lByte,
|
||||
lCount,
|
||||
wordToHexArr = [];
|
||||
for (lCount = 0; lCount <= 3; lCount++) {
|
||||
lByte = (lValue >>> (lCount * 8)) & 255;
|
||||
wordToHexArr = wordToHexArr.concat(lByte);
|
||||
}
|
||||
return wordToHexArr;
|
||||
}
|
||||
|
||||
var x = [],
|
||||
k,
|
||||
AA,
|
||||
BB,
|
||||
CC,
|
||||
DD,
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d,
|
||||
rnd = strhex(
|
||||
"67452301efcdab8998badcfe10325476d76aa478e8c7b756242070dbc1bdceeef57c0faf4787c62aa8304613fd469501698098d88b44f7afffff5bb1895cd7be6b901122fd987193a679438e49b40821f61e2562c040b340265e5a51e9b6c7aad62f105d02441453d8a1e681e7d3fbc821e1cde6c33707d6f4d50d87455a14eda9e3e905fcefa3f8676f02d98d2a4c8afffa39428771f6816d9d6122fde5380ca4beea444bdecfa9f6bb4b60bebfbc70289b7ec6eaa127fad4ef308504881d05d9d4d039e6db99e51fa27cf8c4ac5665f4292244432aff97ab9423a7fc93a039655b59c38f0ccc92ffeff47d85845dd16fa87e4ffe2ce6e0a30143144e0811a1f7537e82bd3af2352ad7d2bbeb86d391",
|
||||
8
|
||||
);
|
||||
|
||||
x = convertToWordArray(numArr);
|
||||
|
||||
a = rnd[0];
|
||||
b = rnd[1];
|
||||
c = rnd[2];
|
||||
d = rnd[3];
|
||||
|
||||
for (k = 0; k < x.length; k += 16) {
|
||||
AA = a;
|
||||
BB = b;
|
||||
CC = c;
|
||||
DD = d;
|
||||
a = ff(a, b, c, d, x[k + 0], 7, rnd[4]);
|
||||
d = ff(d, a, b, c, x[k + 1], 12, rnd[5]);
|
||||
c = ff(c, d, a, b, x[k + 2], 17, rnd[6]);
|
||||
b = ff(b, c, d, a, x[k + 3], 22, rnd[7]);
|
||||
a = ff(a, b, c, d, x[k + 4], 7, rnd[8]);
|
||||
d = ff(d, a, b, c, x[k + 5], 12, rnd[9]);
|
||||
c = ff(c, d, a, b, x[k + 6], 17, rnd[10]);
|
||||
b = ff(b, c, d, a, x[k + 7], 22, rnd[11]);
|
||||
a = ff(a, b, c, d, x[k + 8], 7, rnd[12]);
|
||||
d = ff(d, a, b, c, x[k + 9], 12, rnd[13]);
|
||||
c = ff(c, d, a, b, x[k + 10], 17, rnd[14]);
|
||||
b = ff(b, c, d, a, x[k + 11], 22, rnd[15]);
|
||||
a = ff(a, b, c, d, x[k + 12], 7, rnd[16]);
|
||||
d = ff(d, a, b, c, x[k + 13], 12, rnd[17]);
|
||||
c = ff(c, d, a, b, x[k + 14], 17, rnd[18]);
|
||||
b = ff(b, c, d, a, x[k + 15], 22, rnd[19]);
|
||||
a = gg(a, b, c, d, x[k + 1], 5, rnd[20]);
|
||||
d = gg(d, a, b, c, x[k + 6], 9, rnd[21]);
|
||||
c = gg(c, d, a, b, x[k + 11], 14, rnd[22]);
|
||||
b = gg(b, c, d, a, x[k + 0], 20, rnd[23]);
|
||||
a = gg(a, b, c, d, x[k + 5], 5, rnd[24]);
|
||||
d = gg(d, a, b, c, x[k + 10], 9, rnd[25]);
|
||||
c = gg(c, d, a, b, x[k + 15], 14, rnd[26]);
|
||||
b = gg(b, c, d, a, x[k + 4], 20, rnd[27]);
|
||||
a = gg(a, b, c, d, x[k + 9], 5, rnd[28]);
|
||||
d = gg(d, a, b, c, x[k + 14], 9, rnd[29]);
|
||||
c = gg(c, d, a, b, x[k + 3], 14, rnd[30]);
|
||||
b = gg(b, c, d, a, x[k + 8], 20, rnd[31]);
|
||||
a = gg(a, b, c, d, x[k + 13], 5, rnd[32]);
|
||||
d = gg(d, a, b, c, x[k + 2], 9, rnd[33]);
|
||||
c = gg(c, d, a, b, x[k + 7], 14, rnd[34]);
|
||||
b = gg(b, c, d, a, x[k + 12], 20, rnd[35]);
|
||||
a = hh(a, b, c, d, x[k + 5], 4, rnd[36]);
|
||||
d = hh(d, a, b, c, x[k + 8], 11, rnd[37]);
|
||||
c = hh(c, d, a, b, x[k + 11], 16, rnd[38]);
|
||||
b = hh(b, c, d, a, x[k + 14], 23, rnd[39]);
|
||||
a = hh(a, b, c, d, x[k + 1], 4, rnd[40]);
|
||||
d = hh(d, a, b, c, x[k + 4], 11, rnd[41]);
|
||||
c = hh(c, d, a, b, x[k + 7], 16, rnd[42]);
|
||||
b = hh(b, c, d, a, x[k + 10], 23, rnd[43]);
|
||||
a = hh(a, b, c, d, x[k + 13], 4, rnd[44]);
|
||||
d = hh(d, a, b, c, x[k + 0], 11, rnd[45]);
|
||||
c = hh(c, d, a, b, x[k + 3], 16, rnd[46]);
|
||||
b = hh(b, c, d, a, x[k + 6], 23, rnd[47]);
|
||||
a = hh(a, b, c, d, x[k + 9], 4, rnd[48]);
|
||||
d = hh(d, a, b, c, x[k + 12], 11, rnd[49]);
|
||||
c = hh(c, d, a, b, x[k + 15], 16, rnd[50]);
|
||||
b = hh(b, c, d, a, x[k + 2], 23, rnd[51]);
|
||||
a = ii(a, b, c, d, x[k + 0], 6, rnd[52]);
|
||||
d = ii(d, a, b, c, x[k + 7], 10, rnd[53]);
|
||||
c = ii(c, d, a, b, x[k + 14], 15, rnd[54]);
|
||||
b = ii(b, c, d, a, x[k + 5], 21, rnd[55]);
|
||||
a = ii(a, b, c, d, x[k + 12], 6, rnd[56]);
|
||||
d = ii(d, a, b, c, x[k + 3], 10, rnd[57]);
|
||||
c = ii(c, d, a, b, x[k + 10], 15, rnd[58]);
|
||||
b = ii(b, c, d, a, x[k + 1], 21, rnd[59]);
|
||||
a = ii(a, b, c, d, x[k + 8], 6, rnd[60]);
|
||||
d = ii(d, a, b, c, x[k + 15], 10, rnd[61]);
|
||||
c = ii(c, d, a, b, x[k + 6], 15, rnd[62]);
|
||||
b = ii(b, c, d, a, x[k + 13], 21, rnd[63]);
|
||||
a = ii(a, b, c, d, x[k + 4], 6, rnd[64]);
|
||||
d = ii(d, a, b, c, x[k + 11], 10, rnd[65]);
|
||||
c = ii(c, d, a, b, x[k + 2], 15, rnd[66]);
|
||||
b = ii(b, c, d, a, x[k + 9], 21, rnd[67]);
|
||||
a = addUnsigned(a, AA);
|
||||
b = addUnsigned(b, BB);
|
||||
c = addUnsigned(c, CC);
|
||||
d = addUnsigned(d, DD);
|
||||
}
|
||||
|
||||
return wordToHex(a).concat(wordToHex(b), wordToHex(c), wordToHex(d));
|
||||
},
|
||||
encString = function (plaintext, key, iv) {
|
||||
var i;
|
||||
plaintext = s2a(plaintext, false);
|
||||
|
||||
key = s2a(key, false);
|
||||
for (i = key.length; i < 32; i++) {
|
||||
key[i] = 0;
|
||||
}
|
||||
|
||||
if (iv === undefined) {
|
||||
} else {
|
||||
iv = s2a(iv, false);
|
||||
for (i = iv.length; i < 16; i++) {
|
||||
iv[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
var ct = rawEncrypt(plaintext, key, iv);
|
||||
var ret = [iv];
|
||||
for (i = 0; i < ct.length; i++) {
|
||||
ret[ret.length] = ct[i];
|
||||
}
|
||||
// @ts-ignore
|
||||
return Base64.encode(ret);
|
||||
},
|
||||
decString = function (ciphertext, key) {
|
||||
var tmp = Base64.decode(ciphertext);
|
||||
var iv = tmp.slice(0, 16);
|
||||
var ct = tmp.slice(16, tmp.length);
|
||||
var i;
|
||||
|
||||
key = s2a(key, false);
|
||||
for (i = key.length; i < 32; i++) {
|
||||
key[i] = 0;
|
||||
}
|
||||
|
||||
var pt = rawDecrypt(ct, key, iv, false);
|
||||
return pt;
|
||||
},
|
||||
Base64 = (function () {
|
||||
var _chars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
||||
chars = _chars.split(""),
|
||||
encode = function (b, withBreaks) {
|
||||
var flatArr = [],
|
||||
b64 = "",
|
||||
i,
|
||||
broken_b64,
|
||||
totalChunks = Math.floor((b.length * 16) / 3);
|
||||
for (i = 0; i < b.length * 16; i++) {
|
||||
flatArr.push(b[Math.floor(i / 16)][i % 16]);
|
||||
}
|
||||
for (i = 0; i < flatArr.length; i = i + 3) {
|
||||
b64 += chars[flatArr[i] >> 2];
|
||||
b64 += chars[((flatArr[i] & 3) << 4) | (flatArr[i + 1] >> 4)];
|
||||
if (flatArr[i + 1] !== undefined) {
|
||||
b64 += chars[((flatArr[i + 1] & 15) << 2) | (flatArr[i + 2] >> 6)];
|
||||
} else {
|
||||
b64 += "=";
|
||||
}
|
||||
if (flatArr[i + 2] !== undefined) {
|
||||
b64 += chars[flatArr[i + 2] & 63];
|
||||
} else {
|
||||
b64 += "=";
|
||||
}
|
||||
}
|
||||
broken_b64 = b64.slice(0, 64) + "\n";
|
||||
for (i = 1; i < Math.ceil(b64.length / 64); i++) {
|
||||
broken_b64 +=
|
||||
b64.slice(i * 64, i * 64 + 64) +
|
||||
(Math.ceil(b64.length / 64) === i + 1 ? "" : "\n");
|
||||
}
|
||||
return broken_b64;
|
||||
},
|
||||
decode = function (string) {
|
||||
string = string.replace(/\n/g, "");
|
||||
var flatArr = [],
|
||||
c = [],
|
||||
b = [],
|
||||
i;
|
||||
for (i = 0; i < string.length; i = i + 4) {
|
||||
c[0] = _chars.indexOf(string.charAt(i));
|
||||
c[1] = _chars.indexOf(string.charAt(i + 1));
|
||||
c[2] = _chars.indexOf(string.charAt(i + 2));
|
||||
c[3] = _chars.indexOf(string.charAt(i + 3));
|
||||
|
||||
b[0] = (c[0] << 2) | (c[1] >> 4);
|
||||
b[1] = ((c[1] & 15) << 4) | (c[2] >> 2);
|
||||
b[2] = ((c[2] & 3) << 6) | c[3];
|
||||
flatArr.push(b[0], b[1], b[2]);
|
||||
}
|
||||
flatArr = flatArr.slice(0, flatArr.length - (flatArr.length % 16));
|
||||
return flatArr;
|
||||
};
|
||||
// @ts-ignore
|
||||
if (typeof Array.indexOf === "function") {
|
||||
// @ts-ignore
|
||||
_chars = chars;
|
||||
}
|
||||
|
||||
return {
|
||||
encode: encode,
|
||||
decode: decode
|
||||
};
|
||||
})();
|
||||
|
||||
export { enc, dec };
|
||||
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 34 KiB |
BIN
src/assets/classic_theme.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/credits/libcurl.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/assets/credits/mercury.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/assets/credits/motortruck1221.png
Normal file
|
After Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
BIN
src/assets/credits/rift.jpeg
Normal file
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 30 KiB |
BIN
src/assets/fortnite.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
|
|
@ -1,3 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6" style="width: 23px">
|
||||
<path style="fill: #ffffff00" stroke-linecap="round" stroke-linejoin="round" d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"></path>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 357 B |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
|
@ -1,16 +0,0 @@
|
|||
<svg
|
||||
style="width: 23px"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor"
|
||||
class="w-6 h-6"
|
||||
>
|
||||
<path
|
||||
style="fill: #ffffff00"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"
|
||||
/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 449 B |
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:bx="https://boxy-svg.com">
|
||||
<defs>
|
||||
<linearGradient id="gradient-2" bx:pinned="true">
|
||||
<stop offset="0" style="stop-color: rgb(189, 177, 251);"/>
|
||||
<stop offset="1" style="stop-color: rgb(56, 40, 137);"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="gradient-2-0" gradientUnits="userSpaceOnUse" x1="249.128" y1="108.223" x2="249.128" y2="387.839" gradientTransform="matrix(1, 0, 0, 1, 0.522352, -0.522402)" xlink:href="#gradient-2"/>
|
||||
</defs>
|
||||
<path d="M 461.989 195.13 C 471.654 233.897 435.897 278.674 375.006 312.516 C 351.223 356.99 303.798 387.317 249.174 387.317 C 220.008 387.317 192.894 378.671 170.336 363.842 C 100.132 362.771 47.029 339.987 37.312 301.014 C 27.762 262.712 62.552 218.542 122.115 184.85 C 145.467 139.098 193.594 107.701 249.174 107.701 C 279.078 107.701 306.825 116.79 329.716 132.314 C 399.547 133.535 452.307 156.296 461.989 195.13 Z M 70.452 301.149 C 76.408 321.921 103.025 334.591 140.998 338.165 C 119.847 313.756 107.08 282.1 107.08 247.509 C 107.08 243.191 107.279 238.92 107.668 234.702 C 79.316 257.185 64.695 281.071 70.452 301.149 Z M 432.485 197.337 C 426.434 176.235 399.064 163.495 360.125 160.157 C 379.612 184.088 391.268 214.459 391.268 247.509 C 391.268 254.474 390.75 261.32 389.751 268.012 C 421.698 244.324 438.604 218.679 432.485 197.337 Z M 277.23 306.128 L 267.075 244.49 C 275.532 239.753 279.17 228.619 279.17 218.221 C 279.17 202.927 263.66 189.485 248.397 189.485 C 233.133 189.485 219.189 203.972 219.189 219.266 C 219.189 229.664 223.35 238.709 231.809 243.445 L 217.992 306.65 Z" style="stroke: rgb(0, 0, 0); fill: url('#gradient-2-0'); stroke-width: 0px; stroke-opacity: 0.59;"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
|
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="27.68" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 296"><path fill="#673AB8" d="m128 0l128 73.9v147.8l-128 73.9L0 221.7V73.9z"></path><path fill="#FFF" d="M34.865 220.478c17.016 21.78 71.095 5.185 122.15-34.704c51.055-39.888 80.24-88.345 63.224-110.126c-17.017-21.78-71.095-5.184-122.15 34.704c-51.055 39.89-80.24 88.346-63.224 110.126Zm7.27-5.68c-5.644-7.222-3.178-21.402 7.573-39.253c11.322-18.797 30.541-39.548 54.06-57.923c23.52-18.375 48.303-32.004 69.281-38.442c19.922-6.113 34.277-5.075 39.92 2.148c5.644 7.223 3.178 21.403-7.573 39.254c-11.322 18.797-30.541 39.547-54.06 57.923c-23.52 18.375-48.304 32.004-69.281 38.441c-19.922 6.114-34.277 5.076-39.92-2.147Z"></path><path fill="#FFF" d="M220.239 220.478c17.017-21.78-12.169-70.237-63.224-110.126C105.96 70.464 51.88 53.868 34.865 75.648c-17.017 21.78 12.169 70.238 63.224 110.126c51.055 39.889 105.133 56.485 122.15 34.704Zm-7.27-5.68c-5.643 7.224-19.998 8.262-39.92 2.148c-20.978-6.437-45.761-20.066-69.28-38.441c-23.52-18.376-42.74-39.126-54.06-57.923c-10.752-17.851-13.218-32.03-7.575-39.254c5.644-7.223 19.999-8.261 39.92-2.148c20.978 6.438 45.762 20.067 69.281 38.442c23.52 18.375 42.739 39.126 54.06 57.923c10.752 17.85 13.218 32.03 7.574 39.254Z"></path><path fill="#FFF" d="M127.552 167.667c10.827 0 19.603-8.777 19.603-19.604c0-10.826-8.776-19.603-19.603-19.603c-10.827 0-19.604 8.777-19.604 19.603c0 10.827 8.777 19.604 19.604 19.604Z"></path></svg>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 30 KiB |
61
src/components/Card.astro
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
---
|
||||
interface Props {
|
||||
title: string;
|
||||
body: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
const { href, title, body } = Astro.props;
|
||||
---
|
||||
|
||||
<li class="link-card">
|
||||
<a href={href}>
|
||||
<h2>
|
||||
{title}
|
||||
<span>→</span>
|
||||
</h2>
|
||||
<p>
|
||||
{body}
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<style>
|
||||
.link-card {
|
||||
list-style: none;
|
||||
display: flex;
|
||||
padding: 1px;
|
||||
background-color: #23262d;
|
||||
background-image: none;
|
||||
background-size: 400%;
|
||||
border-radius: 7px;
|
||||
background-position: 100%;
|
||||
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.link-card > a {
|
||||
width: 100%;
|
||||
text-decoration: none;
|
||||
line-height: 1.4;
|
||||
padding: calc(1.5rem - 1px);
|
||||
border-radius: 8px;
|
||||
color: white;
|
||||
background-color: #23262d;
|
||||
opacity: 0.8;
|
||||
}
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
||||
}
|
||||
p {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.link-card:is(:hover, :focus-within) {
|
||||
background-position: 0;
|
||||
background-image: var(--accent-gradient);
|
||||
}
|
||||
.link-card:is(:hover, :focus-within) h2 {
|
||||
color: rgb(var(--accent-light));
|
||||
}
|
||||
</style>
|
||||
71
src/components/Header.astro
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
---
|
||||
import { MARKETPLACE_ENABLED } from "astro:env/client";
|
||||
import { Icon } from "astro-icon/components";
|
||||
import { getLangFromUrl, useTranslations } from "../i18n/utils";
|
||||
import HeaderButton from "./HeaderButton.astro";
|
||||
import Logo from "./Logo.astro";
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const t = useTranslations(lang);
|
||||
---
|
||||
|
||||
<div
|
||||
id="navbar"
|
||||
class="flex h-16 flex-row items-center justify-end border-b-2 border-border-color bg-navbar-color px-4 z-30 relative"
|
||||
>
|
||||
<div class="w-1/8">
|
||||
{/* Typical desktop menu */}
|
||||
<div class="relative flex-row hidden lg:flex">
|
||||
<HeaderButton text={t("header.home")} route={`/${lang}/`}>
|
||||
<Icon
|
||||
name="ph:house-bold"
|
||||
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
|
||||
/>
|
||||
</HeaderButton>
|
||||
<HeaderButton text={t("header.games")} route={`/${lang}/games/`}>
|
||||
<Icon
|
||||
name="ph:cube"
|
||||
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
|
||||
/>
|
||||
{
|
||||
/* Astro won't let us pass the icon as a prop so it's going into the outlet here. */
|
||||
}
|
||||
</HeaderButton>
|
||||
<HeaderButton
|
||||
text={t("header.settings")}
|
||||
route={`/${lang}/settings/appearance`}
|
||||
>
|
||||
<Icon
|
||||
name="ph:wrench-fill"
|
||||
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
|
||||
/>
|
||||
</HeaderButton>
|
||||
{MARKETPLACE_ENABLED &&
|
||||
<HeaderButton text={t("header.catalog")} route={`/${lang}/catalog/1`}>
|
||||
<Icon
|
||||
name="ph:shopping-bag-open-fill"
|
||||
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
|
||||
/>
|
||||
</HeaderButton>
|
||||
}
|
||||
<HeaderButton text={t("header.morelinks")}>
|
||||
<Icon
|
||||
name="ph:link-bold"
|
||||
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
|
||||
/>
|
||||
</HeaderButton>
|
||||
</div>
|
||||
{/* Mobile hamburger menu */}
|
||||
<div class="flex lg:hidden cursor-pointer" id="mobileNavTrigger">
|
||||
<Icon
|
||||
name="ph:text-align-justify-bold"
|
||||
class="h-9 w-9 text-text-color"
|
||||
id="hamburger_menu"
|
||||
/>
|
||||
<Icon
|
||||
name="ph:caret-right-bold"
|
||||
class="h-9 w-9 text-text-color hidden"
|
||||
id="right_caret"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
import { HeaderButton } from "./HeaderButton";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "preact-router";
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
// Header icons
|
||||
import { HiOutlineCube } from "react-icons/hi";
|
||||
import { RxMixerVertical, RxHamburgerMenu } from "react-icons/rx";
|
||||
import { RiLinksFill } from "react-icons/ri";
|
||||
import { BsQuestionLg } from "react-icons/bs";
|
||||
import { useState } from "preact/hooks";
|
||||
import { Logo } from "./Logo";
|
||||
|
||||
export function Header() {
|
||||
const { t } = useTranslation();
|
||||
const [isActive, setIsActive] = useState(false);
|
||||
|
||||
return (
|
||||
<div
|
||||
id="navbar"
|
||||
className="flex h-16 flex-row items-center justify-between border-b-2 border-border-color bg-navbar-color px-4 "
|
||||
>
|
||||
<Link href="/" className="w-1/8">
|
||||
<div className="relative flex flex-row items-center">
|
||||
<div className="h-16 w-16 fill-navbar-text-color transition-all duration-1000 hover:rotate-[360deg]">
|
||||
<Logo />
|
||||
</div>
|
||||
<h1 className="font-roboto invisible whitespace-nowrap text-2xl font-bold text-navbar-text-color sm:visible sm:text-4xl">
|
||||
{" "}
|
||||
{t("header.title")}{" "}
|
||||
</h1>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
<motion.button
|
||||
type="button"
|
||||
className="text-bold z-20 mr-4 text-3xl text-text-color md:hidden"
|
||||
aria-expanded={isActive}
|
||||
aria-controls="navbar-default"
|
||||
onClick={() => setIsActive(!isActive)}
|
||||
initial={{ rotate: 0 }}
|
||||
animate={{ rotate: isActive ? 90 : 0 }}
|
||||
transition={{ duration: 0.5 }}
|
||||
>
|
||||
<RxHamburgerMenu />
|
||||
</motion.button>
|
||||
{window.innerWidth >= 768 && (
|
||||
//standard menu
|
||||
<div
|
||||
className={`fixed inset-0 z-10 flex md:relative md:right-0 ${
|
||||
window.innerWidth <= 768 && !isActive && "hidden"
|
||||
}`}
|
||||
>
|
||||
<div className="mt-16 h-[calc(100%-4rem)] w-full md:mt-auto md:h-full lg:mt-auto lg:h-full">
|
||||
<div
|
||||
className="flex h-full w-full whitespace-nowrap"
|
||||
onClick={() => setIsActive(false)}
|
||||
>
|
||||
<div className="flex w-full flex-col justify-evenly md:flex-row">
|
||||
<HeaderButton
|
||||
href="/games"
|
||||
Icon={HiOutlineCube}
|
||||
translationKey="header.games"
|
||||
/>
|
||||
<HeaderButton
|
||||
href="/settings"
|
||||
Icon={RxMixerVertical}
|
||||
translationKey="header.settings"
|
||||
/>
|
||||
<HeaderButton
|
||||
href="/faq"
|
||||
Icon={BsQuestionLg}
|
||||
translationKey="header.faq"
|
||||
/>
|
||||
<HeaderButton
|
||||
href="/discord"
|
||||
Icon={RiLinksFill}
|
||||
translationKey="header.discord"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{window.innerWidth <= 768 && (
|
||||
//animated mobile menu
|
||||
<motion.div
|
||||
className={`fixed inset-0 z-10 flex md:relative md:right-0 ${
|
||||
window.innerWidth <= 768 && !isActive && "hidden"
|
||||
}`}
|
||||
initial={{ x: 0 }}
|
||||
animate={{ x: isActive ? 0 : 1000 }}
|
||||
transition={{ duration: 0.5 }}
|
||||
>
|
||||
<div className="mt-16 h-[calc(100%-4rem)] w-full md:mt-auto md:h-full lg:mt-auto lg:h-full">
|
||||
<div
|
||||
className="flex h-full w-full"
|
||||
onClick={() => setIsActive(false)}
|
||||
>
|
||||
<div className="flex w-full flex-col justify-evenly md:flex-row">
|
||||
<HeaderButton
|
||||
href="/games"
|
||||
Icon={HiOutlineCube}
|
||||
translationKey="header.games"
|
||||
/>
|
||||
<HeaderButton
|
||||
href="/settings"
|
||||
Icon={RxMixerVertical}
|
||||
translationKey="header.settings"
|
||||
/>
|
||||
<HeaderButton
|
||||
href="/faq"
|
||||
Icon={BsQuestionLg}
|
||||
translationKey="header.faq"
|
||||
/>
|
||||
<HeaderButton
|
||||
href="/discord"
|
||||
Icon={RiLinksFill}
|
||||
translationKey="header.discord"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
16
src/components/HeaderButton.astro
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
const { text, route } = Astro.props;
|
||||
---
|
||||
|
||||
<a
|
||||
class="group flex w-full flex-row items-center justify-center border-t-2 border-solid border-navbar-text-color p-4 lg:border-none h-1/3 lg:h-fit"
|
||||
id="header_anchor"
|
||||
href={route}
|
||||
>
|
||||
<slot />
|
||||
<span
|
||||
class="font-roboto pl-2 text-center text-3xl font-bold text-text-color roboto transition duration-500 group-hover:text-text-hover-color lg:text-xl text-nowrap"
|
||||
>
|
||||
{text}
|
||||
</span>
|
||||
</a>
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "preact-router";
|
||||
|
||||
interface HeaderButtonProps {
|
||||
href: string;
|
||||
Icon: any;
|
||||
translationKey: string;
|
||||
}
|
||||
|
||||
export function HeaderButton(props: HeaderButtonProps) {
|
||||
const { href, Icon, translationKey } = props;
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Link href={href} className="flex h-full w-full bg-navbar-color sm:h-auto">
|
||||
<div className="group flex w-full flex-row items-center justify-center border-t-2 border-solid border-navbar-text-color p-4 md:border-none">
|
||||
<Icon className="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6" />
|
||||
<span className="font-roboto pl-1 text-center text-3xl font-bold text-text-color transition duration-500 group-hover:text-text-hover-color md:text-lg">
|
||||
{t(translationKey)}
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
import { Header } from "./Header";
|
||||
|
||||
export function HeaderRoute(props: { children: any }) {
|
||||
return (
|
||||
<div className="flex h-screen flex-col">
|
||||
<Header />
|
||||
<div className="flex-1 overflow-y-auto overflow-x-hidden">
|
||||
<main className="h-full">{props.children}</main>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||