Compare commits
2 commits
main
...
archive/v7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a38047438f | ||
|
|
64194f6ee3 |
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"$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": []
|
||||
}
|
||||
12
.devcontainer/Dockerfile
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
FROM node:18
|
||||
|
||||
# Install basic development tools
|
||||
RUN apt update && apt install -y less man-db sudo
|
||||
|
||||
# Ensure default `node` user has access to `sudo`
|
||||
ARG USERNAME=node
|
||||
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME
|
||||
|
||||
# Set `DEVCONTAINER` environment variable to help with orientation
|
||||
ENV DEVCONTAINER=true
|
||||
9
.devcontainer/devcontainer.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// See https://containers.dev/implementors/json_reference/ for configuration reference
|
||||
{
|
||||
"name": "Nebula",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"remoteUser": "node",
|
||||
"postCreateCommand": "npm install"
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
node_modules/
|
||||
.vscode
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
.github/
|
||||
.env.example
|
||||
.env
|
||||
dist/
|
||||
.git/
|
||||
.astro/
|
||||
~/
|
||||
.gitignore
|
||||
biome.json
|
||||
docker-compose.yml
|
||||
Dockerfile
|
||||
README.md
|
||||
4
.github/FUNDING.yml
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
patreon: nebuladevs
|
||||
ko_fi: nebulaa
|
||||
11
.github/dependabot.yaml
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
48
.github/workflows/docker.yml
vendored
|
|
@ -1,48 +0,0 @@
|
|||
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@v3
|
||||
- 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
|
||||
36
.github/workflows/release.yml
vendored
|
|
@ -1,36 +0,0 @@
|
|||
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: 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 }}
|
||||
45
.gitignore
vendored
|
|
@ -1,43 +1,10 @@
|
|||
# build output
|
||||
dist/
|
||||
server/*.js
|
||||
|
||||
# generated types
|
||||
.astro/
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
package-lock.json
|
||||
/node_modules
|
||||
|
||||
#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*
|
||||
|
||||
# environment variables
|
||||
.env
|
||||
.env.production
|
||||
|
||||
# macOS-specific files
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.breakpoints
|
||||
|
||||
# jetbrains setting folder
|
||||
.idea/
|
||||
|
||||
# nebula catalog database
|
||||
database.sqlite
|
||||
|
||||
|
||||
# YOUR config
|
||||
config.toml
|
||||
|
||||
# Goofy PNPM problem
|
||||
~/
|
||||
memory.txt
|
||||
old.app.js
|
||||
|
|
|
|||
3
.gitmodules
vendored
|
|
@ -1,3 +0,0 @@
|
|||
[submodule "workerware"]
|
||||
path = workerware
|
||||
url = https://github.com/mercuryworkshop/workerware
|
||||
1
.prettierignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
node_modules
|
||||
6
.prettierrc
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
4
.vscode/extensions.json
vendored
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"recommendations": ["astro-build.astro-vscode"],
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
11
.vscode/launch.json
vendored
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "./node_modules/.bin/astro dev",
|
||||
"name": "Development server",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
10
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"editor.tabSize": 2,
|
||||
"editor.insertSpaces": true,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# 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
|
||||
24
Dockerfile
|
|
@ -1,19 +1,7 @@
|
|||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json .
|
||||
FROM node:18
|
||||
WORKDIR /usr/src/app
|
||||
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
|
||||
ENTRYPOINT ["pnpm"]
|
||||
CMD ["start", "--color"]
|
||||
RUN npm install
|
||||
RUN npm ci
|
||||
EXPOSE 3000
|
||||
CMD ["npm", "start"]
|
||||
|
|
|
|||
661
LICENSE
Normal file
|
|
@ -0,0 +1,661 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2022 Nebula Services
|
||||
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/>.
|
||||
529
README.md
|
|
@ -1,363 +1,214 @@
|
|||
<div align="center">
|
||||
# Nebula
|
||||
|
||||
<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" />
|
||||
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 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>
|
||||
Quick note: If you are a system administrator, and have questions, our email is always open `chloe@nebulaproxy.io`
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
<h2>Get Started</h2>
|
||||
<a>To get started, press one of the buttons below to deploy Incog</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
|
||||
|
||||
- Multiple Proxy "Backends":
|
||||
- [Ultraviolet](https://github.com/titaniumnetwork-dev/ultraviolet)
|
||||
- [RammerHead](https://github.com/binary-person/rammerhead)
|
||||
- Stunning and highly functional UI with multiple themes
|
||||
- XOR/b64 encoding all traffic
|
||||
- Hides your IP from sites
|
||||
- [List of officially supported sites](https://github.com/NebulaServices/Nebula/blob/dev/docs/officially-supported-sites.md)
|
||||
- _limited_ mobile support
|
||||
- Stealth Mode (buffed `about:blank` cloaking)
|
||||
- **NEW** Clickoff cloaking
|
||||
- **NEW** Email OTP verification
|
||||
|
||||
# Deployment
|
||||
|
||||
Table of contents
|
||||
|
||||
- Quick & easy deployment
|
||||
- Deployment configuration explaination
|
||||
- how to use email OTP Verification mode
|
||||
- Advanced Deployment
|
||||
- Filesystem
|
||||
|
||||
## Quick & Easy Deployment Options
|
||||
|
||||
## PLEASE READ THIS NOTICE: IF YOU ARE USING NODE VERSION 20 (HEROKU, RAILWAY), YOU WILL NEED TO TEMPORARILY DOWNGRADE TO 19 OR EARLIER.
|
||||
|
||||
|
||||
[](https://cloud.ibm.com/devops/setup/deploy?repository=https://github.com/NebulaServices/Nebula)
|
||||
<br>
|
||||
[](https://console.aws.amazon.com/amplify/home#/deploy?repo=https://github.com/NebulaServices/Nebula)
|
||||
<br>
|
||||
[](https://deploy.cloud.run/?git_repo=https://github.com/NebulaServices/Nebula)
|
||||
<br>
|
||||
[](https://railway.app/new/template/pBzeiN)
|
||||
<br>
|
||||
[](https://app.koyeb.com/deploy?type=git&repository=github.com/NebulaServices/Nebula&branch=main&name=NebulaProxy)
|
||||
|
||||
---
|
||||
|
||||
## Contributors
|
||||
## Deployment Configuration Guide
|
||||
|
||||
(Example configuration with none-json notes)
|
||||
|
||||
```json
|
||||
{
|
||||
"sendgrid_verification": false,
|
||||
"sendgrid_options": {
|
||||
"api_key": "YOUR_SENDGRID_API_KEY",
|
||||
"sendFromEmail": "THE EMAIL THE CODES WILL BE SENT FROM (MUST BE VERIFIED IN SENDGRID)",
|
||||
"to_email": "THE EMAIL YOU WANT THE CODES SENT TO"
|
||||
},
|
||||
|
||||
"discord_verification": false,
|
||||
"webhook_url": "YOUR DISCORD WEBHOOK URL",
|
||||
|
||||
"smtp_verification": false,
|
||||
"smtp_options": {
|
||||
"to_email": "THE EMAIL YOU WANT THE CODES SENT TO",
|
||||
"sendFromEmail": "THE EMAIL THE CODES ARE SENT FROM",
|
||||
"host": "YOUR SMTP HOST",
|
||||
"port": 465,
|
||||
"auth": {
|
||||
"user": "SMTP USER",
|
||||
"pass": "YOUR PASSWORD"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Email Verification OTP
|
||||
|
||||
### What is this?
|
||||
|
||||
Email verification is a new and unique feature that we've implemented in the event that someone wants to keep their deployment of Nebula private and secure.
|
||||
|
||||
### What does it do
|
||||
|
||||
When a user tries to access the website, before allowed access they will be asked for a One time password sent to an email set in the deployment configuration. Once verified, they will have 15 day access to the site.
|
||||
|
||||
#### SendGrid Setup Instructions
|
||||
|
||||
- Firstly, We need to enable verification within the deployment configuration
|
||||
|
||||
- change `"sendgrid_verification":false,` to `"sendgrid_verification":true,` above the SendGrid Section
|
||||
|
||||
- _Note: You have to reboot the node app for any changes to take place._
|
||||
|
||||
- Now, we need to use an api to send a message
|
||||
- Make an account at Sendgrid (https://app.sendgrid.com/)
|
||||
- _Note: It is likely that other versions of Nebula will use a different package to send emails._
|
||||
- Verify the email you want to recieve emails from (Create a sender identity)
|
||||
- Go to settings -> Sender authentication and click Verify a Single Sender
|
||||
- Now, We need to get the API key to connect to the API
|
||||
- Go to settings -> API Keys -> and make an API key.
|
||||
- Complete the information in the deployment config `deployment.config.json` under the `sendgrid_options` section such as: sendFromEmail, to_email and api_key
|
||||
|
||||
#### Discord Webhook Setup Instructions
|
||||
|
||||
- Set discord_verification to true in the deployment configuration.
|
||||
- Create a channel in a discord server you have admin in.
|
||||
- Click the Edit Channel button.
|
||||
- Click Integrations
|
||||
- Click create web hook and copy the URL.
|
||||
- Paste it under the `webhook_url` section in the deployment configuration.
|
||||
|
||||
#### SMTP Setup Instructions
|
||||
|
||||
- Set `smtp_verification` to true.
|
||||
- Change `to_email` to the email address you want the codes to be sent to.
|
||||
- Change `sendFromEmail to the email address that is going to send the codes.
|
||||
- Get the host and port from your email provider's documentation.
|
||||
- Fill in your username and password under the `user` and `pass` section under auth.
|
||||
|
||||
## Advanced Deployment
|
||||
|
||||
### Initial configuration
|
||||
|
||||
credits to @ProgrammerIn-wonderland for writing this wonderful tutorial (which can also be found in the docs :)
|
||||
|
||||
- Create an account at https://www.cloudflare.com/
|
||||
- Create an account at https://www.freenom.com/ (or any registrars)
|
||||
- Find a free domain name at Freenom
|
||||
- Click checkout
|
||||
- Select (12 Months @ FREE)
|
||||
- Select "Use DNS"
|
||||
- Select Use your own DNS
|
||||
- Go to cloudflare, click add new site, and enter the free domain name
|
||||
- Select "Free Plan"
|
||||
- Click continue, ignore DNS
|
||||
- Copy the name servers cloudflare gives you
|
||||
- Go back to your Freenom tab, enter in the name servers which cloudflare gave you
|
||||
- You can keep IP blank
|
||||
- Click continue
|
||||
- Click complete order
|
||||
- Go back to cloudflare tab, click "Check Nameservers"
|
||||
- Select DNS on your right bar
|
||||
- Enter in the IP of the server which will be hosting Nebula
|
||||
- Target will be `@`
|
||||
- Click Enable proxy (little gray cloud icon, if active its orange)
|
||||
- Select SSL/TLS in your right bar
|
||||
- Click "Flexible"
|
||||
|
||||
- [Rifting](https://github.com/rifting) - Owner & Maintainer
|
||||
- [MotorTruck1221](https://motortruck1221.com) - Maintainer
|
||||
---
|
||||
|
||||
### Server configuration
|
||||
|
||||
- SSH into the server you'll be using, I'll assume its running Ubuntu 22.04 (though the commands are the same for debian 10+ versions, and Ubuntu versions 20.04+)
|
||||
- run
|
||||
|
||||
```
|
||||
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - \ &&
|
||||
sudo apt-get install -y nodejs npm
|
||||
git clone https://github.com/NebulaServices/Nebula.git
|
||||
cd Nebula
|
||||
npm i
|
||||
npm ci
|
||||
sudo nohup PORT=80 node . &
|
||||
```
|
||||
|
||||
**Make sure your firewall is configured to let through port 80 traffic!** \
|
||||
_Note: Server will need to run` cd Nebula && sudo nohup PORT=80 node . &` on reboot_
|
||||
|
||||
## File Structure
|
||||
|
||||
| **File** | Purpose | |
|
||||
| -------------------------------- | -------------------------------------------------------------------------------------------------------- | --- |
|
||||
| `src/index.html` | The main frontend visuals for NebulaWEB. | |
|
||||
| `src/unv.html` | The verification-required frontend/visuals. | |
|
||||
| `src/options.html` | The frontend for Nebula's options, settings, and preferences. | |
|
||||
| `public/resources/v.js` | Client verification system for the OTP system. | |
|
||||
| `public/resources/nebulamain.js` | All of the DOM/client code for NebulaWEB. Includes options, themeSystem, cloak, stealthengine, and more. | |
|
||||
| `app.js` | The backend server for Nebula. Contains Nodestatic, Bare, HTTP, and more. | |
|
||||
|
||||
## 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)
|
||||
---
|
||||
- HTML, JS, CSS
|
||||
- Partical.JS (Specifically v4, 5, 6.1 &< only)
|
||||
- Ultraviolet (proxy)
|
||||
- Osana (proxy)
|
||||
- TompHTTP Bare Server Node
|
||||
- ExpressJS
|
||||
|
||||
## Catalog/Marketplace
|
||||
## Support
|
||||
|
||||
- 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 would recommend using Postgres over SQLite. To do this see [#config](#config)
|
||||
- To use postgres via the provided docker-compose files, see [#docker](#docker)
|
||||
For support, email chloe@nebula.bio or join our discord: discord.gg/unblocker
|
||||
|
||||
### How to make a theme
|
||||
## Demo
|
||||
|
||||
- Themes allow you to customize the *look* of Nebula.
|
||||
[Click here to see a demo of Nebula](https://nebulaproxy.io/)
|
||||
|
||||
#### Prerequisites:
|
||||
- Make sure you have our [Discord server](https://discord.gg/unblocker) so you can submit your theme
|
||||
## Acknowledgements
|
||||
|
||||
##### Making the themes:
|
||||
- [UV (one of the proxies use)](https://github.com/titaniumnetwork-dev/Ultraviolet)
|
||||
- [Osana (one of the proxies we use)](https://github.com/NebulaServices/Osana)
|
||||
- [Bare Server Node](https://github.com/tomphttp/bare-server-node)
|
||||
- [Partical.JS (v4, 5, 6.1 &< only)](https://github.com/VincentGarreau/particles.js)
|
||||
|
||||
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: ;
|
||||
}
|
||||
```
|
||||
## License
|
||||
|
||||
> [!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/submition:
|
||||
> ```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 your satisfied with said colors, submit your theme in 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 the 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 could be named anything. 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 your 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 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
|
||||
|
||||
- The 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, 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
|
||||
|
||||
### Terminal
|
||||
|
||||
Prerequisites:
|
||||
- Node & npm
|
||||
- Git
|
||||
|
||||
1. Clone the repo:
|
||||
```bash
|
||||
git clone https://github.com/nebulaservices/nebula --recursive && cd nebula
|
||||
```
|
||||
|
||||
2. Install all of the dependencies:
|
||||
```bash
|
||||
npm i
|
||||
```
|
||||
|
||||
3. Create a `config.toml` file
|
||||
```bash
|
||||
cp config.example.toml config.toml
|
||||
```
|
||||
|
||||
4. Modify the `config.toml` file to you liking (docs [here](#environment))
|
||||
```
|
||||
nano config.toml
|
||||
```
|
||||
|
||||
5. Build the frontend & server:
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
6. Start the server
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> You can run `npm run bstart` to build and start together
|
||||
---
|
||||
|
||||
### Docker
|
||||
|
||||
- There are two ways to deploy with docker:
|
||||
- [Normal docker](#normal-docker)
|
||||
- [Docker Compose](#docker-compose)
|
||||
|
||||
#### Normal Docker
|
||||
|
||||
Prerequisites:
|
||||
- Git
|
||||
- Docker
|
||||
|
||||
1. Clone the repo (skip if using 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 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. Most of the time, the defaults are fine, 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` |
|
||||
|----------------------------| ----------------------------------------------------------------------------|------------|--------------|
|
||||
(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.
|
||||
|
|
|
|||
249
app.js
Normal file
|
|
@ -0,0 +1,249 @@
|
|||
import express from "express";
|
||||
import cookieParser from "cookie-parser";
|
||||
import http from "node:http";
|
||||
import createBareServer from "@tomphttp/bare-server-node";
|
||||
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
|
||||
import path from "node:path";
|
||||
import config from "./deployment.config.json" assert { type: "json" };
|
||||
import sgMail from "@sendgrid/mail";
|
||||
import nodemailer from "nodemailer";
|
||||
import * as uuid from "uuid";
|
||||
import fs from "node:fs";
|
||||
import bcrypt from "bcrypt";
|
||||
// fx
|
||||
const PORT = process.env.PORT || 3000;
|
||||
const __dirname = process.cwd();
|
||||
const ACTIVE_CODES = new Set();
|
||||
if (!fs.existsSync("./tmp/memory.txt")) {
|
||||
fs.writeFileSync("./tmp/memory.txt", "", "utf-8");
|
||||
}
|
||||
let TOKENS = fs
|
||||
.readFileSync("./tmp/memory.txt", "utf-8")
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((token) => {
|
||||
const parts = token.split(":");
|
||||
return {
|
||||
id: parts[0],
|
||||
token: parts[1],
|
||||
expiration: parts[2]
|
||||
};
|
||||
});
|
||||
|
||||
const server = http.createServer();
|
||||
const app = express(server);
|
||||
const bareServer = createBareServer("/bare/");
|
||||
|
||||
// Middleware
|
||||
app.use(cookieParser());
|
||||
app.use(express.json());
|
||||
app.use(
|
||||
express.urlencoded({
|
||||
extended: true
|
||||
})
|
||||
);
|
||||
|
||||
// Verification
|
||||
app.patch("/generate-otp", async (req, res) => {
|
||||
if (
|
||||
config.sendgrid_verification ||
|
||||
config.discord_verification ||
|
||||
config.smtp_verificaton
|
||||
) {
|
||||
const OTP = generateCode();
|
||||
ACTIVE_CODES.add(OTP);
|
||||
|
||||
setTimeout(() => {
|
||||
ACTIVE_CODES.delete(OTP);
|
||||
}, 1000 * 60 * 5);
|
||||
|
||||
let email = {
|
||||
to: "",
|
||||
from: "",
|
||||
subject: `NebulaWEB personal access code ${OTP}`,
|
||||
text: `
|
||||
####### ACCESS CODE (OTP) ${OTP} #######
|
||||
####### DO NOT SHARE THIS CODE! #######
|
||||
(this message is automated)`
|
||||
};
|
||||
|
||||
if (config.sendgrid_verification) {
|
||||
sgMail.setApiKey(config.sendgrid_options.api_key);
|
||||
|
||||
email.to = config.sendgrid_options.to_email;
|
||||
email.from = config.sendgrid_options.sendFromEmail;
|
||||
try {
|
||||
await sgMail.send(msg);
|
||||
} catch {
|
||||
return res.status(504).end();
|
||||
}
|
||||
}
|
||||
|
||||
if (config.smtp_verification) {
|
||||
const smtpMailerAgent = nodemailer.createTransport(config.smtp_options);
|
||||
|
||||
email.to = config.smtp_options.to_email;
|
||||
email.from = config.smtp_options.sendFromEmail;
|
||||
try {
|
||||
smtpMailerAgent.sendMail(email);
|
||||
} catch {
|
||||
return res.status(504).end();
|
||||
}
|
||||
}
|
||||
|
||||
if (config.discord_verification) {
|
||||
try {
|
||||
await fetch(config.webhook_url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
content: `Your NebulaWEB access code is \`${OTP}\``
|
||||
})
|
||||
});
|
||||
} catch {
|
||||
return res.status(500).end();
|
||||
}
|
||||
}
|
||||
|
||||
res.status(200).end();
|
||||
} else {
|
||||
res.status(404).end();
|
||||
}
|
||||
});
|
||||
|
||||
function generateCode() {
|
||||
const code = Math.floor(Math.random() * 1000000);
|
||||
return code.toString().padStart(6, "0");
|
||||
}
|
||||
|
||||
app.post("/validate-otp", (req, res) => {
|
||||
if (
|
||||
config.sendgrid_verification ||
|
||||
config.discord_verification ||
|
||||
config.smtp_verificaton
|
||||
) {
|
||||
const OTP = req.body.otp;
|
||||
|
||||
if (ACTIVE_CODES.has(OTP)) {
|
||||
ACTIVE_CODES.delete(OTP);
|
||||
|
||||
const token = uuid.v4();
|
||||
|
||||
TOKENS.push({
|
||||
id: OTP,
|
||||
token: hash(token),
|
||||
expiration: Date.now() + 1000 * 60 * 60 * 24 * 30
|
||||
});
|
||||
|
||||
fs.writeFileSync(
|
||||
"./tmp/memory.txt",
|
||||
TOKENS.map((token) => {
|
||||
return `${token.id}:${token.token}:${token.expiration}`;
|
||||
}).join("\n"),
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
validation: `${OTP}:${token}`
|
||||
});
|
||||
} else {
|
||||
res.status(401).json({
|
||||
success: false
|
||||
});
|
||||
}
|
||||
} else {
|
||||
res.status(404).end();
|
||||
}
|
||||
});
|
||||
|
||||
// Static files
|
||||
app.use(express.static(path.join(__dirname, "public")));
|
||||
app.use("/uv/", express.static(uvPath));
|
||||
|
||||
// Login route
|
||||
app.get("/login", (req, res) => {
|
||||
if (
|
||||
config.sendgrid_verification ||
|
||||
config.discord_verification ||
|
||||
config.smtp_verificaton
|
||||
) {
|
||||
res.sendFile(path.join(__dirname, "src", "unv.html"));
|
||||
} else {
|
||||
res.redirect("/");
|
||||
}
|
||||
});
|
||||
|
||||
// General Routes
|
||||
app.use((req, res, next) => {
|
||||
if (
|
||||
config.sendgrid_verification ||
|
||||
config.discord_verification ||
|
||||
config.smtp_verificaton
|
||||
) {
|
||||
const verification = req.cookies["validation"];
|
||||
if (!verification || !validateToken(verification)) {
|
||||
return res.redirect("/login");
|
||||
}
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
app.get("/", (req, res) => {
|
||||
res.sendFile(path.join(__dirname, "src", "index.html"));
|
||||
});
|
||||
|
||||
app.get("/options", (req, res) => {
|
||||
res.sendFile(path.join(__dirname, "src", "options.html"));
|
||||
});
|
||||
|
||||
app.get("/privacy", (req, res) => {
|
||||
res.sendFile(path.join(__dirname, "src", "privacy.html"));
|
||||
});
|
||||
|
||||
// Bare Server
|
||||
server.on("request", (req, res) => {
|
||||
if (bareServer.shouldRoute(req)) {
|
||||
bareServer.routeRequest(req, res);
|
||||
} else {
|
||||
app(req, res);
|
||||
}
|
||||
});
|
||||
|
||||
server.on("upgrade", (req, socket, head) => {
|
||||
if (bareServer.shouldRoute(req)) {
|
||||
bareServer.routeUpgrade(req, socket, head);
|
||||
} else {
|
||||
socket.end();
|
||||
}
|
||||
});
|
||||
|
||||
server.on("listening", () => {
|
||||
console.log(`Server running at http://localhost:${PORT}/.`);
|
||||
});
|
||||
|
||||
server.listen({
|
||||
port: PORT
|
||||
});
|
||||
|
||||
function hash(token) {
|
||||
const salt = bcrypt.genSaltSync(10);
|
||||
return bcrypt.hashSync(token, salt);
|
||||
}
|
||||
|
||||
function validateToken(verification) {
|
||||
const [id, token] = verification.split(":");
|
||||
const tokenData = TOKENS.find((token) => token.id == id);
|
||||
|
||||
if (!tokenData) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tokenData.expiration < Date.now()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return bcrypt.compareSync(token, tokenData.token);
|
||||
}
|
||||
7
app.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "NebulaWEB",
|
||||
"description": "Explore the web. Freely. ",
|
||||
"repository": "https://github.com/NebulaServices/Nebula",
|
||||
"logo": "https://avatars.githubusercontent.com/u/86420004?v=4",
|
||||
"keywords": ["educational", "science", "math"]
|
||||
}
|
||||
118
astro.config.ts
|
|
@ -1,118 +0,0 @@
|
|||
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 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({
|
||||
experimental: {
|
||||
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
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
integrations: [
|
||||
tailwind(),
|
||||
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: `${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
|
|
@ -1,32 +0,0 @@
|
|||
{
|
||||
"$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,19 +0,0 @@
|
|||
[marketplace]
|
||||
enabled = true # Turn on or off the marketplace entirely
|
||||
psk = "CHANGEME" # Change this to something more secure.
|
||||
level = 1
|
||||
|
||||
[db]
|
||||
name = "database" # Your databsae 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)
|
||||
|
||||
[postgres] # Set the "domain" to either and ip address or a actual domain
|
||||
domain = ""
|
||||
port = 5432
|
||||
|
||||
[server.server]
|
||||
port = 8080
|
||||
wisp = true
|
||||
logging = true # Disable for the tons & tons of logs to go away (useful for debugging but otherwise eh)
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
: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;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 9.6 KiB |
|
|
@ -1,18 +0,0 @@
|
|||
: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%);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 56 KiB |
|
|
@ -1,19 +0,0 @@
|
|||
: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;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.7 KiB |
|
|
@ -1,24 +0,0 @@
|
|||
: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");
|
||||
}
|
||||
|
Before Width: | Height: | Size: 50 KiB |
23
deployment.config.json
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"sendgrid_verification": false,
|
||||
"sendgrid_options": {
|
||||
"api_key": "YOUR_SENDGRID_API_KEY",
|
||||
"sendFromEmail": "THE EMAIL THE CODES WILL BE SENT FROM (MUST BE VERIFIED IN SENDGRID)",
|
||||
"to_email": "THE EMAIL YOU WANT THE CODES SENT TO"
|
||||
},
|
||||
|
||||
"discord_verification": false,
|
||||
"webhook_url": "YOUR DISCORD WEBHOOK URL",
|
||||
|
||||
"smtp_verification": false,
|
||||
"smtp_options": {
|
||||
"to_email": "THE EMAIL YOU WANT THE CODES SENT TO",
|
||||
"sendFromEmail": "THE EMAIL THE CODES ARE SENT FROM",
|
||||
"host": "YOUR SMTP HOST",
|
||||
"port": 465,
|
||||
"auth": {
|
||||
"user": "SMTP USER",
|
||||
"pass": "YOUR PASSWORD"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
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,20 +1,10 @@
|
|||
version: "3"
|
||||
services:
|
||||
nebula:
|
||||
image: ghcr.io/nebulaservices/nebula:latest
|
||||
image: nebula:latest
|
||||
build: .
|
||||
container_name: nebula
|
||||
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
|
||||
# DO NOT CHANGE 3000!
|
||||
- your port here:3000
|
||||
|
|
|
|||
8
ecosystem.config.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: "Site",
|
||||
script: "proxysocks node app.js"
|
||||
}
|
||||
]
|
||||
};
|
||||
2551
package-lock.json
generated
Normal file
80
package.json
|
|
@ -1,68 +1,28 @@
|
|||
{
|
||||
"name": "nebula",
|
||||
"name": "nebula-web",
|
||||
"version": "7.11.6",
|
||||
"description": "Explore the web. Freely.",
|
||||
"type": "module",
|
||||
"version": "9.0.0",
|
||||
"private": true,
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
"dev": "concurrently \"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": "concurrently \"npm:build:server\" \"npm: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": "concurrently -m 1 \"npm:format:code\" \"npm:format:imports\"",
|
||||
"version": "changeset version"
|
||||
"start": "node app.js"
|
||||
},
|
||||
"keywords": [
|
||||
"proxy"
|
||||
],
|
||||
"author": "Nebula Services",
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"@astrojs/check": "^0.8.3",
|
||||
"@astrojs/node": "^8.3.4",
|
||||
"@astrojs/svelte": "^5.7.2",
|
||||
"@astrojs/tailwind": "^5.1.2",
|
||||
"@fastify/compress": "^8.0.1",
|
||||
"@fastify/helmet": "^12.0.1",
|
||||
"@fastify/middie": "^9.0.2",
|
||||
"@fastify/multipart": "^9.0.1",
|
||||
"@fastify/static": "^8.0.1",
|
||||
"@iconify-json/ph": "^1.2.1",
|
||||
"@mercuryworkshop/bare-mux": "^2.1.6",
|
||||
"@mercuryworkshop/epoxy-transport": "2.1.13",
|
||||
"@mercuryworkshop/libcurl-transport": "^1.3.10",
|
||||
"@playform/compress": "^0.1.4",
|
||||
"@svelte-drama/suspense": "0.5.1",
|
||||
"@titaniumnetwork-dev/ultraviolet": "^3.2.7",
|
||||
"@types/node": "^22.7.5",
|
||||
"@types/sequelize": "^4.28.20",
|
||||
"astro": "^4.16.2",
|
||||
"astro-icon": "^1.1.1",
|
||||
"chalk": "^5.3.0",
|
||||
"concurrently": "^8.2.2",
|
||||
"fastify": "^5.0.0",
|
||||
"form-data": "^4.0.1",
|
||||
"gradient-string": "^3.0.0",
|
||||
"libcurl.js-new": "npm:libcurl.js@^0.6.16",
|
||||
"nanostores": "^0.10.3",
|
||||
"ora": "^8.1.0",
|
||||
"pg": "^8.13.0",
|
||||
"pg-hstore": "^2.3.4",
|
||||
"sequelize": "^6.37.4",
|
||||
"smol-toml": "^1.3.0",
|
||||
"sqlite3": "^5.1.7",
|
||||
"svelte": "^4.2.19",
|
||||
"svelte-french-toast": "^1.2.0",
|
||||
"tailwindcss": "^3.4.13",
|
||||
"typescript": "^5.6.3",
|
||||
"vite-plugin-static-copy": "^1.0.6",
|
||||
"wisp-server-node": "^1.1.7"
|
||||
"@sendgrid/mail": "^7.7.0",
|
||||
"@tomphttp/bare-server-node": "^1.2.5",
|
||||
"@titaniumnetwork-dev/ultraviolet": "^1.0.11",
|
||||
"bcrypt": "^5.1.0",
|
||||
"cookie-parser": "^1.4.6",
|
||||
"express": "^4.18.2",
|
||||
"nodemailer": "^6.9.1",
|
||||
"uuid": "^9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.3",
|
||||
"@changesets/cli": "^2.27.9",
|
||||
"bufferutil": "^4.0.8",
|
||||
"sharp": "^0.33.5",
|
||||
"tsx": "^4.19.1"
|
||||
"engines": {
|
||||
"node": "19.x"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8722
pnpm-lock.yaml
generated
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 615 B |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
|
@ -1,9 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
|
||||
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
|
||||
<style>
|
||||
path { fill: #000; }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
path { fill: #FFF; }
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 749 B |
BIN
public/images/logo.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
|
|
@ -1,19 +0,0 @@
|
|||
: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;
|
||||
}
|
||||
2
public/osana/osana.bundle.js
Normal file
1
public/osana/osana.bundle.js.map
Normal file
1
public/osana/osana.client.js
Normal file
1
public/osana/osana.client.js.map
Normal file
2
public/osana/osana.config.js
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(()=>{"use strict";self.__osana$config={bare:`${location.origin}/bare/`,prefix:"/service/~osana/",codec:self.__osana$bundle.codecs.none,files:{config:"/osana/osana.config.js",client:"/osana/osana.client.js",bundle:"/osana/osana.bundle.js",worker:"/osana/osana.worker.js"},blacklist:[/^(www\.)?netflix\.com/,/^accounts\.google\.com/]}})();
|
||||
//# sourceMappingURL=osana.config.js.map
|
||||
1
public/osana/osana.config.js.map
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"osana.config.js","mappings":"mBAAAA,KAAKC,eAAiB,CAClBC,KAAM,GAAGC,SAASC,eAClBC,OAAQ,WACRC,MAAON,KAAKO,eAAeC,OAAOC,KAClCC,MAAO,CACHC,OAAQ,mBACRC,OAAQ,mBACRC,OAAQ,mBACRC,OAAQ,oBAEZC,UAAW,CACP,wBACA,0B","sources":["webpack://osana/./src/config.ts"],"sourcesContent":["self.__osana$config = {\n bare: `${location.origin}/bare/`,\n prefix: \"/~osana/\",\n codec: self.__osana$bundle.codecs.none,\n files: {\n config: \"/osana.config.js\",\n client: \"/osana.client.js\",\n bundle: \"/osana.bundle.js\",\n worker: \"/osana.worker.js\"\n },\n blacklist: [\n /^(www\\.)?netflix\\.com/,\n /^accounts\\.google\\.com/,\n ]\n};\nexport {};\n"],"names":["self","__osana$config","bare","location","origin","prefix","codec","__osana$bundle","codecs","none","files","config","client","bundle","worker","blacklist"],"sourceRoot":""}
|
||||
2
public/osana/osana.worker.js
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(()=>{"use strict";importScripts("/osana/osana.bundle.js?1"),importScripts("/osana/osana.config.js?1"),self.OsanaServiceWorker=class{constructor(){this.config=self.__osana$config,this.bundle=self.__osana$bundle,this.bareClient=new this.bundle.BareClient(this.config.bare)}fetch(t){return s=this,n=void 0,r=function*(){const s=this.config.codec.decode(new URL(t.request.url).pathname.replace(this.config.prefix,""))+new URL(t.request.url).search;if(!/^https?:\/\//.test(s))return fetch(t.request.url);const n=new URL(s),i=this.bundle.rewrite.headers.request(Object.fromEntries(t.request.headers.entries()),n);if(this.config.blacklist&&this.config.blacklist.some((e=>e.test(n.host))))return new e;const r={method:t.request.method,headers:i};["GET","HEAD"].includes(t.request.method)||(r.body=yield t.request.blob());const o=yield this.bareClient.fetch(n,r);let a=o.rawResponse.status;const c=this.bundle.rewrite.headers.response(o.rawHeaders,n);let l="";return/text\/html/.test(c["Content-Type"])?(l=`<head><script src="${this.config.files.bundle}?1"><\/script><script src="${this.config.files.config}?1"><\/script><script src="${this.config.files.client}?1"><\/script><link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjYGBkZAAAAAoAAx9k7/gAAAAASUVORK5CYIIA"><link rel="icon" href="${n.origin}/favicon.ico">`+(301===a&&c.location?`<meta http-equiv="refresh" content="0; url=${this.bundle.rewrite.url(c.location)}">`:"")+"</head>",l+=this.bundle.rewrite.html(yield o.text(),n.origin+n.pathname)):l=/text\/css/.test(c["Content-Type"])||"style"===t.request.destination?this.bundle.rewrite.css(yield o.text(),n.origin+n.pathname):/application\/javascript/.test(c["Content-Type"])||"script"===t.request.destination?this.bundle.rewrite.js(yield o.text()):yield o.arrayBuffer(),new Response(l,{status:o.rawResponse.status,statusText:o.rawResponse.statusText,headers:c})},new((i=void 0)||(i=Promise))((function(e,t){function o(e){try{c(r.next(e))}catch(e){t(e)}}function a(e){try{c(r.throw(e))}catch(e){t(e)}}function c(t){var s;t.done?e(t.value):(s=t.value,s instanceof i?s:new i((function(e){e(s)}))).then(o,a)}c((r=r.apply(s,n||[])).next())}));var s,n,i,r}};class e extends Response{constructor(){super("Forbidden",{status:403,statusText:"Forbidden",headers:{"Content-Type":"text/plain"}})}}})();
|
||||
//# sourceMappingURL=osana.worker.js.map
|
||||
1
public/osana/osana.worker.js.map
Normal file
154
public/resources/adjectives_surnames.json
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
{
|
||||
"adjectives": [
|
||||
"admiring",
|
||||
"adoring",
|
||||
"affectionate",
|
||||
"agitated",
|
||||
"amazing",
|
||||
"angry",
|
||||
"awesome",
|
||||
"beautiful",
|
||||
"blissful",
|
||||
"bold",
|
||||
"boring",
|
||||
"brave",
|
||||
"busy",
|
||||
"charming",
|
||||
"clever",
|
||||
"cool",
|
||||
"compassionate",
|
||||
"competent",
|
||||
"condescending",
|
||||
"confident",
|
||||
"cranky",
|
||||
"crazy",
|
||||
"dazzling",
|
||||
"determined",
|
||||
"distracted",
|
||||
"dreamy",
|
||||
"eager",
|
||||
"ecstatic",
|
||||
"elastic",
|
||||
"elated",
|
||||
"elegant",
|
||||
"eloquent",
|
||||
"epic",
|
||||
"exciting",
|
||||
"fervent",
|
||||
"festive",
|
||||
"flamboyant",
|
||||
"focused",
|
||||
"friendly",
|
||||
"frosty",
|
||||
"funny",
|
||||
"gallant",
|
||||
"gifted",
|
||||
"goofy",
|
||||
"gracious",
|
||||
"great",
|
||||
"happy",
|
||||
"hardcore",
|
||||
"heuristic",
|
||||
"hopeful",
|
||||
"hungry",
|
||||
"infallible",
|
||||
"inspiring",
|
||||
"interesting",
|
||||
"intelligent",
|
||||
"jolly",
|
||||
"jovial",
|
||||
"keen",
|
||||
"kind",
|
||||
"laughing",
|
||||
"loving",
|
||||
"lucid",
|
||||
"magical",
|
||||
"mystifying",
|
||||
"modest",
|
||||
"musing",
|
||||
"naughty",
|
||||
"nervous",
|
||||
"nice",
|
||||
"nifty",
|
||||
"nostalgic",
|
||||
"objective",
|
||||
"optimistic",
|
||||
"peaceful",
|
||||
"pedantic",
|
||||
"pensive",
|
||||
"practical",
|
||||
"priceless",
|
||||
"quirky",
|
||||
"quizzical",
|
||||
"recursing",
|
||||
"relaxed",
|
||||
"reverent",
|
||||
"romantic",
|
||||
"sad",
|
||||
"serene",
|
||||
"sharp",
|
||||
"silly",
|
||||
"sleepy",
|
||||
"stoic",
|
||||
"strange",
|
||||
"stupefied",
|
||||
"suspicious",
|
||||
"sweet",
|
||||
"tender",
|
||||
"thirsty",
|
||||
"trusting",
|
||||
"unruffled",
|
||||
"upbeat",
|
||||
"vibrant",
|
||||
"vigilant",
|
||||
"vigorous",
|
||||
"wizardly",
|
||||
"wonderful",
|
||||
"xenodochial",
|
||||
"youthful",
|
||||
"zealous",
|
||||
"zen"
|
||||
],
|
||||
"surnames": [
|
||||
"albattani",
|
||||
"allen",
|
||||
"almeida",
|
||||
"antonelli",
|
||||
"agnesi",
|
||||
"archimedes",
|
||||
"ardinghelli",
|
||||
"aryabhata",
|
||||
"austin",
|
||||
"babbage",
|
||||
"banach",
|
||||
"banzai",
|
||||
"bardeen",
|
||||
"bartik",
|
||||
"bassi",
|
||||
"beaver",
|
||||
"bell",
|
||||
"benz",
|
||||
"bhabha",
|
||||
"bhaskara",
|
||||
"black",
|
||||
"blackburn",
|
||||
"blackwell",
|
||||
"bohr",
|
||||
"booth",
|
||||
"borg",
|
||||
"bose",
|
||||
"bouman",
|
||||
"boyd",
|
||||
"brahmagupta",
|
||||
"brattain",
|
||||
"brown",
|
||||
"buck",
|
||||
"burnell",
|
||||
"cannon",
|
||||
"carson",
|
||||
"cartwright",
|
||||
"carver",
|
||||
"cerf",
|
||||
"chandrasekhar"
|
||||
]
|
||||
}
|
||||
46
public/resources/nebulaclock.js
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// Get's the current day using the Date function built in.
|
||||
// A dependency for displaying time - displayTime(void)
|
||||
function getDayName(dateStr, locale) {
|
||||
var date = new Date(dateStr);
|
||||
return date.toLocaleDateString(locale, { weekday: "long" });
|
||||
}
|
||||
|
||||
// The main function to show the time on the main page
|
||||
// needs to be initialized by a call (only one)
|
||||
// Dependent on getDayName function
|
||||
function displayTime() {
|
||||
var date = new Date();
|
||||
var h = date.getHours(); // 0 - 23
|
||||
var m = date.getMinutes(); // 0 - 59
|
||||
var s = date.getSeconds(); // 0 - 59
|
||||
var session = "AM";
|
||||
h = h == 12 ? 24 : h;
|
||||
|
||||
if (h == 0) {
|
||||
h = 12;
|
||||
} else if (h >= 12) {
|
||||
h = h - 12;
|
||||
session = "PM";
|
||||
}
|
||||
h = h < 10 ? "0" + h : h;
|
||||
m = m < 10 ? "0" + m : m;
|
||||
s = s < 10 ? "0" + s : s;
|
||||
// Repeat itself every second
|
||||
setTimeout(displayTime, 1000);
|
||||
// Get today's date
|
||||
var today = new Date();
|
||||
var dd = String(today.getDate()).padStart(2, "0");
|
||||
var mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0!
|
||||
var yyyy = today.getFullYear();
|
||||
today = mm + "/" + dd + "/" + yyyy;
|
||||
var time = h + "<span style='opacity:100%;' class='clockColon'>:</span>" + m;
|
||||
try {
|
||||
document.getElementById("digitalClock").innerHTML =
|
||||
getDayName(today, "us-US") + ", " + time + " " + session + ".";
|
||||
} catch {}
|
||||
|
||||
return time;
|
||||
}
|
||||
// initialize the time function
|
||||
|
||||
displayTime();
|
||||
359
public/resources/nebulamain.js
Normal file
|
|
@ -0,0 +1,359 @@
|
|||
// Welcome to the main Nebula script
|
||||
// This script handles all the tasks neccesary for a proxy.
|
||||
// What this doesn't include is the actual proxies, just the neccesary tasks in order for the proxies to be able to preform, such as registering the service worker required by Interception proxies.
|
||||
|
||||
// Documentation Writers/Contributors:
|
||||
// GreenWorld#0001 (Discord) / GreenyDev (Github)
|
||||
// If you would like to contribute, feel free to open a pull request.
|
||||
// These docs are not finished
|
||||
|
||||
// Navigation controls for smaller devices
|
||||
// Executed in the inline HTML
|
||||
function openNav() {
|
||||
document.getElementById("sidenav").style.width = "260px";
|
||||
}
|
||||
function closeNav() {
|
||||
document.getElementById("sidenav").style.width = "0px";
|
||||
}
|
||||
|
||||
function setLoaderText() {
|
||||
document.getElementById("connectorText").textContent =
|
||||
"connecting to service";
|
||||
const loader = document.getElementById("lpoader");
|
||||
|
||||
const loadConstructer = loader.style;
|
||||
loadConstructer.display = "flex";
|
||||
loadConstructer.justifyContent = "center";
|
||||
// Changing the text over multiple periods of time creates character, and aliveness (is that even a word?)
|
||||
setTimeout(() => {
|
||||
document.getElementById("connectorText").style.fontSize = "12px";
|
||||
document.getElementById("connectorText").textContent =
|
||||
"Due to high server load, this may take a while.";
|
||||
}, 3200);
|
||||
setTimeout(() => {
|
||||
document.getElementById("connectorText").style.fontSize = "14px";
|
||||
document.getElementById("connectorText").textContent =
|
||||
"Hmmm.. Something isn't right..";
|
||||
}, 17000);
|
||||
}
|
||||
|
||||
window.stealthEngineLoaded = false;
|
||||
|
||||
window.addEventListener("load", () => {
|
||||
// Register the service workers for Osana and Ultraviolet proxy protocols
|
||||
// This is a better method than registering onsubmit because this allows the ability to use proxied links on the main page.
|
||||
|
||||
navigator.serviceWorker.register("./sw.js", {
|
||||
scope: "/service/"
|
||||
});
|
||||
|
||||
// Link evaluation
|
||||
// This functions' purpose is to check a string of text (the argument)
|
||||
// it recognizes whether a string is a URL or not, and it returns a true or false value
|
||||
function isUrl(val = "") {
|
||||
if (
|
||||
/^http(s?):\/\//.test(val) ||
|
||||
(val.includes(".") && val.substr(0, 1) !== " ")
|
||||
)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
const proxy = localStorage.getItem("proxy") || "uv";
|
||||
const inpbox = document.querySelector("form");
|
||||
// Display the "loading" indicators on the main page, looks much better than a static/still screen.
|
||||
|
||||
const hasLoadedElement = document.createElement("div");
|
||||
hasLoadedElement.id = "hasLoaded";
|
||||
hasLoadedElement.style.display = "none";
|
||||
document.body.appendChild(hasLoadedElement);
|
||||
|
||||
inpbox.addEventListener("submit", (event) => {
|
||||
// Prevents the default event tasks
|
||||
event.preventDefault();
|
||||
console.log("Connecting to service -> loading");
|
||||
setLoaderText();
|
||||
});
|
||||
|
||||
// Form submission
|
||||
const form = document.querySelector("form");
|
||||
form.addEventListener("submit", (event) => {
|
||||
event.preventDefault();
|
||||
// Check if the service worker (commonly called SW) is registered
|
||||
if (typeof navigator.serviceWorker === "undefined")
|
||||
alert(
|
||||
"An error occured registering your service worker. Please contact support - discord.gg/unblocker"
|
||||
);
|
||||
//
|
||||
if (proxy === "uv" || proxy === "osana") {
|
||||
// Re-register the service worker incase it failed to onload
|
||||
navigator.serviceWorker
|
||||
.register("./sw.js", {
|
||||
scope: "/service/"
|
||||
})
|
||||
.then(() => {
|
||||
const value = event.target.firstElementChild.value;
|
||||
let url = value.trim();
|
||||
if (!isUrl(url)) url = "https://www.google.com/search?q=" + url;
|
||||
if (!(url.startsWith("https://") || url.startsWith("http://")))
|
||||
url = "http://" + url;
|
||||
// encode the URL for UltraViolet
|
||||
let redirectTo =
|
||||
proxy === "uv"
|
||||
? __uv$config.prefix + __uv$config.encodeUrl(url)
|
||||
: __osana$config.prefix + __osana$config.codec.encode(url);
|
||||
const option = localStorage.getItem("nogg");
|
||||
if (option === "on") {
|
||||
if (window.stealthEngineLoaded !== false) {
|
||||
stealthEngine(redirectTo);
|
||||
} else {
|
||||
console.error(
|
||||
"Stealth Engine failed to load! Please contact support - discord.gg/unblocker"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
// If StealthMode is off, this is the enabled option.
|
||||
const _popout = window.open("/blob", "_self");
|
||||
const blob = _popout.document;
|
||||
// Write all of the neccesary page elements, and the Options including the cloak (if enabled)
|
||||
// The blob writing is just the background elements, like the "Nebula is loading your content, please wait" screen. It does not carry proxied content, or even the iframe.
|
||||
blob.write(`
|
||||
<script>
|
||||
function handleTabLeave(activeInfo) {
|
||||
var link = document.querySelector("link[rel~='icon']");
|
||||
if (localStorage.getItem('ADVcloak') == "on") {
|
||||
if (document.title == "Nebula") {
|
||||
document.title = "Google"
|
||||
if (!link) {
|
||||
link = document.createElement('link');
|
||||
link.rel = 'icon';
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
}
|
||||
link.href = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQo7AE3IF34XPGyseQjkXIOsWXpkZiLlMjSAwySjcJSPAwlv3hnGKi1&usqp=CAU';
|
||||
document.title = "Google"
|
||||
} else if (document.title == "Google") {
|
||||
document.title = "Nebula"
|
||||
if (!link) {
|
||||
link = document.createElement('link');
|
||||
link.rel = 'icon';
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
document.addEventListener("visibilitychange", handleTabLeave)
|
||||
</script>
|
||||
|
||||
<style>@import "https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap"; body{background:#191724;color:#fff}div{margin-top:30px;font-size:100px;text-align:center;font-family:"Roboto";font-weight:700}.loader .b1{left:42%}.loader .b2{left:50%;animation-delay:100ms}.loader .b3{left:58%;animation-delay:200ms;color:#eb6f92}.loader .b1,.loader .b2,.loader .b3{width:10px;height:30px;position:absolute;top:50%;transform:rotate(0);animation-name:spinify;animation-duration:1600ms;animation-iteration-count:infinite;color:#eb6f92;background-color:#eb6f92}@keyframes spinify{0%{transform:translate(0px,0px)}33%{transform:translate(0px,24px);border-radius:100%;width:10px;height:10px}66%{transform:translate(0px,-16px)}88%{transform:translate(0px,4px)}100%{transform:translate(0px,0px)}}</style>
|
||||
<div class="loader">
|
||||
<div>Nebula is loading your content!</div>
|
||||
<div style='font-size:35px;'>Please wait</div>
|
||||
<div class="b1"></div>
|
||||
<div class="b2"></div>
|
||||
<div class="b3"></div>
|
||||
</div>
|
||||
`);
|
||||
// inside of the blob, create and append the Iframe element which WILL carry the proxied content.
|
||||
const iframe = blob.createElement("iframe");
|
||||
const style = iframe.style;
|
||||
const img = blob.createElement("link");
|
||||
const link = location.href;
|
||||
// We attach ARC because it supports us, keeping our arc link there would be greatly appreciated :)
|
||||
const arcSrc = blob.createElement("script");
|
||||
arcSrc.setAttribute(
|
||||
"src",
|
||||
"https://arc.io/widget.min.js#BgaWcYfi"
|
||||
);
|
||||
// Arc requires the Async attribute
|
||||
// Async means not running parallel to other tasks, so it loads seperately to everything else (in a sense)
|
||||
// Aysnchronous and Synchronous are somewhat difficult topics, so we recommend you
|
||||
arcSrc.setAttribute("async", "");
|
||||
blob.head.appendChild(arcSrc);
|
||||
img.rel = "icon";
|
||||
img.href =
|
||||
"https://static.nebulacdn.xyz/content/images/nebula_logo_619x619.png";
|
||||
blob.title = getRandomName();
|
||||
// slice the link like some nice fruit :)
|
||||
// Removing the '/' from 'whateverthislinkis.gay/'
|
||||
// ^
|
||||
var currentLink = link.slice(0, link.length - 1);
|
||||
// To attribute the iframe to a source, we need to + the current link (post-slice) to the requested website, which is passed through the functions argument
|
||||
iframe.src = currentLink + redirectTo;
|
||||
|
||||
// Style the Iframe to fill the entire screen and remove the bessels.
|
||||
style.position = "fixed";
|
||||
style.top = style.bottom = style.left = style.right = 0;
|
||||
style.border = style.outline = "none";
|
||||
style.width = style.height = "100%";
|
||||
// finally, append the iframe to the blob's (window) body
|
||||
blob.body.appendChild(iframe);
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Set the option
|
||||
var option = localStorage.getItem("nogg");
|
||||
if (localStorage.getItem("theme") == null) {
|
||||
localStorage.setItem("theme", "dark");
|
||||
}
|
||||
|
||||
// Extra logging for support
|
||||
function log() {
|
||||
setTimeout(
|
||||
console.log.bind(
|
||||
console,
|
||||
"%cWelcome To Nebula!",
|
||||
"background: #3F51B5;color:#FFF;padding:5px;border-radius: 5px;line-height: 26px; font-size:24px;"
|
||||
)
|
||||
);
|
||||
setTimeout(
|
||||
console.log.bind(
|
||||
console,
|
||||
"%cIf you are seeing this, Nebula's main script has succesfully loaded!",
|
||||
"background: green;color:#FFF;padding:5px;border-radius: 5px;line-height: 26px; font-size:16px;"
|
||||
)
|
||||
);
|
||||
setTimeout(
|
||||
console.log.bind(
|
||||
console,
|
||||
"%cIf you encounter an error, contact our support team on discord. Copy and paste the information below and send it in the ticket",
|
||||
"background: red;color:#FFF;padding:5px;border-radius: 5px;line-height: 26px; font-size:12px;"
|
||||
)
|
||||
);
|
||||
let online = navigator.onLine;
|
||||
let userAgent = navigator.userAgent;
|
||||
let browserName;
|
||||
let diagnosticDomain = window.location.href;
|
||||
if (userAgent.match(/chrome|chromium|crios/i)) {
|
||||
browserName = "Chrome";
|
||||
} else if (userAgent.match(/firefox|fxios/i)) {
|
||||
browserName = "Firefox";
|
||||
} else if (userAgent.match(/safari/i)) {
|
||||
browserName = "Safari";
|
||||
} else if (userAgent.match(/opr\//i)) {
|
||||
browserName = "Opera";
|
||||
} else if (userAgent.match(/edg/i)) {
|
||||
browserName = "Edge";
|
||||
} else {
|
||||
browserName = "Browser not detected!";
|
||||
}
|
||||
setTimeout(
|
||||
console.log.bind(
|
||||
console,
|
||||
`%c Information: \n Online: ${online} \n URL: ${diagnosticDomain} \n Browser: ${browserName} \n UA: ${userAgent}`,
|
||||
"background: gray;color:#FFF;padding:5px;line-height: 26px; font-size:14px;"
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
log();
|
||||
|
||||
// Adjectives and surnames for a more advanced stealth engine.
|
||||
// Used together to generate random names for the tab name
|
||||
let adjectives;
|
||||
let surnames;
|
||||
|
||||
async function surnameAdjectivesData() {
|
||||
await fetch("/resources/adjectives_surnames.json")
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
adjectives = data.adjectives;
|
||||
surnames = data.surnames;
|
||||
});
|
||||
}
|
||||
surnameAdjectivesData();
|
||||
|
||||
// Random number generator
|
||||
// Dependency of getRandomName function
|
||||
function getRandomNumber(min, max) {
|
||||
return Math.floor(Math.random() * (max - min) + min);
|
||||
}
|
||||
|
||||
// Random name generator
|
||||
function getRandomName() {
|
||||
const random1 = getRandomNumber(0, adjectives.length);
|
||||
const random2 = getRandomNumber(0, surnames.length);
|
||||
const adjective = adjectives[random1];
|
||||
const surname = surnames[random2];
|
||||
// Connect the adjective and surname together to create a random name
|
||||
const randomName = adjective + "-" + surname;
|
||||
return randomName;
|
||||
}
|
||||
|
||||
// Clickoff cloaking
|
||||
// This is used to cloak the tab when it is not active
|
||||
function handleTabLeave() {
|
||||
var link = document.querySelector("link[rel~='icon']");
|
||||
if (localStorage.getItem("ADVcloak") == "on") {
|
||||
if (document.title == "Nebula") {
|
||||
if (!link) {
|
||||
link = document.createElement("link");
|
||||
link.rel = "icon";
|
||||
document.getElementsByTagName("head")[0].appendChild(link);
|
||||
}
|
||||
link.href = "https://www.google.com/favicon.ico";
|
||||
document.title = "Google";
|
||||
} else if (document.title == "Google") {
|
||||
document.title = "Nebula";
|
||||
if (!link) {
|
||||
link = document.createElement("link");
|
||||
link.rel = "icon";
|
||||
document.getElementsByTagName("head")[0].appendChild(link);
|
||||
}
|
||||
link.href =
|
||||
"https://camo.githubusercontent.com/b565ae2e136e0ac6023e7099288a62382de7c2b8cdce86a8b90449b86649434c/68747470733a2f2f6e6562756c6170726f78792e6e6562756c612e62696f2f696d616765732f6c6f676f2e706e67";
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Create and Add the event listener
|
||||
document.addEventListener("visibilitychange", handleTabLeave);
|
||||
|
||||
const stealthStored = localStorage.getItem("nogg");
|
||||
function link(_link) {
|
||||
if (stealthStored == "on") {
|
||||
let inFrame;
|
||||
try {
|
||||
inFrame = window !== top;
|
||||
} catch (e) {
|
||||
inFrame = true;
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!inFrame && !navigator.userAgent.includes("Firefox")) {
|
||||
const popup = open("about:blank", "_blank");
|
||||
if (!popup || popup.closed) {
|
||||
alert("Popups are disabled!");
|
||||
} else {
|
||||
const doc = popup.document;
|
||||
const iframe = doc.createElement("iframe");
|
||||
const style = iframe.style;
|
||||
const img = doc.createElement("link");
|
||||
img.rel = "icon";
|
||||
img.href =
|
||||
"https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png";
|
||||
doc.title = getRandomName();
|
||||
var currentLink = _link.slice(0, _link.length - 1);
|
||||
iframe.src =
|
||||
location.origin +
|
||||
"/service/go/" +
|
||||
__uv$config.encodeUrl(currentLink);
|
||||
style.position = "fixed";
|
||||
style.top = style.bottom = style.left = style.right = 0;
|
||||
style.border = style.outline = "none";
|
||||
style.width = style.height = "100%";
|
||||
doc.body.appendChild(iframe);
|
||||
}
|
||||
}
|
||||
}, 200);
|
||||
} else {
|
||||
location.href =
|
||||
"service/go/" + __uv$config.encodeUrl("https://radon.games/");
|
||||
}
|
||||
}
|
||||
124
public/resources/options.js
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
// OPTIONS
|
||||
|
||||
const storedSetTheme = localStorage.getItem("theme");
|
||||
|
||||
function switchProxy() {
|
||||
var selecter = document.getElementById("proxySwitcher");
|
||||
var selectedOption = selecter.value;
|
||||
|
||||
localStorage.setItem("proxy", selectedOption);
|
||||
var storedChoice = localStorage.getItem("proxy");
|
||||
}
|
||||
|
||||
function setDefaultsIfUndefined() {
|
||||
if (localStorage.ADVcloak == undefined) localStorage.setItem("ADVcloak", "off")
|
||||
if (localStorage.nogg == undefined) localStorage.setItem("nogg", "off")
|
||||
if (localStorage.ABtitle == undefined) localStorage.setItem("ABtitle", "")
|
||||
if (localStorage.ABfaviconURL == undefined) localStorage.setItem("ABfaviconURL", "")
|
||||
if (localStorage.theme == undefined) localStorage.setItem("theme", "dark")
|
||||
if (localStorage.proxy == undefined) localStorage.setItem("proxy", "uv")
|
||||
}
|
||||
setDefaultsIfUndefined();
|
||||
|
||||
function resetViews() {
|
||||
changeCSS("--background-primary", "#191724", true);
|
||||
changeCSS("--navbar-color", "#26233a", true);
|
||||
changeCSS("--navbar-height", "60px", true);
|
||||
changeCSS("--navbar-text-color", "rgb(121 103 221)", true);
|
||||
changeCSS("--navbar-link-color", "#e0def4", true);
|
||||
changeCSS("--navbar-font", '"Roboto"', true);
|
||||
changeCSS("--input-text-color", "#e0def4", true);
|
||||
changeCSS("--input-placeholder-color", "#6e6a86", true);
|
||||
changeCSS("--input-background-color", "#1f1d2e", true);
|
||||
changeCSS("--input-placeholder-color", "white", true);
|
||||
changeCSS("--input-border-color", "#eb6f92", true);
|
||||
changeCSS("--input-border-size", "1.3px", true);
|
||||
return "All views reset";
|
||||
}
|
||||
function saveIc() {
|
||||
var notification = `
|
||||
<div class="notification-container" id="notification-container">
|
||||
<div class="notification notification-success">
|
||||
<strong>Success!</strong> Your settings have been saved!
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
document.getElementById("notifhere").innerHTML = notification;
|
||||
setTimeout(() => {
|
||||
var NotificationOBJ = document.getElementById("notifhere");
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function unsavedChanges() {
|
||||
var notification = `
|
||||
<div class="notification-container" id="notification-container">
|
||||
<div class="notification notification-danger" id="notification-container">
|
||||
<strong>Danger!</strong> You have unsaved changes!
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
document.getElementById("notifhere").innerHTML = notification;
|
||||
setTimeout(() => {
|
||||
var NotificationOBJ = document.getElementById("notifhere");
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
var option = localStorage.getItem("nogg");
|
||||
|
||||
function toggleNoGG() {
|
||||
if (option === "on") {
|
||||
option = "off";
|
||||
localStorage.setItem("nogg", "off");
|
||||
} else {
|
||||
option = "on";
|
||||
localStorage.setItem("nogg", "on");
|
||||
}
|
||||
}
|
||||
var option2 = localStorage.ADVcloak;
|
||||
function toggleClickoff() {
|
||||
if (option2 == undefined) return console.error("ADVcloak key unset!")
|
||||
if (option2 === "on") {
|
||||
option2 = "off";
|
||||
localStorage.setItem("ADVcloak", "off");
|
||||
} else {
|
||||
option2 = "on";
|
||||
localStorage.setItem("ADVcloak", "on");
|
||||
}
|
||||
}
|
||||
|
||||
function toggleSetting(localStorageKey, value) {
|
||||
localStorage.setItem(localStorageKey, value);
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
if (localStorage.getItem("ABfaviconURL") === null) {
|
||||
} else if (localStorage.getItem("ABfaviconURL") == "") {
|
||||
} else {
|
||||
document.querySelector("#faviconInput").value =
|
||||
localStorage.getItem("ABfaviconURL");
|
||||
}
|
||||
if (localStorage.getItem("ABtitle") === null) {
|
||||
} else if (localStorage.getItem("ABtitle") == "") {
|
||||
} else {
|
||||
document.querySelector("#titleInput").value =
|
||||
localStorage.getItem("ABtitle");
|
||||
}
|
||||
};
|
||||
|
||||
function saveAbInfo() {
|
||||
var faviconURL = document.getElementById("faviconInput").value;
|
||||
var title = document.getElementById("titleInput").value;
|
||||
localStorage.setItem("ABfaviconURL", faviconURL);
|
||||
localStorage.setItem("ABtitle", title);
|
||||
var notification = `
|
||||
<div class="notification-container" id="notification-container">
|
||||
<div class="notification notification-success">
|
||||
<strong>Success!</strong> Your settings have been saved!
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
document.getElementById("notifhere").innerHTML = notification;
|
||||
setTimeout(() => {
|
||||
var NotificationOBJ = document.getElementById("notifhere");
|
||||
}, 2000);
|
||||
}
|
||||
33
public/resources/preload.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
window.onload = function () {
|
||||
changeCSS(
|
||||
"--background-primary",
|
||||
localStorage.getItem("--background-primary")
|
||||
);
|
||||
changeCSS("--navbar-color", localStorage.getItem("--navbar-color"));
|
||||
changeCSS("--navbar-height", localStorage.getItem("--navbar-height"));
|
||||
changeCSS("--navbar-text-color", localStorage.getItem("--navbar-text-color"));
|
||||
changeCSS("--input-text-color", localStorage.getItem("--input-text-color"));
|
||||
changeCSS(
|
||||
"--input-placeholder-color",
|
||||
localStorage.getItem("--input-placeholder-color")
|
||||
);
|
||||
changeCSS(
|
||||
"--input-background-color",
|
||||
localStorage.getItem("--input-background-color")
|
||||
);
|
||||
changeCSS(
|
||||
"--input-border-color",
|
||||
localStorage.getItem("--input-border-color")
|
||||
);
|
||||
changeCSS("--input-border-size", localStorage.getItem("--input-border-size"));
|
||||
changeCSS("--navbar-link-color", localStorage.getItem("--navbar-link-color"));
|
||||
changeCSS("--navbar-font", localStorage.getItem("--navbar-font"));
|
||||
changeCSS(
|
||||
"--navbar-logo-filter",
|
||||
localStorage.getItem("--navbar-logo-filter")
|
||||
);
|
||||
changeCSS(
|
||||
"--text-color-primary",
|
||||
localStorage.getItem("--text-color-primary")
|
||||
);
|
||||
};
|
||||
103
public/resources/stealthEngine.js
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
// Stealth engine, a dependency for everything above.
|
||||
|
||||
// ensures that the js file is loaded
|
||||
window.stealthEngineLoaded = true;
|
||||
function stealthEngine(encodedURL) {
|
||||
// Remember that the EncodedURL argument must be pre-encoded, or encoded before the function is called.
|
||||
// This function does not encode the argument at all!
|
||||
|
||||
// Initialize the variable
|
||||
let inFrame;
|
||||
// make sure there isn't a window open already
|
||||
try {
|
||||
inFrame = window !== top;
|
||||
} catch (e) {
|
||||
inFrame = true;
|
||||
}
|
||||
setTimeout(() => {
|
||||
// Basically, a checklist to make sure that an error won't occur.
|
||||
// In this if statement, we're checking if an iframe is already being opened, if popups are disabled, and if the user agent IS NOT firefox (firefox sucks, sorry Moz)
|
||||
if (!inFrame && !navigator.userAgent.includes("Firefox")) {
|
||||
const popup = open("about:blank", "_blank");
|
||||
if (!popup || popup.closed) {
|
||||
alert(
|
||||
"StealthEngine was unable to open a popup. (do you have popups disabled?)"
|
||||
);
|
||||
} else {
|
||||
const doc = popup.document;
|
||||
const iframe = doc.createElement("iframe");
|
||||
const style = iframe.style;
|
||||
popup.onload = () => {
|
||||
document.getElementById("lpoader").style.display = "none";
|
||||
document.getElementById("connectorText").textContent =
|
||||
"connecting to service";
|
||||
setTimeout(() => {
|
||||
document.getElementById("connectorText").textContent =
|
||||
"connecting to service";
|
||||
}, 17500);
|
||||
};
|
||||
var isClosed = setInterval(function () {
|
||||
if (popup.closed) {
|
||||
clearInterval(isClosed);
|
||||
document.getElementById("lpoader").style.display = "none";
|
||||
document.getElementById("connectorText").textContent =
|
||||
"connecting to service";
|
||||
}
|
||||
}, 1000);
|
||||
// Favicon attachment
|
||||
const img = doc.createElement("link");
|
||||
const arcSrc = doc.createElement("script");
|
||||
// We attach ARC because it supports us, keeping our arc link there would be greatly appreciated :)
|
||||
arcSrc.setAttribute("src", "https://arc.io/widget.min.js#BgaWcYfi");
|
||||
arcSrc.setAttribute("async", "");
|
||||
doc.head.appendChild(arcSrc);
|
||||
const link = location.href;
|
||||
img.rel = "icon";
|
||||
img.href =
|
||||
ABFavicon ||
|
||||
"https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png";
|
||||
if (localStorage.nogg == "on") {
|
||||
doc.title = ABTitle || getRandomName();
|
||||
} else {
|
||||
doc.title = ABTitle || "Nebula";
|
||||
}
|
||||
|
||||
var currentLink = link.slice(0, link.length - 1);
|
||||
|
||||
iframe.src = currentLink + encodedURL;
|
||||
|
||||
style.position = "fixed";
|
||||
style.top = style.bottom = style.left = style.right = 0;
|
||||
style.border = style.outline = "none";
|
||||
style.width = style.height = "100%";
|
||||
|
||||
doc.body.appendChild(iframe);
|
||||
doc.head.appendChild(img);
|
||||
}
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
let tryAbFavi = localStorage.getItem("ABfaviconURL");
|
||||
let ABFavicon = "";
|
||||
if (tryAbFavi === null) {
|
||||
console.warn("ABfaviconURL is null, Defaulting");
|
||||
ABFavicon = "";
|
||||
} else if (tryAbFavi == "") {
|
||||
console.warn("ABfaviconURL is empty, Defaulting");
|
||||
ABFavicon = "";
|
||||
} else {
|
||||
ABFavicon = tryAbFavi;
|
||||
}
|
||||
|
||||
let tryAbTitle = localStorage.getItem("ABtitle");
|
||||
let ABTitle = "";
|
||||
if (tryAbTitle === null) {
|
||||
console.warn("ABtitle is null, Defaulting");
|
||||
ABTitle = "";
|
||||
} else if (tryAbTitle == "") {
|
||||
console.warn("ABtitle is empty, Defaulting");
|
||||
ABTitle = "";
|
||||
} else {
|
||||
ABTitle = tryAbTitle;
|
||||
}
|
||||
189
public/resources/theme.js
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
const THEME_OPTIONS = {
|
||||
dark: {
|
||||
"--background-primary": "#191724",
|
||||
"--navbar-color": "#26233a",
|
||||
"--navbar-height": "60px",
|
||||
"--navbar-text-color": "#7967dd",
|
||||
"--input-text-color": "#e0def4",
|
||||
"--input-placeholder-color": "#6e6a86",
|
||||
"--input-background-color": "#1f1d2e",
|
||||
"--input-placeholder-color": "white",
|
||||
"--input-border-color": "#eb6f92",
|
||||
"--input-border-size": "1.3px",
|
||||
"--navbar-link-color": "#e0def4",
|
||||
"--navbar-font": '"Roboto"',
|
||||
"--navbar-logo-filter": "invert(0%)",
|
||||
"--text-color-primary": "#e0def4"
|
||||
},
|
||||
light: {
|
||||
"--background-primary": "#d8d8d8",
|
||||
"--navbar-color": "#a2a2a2",
|
||||
"--navbar-height": "4em",
|
||||
"--navbar-text-color": "#000000",
|
||||
"--input-text-color": "#e0def4",
|
||||
"--input-placeholder-color": "white",
|
||||
"--input-background-color": "black",
|
||||
"--input-border-color": "#eb6f92",
|
||||
"--input-border-size": "1.3px",
|
||||
"--navbar-link-color": "#000000",
|
||||
"--navbar-font": '"Roboto"',
|
||||
"--navbar-logo-filter": "invert(30%)",
|
||||
"--text-color-primary": "#303030"
|
||||
},
|
||||
suit: {
|
||||
"--background-primary": "#0c0c0c",
|
||||
"--navbar-color": "#ff2e4e",
|
||||
"--navbar-height": "4em",
|
||||
"--navbar-text-color": "#000000",
|
||||
"--input-text-color": "#e0def4",
|
||||
"--input-placeholder-color": "white",
|
||||
"--input-background-color": "#00000000",
|
||||
"--input-border-color": "#ff346e",
|
||||
"--input-border-size": "1.3px",
|
||||
"--navbar-link-color": "#000000",
|
||||
"--navbar-font": '"Roboto"',
|
||||
"--navbar-logo-filter": "brightness(30)",
|
||||
"--text-color-primary": "#00000"
|
||||
},
|
||||
metallic: {
|
||||
"--background-primary": "#171717",
|
||||
"--navbar-color": "#004953",
|
||||
"--navbar-height": "4em",
|
||||
"--navbar-text-color": "#ffffff",
|
||||
"--input-text-color": "#e0def4",
|
||||
"--input-placeholder-color": "white",
|
||||
"--input-background-color": "#004953",
|
||||
"--input-border-color": "#000000",
|
||||
"--input-border-size": "1.3px",
|
||||
"--navbar-link-color": "#e0def4",
|
||||
"--navbar-font": '"Roboto"',
|
||||
"--navbar-logo-filter": "invert(50%)",
|
||||
"--text-color-primary": "#e0def4"
|
||||
},
|
||||
dante: {
|
||||
"--background-primary": "#131313",
|
||||
"--navbar-color": "#e4ff8b",
|
||||
"--navbar-height": "3.5em",
|
||||
"--navbar-text-color": "#000000",
|
||||
"--input-text-color": "#000000",
|
||||
"--input-placeholder-color": "000000",
|
||||
"--input-background-color": "#e4ff8b",
|
||||
"--input-border-color": "#00000000",
|
||||
"--input-border-size": "1.3px",
|
||||
"--navbar-link-color": "#000000",
|
||||
"--navbar-font": '"Roboto"',
|
||||
"--navbar-logo-filter": "brightness(0%)",
|
||||
"--text-color-primary": "#000"
|
||||
}
|
||||
};
|
||||
|
||||
function changeCSS(property, value, isRoot = false) {
|
||||
const root = document.documentElement;
|
||||
isRoot
|
||||
? root.style.setProperty(property, value)
|
||||
: root.style.setProperty(property, value, "important");
|
||||
}
|
||||
|
||||
function saveCSS(variable, value) {
|
||||
localStorage.setItem(variable, value);
|
||||
}
|
||||
function applyTheme(theme) {
|
||||
Object.entries(theme).forEach(([property, value]) => {
|
||||
changeCSS(property, value);
|
||||
localStorage.setItem(property, value);
|
||||
});
|
||||
}
|
||||
|
||||
function switchTheme() {
|
||||
const selecter = document.getElementById("themeSwitcher");
|
||||
const selectedOption = selecter.value;
|
||||
console.log(selectedOption);
|
||||
const theme = THEME_OPTIONS[selectedOption];
|
||||
|
||||
if (!theme) {
|
||||
return;
|
||||
}
|
||||
|
||||
applyTheme(theme);
|
||||
localStorage.setItem("theme", selectedOption);
|
||||
|
||||
if (selectedOption == "custom") {
|
||||
let startCustom = prompt(
|
||||
"Would you like to have an interactive setup? Y/N",
|
||||
""
|
||||
);
|
||||
if (startCustom == "Y" || startCustom == "y") {
|
||||
alert(
|
||||
"Welcome to the interactive setup. Please enter the following values. If you don't know what to enter, just press enter. They will default to Dark Mode."
|
||||
);
|
||||
let background = prompt(
|
||||
"Background color || Possible Types: Keywords, RGB, RBBA, HSL, HSLA, Hexadecimal. || Default Value: #191724",
|
||||
""
|
||||
);
|
||||
let navbar = prompt(
|
||||
"Navbar color || Possible Types: Keywords, RGB, RBBA, HSL, HSLA, Hexadecimal. || Default Value: #26233a",
|
||||
""
|
||||
);
|
||||
let navbarHeight = prompt(
|
||||
"Navbar height || Possible Types: ABSOLUTE: cm, mm, Q, in, pc, pt, px RELATIVE: em, ex, ch, rem, lh, rlh, vw, vh, vb, vi || Default Value: 60px",
|
||||
""
|
||||
);
|
||||
let navbarText = prompt(
|
||||
"Navbar text color || Possible Types: Keywords, RGB, RBBA, HSL, HSLA, Hexadecimal. || Default Value: #7967dd",
|
||||
""
|
||||
);
|
||||
let inputText = prompt(
|
||||
"Input text color || Possible Types: Keywords, RGB, RBBA, HSL, HSLA, Hexadecimal. || Default Value: #e0def4",
|
||||
""
|
||||
);
|
||||
let inputPlaceholder = prompt(
|
||||
"Input placeholder color || Possible Types: Keywords, RGB, RBBA, HSL, HSLA, Hexadecimal. || Default Value: #6e6a86",
|
||||
""
|
||||
);
|
||||
let inputBackground = prompt(
|
||||
"Input background color || Possible Types: Keywords, RGB, RBBA, HSL, HSLA, Hexadecimal. || Default Value: #1f1d2e",
|
||||
""
|
||||
);
|
||||
let inputBorder = prompt(
|
||||
"Input border color || Possible Types: Keywords, RGB, RBBA, HSL, HSLA, Hexadecimal. || Default Value: #eb6f92",
|
||||
""
|
||||
);
|
||||
let inputBorderSize = prompt(
|
||||
"Input border size || Possible Types: ABSOLUTE: cm, mm, Q, in, pc, pt, px RELATIVE: em, ex, ch, rem, lh, rlh, vw, vh, vb, vi || Default Value: 1.3px",
|
||||
""
|
||||
);
|
||||
let navbarFont = prompt(
|
||||
'Navbar font || Enter a default font name, custom ones will likely not work. || Default Value: "Roboto"',
|
||||
""
|
||||
);
|
||||
let navbarLink = prompt(
|
||||
"Navbar link color || Possible Types: Keywords, RGB, RBBA, HSL, HSLA, Hexadecimal. || Default Value: #e0def4",
|
||||
""
|
||||
);
|
||||
let navbarLogoFilter = prompt(
|
||||
"Navbar logo filter || Adjust the NavBar-Logo-Filter. || Default Value: invert(0%)",
|
||||
""
|
||||
);
|
||||
let textColorPrimary = prompt(
|
||||
"Text color primary || Possible Types: Keywords, RGB, RBBA, HSL, HSLA, Hexadecimal. || Default Value: #e0def4",
|
||||
""
|
||||
);
|
||||
localStorage.setItem("theme", "custom");
|
||||
changeCSS("--background-primary", background, true);
|
||||
changeCSS("--navbar-color", navbar, true);
|
||||
changeCSS("--navbar-height", navbarHeight, true);
|
||||
changeCSS("--navbar-text-color", navbarText, true);
|
||||
changeCSS("--input-text-color", inputText, true);
|
||||
changeCSS("--input-placeholder-color", inputPlaceholder, true);
|
||||
changeCSS("--input-background-color", inputBackground, true);
|
||||
changeCSS("--input-border-color", inputBorder, true);
|
||||
changeCSS("--input-border-size", inputBorderSize, true);
|
||||
changeCSS("--navbar-link-color", navbarLink, true);
|
||||
changeCSS("--navbar-font", navbarFont, true);
|
||||
changeCSS("--navbar-logo-filter", navbarLogoFilter, true);
|
||||
changeCSS("--text-color-primary", textColorPrimary, true);
|
||||
} else {
|
||||
alert("Non-Interactive Setup Not supported yet.");
|
||||
}
|
||||
}
|
||||
}
|
||||
43
public/resources/v.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
const generateOTP = document.getElementById("generate-otp");
|
||||
|
||||
generateOTP.onclick = () => {
|
||||
fetch("/generate-otp", { method: "PATCH" });
|
||||
};
|
||||
|
||||
const validateOTP = document.getElementById("validate-otp");
|
||||
|
||||
validateOTP.onclick = () => {
|
||||
fetch("/validate-otp", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
otp: document.getElementById("otp").value
|
||||
})
|
||||
})
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
if (data.success) {
|
||||
setCookie("validation", data.validation, 30);
|
||||
location.href = "/";
|
||||
} else {
|
||||
alert("Invalid OTP.");
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
alert("An error occurred while validating your OTP.");
|
||||
});
|
||||
};
|
||||
|
||||
function setCookie(name, value, days) {
|
||||
var expires = "";
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
}
|
||||
document.cookie = name + "=" + (value || "") + expires + "; path=/";
|
||||
}
|
||||
500
public/style/main.css
Normal file
|
|
@ -0,0 +1,500 @@
|
|||
@import url("https://fonts.googleapis.com/css2?family=Dongle&family=Roboto:wght@100&display=swap");
|
||||
@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@1,100&display=swap");
|
||||
|
||||
:root {
|
||||
--background-primary: #191724;
|
||||
--navbar-color: #26233a;
|
||||
--navbar-height: 60px;
|
||||
--navbar-text-color: #7967dd;
|
||||
--navbar-link-color: #e0def4;
|
||||
--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;
|
||||
}
|
||||
|
||||
::-webkit-input-placeholder {
|
||||
text-align: center;
|
||||
font-family: "Roboto";
|
||||
}
|
||||
|
||||
:-moz-placeholder {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#navbar {
|
||||
height: var(--navbar-height);
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: var(--navbar-color);
|
||||
}
|
||||
|
||||
.sidenav-btn {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidenav {
|
||||
height: 100%;
|
||||
width: 0;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #232133;
|
||||
padding-top: 60px;
|
||||
-webkit-transition: 0.5s;
|
||||
transition: 0.5s;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sidenav a {
|
||||
padding: 8px 16px 16px 32px;
|
||||
text-decoration: none;
|
||||
width: 100vw;
|
||||
font-size: 24px;
|
||||
color: #cfcfcf;
|
||||
display: block;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.sidenav .closebtn {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 25px;
|
||||
font-size: 36px;
|
||||
margin-left: 50px;
|
||||
z-index: 2;
|
||||
left: 140px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 690px) {
|
||||
/* funny number */
|
||||
|
||||
#navbar > ul > li {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidenav-btn {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
left: 90vw;
|
||||
width: var(--navbar-height);
|
||||
height: var(--navbar-height);
|
||||
}
|
||||
|
||||
.sidenav-btn > svg {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
#digitalCLOContainerLI {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#navbar > ul > li > a > svg {
|
||||
min-width: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--navbar-link-color);
|
||||
text-decoration: none !important;
|
||||
font-family: "Roboto";
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: grey;
|
||||
transition: 0.5s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.down {
|
||||
background-color: rgb(90, 24, 154);
|
||||
left: inherit !important;
|
||||
font-family: "Helvetica";
|
||||
background-color: var(--navbar-color);
|
||||
/* box-shadow: 2px 2px rgb(0 0 0 / 20%); */
|
||||
color: white;
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
list-style-type: none;
|
||||
position: fixed;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
#navbar ul:not(.down) {
|
||||
font-family: "Helvetica";
|
||||
/* box-shadow: 2px 2px rgb(0 0 0 / 20%); */
|
||||
color: white;
|
||||
margin-left: auto;
|
||||
list-style-type: none;
|
||||
float: right !important;
|
||||
margin-right: 2.3%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#navbar ul li {
|
||||
float: left;
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
padding-right: 1em;
|
||||
padding-left: 1em;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
::placeholder,
|
||||
input[type="text"] {
|
||||
color: var(--input-placeholder-color);
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
font-family: "Roboto";
|
||||
}
|
||||
|
||||
#navbar ul p,
|
||||
ul a {
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
#navbar ul li p, ul li a {
|
||||
font-weight: normal;
|
||||
}
|
||||
*/
|
||||
|
||||
#navbar ul li ul {
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
margin-top: 1rem;
|
||||
left: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#navbar ul li:hover ul,
|
||||
ul li ul:hover {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#navbar ul li p {
|
||||
color: white;
|
||||
font-family: "Calibri";
|
||||
z-index: 3 !important;
|
||||
}
|
||||
|
||||
#navbar ul li ul li {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#content {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 98%;
|
||||
color: white;
|
||||
flex-direction: column;
|
||||
font-family: "Roboto";
|
||||
}
|
||||
|
||||
#content h1 {
|
||||
padding-bottom: 0.5em;
|
||||
font-weight: 100;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#content img {
|
||||
padding-left: 0.5em;
|
||||
filter: brightness(0) invert(1);
|
||||
}
|
||||
|
||||
#content input {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
font-family: "Calibri";
|
||||
border-style: solid !important;
|
||||
border: var(--input-border-size) solid var(--input-border-color);
|
||||
border-width: 1px;
|
||||
border-radius: 15px;
|
||||
background-color: var(--input-background-color);
|
||||
color: var(--input-text-color);
|
||||
width: 300px;
|
||||
height: 50px;
|
||||
box-shadow: none !important;
|
||||
outline: none;
|
||||
text-align: center;
|
||||
font-family: "Roboto";
|
||||
}
|
||||
|
||||
#content input:focus {
|
||||
outline: none;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
@keyframes inputwide {
|
||||
0% {
|
||||
width: 0px;
|
||||
transition-duration: 0.5s;
|
||||
}
|
||||
|
||||
100% {
|
||||
width: 300px;
|
||||
transition-duration: 0.5s;
|
||||
}
|
||||
}
|
||||
|
||||
.loader {
|
||||
width: 283px;
|
||||
text-align: center;
|
||||
display: none;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
transition: 0.1s;
|
||||
}
|
||||
|
||||
svg path,
|
||||
svg rect {
|
||||
fill: #eb6f92;
|
||||
}
|
||||
|
||||
.connector {
|
||||
color: white;
|
||||
margin-left: 10px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
@keyframes popout {
|
||||
0% {
|
||||
height: -20px;
|
||||
}
|
||||
|
||||
100% {
|
||||
height: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.nebHeader {
|
||||
font-family: var(--navbar-font);
|
||||
color: var(--navbar-text-color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
margin-left: 0.5%;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--background-primary);
|
||||
color: var(--text-color-primary);
|
||||
animation: fadeInAnimation ease 1s;
|
||||
animation-iteration-count: 1;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
|
||||
@keyframes fadeInAnimation {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
input:focus::placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
#navbar #thumbImg {
|
||||
transition: width 2s, height 2s, transform 2s;
|
||||
filter: var(--navbar-logo-filter);
|
||||
}
|
||||
|
||||
#navbar #thumbImg:hover {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
||||
.stamp {
|
||||
text-align: right;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
font-family: "Montserrat", sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: lighter;
|
||||
color: whitesmoke;
|
||||
opacity: 90%;
|
||||
user-select: none;
|
||||
font-size: 13px;
|
||||
padding-left: 5px;
|
||||
padding-bottom: 1px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.stamp:hover {
|
||||
text-align: right;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
font-family: "Montserrat", sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: lighter;
|
||||
color: whitesmoke;
|
||||
opacity: 38%;
|
||||
user-select: none;
|
||||
font-size: 13px;
|
||||
padding-left: 5px;
|
||||
padding-bottom: 1px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.github {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.tos {
|
||||
position: fixed;
|
||||
right: 67px;
|
||||
bottom: 0;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.privacy {
|
||||
position: fixed;
|
||||
right: 114px;
|
||||
bottom: 0;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.modal-window {
|
||||
position: fixed;
|
||||
background-color: rgba(255, 255, 255, 0.25);
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 999;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: all 0.3s;
|
||||
font-family: "Montserrat", sans-serif;
|
||||
}
|
||||
|
||||
.modal-window:target {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.modal-window > div {
|
||||
width: 400px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 2em;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.modal-window header {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.modal-window h1 {
|
||||
font-size: 150%;
|
||||
margin: 0 0 15px;
|
||||
}
|
||||
|
||||
.modal-close {
|
||||
color: #aaa;
|
||||
line-height: 50px;
|
||||
font-size: 80%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
width: 70px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.modal-close:hover {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.modal-window > div {
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
.modal-window div:not(:last-of-type) {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
max-width: 150px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
small {
|
||||
color: lightgray;
|
||||
}
|
||||
|
||||
.btn {
|
||||
background-color: white;
|
||||
padding: 1em 1.5em;
|
||||
border-radius: 0.5rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.btn i {
|
||||
padding-right: 0.3em;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1190px) {
|
||||
#digitalClock {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.clockColon {
|
||||
opacity: 100%;
|
||||
|
||||
animation: blink 0.5s step-end infinite alternate;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
50% {
|
||||
opacity: 0%;
|
||||
}
|
||||
}
|
||||
556
public/style/options.css
Normal file
|
|
@ -0,0 +1,556 @@
|
|||
@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300&display=swap");
|
||||
|
||||
:root {
|
||||
--background-primary: #191724;
|
||||
--sidebar-color: #191724;
|
||||
--sidebar-text-color: #e0def4;
|
||||
--text-color-primary: #e0def4;
|
||||
--text-color-secondary: #6e6a86;
|
||||
--focus-color: #eb6f92;
|
||||
--header-height: 10vh;
|
||||
--section-font-size: 20pt;
|
||||
--section-font: 'Calibri';
|
||||
--section-padding: 0.5em;
|
||||
--setting-distance-from-sidebar: 1em;
|
||||
--setting-distance-from-right: 1em;
|
||||
--setting-name-font: 'Calibri';
|
||||
--setting-desc-font: 'Calibri';
|
||||
}
|
||||
|
||||
* {
|
||||
user-select: none;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
body {
|
||||
background-color: var(--background-primary);
|
||||
}*/
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-content: center;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
align-items: flex-end;
|
||||
margin-top: 75px;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
animation: fadeIn 700ms ease-in 30ms forwards;
|
||||
-webkit-animation: fadeIn 700ms ease-in 300ms forwards;
|
||||
position: absolute;
|
||||
top: var(--header-height);
|
||||
left: 0;
|
||||
background-color: var(--sidebar-color);
|
||||
transition: width 0.5s;
|
||||
width: var(--sidebar-width);
|
||||
}
|
||||
|
||||
.setting li a {
|
||||
background-color: #2e2828;
|
||||
padding: 10px 16px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.settings-div li a ul {
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
margin-top: 10px;
|
||||
left: 0 !important;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.settings-div li a:hover ul,
|
||||
ul li:hover {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
.settings-div ul li p{
|
||||
color: white;
|
||||
font-family: 'Calibri';
|
||||
z-index: 3 !important;
|
||||
|
||||
}*/
|
||||
|
||||
li {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.settings-div li a ul li {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.section {
|
||||
background-color: transparent;
|
||||
color: var(--sidebar-text-color);
|
||||
font-size: var(--section-font-size);
|
||||
font-family: var(--section-font);
|
||||
width: 100%;
|
||||
transition: background-color 0.5s;
|
||||
padding-top: var(--section-padding);
|
||||
padding-bottom: var(--section-padding);
|
||||
}
|
||||
|
||||
.section:hover {
|
||||
background-color: #ffffff20;
|
||||
}
|
||||
|
||||
.settings-div {
|
||||
position: absolute;
|
||||
left: calc(var(--sidebar-width) + var(--setting-distance-from-sidebar));
|
||||
top: 0;
|
||||
width: calc(100vw - var(--sidebar-width) - var(--setting-distance-from-sidebar));
|
||||
padding-top: 5%;
|
||||
}
|
||||
|
||||
.setting-input {
|
||||
/* left: 100%; */
|
||||
color: black !important;
|
||||
position: relative;
|
||||
/* right: 0; */
|
||||
transform: translateY(-1.5em);
|
||||
float: right;
|
||||
margin-right: 5%;
|
||||
}
|
||||
|
||||
.setting-input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@300&display=swap');
|
||||
|
||||
.toogle-button {
|
||||
font-weight: bold;
|
||||
font-size: 10PX;
|
||||
display: inline-block;
|
||||
width: 75px;
|
||||
height: 35px;
|
||||
background-color: #dfddf3;
|
||||
border-radius: 30px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.toogle-button::after {
|
||||
content: 'Off';
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
color: #E7E2CD;
|
||||
background-color: #e14343;
|
||||
border: 2px solid #E7E2CD;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 5px rgb(0 0 0 / 25%);
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
left: 0;
|
||||
line-height: 0;
|
||||
display: grid;
|
||||
place-content: center;
|
||||
transition: all .5s;
|
||||
transform: 1s ease-in;
|
||||
font-family: 'Mulish', sans-serif;
|
||||
}
|
||||
|
||||
.setting-input:checked+.toogle-button::after {
|
||||
content: 'On';
|
||||
background-color: #53b357;
|
||||
transform: translateX(35px) rotate(360deg);
|
||||
}
|
||||
|
||||
ul li {
|
||||
float: left;
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
padding-right: 1em;
|
||||
padding-left: 1em;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
transform: translateY(-30px);
|
||||
font-family: var(--setting-desc-font);
|
||||
color: white;
|
||||
}
|
||||
|
||||
@-webkit-keyframes fadeIn {
|
||||
0% {
|
||||
opacity: 0.01;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
0% {
|
||||
opacity: 0.01;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap');
|
||||
|
||||
.notification-container {
|
||||
position: fixed;
|
||||
top: 4px;
|
||||
right: 5px;
|
||||
width: 500px;
|
||||
max-width: calc(100% - 30px);
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
|
||||
.notification {
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
padding: 15px 20px;
|
||||
line-height: 20px;
|
||||
margin-bottom: 15px;
|
||||
animation: grow 0.5s ease-in forwards;
|
||||
}
|
||||
|
||||
@keyframes grow {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.8);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.notification.hide {
|
||||
animation: shrink 0.3s ease-out forwards;
|
||||
}
|
||||
|
||||
@keyframes shrink {
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: scale(0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.notification strong {
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
letter-spacing: 0.5px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.notification-info {
|
||||
background-color: #00cae3;
|
||||
}
|
||||
|
||||
.notification-success {
|
||||
background-color: #3d3571;
|
||||
}
|
||||
|
||||
.notification-warning {
|
||||
background-color: #ff9e0f;
|
||||
}
|
||||
|
||||
.notification-danger {
|
||||
background-color: #f55145;
|
||||
}
|
||||
|
||||
.stamp {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.bk-btn {
|
||||
height: 52px;
|
||||
width: 52px;
|
||||
background-color: black;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.bk-btn .bk-btn-triangle {
|
||||
position: relative;
|
||||
top: 13px;
|
||||
left: 10.4px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 13px solid transparent;
|
||||
border-bottom: 13px solid transparent;
|
||||
border-right: 13px solid white;
|
||||
}
|
||||
|
||||
.bk-btn .bk-btn-bar {
|
||||
position: relative;
|
||||
background-color: white;
|
||||
height: 7.8px;
|
||||
width: 13px;
|
||||
top: -3.64px;
|
||||
left: 22.88px;
|
||||
}
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300&display=swap');
|
||||
|
||||
.settings-cont {
|
||||
background: #45454521;
|
||||
box-sizing: border-box;
|
||||
width: 300px;
|
||||
height: 246px;
|
||||
padding: 30px;
|
||||
border: 2px solid rgb(0 0 0 / 64%);
|
||||
border-radius: 9px;
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.name {
|
||||
color: var(--text-color-primary);
|
||||
font-size: 27px;
|
||||
margin: 0;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-weight: 700;
|
||||
font-style: bold;
|
||||
}
|
||||
|
||||
.description {
|
||||
color: var(--text-color-secondary);
|
||||
margin: 0;
|
||||
font-size: 17px;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-weight: 300;
|
||||
/* font-style: Italic; */
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.secondary-desc {
|
||||
color: var(--text-color-primary);
|
||||
margin: 0;
|
||||
margin-top: 0.3em;
|
||||
font-size: 18px;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-weight: 300;
|
||||
/* font-style: Italic; */
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Oxygen:wght@700&display=swap');
|
||||
|
||||
.new-tag {
|
||||
font-size: 16px;
|
||||
color: rgb(226, 68, 68);
|
||||
font-family: 'Oxygen', sans-serif;
|
||||
}
|
||||
|
||||
.square {
|
||||
width: .7em;
|
||||
height: .7em;
|
||||
margin: .5em;
|
||||
}
|
||||
|
||||
|
||||
/* Custom dropdown */
|
||||
|
||||
.custom-dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin: 10px;
|
||||
/* demo only */
|
||||
}
|
||||
|
||||
.custom-dropdown select {
|
||||
background-color: rgb(121 103 221);
|
||||
color: var(--text-color-primary);
|
||||
font-size: inherit;
|
||||
padding: .5em;
|
||||
padding-right: 2.5em;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
border-radius: 3px;
|
||||
text-indent: 0.01px;
|
||||
text-overflow: '';
|
||||
-webkit-appearance: button;
|
||||
/* hide default arrow in chrome OSX */
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.custom-dropdown::before,
|
||||
.custom-dropdown::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.custom-dropdown::after {
|
||||
/* Custom dropdown arrow */
|
||||
content: "\25BC";
|
||||
height: 1em;
|
||||
font-size: .625em;
|
||||
line-height: 1;
|
||||
right: 1.2em;
|
||||
top: 50%;
|
||||
margin-top: -.5em;
|
||||
}
|
||||
|
||||
.custom-dropdown::before {
|
||||
/* Custom dropdown arrow cover */
|
||||
width: 2em;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
.custom-dropdown select[disabled] {
|
||||
color: rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
.custom-dropdown select[disabled]::after {
|
||||
color: rgba(0, 0, 0, .1);
|
||||
}
|
||||
|
||||
.custom-dropdown::before {
|
||||
background-color: rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.custom-dropdown::after {
|
||||
color: rgba(0, 0, 0, .4);
|
||||
}
|
||||
|
||||
.button-save {
|
||||
background-color: #5e18eb;
|
||||
color: #fff;
|
||||
font-size: inherit;
|
||||
padding: 0.5em;
|
||||
padding-right: -0.5em;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
border-radius: 3px;
|
||||
text-indent: 0.01px;
|
||||
text-overflow: '';
|
||||
-webkit-appearance: button;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.button-save-alt {
|
||||
background-color: #5e18eb;
|
||||
color: #fff;
|
||||
font-size: inherit;
|
||||
padding: 0.3em;
|
||||
padding-right: -0.5em;
|
||||
border: 0;
|
||||
margin: 0.2vh;
|
||||
border-radius: 3px;
|
||||
text-indent: 0.01px;
|
||||
text-overflow: '';
|
||||
-webkit-appearance: button;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap');
|
||||
|
||||
.expiramental {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-size: 10px;
|
||||
color: rgb(184, 0, 0);
|
||||
font-weight: 400;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
input[type=checkbox] {
|
||||
height: 0;
|
||||
width: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: pointer;
|
||||
/* text-indent: -10049px; */
|
||||
width: 85px;
|
||||
height: 37px;
|
||||
background: #504e58;
|
||||
display: block;
|
||||
border-radius: 100px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
label:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
width: 35px;
|
||||
height: 28px;
|
||||
background: #3d3571;
|
||||
border-radius: 90px;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
input:checked+label {
|
||||
background: #7967dd;
|
||||
|
||||
}
|
||||
|
||||
input:checked+label:after {
|
||||
left: calc(100% - 5px);
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
label:active:after {
|
||||
width: 38px;
|
||||
}
|
||||
|
||||
.bareLocationInput {
|
||||
border-style: solid !important;
|
||||
border: var(--input-border-size) solid #5e18eb;
|
||||
border-width: 0px;
|
||||
border-radius: 6px;
|
||||
background-color: #191724;
|
||||
color: var(--input-text-color);
|
||||
width: auto;
|
||||
height: auto;
|
||||
box-shadow: none !important;
|
||||
outline: none;
|
||||
text-align: center;
|
||||
width: 220px;
|
||||
font-size: 16px;
|
||||
font-family: 'Roboto';
|
||||
height: 29px;
|
||||
transition: 0.06s;
|
||||
}
|
||||
|
||||
.bareLocationInput:hover {
|
||||
border: var(--input-border-size) solid #5e18eb;
|
||||
border-width: 1px;
|
||||
border-radius: 6px;
|
||||
|
||||
}
|
||||
|
||||
.bareValidSignal {
|
||||
margin-top: -13px;
|
||||
color: #f45145bd;
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-weight: lighter;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
}
|
||||
5
public/style/privacy.css
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
body {
|
||||
color: white;
|
||||
font-family: "Roboto";
|
||||
margin-left: 20px;
|
||||
}
|
||||
65
public/sw.js
|
|
@ -1,57 +1,14 @@
|
|||
importScripts("/uv/uv.bundle.js");
|
||||
importScripts("/uv/uv.config.js");
|
||||
importScripts("/workerware/workerware.js");
|
||||
importScripts(__uv$config.sw || "/uv/uv.sw.js");
|
||||
const uv = new UVServiceWorker();
|
||||
const ww = new WorkerWare({ debug: false });
|
||||
importScripts("./uv/uv.bundle.js");
|
||||
importScripts("./uv/uv.config.js");
|
||||
importScripts("./uv/uv.sw.js");
|
||||
importScripts("./osana/osana.worker.js");
|
||||
|
||||
//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;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
const UV = new UVServiceWorker();
|
||||
const Osana = new OsanaServiceWorker();
|
||||
|
||||
self.addEventListener("fetch", function (event) {
|
||||
event.respondWith(
|
||||
(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);
|
||||
} else {
|
||||
return await fetch(event.request);
|
||||
}
|
||||
})()
|
||||
);
|
||||
self.addEventListener("fetch", (event) => {
|
||||
if (event.request.url.startsWith(location.origin + "/service/go/"))
|
||||
event.respondWith(UV.fetch(event));
|
||||
if (event.request.url.startsWith(location.origin + "/service/~osana/"))
|
||||
event.respondWith(Osana.fetch(event));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,30 +1,10 @@
|
|||
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("")
|
||||
);
|
||||
},
|
||||
decodeUrl: function decode(str) {
|
||||
if (!str) return str;
|
||||
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("?") : "")
|
||||
);
|
||||
},
|
||||
handler: "/uv/uv.handler.js",
|
||||
client: "/uv/uv.client.js",
|
||||
bundle: "/uv/uv.bundle.js",
|
||||
config: "/uv/uv.config.js",
|
||||
sw: "/uv/uv.sw.js"
|
||||
prefix: "/service/go/",
|
||||
bare: "/bare/",
|
||||
encodeUrl: Ultraviolet.codec.xor.encode,
|
||||
decodeUrl: Ultraviolet.codec.xor.decode,
|
||||
handler: "/uv/uv.handler.js",
|
||||
bundle: "/uv/uv.bundle.js",
|
||||
config: "/uv/uv.config.js",
|
||||
sw: "/uv/uv.sw.js"
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,171 +0,0 @@
|
|||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import chalk from "chalk";
|
||||
import { TomlPrimitive, parse } from "smol-toml";
|
||||
|
||||
interface TomlData {
|
||||
marketplace: {
|
||||
enabled: boolean;
|
||||
psk: String;
|
||||
};
|
||||
server: {
|
||||
server: {
|
||||
port: number;
|
||||
wisp: boolean;
|
||||
logging: boolean;
|
||||
};
|
||||
};
|
||||
db: {
|
||||
name: string;
|
||||
username: string;
|
||||
password: string;
|
||||
postgres: boolean;
|
||||
};
|
||||
postgres: {
|
||||
domain: string;
|
||||
port: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface Verify {
|
||||
name: string;
|
||||
typeOF: any;
|
||||
type: any;
|
||||
}
|
||||
|
||||
let doc = readFileSync(fileURLToPath(new URL("../config.toml", import.meta.url))).toString();
|
||||
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}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
verify([
|
||||
{ name: "marketplace", typeOF: parsedDoc.marketplace, type: "object" },
|
||||
{ name: "marketplace.enabled", typeOF: parsedDoc.marketplace.enabled, type: "boolean" },
|
||||
{ name: "marketplace.psk", typeOF: parsedDoc.marketplace.psk, type: "string" },
|
||||
{ name: "server", typeOF: parsedDoc.server, type: "object" },
|
||||
{ name: "server.server", typeOF: parsedDoc.server.server, type: "object" },
|
||||
{ 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: "db", typeOF: parsedDoc.db, type: "object" },
|
||||
{ name: "db.name", typeOF: parsedDoc.db.name, type: "string" },
|
||||
{ name: "db.username", typeOF: parsedDoc.db.username, type: "string" },
|
||||
{ name: "db.password", typeOF: parsedDoc.db.password, type: "string" },
|
||||
{ name: "db.postgres", typeOF: parsedDoc.db.postgres, type: "boolean" },
|
||||
{ name: "postgres", typeOF: parsedDoc.postgres, type: "object" },
|
||||
{ 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 { TomlData, parsedDoc };
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
import { fileURLToPath } from "node:url";
|
||||
import chalk from "chalk";
|
||||
import ora from "ora";
|
||||
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,
|
||||
title: item.title,
|
||||
image: item.image,
|
||||
author: item.author,
|
||||
version: item.version,
|
||||
description: item.description,
|
||||
tags: item.tags,
|
||||
payload: item.payload,
|
||||
background_video: item.background_video,
|
||||
background_image: item.background_image,
|
||||
type: item.type
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function setupDB(db: ModelStatic<CatalogModel>) {
|
||||
//We have some packages that need to be installed if they aren't.
|
||||
const items: Items[] = [
|
||||
{
|
||||
package_name: "com.nebula.gruvbox",
|
||||
title: "Gruvbox",
|
||||
image: "gruvbox.jpeg",
|
||||
author: "Nebula Services",
|
||||
version: "1.0.0",
|
||||
description: "The gruvbox theme",
|
||||
tags: ["Theme", "Simple"],
|
||||
payload: "gruvbox.css",
|
||||
type: "theme"
|
||||
},
|
||||
{
|
||||
package_name: "com.nebula.oled",
|
||||
title: "Oled theme",
|
||||
image: "oled.jpg",
|
||||
author: "Nebula Services",
|
||||
version: "1.0.0",
|
||||
description: "A sleek & simple Oled theme for Nebula",
|
||||
tags: ["Theme", "Simple", "Sleek"],
|
||||
payload: "oled.css",
|
||||
type: "theme"
|
||||
},
|
||||
{
|
||||
package_name: "com.nebula.lightTheme",
|
||||
title: "Light Theme",
|
||||
image: "light.png",
|
||||
author: "Nebula Services",
|
||||
version: "1.0.0",
|
||||
description: "A sleek light theme for Nebula",
|
||||
tags: ["Theme", "Simple", "Light"],
|
||||
payload: "light.css",
|
||||
type: "theme"
|
||||
},
|
||||
{
|
||||
package_name: "com.nebula.retro",
|
||||
title: "Retro Theme",
|
||||
image: "retro.png",
|
||||
author: "Nebula Services",
|
||||
version: "1.0.0",
|
||||
description: "Give a retro look to Nebula",
|
||||
tags: ["Theme", "Simple", "Dark", "Retro"],
|
||||
payload: "retro.css",
|
||||
type: "theme"
|
||||
}
|
||||
//To add plugins: plugin types consist of plugin-sw (workerware) & plugin-page (uv.config.inject)
|
||||
];
|
||||
const dbItems = await db.findAll();
|
||||
if (dbItems.length === 0) {
|
||||
const spinner = ora(chalk.hex("#7967dd")("Performing DB setup...")).start();
|
||||
await installItems(db, items);
|
||||
spinner.succeed(chalk.hex("#eb6f92")("DB setup complete!"));
|
||||
}
|
||||
}
|
||||
|
||||
export { setupDB };
|
||||
1
server/env.d.ts
vendored
|
|
@ -1 +0,0 @@
|
|||
declare module "@rubynetwork/rammerhead/src/server/index.js";
|
||||
|
|
@ -1,229 +0,0 @@
|
|||
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 { 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,
|
||||
dialect: parsedDoc.db.postgres ? "postgres" : "sqlite",
|
||||
logging: parsedDoc.server.server.logging,
|
||||
storage: "database.sqlite" //this is sqlite only
|
||||
});
|
||||
|
||||
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 },
|
||||
author: { type: DataTypes.TEXT },
|
||||
image: { type: DataTypes.TEXT },
|
||||
tags: { type: DataTypes.JSON, allowNull: true },
|
||||
version: { type: DataTypes.TEXT },
|
||||
background_image: { type: DataTypes.TEXT, allowNull: true },
|
||||
background_video: { type: DataTypes.TEXT, allowNull: true },
|
||||
payload: { type: DataTypes.TEXT },
|
||||
type: { type: DataTypes.TEXT }
|
||||
});
|
||||
|
||||
function marketplaceAPI(app: FastifyInstance) {
|
||||
app.get("/api/catalog-stats/", (request, reply) => {
|
||||
reply.send({
|
||||
version: "1.0.0",
|
||||
spec: "Nebula Services",
|
||||
enabled: true
|
||||
});
|
||||
});
|
||||
|
||||
// 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: number = parseInt(page, 10) || 1;
|
||||
if (pageNum < 1) {
|
||||
reply.status(400).send({ error: "Page must be a positive number!" });
|
||||
}
|
||||
const offset = (pageNum - 1) * 20;
|
||||
const totalItems = await catalogAssets.count();
|
||||
const dbAssets = await catalogAssets.findAll({ offset: offset, limit: 20 });
|
||||
const assets = dbAssets.reduce((acc, asset) => {
|
||||
acc[asset.package_name] = {
|
||||
title: asset.title,
|
||||
description: asset.description,
|
||||
author: asset.author,
|
||||
image: asset.image,
|
||||
tags: asset.tags,
|
||||
version: asset.version,
|
||||
background_image: asset.background_image,
|
||||
background_video: asset.background_video,
|
||||
payload: asset.payload,
|
||||
type: asset.type
|
||||
};
|
||||
return acc;
|
||||
}, {});
|
||||
return reply.send({ assets, pages: Math.ceil(totalItems / 20) });
|
||||
} catch (error) {
|
||||
return reply.status(500).send({ error: "An error occured" });
|
||||
}
|
||||
});
|
||||
|
||||
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!" });
|
||||
const details = {
|
||||
title: packageRow.get("title"),
|
||||
description: packageRow.get("description"),
|
||||
image: packageRow.get("image"),
|
||||
author: packageRow.get("author"),
|
||||
tags: packageRow.get("tags"),
|
||||
version: packageRow.get("version"),
|
||||
background_image: packageRow.get("background_image"),
|
||||
background_video: packageRow.get("background_video"),
|
||||
payload: packageRow.get("payload"),
|
||||
type: packageRow.get("type")
|
||||
};
|
||||
reply.send(details);
|
||||
} catch (error) {
|
||||
reply.status(500).send({ error: "An unexpected error occured" });
|
||||
}
|
||||
});
|
||||
|
||||
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) {
|
||||
return { status: 500, error: new Error("No packagename defined!") };
|
||||
} else if (upload && !data) {
|
||||
return { status: 400, error: new Error("No file uploaded!") };
|
||||
} else {
|
||||
return { status: 200 };
|
||||
}
|
||||
}
|
||||
|
||||
app.post("/api/upload-asset", async (request: UploadReq, reply) => {
|
||||
const data = await request.file();
|
||||
const verify: VerifyStatus = await verifyReq(request, true, data);
|
||||
if (verify.error !== undefined) {
|
||||
reply.status(verify.status).send({ status: verify.error.message });
|
||||
} else {
|
||||
try {
|
||||
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)`
|
||||
});
|
||||
}
|
||||
return reply.status(verify.status).send({ status: "File uploaded successfully!" });
|
||||
}
|
||||
});
|
||||
|
||||
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: Catalog = {
|
||||
package_name: request.body.uuid,
|
||||
title: request.body.title,
|
||||
image: request.body.image,
|
||||
author: request.body.author,
|
||||
version: request.body.version,
|
||||
description: request.body.description,
|
||||
tags: request.body.tags,
|
||||
payload: request.body.payload,
|
||||
background_video: request.body.background_video,
|
||||
background_image: request.body.background_image,
|
||||
type: request.body.type as CatalogType
|
||||
};
|
||||
await catalogAssets.create({
|
||||
package_name: body.package_name,
|
||||
title: body.title,
|
||||
image: body.image,
|
||||
author: body.author,
|
||||
version: body.version,
|
||||
description: body.description,
|
||||
tags: body.tags,
|
||||
payload: body.payload,
|
||||
background_video: body.background_video,
|
||||
background_image: body.background_image,
|
||||
type: body.type
|
||||
});
|
||||
const assets = fileURLToPath(new URL("../database_assets", import.meta.url));
|
||||
try {
|
||||
await access(`${assets}/${body.package_name}/`, constants.F_OK);
|
||||
return reply.status(500).send({ status: "Package already exists!" });
|
||||
} catch (err) {
|
||||
await mkdir(`${assets}/${body.package_name}/`);
|
||||
return reply
|
||||
.status(verify.status)
|
||||
.send({ status: "Package created successfully!" });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export { marketplaceAPI, db, catalogAssets, Catalog, CatalogModel };
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
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";
|
||||
import fastifyMiddie from "@fastify/middie";
|
||||
import fastifyMultipart from "@fastify/multipart";
|
||||
import fastifyStatic from "@fastify/static";
|
||||
import chalk from "chalk";
|
||||
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";
|
||||
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(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, {
|
||||
root: fileURLToPath(new URL("../database_assets", import.meta.url)),
|
||||
prefix: "/packages/",
|
||||
decorateReply: false
|
||||
});
|
||||
marketplaceAPI(app);
|
||||
}
|
||||
|
||||
await app.register(fastifyMiddie);
|
||||
|
||||
app.use(ssrHandler);
|
||||
|
||||
const port: number =
|
||||
parseInt(process.env.PORT as string) || parsedDoc.server.server.port || parseInt("8080");
|
||||
const titleText = `
|
||||
_ _ _ _ ____ _
|
||||
| \\ | | ___| |__ _ _| | __ _ / ___| ___ _ ____ _(_) ___ ___ ___
|
||||
| \\| |/ _ \\ '_ \\| | | | |/ _' | \\___ \\ / _ \\ '__\\ \\ / / |/ __/ _ \\/ __|
|
||||
| |\\ | __/ |_) | |_| | | (_| | ___) | __/ | \\ V /| | (_| __/\\__ \\
|
||||
|_| \\_|\\___|_.__/ \\__,_|_|\\__,_| |____/ \\___|_| \\_/ |_|\\___\\___||___/
|
||||
`;
|
||||
const titleColors = {
|
||||
purple: "#7967dd",
|
||||
pink: "#eb6f92"
|
||||
};
|
||||
|
||||
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 + "/")}`
|
||||
)
|
||||
);
|
||||
if (parsedDoc.marketplace.enabled) {
|
||||
await catalogAssets.sync();
|
||||
await setupDB(catalogAssets);
|
||||
}
|
||||
});
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import { createServer } from "node:http";
|
||||
import {
|
||||
FastifyServerFactory,
|
||||
FastifyServerFactoryHandler,
|
||||
RawServerDefault,
|
||||
} from "fastify";
|
||||
import wisp from "wisp-server-node";
|
||||
import { LOG_LEVEL, WispOptions } from "wisp-server-node/dist/Types.js";
|
||||
import { parsedDoc } from "./config.js";
|
||||
|
||||
const wispOptions: WispOptions = {
|
||||
logLevel: parsedDoc.server.server.logging ? LOG_LEVEL.DEBUG : LOG_LEVEL.NONE,
|
||||
pingInterval: 30,
|
||||
};
|
||||
|
||||
const serverFactory: FastifyServerFactory = (
|
||||
handler: FastifyServerFactoryHandler
|
||||
): RawServerDefault => {
|
||||
const httpServer = createServer();
|
||||
httpServer.on("request", (req, res) => {
|
||||
handler(req, res);
|
||||
});
|
||||
httpServer.on("upgrade", (req, socket, head) => {
|
||||
if (parsedDoc.server.server.wisp) {
|
||||
if (req.url?.endsWith("/wisp/")) {
|
||||
wisp.routeRequest(req, socket as any, head, wispOptions);
|
||||
}
|
||||
}
|
||||
});
|
||||
return httpServer;
|
||||
};
|
||||
|
||||
export { serverFactory };
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"noEmit": false,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"paths": {}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
|
@ -1,61 +0,0 @@
|
|||
---
|
||||
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>
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
---
|
||||
import { MARKETPLACE_ENABLED } from "astro:env/client";
|
||||
import { Icon } from "astro-icon/components";
|
||||
import { getLangFromUrl, useTranslations } from "../i18n/utils";
|
||||
import { isMobileNavOpen } from "../store.js";
|
||||
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" id="mobileNavTrigger" transition:persist>
|
||||
<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>
|
||||
<script>
|
||||
import { isMobileNavOpen } from "../store.js";
|
||||
let isMobileNavOpenLocal = true;
|
||||
const right_caret = document.getElementById("right_caret");
|
||||
const hamburger_menu = document.getElementById("hamburger_menu");
|
||||
const mobileNavTrigger = document.getElementById("mobileNavTrigger");
|
||||
// Create a copy of the nano store so we can make this a toggle
|
||||
|
||||
// Set the store to true when the button is clicked
|
||||
function openDialog() {
|
||||
if (isMobileNavOpenLocal == false) {
|
||||
isMobileNavOpen.set(true);
|
||||
if (hamburger_menu && right_caret) {
|
||||
hamburger_menu.style.display = "none";
|
||||
right_caret.style.display = "block";
|
||||
}
|
||||
} else {
|
||||
isMobileNavOpen.set(false);
|
||||
if (hamburger_menu && right_caret) {
|
||||
hamburger_menu.style.display = "block";
|
||||
right_caret.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isMobileNavOpen.subscribe((open) => {
|
||||
if (open) {
|
||||
isMobileNavOpenLocal = true;
|
||||
if (hamburger_menu && right_caret) {
|
||||
hamburger_menu.style.display = "none";
|
||||
right_caret.style.display = "block";
|
||||
}
|
||||
} else {
|
||||
isMobileNavOpenLocal = false;
|
||||
if (hamburger_menu && right_caret) {
|
||||
hamburger_menu.style.display = "block";
|
||||
right_caret.style.display = "none";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Add an event listener to the button
|
||||
|
||||
if (mobileNavTrigger) {
|
||||
mobileNavTrigger.addEventListener("click", openDialog);
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
---
|
||||
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,23 +0,0 @@
|
|||
<div class="w-full h-full bg-primary text-navbar-text-color flex justify-center items-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" viewBox="0 0 400 400" width="400" height="400" fill="#5e17eb" class="animate-pulse-brighter w-48 h-48">
|
||||
<g id="svgg">
|
||||
<path id="path0" fill-rule="evenodd" class="s0" 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"/>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<style>
|
||||
@keyframes pulse-brighter {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
.animate-pulse-brighter {
|
||||
animation: pulse-brighter 2s infinite;
|
||||
height: 11rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<svg
|
||||
version="1.2"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 400 400"
|
||||
width="400"
|
||||
height="400"
|
||||
style="width: 100%; height: 100%;"
|
||||
><title>nebula</title><g id="svgg"
|
||||
><path
|
||||
id="path0"
|
||||
fill-rule="evenodd"
|
||||
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
|
||||
>
|
||||
|
Before Width: | Height: | Size: 3.4 KiB |
|
|
@ -1,58 +0,0 @@
|
|||
---
|
||||
import { Icon } from "astro-icon/components";
|
||||
import { getLangFromUrl, useTranslations } from "../i18n/utils";
|
||||
import HeaderButton from "./HeaderButton.astro";
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const t = useTranslations(lang);
|
||||
import { MARKETPLACE_ENABLED } from "astro:env/client";
|
||||
---
|
||||
|
||||
<div
|
||||
class="h-full mt-16 flex w-full flex-col justify-evenly bg-navbar-color m-auto"
|
||||
id="mobileNavMenu"
|
||||
>
|
||||
<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"
|
||||
/>
|
||||
</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>
|
||||
<script>
|
||||
import { fade } from "astro:transitions";
|
||||
import { isMobileNavOpen } from "../store.js";
|
||||
function closeMobileNav() {
|
||||
isMobileNavOpen.set(false);
|
||||
}
|
||||
const mobileNavMenu = document.getElementById("mobileNavMenu");
|
||||
mobileNavMenu!.addEventListener("click", closeMobileNav);
|
||||
</script>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
---
|
||||
const { title, route } = Astro.props;
|
||||
---
|
||||
|
||||
<a
|
||||
href={route}
|
||||
class="snap-center snap-always group flex flex-col items-center md:p-0 max-sm:p-3 sm:p-3 bg-navbar-color w-full rounded-3xl md:flex-row md:bg-none md:rounded-none"
|
||||
>
|
||||
<div class="xl:p-2 max-sm:p-2 sm:p-2 md:p-0">
|
||||
<slot />
|
||||
</div>
|
||||
<div
|
||||
class="max-md:min-w-24 font-roboto text-center font-bold text-text-color roboto transition duration-500 group-hover:text-text-hover-color md:text-xl text-nowrap"
|
||||
>
|
||||
{title}
|
||||
</div>
|
||||
</a>
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
<script lang="ts">
|
||||
import { Suspense } from "@svelte-drama/suspense";
|
||||
import { Settings } from "@utils/settings/index";
|
||||
export let page;
|
||||
export let lang;
|
||||
async function getAssets() {
|
||||
const response = await fetch("/api/catalog-assets?page=" + page);
|
||||
const data = await response.json();
|
||||
return data.assets;
|
||||
}
|
||||
const assets = getAssets();
|
||||
</script>
|
||||
|
||||
<div class="text-3xl font-roboto font-bold text-text-color p-10">
|
||||
<Suspense let:suspend>
|
||||
<div slot="loading">
|
||||
<p class="text-4xl"> Loading... </p>
|
||||
</div>
|
||||
{#await suspend(assets) then data}
|
||||
{#if Object.keys(data).length > 0}
|
||||
<div class="flex flex-row gap-6 flex-wrap justify-center">
|
||||
{#each Object.entries(data) as [key, asset]}
|
||||
<a href={`/${lang}/catalog/package/${key}`}>
|
||||
<div class="bg-navbar-color w-64 rounded-3xl shadow-lg overflow-hidden transition-transform duration-300 hover:scale-105">
|
||||
<img src={`/packages/${key}/${asset.image}`} alt={asset.title} class="w-full h-40 object-cover" />
|
||||
<div class="p-6 text-sm">
|
||||
<p class="font-semibold text-2xl mb-2"> {asset.title} </p>
|
||||
<p class="mb-4"> {asset.description} </p>
|
||||
<div class="flex flex-wrap gap-2 mb-4 w-full">
|
||||
{#each asset.tags as tag}
|
||||
<p class="bg-navbar-text-color text-navbar-color font-bold px-3 py-1 rounded-md text-center"> {tag} </p>
|
||||
{/each}
|
||||
</div>
|
||||
<div>
|
||||
<strong>Version:</strong>
|
||||
{asset.version}
|
||||
</div>
|
||||
<div><strong>Type:</strong> {asset.type === "plugin-page" || asset.type === "plugin-sw" ? "plugin" : asset.type}</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
{/await}
|
||||
</Suspense>
|
||||
</div>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
<script lang="ts">
|
||||
import { Suspense } from "@svelte-drama/suspense";
|
||||
import { Settings, settings } from "@utils/settings/index";
|
||||
import Parent from "./Parent.svelte";
|
||||
async function getItem(item) {
|
||||
try {
|
||||
const response = await fetch(`/api/packages/${item.name}`);
|
||||
const data = await response.json();
|
||||
return {
|
||||
...data,
|
||||
package_name: item.name
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("error: failed to fetch", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function getAssets() {
|
||||
const items = JSON.parse(localStorage.getItem(Settings.PluginSettings.plugins)) || [];
|
||||
const promises = items.map(getItem);
|
||||
const dataArray = await Promise.all(promises);
|
||||
let accumulatedData = dataArray.filter((data) => data !== null);
|
||||
accumulatedData = accumulatedData.filter(({ remove }) => remove !== true);
|
||||
console.log(JSON.stringify(accumulatedData));
|
||||
return accumulatedData;
|
||||
}
|
||||
let assets = getAssets();
|
||||
let compRef = [];
|
||||
</script>
|
||||
<Suspense let:suspend>
|
||||
{#await suspend(assets) then data}
|
||||
{#each Object.entries(data) as [key, asset]}
|
||||
<Parent bind:this={compRef[key]}>
|
||||
<div class="rounded-3xl bg-navbar-color w-64 flex flex-col cursor-pointer">
|
||||
<div class="w-full">
|
||||
<img src={`/packages/${asset.package_name}/${asset.image}`} alt="plugin" class="aspect-[16/9] rounded-t-3xl"/>
|
||||
</div>
|
||||
<div class="h-2/6 text-center content-center p-3 font-semibold items-center flex flex-col">
|
||||
<div class="text-2xl"> {asset.title} </div>
|
||||
<div class="flex flex-row">
|
||||
<div class="h-8 w-8 cursor-pointer" on:click={() => {settings.marketPlaceSettings.uninstall(asset.type === "page" ? "plugin-page" : "plugin-sw", asset.package_name); compRef[key].$destroy()}}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 256 256" {...$$props}>
|
||||
<path fill="currentColor" d="M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16M112 168a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm48 0a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm0-120H96v-8a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8Z" />
|
||||
</svg>
|
||||
</div>
|
||||
<a class="h-8 w-8 cursor-pointer" href={`../catalog/package/${asset.package_name}`}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 256 256" {...$$props}>
|
||||
<path fill="currentColor" d="M192 136v72a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16V80a16 16 0 0 1 16-16h72a8 8 0 0 1 0 16H48v128h128v-72a8 8 0 0 1 16 0m32-96a8 8 0 0 0-8-8h-64a8 8 0 0 0-5.66 13.66L172.69 72l-42.35 42.34a8 8 0 0 0 11.32 11.32L184 83.31l26.34 26.35A8 8 0 0 0 224 104Z" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Parent>
|
||||
{/each}
|
||||
{/await}
|
||||
</Suspense>
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<script lang="ts">
|
||||
import { Suspense } from "@svelte-drama/suspense";
|
||||
import { Settings, settings } from "@utils/settings/index";
|
||||
import Parent from "./Parent.svelte";
|
||||
async function getItem(item) {
|
||||
try {
|
||||
const response = await fetch(`/api/packages/${item}`);
|
||||
const data = await response.json();
|
||||
return {
|
||||
...data,
|
||||
package_name: item
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("error: failed to fetch", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function getAssets() {
|
||||
const items = JSON.parse(localStorage.getItem(Settings.AppearanceSettings.themes)) || [];
|
||||
const promises = items.map(getItem);
|
||||
const dataArray = await Promise.all(promises);
|
||||
const accumulatedData = dataArray.filter((data) => data !== null);
|
||||
console.log(JSON.stringify(accumulatedData));
|
||||
return accumulatedData;
|
||||
}
|
||||
let assets = getAssets();
|
||||
let compRef = [];
|
||||
</script>
|
||||
<Suspense let:suspend>
|
||||
<div class="rounded-3xl bg-navbar-color w-64 flex flex-col cursor-pointer">
|
||||
<div class="w-full" on:click={() => {settings.marketPlaceSettings.changeTheme(true)}}>
|
||||
<img src='/classic_theme.png' alt="Classic Nebula" class="aspect-[16/9] rounded-t-3xl"/>
|
||||
</div>
|
||||
<div class="h-2/6 text-center content-center p-3 font-semibold items-center flex flex-col text-2xl">
|
||||
Classic Nebula
|
||||
</div>
|
||||
</div>
|
||||
{#await suspend(assets) then data}
|
||||
{#each Object.entries(data) as [key, asset]}
|
||||
<Parent bind:this={compRef[key]}>
|
||||
<div class="rounded-3xl bg-navbar-color w-64 flex flex-col cursor-pointer">
|
||||
<div class="w-full" on:click={() => {settings.marketPlaceSettings.changeTheme(false, asset.payload, asset.background_video, asset.background_image, asset.package_name)}}>
|
||||
<img src={`/packages/${asset.package_name}/${asset.image}`} alt="theme" class="aspect-[16/9] rounded-t-3xl"/>
|
||||
</div>
|
||||
<div class="h-2/6 text-center content-center p-3 font-semibold items-center flex flex-col">
|
||||
<div class="text-2xl"> {asset.title} </div>
|
||||
<div class="flex flex-row">
|
||||
<div class="h-8 w-8 cursor-pointer" on:click={() => {settings.marketPlaceSettings.uninstall("theme", asset.package_name); settings.marketPlaceSettings.changeTheme(true); compRef[key].$destroy()}}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 256 256" {...$$props}>
|
||||
<path fill="currentColor" d="M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16M112 168a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm48 0a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0Zm0-120H96v-8a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8Z" />
|
||||
</svg>
|
||||
</div>
|
||||
<a class="h-8 w-8 cursor-pointer" href={`../catalog/package/${asset.package_name}`}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 256 256" {...$$props}>
|
||||
<path fill="currentColor" d="M192 136v72a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16V80a16 16 0 0 1 16-16h72a8 8 0 0 1 0 16H48v128h128v-72a8 8 0 0 1 16 0m32-96a8 8 0 0 0-8-8h-64a8 8 0 0 0-5.66 13.66L172.69 72l-42.35 42.34a8 8 0 0 0 11.32 11.32L184 83.31l26.34 26.35A8 8 0 0 0 224 104Z" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Parent>
|
||||
{/each}
|
||||
{/await}
|
||||
</Suspense>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!-- Legit just so we can use $destroy() -->
|
||||
<slot />
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
import { Image } from "astro:assets";
|
||||
import { type ImageMetadata } from "astro";
|
||||
const images = import.meta.glob<{ default: ImageMetadata }>(
|
||||
"/src/assets/credits/*.{jpeg,jpg,png,gif,webp}"
|
||||
);
|
||||
|
||||
interface Props {
|
||||
image?: string;
|
||||
name: string;
|
||||
link: string;
|
||||
}
|
||||
|
||||
const { image, name, link } = Astro.props;
|
||||
---
|
||||
<a class="rounded-md bg-navbar-color h-50 w-50 p-2 flex flex-col items-center" href={link} target="_blank" rel="noopener noreferrer">
|
||||
{image && <Image loading='lazy' class='w-32 h-32 object-cover rounded-md' src={images[image]()} alt={name} />}
|
||||
<p class="h-12 w-full text-text-color flex items-center justify-center text-xl font-semibold">{name}</p>
|
||||
</a>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<script>
|
||||
import { settings, Settings } from "@utils/settings/index";
|
||||
// This loads the settings in a nice way
|
||||
settings.tabSettings.cloakTab(localStorage.getItem(Settings.TabSettings.tabCloak) as string || "default");
|
||||
settings.proxySettings.changeProxy(localStorage.getItem(Settings.ProxySettings.proxy) as string || "automatic");
|
||||
settings.proxySettings.openIn(localStorage.getItem(Settings.ProxySettings.openIn) as string || "embed");
|
||||
settings.proxySettings.setSearchEngine(localStorage.getItem(Settings.ProxySettings.searchEngine) as string || "ddg");
|
||||
settings.proxySettings.setWispURL(localStorage.getItem(Settings.ProxySettings.wispServerURL) as string || "default");
|
||||
settings.proxySettings.setTransport(localStorage.getItem(Settings.ProxySettings.transport) as string || "libcurl");
|
||||
settings.marketPlaceSettings.changeTheme(false, undefined, localStorage.getItem(Settings.AppearanceSettings.video) as string, localStorage.getItem(Settings.AppearanceSettings.image) as string, localStorage.getItem(Settings.AppearanceSettings.themeName) as string);
|
||||
document.addEventListener("astro:after-swap", function() {
|
||||
settings.tabSettings.cloakTab(localStorage.getItem(Settings.TabSettings.tabCloak) as string || "default");
|
||||
//settings.marketPlaceSettings.changeTheme(false);
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
---
|
||||
interface Inputs {
|
||||
input: boolean;
|
||||
required?: boolean;
|
||||
placeholder?: string;
|
||||
}
|
||||
interface SelectOptions {
|
||||
value: string;
|
||||
name: string;
|
||||
disabled: boolean;
|
||||
}
|
||||
interface Selects {
|
||||
select: boolean;
|
||||
name?: string;
|
||||
multiple?: boolean;
|
||||
options?: SelectOptions[];
|
||||
}
|
||||
interface Buttons {
|
||||
name: string;
|
||||
id: string;
|
||||
}
|
||||
interface Props {
|
||||
title: string;
|
||||
description: string;
|
||||
input: Inputs;
|
||||
select: Selects;
|
||||
button: Buttons;
|
||||
}
|
||||
|
||||
const { title, description, input, select, button } = Astro.props;
|
||||
---
|
||||
|
||||
<div class="w-64 rounded-3xl bg-navbar-color h-64 flex flex-col items-center p-4">
|
||||
<h1 class="text-3xl font-bold mb-2"> { title } </h1>
|
||||
<p class="text-md w-full text-ellipsis text-center"> { description } </p>
|
||||
<div class="w-full h-full flex-grow flex justify-center items-center flex-col gap-4">
|
||||
<!-- We only want to render an input if it's enabled -->
|
||||
{input.input &&
|
||||
<input class="text-md w-full h-10 p-2 bg-input border border-input-border-color rounded-md text-input-text" required={input.required} placeholder={input.placeholder}></input>
|
||||
}
|
||||
<!-- Same with dropdown selections -->
|
||||
{select.select &&
|
||||
<select id={select.name?.replace(/[^a-zA-Z0-9]/g, '').toLowerCase()} class="text-md w-full h-10 p-2 bg-input border border-input-border-color rounded-md text-input-text" multiple={select.multiple} name={select.name}>
|
||||
{select.options!.map((option) => (
|
||||
<option disabled={option.disabled} value={option.value}>{option.name}</option>
|
||||
))}
|
||||
</select>
|
||||
}
|
||||
<button id={button.id.replace(/[^a-zA-Z0-9]/g, '').toLowerCase()} class="w-36 h-10 rounded-md border border-input-border-color text-input-text bg-input hover:border-input hover:bg-input-border-color hover:text-input hover:font-bold active:bg-input active:text-input-text transition-all duration-200">
|
||||
{button.name}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||