forked from Mirrors/keyoxide-web
Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
abfa9697b1 | |||
|
353cd3b1e5 | ||
|
7b5aa4703a | ||
d34d3027ee |
16 changed files with 8270 additions and 9861 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
@ -34,3 +34,12 @@ ignore
|
||||||
dist
|
dist
|
||||||
static
|
static
|
||||||
logs
|
logs
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
.pnp.*
|
||||||
|
.yarn/*
|
||||||
|
!.yarn/patches
|
||||||
|
!.yarn/plugins
|
||||||
|
!.yarn/releases
|
||||||
|
!.yarn/sdks
|
||||||
|
!.yarn/versions
|
|
@ -10,7 +10,7 @@ dist/
|
||||||
logs/
|
logs/
|
||||||
|
|
||||||
package.json
|
package.json
|
||||||
package-lock.json
|
yarn.lock
|
||||||
robots.txt
|
robots.txt
|
||||||
\.licenseignore
|
\.licenseignore
|
||||||
\.woodpecker.yml
|
\.woodpecker.yml
|
||||||
|
|
57
.woodpecker.yml
Normal file
57
.woodpecker.yml
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
steps:
|
||||||
|
test:
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- yarn --pure-lockfile
|
||||||
|
- yarn run test
|
||||||
|
|
||||||
|
build-latest-container:
|
||||||
|
when:
|
||||||
|
branch: main
|
||||||
|
event: tag
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: https://codeberg.org/v2
|
||||||
|
username:
|
||||||
|
from_secret: codeberg_username
|
||||||
|
password:
|
||||||
|
from_secret: codeberg_password
|
||||||
|
repo: codeberg.org/keyoxide/keyoxide-web
|
||||||
|
tags: latest
|
||||||
|
build_args_from_env:
|
||||||
|
- CI_COMMIT_SHA
|
||||||
|
- CI_COMMIT_BRANCH
|
||||||
|
|
||||||
|
build-tag-container:
|
||||||
|
when:
|
||||||
|
branch: main
|
||||||
|
event: tag
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: https://codeberg.org/v2
|
||||||
|
username:
|
||||||
|
from_secret: codeberg_username
|
||||||
|
password:
|
||||||
|
from_secret: codeberg_password
|
||||||
|
repo: codeberg.org/keyoxide/keyoxide-web
|
||||||
|
auto_tag: true
|
||||||
|
build_args_from_env:
|
||||||
|
- CI_COMMIT_SHA
|
||||||
|
- CI_COMMIT_BRANCH
|
||||||
|
|
||||||
|
build-dev-container:
|
||||||
|
when:
|
||||||
|
branch: dev
|
||||||
|
event: push
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: https://codeberg.org/v2
|
||||||
|
username:
|
||||||
|
from_secret: codeberg_username
|
||||||
|
password:
|
||||||
|
from_secret: codeberg_password
|
||||||
|
repo: codeberg.org/keyoxide/keyoxide-web
|
||||||
|
tags: dev
|
||||||
|
build_args_from_env:
|
||||||
|
- CI_COMMIT_SHA
|
||||||
|
- CI_COMMIT_BRANCH
|
|
@ -1,20 +0,0 @@
|
||||||
when:
|
|
||||||
branch: dev
|
|
||||||
event: push
|
|
||||||
steps:
|
|
||||||
build-latest-container:
|
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
|
||||||
settings:
|
|
||||||
registry: https://codeberg.org/v2
|
|
||||||
username:
|
|
||||||
from_secret: codeberg_username
|
|
||||||
password:
|
|
||||||
from_secret: codeberg_password
|
|
||||||
repo: codeberg.org/keyoxide/keyoxide-web
|
|
||||||
tag: dev
|
|
||||||
build_args_from_env:
|
|
||||||
- CI_COMMIT_SHA
|
|
||||||
- CI_COMMIT_BRANCH
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- test
|
|
|
@ -1,20 +0,0 @@
|
||||||
when:
|
|
||||||
branch: main
|
|
||||||
event: tag
|
|
||||||
steps:
|
|
||||||
build-latest-container:
|
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
|
||||||
settings:
|
|
||||||
registry: https://codeberg.org/v2
|
|
||||||
username:
|
|
||||||
from_secret: codeberg_username
|
|
||||||
password:
|
|
||||||
from_secret: codeberg_password
|
|
||||||
repo: codeberg.org/keyoxide/keyoxide-web
|
|
||||||
auto_tag: true
|
|
||||||
build_args_from_env:
|
|
||||||
- CI_COMMIT_SHA
|
|
||||||
- CI_COMMIT_BRANCH
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- test
|
|
|
@ -1,8 +0,0 @@
|
||||||
when:
|
|
||||||
event: [push, pull_request, tag, release, manual]
|
|
||||||
steps:
|
|
||||||
test:
|
|
||||||
image: node:20
|
|
||||||
commands:
|
|
||||||
- npm ci
|
|
||||||
- npm test
|
|
4
.yarnrc.yml
Normal file
4
.yarnrc.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
nodeLinker: node-modules
|
||||||
|
npmScopes:
|
||||||
|
myriation:
|
||||||
|
npmRegistryServer: https://git.myriation.xyz/api/packages/myriation/npm/
|
|
@ -3,9 +3,9 @@ FROM node:20-alpine as builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN npm ci
|
RUN corepack enable
|
||||||
RUN npm run build:server
|
RUN yarn install --immutable
|
||||||
RUN npm run build:static
|
RUN yarn run build:server && yarn run build:static
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
|
|
28
README.md
28
README.md
|
@ -15,13 +15,13 @@ Self-hosting Keyoxide is an important aspect of the project. Users need to trust
|
||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
The Docker container allows you to easily self-host the [Keyoxide](https://keyoxide.org) project. To get started, run:
|
The Docker container allows you to easily self-host the [Keyoxide](https://keyoxide.org) project. To get started, simply run:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run -d -p 3000:3000 codeberg.org/keyoxide/keyoxide-web:latest
|
docker run -d -p 3000:3000 codeberg.org/keyoxide/keyoxide-web:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
Keyoxide will now be available at [http://localhost:3000](localhost:3000).
|
Keyoxide will now be available by visiting http://localhost:3000.
|
||||||
|
|
||||||
More information available in the [documentation](https://docs.keyoxide.org/guides/self-hosting/).
|
More information available in the [documentation](https://docs.keyoxide.org/guides/self-hosting/).
|
||||||
|
|
||||||
|
@ -34,29 +34,9 @@ Install `node` in one of the following ways:
|
||||||
- using [nvm](https://github.com/nvm-sh/nvm)
|
- using [nvm](https://github.com/nvm-sh/nvm)
|
||||||
- directly from their [website](https://nodejs.org/)
|
- directly from their [website](https://nodejs.org/)
|
||||||
|
|
||||||
Install the dependencies and run the server:
|
Install dependencies with `npm install` or `yarn`.
|
||||||
|
|
||||||
```sh
|
Run the server with `npm dev` or `yarn dev`. The Keyoxide web client will now be available at [https://localhost:3000](https://localhost:3000).
|
||||||
npm install
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
The web client will now be available at [http://localhost:3000](localhost:3000).
|
|
||||||
|
|
||||||
### Using nix
|
|
||||||
|
|
||||||
Enter a development shell:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
nix develop
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, start a local server directly:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
nix develop --command bash -c "npm run dev"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
61
flake.lock
61
flake.lock
|
@ -1,61 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1717144377,
|
|
||||||
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-24.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"utils": "utils"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1710146030,
|
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
28
flake.nix
28
flake.nix
|
@ -1,28 +0,0 @@
|
||||||
{
|
|
||||||
description = "keyoxide-web";
|
|
||||||
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
|
||||||
utils.url = "github:numtide/flake-utils";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, utils }:
|
|
||||||
utils.lib.eachDefaultSystem (system:
|
|
||||||
let
|
|
||||||
name = "keyoxide-web";
|
|
||||||
pkgs = import nixpkgs { inherit system; };
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# nix develop
|
|
||||||
devShell = with pkgs; mkShell {
|
|
||||||
buildInputs = [
|
|
||||||
nodejs_20
|
|
||||||
];
|
|
||||||
|
|
||||||
shellHook = ''
|
|
||||||
echo "node: `${nodejs_20}/bin/node --version`"
|
|
||||||
echo "npm: `${nodejs_20}/bin/npm --version`"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
9688
package-lock.json
generated
9688
package-lock.json
generated
File diff suppressed because it is too large
Load diff
12
package.json
12
package.json
|
@ -4,12 +4,13 @@
|
||||||
"description": "Verifying online identity with cryptography",
|
"description": "Verifying online identity with cryptography",
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"packageManager": "yarn@3.6.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ajv": "^8.6.3",
|
"ajv": "^8.6.3",
|
||||||
"bent": "^7.3.12",
|
"bent": "^7.3.12",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"colorjs.io": "^0.4.5",
|
"colorjs.io": "^0.4.5",
|
||||||
"doipjs": "^1.2.9",
|
"doipjs": "npm:@myriation/doipjs@1.2.9+myriation.1",
|
||||||
"dotenv": "^16.0.3",
|
"dotenv": "^16.0.3",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-http-context2": "^1.0.0",
|
"express-http-context2": "^1.0.0",
|
||||||
|
@ -48,15 +49,14 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node ./",
|
"start": "node ./",
|
||||||
"dev": "LOG_LEVEL=debug npm run watch & npm run build:static:dev",
|
"dev": "LOG_LEVEL=debug yarn run watch & yarn run build:static:dev",
|
||||||
"pretest": "npm run lint",
|
"test": "yarn run lint && mocha",
|
||||||
"test": "mocha",
|
|
||||||
"watch": "nodemon --config nodemon.json ./",
|
"watch": "nodemon --config nodemon.json ./",
|
||||||
"build": "npm run build:server && npm run build:static",
|
"build": "yarn run build:server && yarn run build:static",
|
||||||
"build:server": "ncc build ./src/index.js -o dist",
|
"build:server": "ncc build ./src/index.js -o dist",
|
||||||
"build:static": "webpack --config webpack.config.js --env static=true --env mode=production",
|
"build:static": "webpack --config webpack.config.js --env static=true --env mode=production",
|
||||||
"build:static:dev": "webpack --config webpack.config.js --env static=true --env mode=development",
|
"build:static:dev": "webpack --config webpack.config.js --env static=true --env mode=development",
|
||||||
"lint": "npm run standard:check && npm run biome:check",
|
"lint": "yarn run standard:check && yarn run biome:check",
|
||||||
"biome:check": "biome check ./src && biome lint ./src",
|
"biome:check": "biome check ./src && biome lint ./src",
|
||||||
"biome:fix": "biome check --apply ./src && biome lint --apply ./src",
|
"biome:fix": "biome check --apply ./src && biome lint --apply ./src",
|
||||||
"standard:check": "standard ./src",
|
"standard:check": "standard ./src",
|
||||||
|
|
16
shell.nix
Normal file
16
shell.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
{ pkgs ? import <nixpkgs> {}}:
|
||||||
|
let
|
||||||
|
unstable = import (fetchTarball "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz") {};
|
||||||
|
in
|
||||||
|
pkgs.mkShell {
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
nodejs
|
||||||
|
yarn
|
||||||
|
xvfb_run
|
||||||
|
unstable.cypress
|
||||||
|
];
|
||||||
|
|
||||||
|
CYPRESS_INSTALL_BINARY=0; #skip installing the Cypress binary from yarn
|
||||||
|
CYPRESS_RUN_BINARY="${unstable.cypress}/bin/Cypress";
|
||||||
|
}
|
|
@ -42,7 +42,12 @@ const opts = {
|
||||||
privateKey: process.env.ACTIVITYPUB_PRIVATE_KEY || null
|
privateKey: process.env.ACTIVITYPUB_PRIVATE_KEY || null
|
||||||
},
|
},
|
||||||
irc: {
|
irc: {
|
||||||
nick: process.env.IRC_NICK || null
|
nick: process.env.IRC_NICK || null,
|
||||||
|
sasl: Object.keys(process.env).filter(k => k.startsWith('IRC_SASL_USERNAME_')).map(k => ({
|
||||||
|
username: process.env[k],
|
||||||
|
password: process.env[`IRC_SASL_PASSWORD_${k.substring('IRC_SASL_USERNAME_'.length)}`],
|
||||||
|
domainRegex: process.env[`IRC_SASL_DOMAIN_REGEX_${k.substring('IRC_SASL_USERNAME_'.length)}`]
|
||||||
|
}))
|
||||||
},
|
},
|
||||||
matrix: {
|
matrix: {
|
||||||
instance: process.env.MATRIX_INSTANCE || null,
|
instance: process.env.MATRIX_INSTANCE || null,
|
||||||
|
|
Loading…
Reference in a new issue