mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
refactor: 🚚 Begin rebranding to Versia Server
This commit is contained in:
parent
06c65559d1
commit
c10da18182
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "Lysand Dev Container",
|
"name": "versia Dev Container",
|
||||||
"dockerFile": "Dockerfile",
|
"dockerFile": "Dockerfile",
|
||||||
"runArgs": [
|
"runArgs": [
|
||||||
"-v",
|
"-v",
|
||||||
|
|
|
||||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -32,7 +32,7 @@ Please upload logs onto a service like [Pastebin](https://pastebin.com/) or [Has
|
||||||
- OS: [e.g. Fedora 39]
|
- OS: [e.g. Fedora 39]
|
||||||
- Bun version
|
- Bun version
|
||||||
- Postgres version
|
- Postgres version
|
||||||
- Lysand commit ID or version
|
- versia Server commit ID or version
|
||||||
|
|
||||||
## Additional context
|
## Additional context
|
||||||
|
|
||||||
|
|
|
||||||
16
.github/config.workflow.toml
vendored
16
.github/config.workflow.toml
vendored
|
|
@ -1,9 +1,9 @@
|
||||||
[database]
|
[database]
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
port = 5432
|
port = 5432
|
||||||
username = "lysand"
|
username = "versia"
|
||||||
password = "lysand"
|
password = "versia"
|
||||||
database = "lysand"
|
database = "versia"
|
||||||
|
|
||||||
[redis.queue]
|
[redis.queue]
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
|
|
@ -38,7 +38,7 @@ rules = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[oidc]
|
[oidc]
|
||||||
# Run Lysand with this value missing to generate a new key
|
# Run Versia with this value missing to generate a new key
|
||||||
jwt_key = "MC4CAQAwBQYDK2VwBCIEID+H5n9PY3zVKZQcq4jrnE1IiRd2EWWr8ApuHUXmuOzl;MCowBQYDK2VwAyEAzenliNkgpXYsh3gXTnAoUWzlCPjIOppmAVx2DBlLsC8="
|
jwt_key = "MC4CAQAwBQYDK2VwBCIEID+H5n9PY3zVKZQcq4jrnE1IiRd2EWWr8ApuHUXmuOzl;MCowBQYDK2VwAyEAzenliNkgpXYsh3gXTnAoUWzlCPjIOppmAVx2DBlLsC8="
|
||||||
|
|
||||||
[http]
|
[http]
|
||||||
|
|
@ -79,7 +79,7 @@ convert_to = "webp"
|
||||||
# access_key = ""
|
# access_key = ""
|
||||||
# secret_access_key = ""
|
# secret_access_key = ""
|
||||||
# region = "us-west-2"
|
# region = "us-west-2"
|
||||||
# bucket_name = "lysand"
|
# bucket_name = "versia"
|
||||||
# public_url = "https://cdn.example.com"
|
# public_url = "https://cdn.example.com"
|
||||||
|
|
||||||
[validation]
|
[validation]
|
||||||
|
|
@ -185,7 +185,7 @@ allowed_mime_types = [
|
||||||
|
|
||||||
[validation.challenges]
|
[validation.challenges]
|
||||||
# "Challenges" (aka captchas) are a way to verify that a user is human
|
# "Challenges" (aka captchas) are a way to verify that a user is human
|
||||||
# Lysand's challenges use no external services, and are Proof of Work based
|
# Versia Server's challenges use no external services, and are Proof of Work based
|
||||||
# This means that they do not require any user interaction, instead
|
# This means that they do not require any user interaction, instead
|
||||||
# they require the user's computer to do a small amount of work
|
# they require the user's computer to do a small amount of work
|
||||||
enabled = true
|
enabled = true
|
||||||
|
|
@ -240,8 +240,8 @@ remove_media = [] # NOT IMPLEMENTED
|
||||||
authorized_fetch = false
|
authorized_fetch = false
|
||||||
|
|
||||||
[instance]
|
[instance]
|
||||||
name = "Lysand"
|
name = "Versia"
|
||||||
description = "A test instance of Lysand"
|
description = "A test instance of Versia Server"
|
||||||
# URL to your instance logo (jpg files should be renamed to jpeg)
|
# URL to your instance logo (jpg files should be renamed to jpeg)
|
||||||
# logo = ""
|
# logo = ""
|
||||||
# URL to your instance banner (jpg files should be renamed to jpeg)
|
# URL to your instance banner (jpg files should be renamed to jpeg)
|
||||||
|
|
|
||||||
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
|
|
@ -16,11 +16,11 @@ jobs:
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
env:
|
env:
|
||||||
POSTGRES_DB: lysand
|
POSTGRES_DB: versia
|
||||||
POSTGRES_USER: lysand
|
POSTGRES_USER: versia
|
||||||
POSTGRES_PASSWORD: lysand
|
POSTGRES_PASSWORD: versia
|
||||||
volumes:
|
volumes:
|
||||||
- lysand-data:/var/lib/postgresql/data
|
- versia-data:/var/lib/postgresql/data
|
||||||
options: --health-cmd pg_isready
|
options: --health-cmd pg_isready
|
||||||
--health-interval 10s
|
--health-interval 10s
|
||||||
--health-timeout 5s
|
--health-timeout 5s
|
||||||
|
|
|
||||||
14
.vscode/launch.json
vendored
14
.vscode/launch.json
vendored
|
|
@ -1,14 +0,0 @@
|
||||||
{
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"type": "node",
|
|
||||||
"name": "vscode-jest-tests.v2.lysand",
|
|
||||||
"request": "launch",
|
|
||||||
"args": ["test", "${jest.testFile}"],
|
|
||||||
"cwd": "/home/jessew/Dev/lysand",
|
|
||||||
"console": "integratedTerminal",
|
|
||||||
"internalConsoleOptions": "neverOpen",
|
|
||||||
"program": "/home/jessew/.bun/bin/bun"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
11
CHANGELOG.md
11
CHANGELOG.md
|
|
@ -1,8 +1,11 @@
|
||||||
# `0.7.0`
|
# `0.7.0` (unreleased)
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> This release marks the rename of the project from `Lysand` to `Versia`.
|
||||||
|
|
||||||
## Backwards Compatibility
|
## Backwards Compatibility
|
||||||
|
|
||||||
Lysand Server `0.7.0` is backwards compatible with `0.6.0`. However, some new features may not be available to older clients. Notably, `lysand-fe` has had major improvements and will not work with `0.6.0`.
|
Versia Server `0.7.0` is backwards compatible with `0.6.0`. However, some new features may not be available to older clients. Notably, `versia-fe` has had major improvements and will not work with `0.6.0`.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
@ -16,7 +19,7 @@ Lysand Server `0.7.0` is backwards compatible with `0.6.0`. However, some new fe
|
||||||
- Added [**Roles API**](docs/api/roles.md).
|
- Added [**Roles API**](docs/api/roles.md).
|
||||||
- Added [**Permissions API**](docs/api/roles.md) and enabled it for every route.
|
- Added [**Permissions API**](docs/api/roles.md) and enabled it for every route.
|
||||||
- Added [**TOS and Privacy Policy**](docs/api/mastodon.md) endpoints.
|
- Added [**TOS and Privacy Policy**](docs/api/mastodon.md) endpoints.
|
||||||
- Added [**Challenge API**](docs/api/challenges.md). (basically CAPTCHAS). This can be enabled/disabled by administrators. No `lysand-fe` support yet.
|
- Added [**Challenge API**](docs/api/challenges.md). (basically CAPTCHAS). This can be enabled/disabled by administrators. No `versia-fe` support yet.
|
||||||
- Added ability to refetch user data from remote instances.
|
- Added ability to refetch user data from remote instances.
|
||||||
- Added ability to change the `username` of a user. ([Mastodon API extension](docs/api/mastodon.md)).
|
- Added ability to change the `username` of a user. ([Mastodon API extension](docs/api/mastodon.md)).
|
||||||
- Added an endpoint to get a user by its username.
|
- Added an endpoint to get a user by its username.
|
||||||
|
|
@ -24,7 +27,7 @@ Lysand Server `0.7.0` is backwards compatible with `0.6.0`. However, some new fe
|
||||||
- Add option to never convert vector images to a raster format.
|
- Add option to never convert vector images to a raster format.
|
||||||
- Refactor logging system to be more robust and easier to use. Logfiles are now automatically rotated.
|
- Refactor logging system to be more robust and easier to use. Logfiles are now automatically rotated.
|
||||||
- Add support for HTTP proxies.
|
- Add support for HTTP proxies.
|
||||||
- Add support for serving Lysand over a Tor hidden service.
|
- Add support for serving Versia over a Tor hidden service.
|
||||||
- Add global server error handler, to properly return 500 error messages to clients.
|
- Add global server error handler, to properly return 500 error messages to clients.
|
||||||
- Sign all federation HTTP requests.
|
- Sign all federation HTTP requests.
|
||||||
- Add JSON schema for configuration file.
|
- Add JSON schema for configuration file.
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
# Contributing to Lysand
|
# Contributing to Versia
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> This document was authored by [@CPlusPatch](https://github.com/CPlusPatch).
|
> This document was authored by [@CPlusPatch](https://github.com/CPlusPatch).
|
||||||
|
|
||||||
Thank you for your interest in contributing to Lysand! We welcome contributions from everyone, regardless of their level of experience or expertise.
|
Thank you for your interest in contributing to Versia Server! We welcome contributions from everyone, regardless of their level of experience or expertise.
|
||||||
|
|
||||||
# Tech Stack
|
# Tech Stack
|
||||||
|
|
||||||
Lysand is built using the following technologies:
|
Versia Server is built using the following technologies:
|
||||||
|
|
||||||
- [Bun](https://bun.sh) - A JavaScript runtime similar to Node.js, but faster and with more features
|
- [Bun](https://bun.sh) - A JavaScript runtime similar to Node.js, but faster and with more features
|
||||||
- [PostgreSQL](https://www.postgresql.org/) - A relational database
|
- [PostgreSQL](https://www.postgresql.org/) - A relational database
|
||||||
|
|
@ -51,19 +51,19 @@ To develop with HTTPS, you need to generate a self-signed certificate. We will u
|
||||||
mkcert -install
|
mkcert -install
|
||||||
# You can change the domain to whatever you want, but it must resolve via /etc/hosts
|
# You can change the domain to whatever you want, but it must resolve via /etc/hosts
|
||||||
# *.localhost domains are automatically aliased to localhost by DNS
|
# *.localhost domains are automatically aliased to localhost by DNS
|
||||||
mkcert -key-file config/lysand.localhost-key.pem -cert-file config/lysand.localhost.pem lysand.localhost
|
mkcert -key-file config/versia.localhost-key.pem -cert-file config/versia.localhost.pem versia.localhost
|
||||||
```
|
```
|
||||||
3. Edit the config:
|
3. Edit the config:
|
||||||
```toml
|
```toml
|
||||||
[http]
|
[http]
|
||||||
base_url = "https://lysand.localhost:9900"
|
base_url = "https://versia.localhost:9900"
|
||||||
bind = "lysand.localhost"
|
bind = "versia.localhost"
|
||||||
bind_port = 9900 # Change the port to whatever you want
|
bind_port = 9900 # Change the port to whatever you want
|
||||||
|
|
||||||
[http.tls]
|
[http.tls]
|
||||||
enabled = true
|
enabled = true
|
||||||
key = "config/lysand.localhost-key.pem"
|
key = "config/versia.localhost-key.pem"
|
||||||
cert = "config/lysand.localhost.pem"
|
cert = "config/versia.localhost.pem"
|
||||||
passphrase = ""
|
passphrase = ""
|
||||||
ca = ""
|
ca = ""
|
||||||
```
|
```
|
||||||
|
|
@ -134,7 +134,7 @@ To add tests for a route, create a `route_file_name.test.ts` file in the same di
|
||||||
|
|
||||||
### Writing documentation
|
### Writing documentation
|
||||||
|
|
||||||
Documentation for the Lysand protocol is available on [lysand.org](https://lysand.org/). If you are thinking of modifying the protocol, please make sure to send a pull request over there to get it approved and merged before you send your pull request here.
|
Documentation for the Versia protocol is available on [lysand.org](https://lysand.org/). If you are thinking of modifying the protocol, please make sure to send a pull request over there to get it approved and merged before you send your pull request here.
|
||||||
|
|
||||||
This project should not need much documentation, but if you think that something needs to be documented, please add it to the README, docs or contribution guide.
|
This project should not need much documentation, but if you think that something needs to be documented, please add it to the README, docs or contribution guide.
|
||||||
|
|
||||||
|
|
@ -145,11 +145,11 @@ If you find a bug, please open an issue on GitHub. Please make sure to include t
|
||||||
- The steps to reproduce the bug
|
- The steps to reproduce the bug
|
||||||
- The expected behavior
|
- The expected behavior
|
||||||
- The actual behavior
|
- The actual behavior
|
||||||
- The version of Lysand you are using
|
- The version of Versia Server you are using
|
||||||
- The version of Bun you are using
|
- The version of Bun you are using
|
||||||
- The version of PostgreSQL you are using
|
- The version of PostgreSQL you are using
|
||||||
- Your operating system and version
|
- Your operating system and version
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
Lysand is licensed under the [AGPLv3 or later](https://www.gnu.org/licenses/agpl-3.0.en.html) license. By contributing to Lysand, you agree to license your contributions under the same license.
|
Versia Server is licensed under the [AGPLv3 or later](https://www.gnu.org/licenses/agpl-3.0.en.html) license. By contributing to Versia, you agree to license your contributions under the same license.
|
||||||
|
|
@ -37,10 +37,10 @@ COPY entrypoint.sh /app
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Gaspard Wierzbinski (https://cpluspatch.dev)"
|
LABEL org.opencontainers.image.authors="Gaspard Wierzbinski (https://cpluspatch.dev)"
|
||||||
LABEL org.opencontainers.image.source="https://github.com/lysand-org/lysand"
|
LABEL org.opencontainers.image.source="https://github.com/lysand-org/lysand"
|
||||||
LABEL org.opencontainers.image.vendor="Lysand Org"
|
LABEL org.opencontainers.image.vendor="Versia Pub"
|
||||||
LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
|
LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
|
||||||
LABEL org.opencontainers.image.title="Lysand Server"
|
LABEL org.opencontainers.image.title="Versia Server"
|
||||||
LABEL org.opencontainers.image.description="Lysand Server docker image"
|
LABEL org.opencontainers.image.description="Versia Server Docker image"
|
||||||
|
|
||||||
# Set current Git commit hash as an environment variable
|
# Set current Git commit hash as an environment variable
|
||||||
ARG GIT_COMMIT
|
ARG GIT_COMMIT
|
||||||
|
|
|
||||||
36
README.md
36
README.md
|
|
@ -1,30 +1,30 @@
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://lysand.org"><img src="https://cdn.lysand.org/logo-long-dark.webp" alt="Lysand Logo" height="110"></a>
|
<a href="https://lysand.org"><img src="https://cdn.lysand.org/logo-long-dark.webp" alt="Versia Logo" height="110"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
      [](code_of_conduct.md)
|
      [](code_of_conduct.md)
|
||||||
|
|
||||||
## What is this?
|
## What is this?
|
||||||
|
|
||||||
**Lysand Server** is a federated social network server based on the [Lysand](https://lysand.org) protocol. It is currently in beta phase, with basic federation and almost complete Mastodon API support.
|
**Versia Server** (formerly Lysand Server) is a federated social network server based on the [Versia](https://lysand.org) protocol. It is currently in beta phase, with basic federation and almost complete Mastodon API support.
|
||||||
|
|
||||||
### Goals
|
### Goals
|
||||||
|
|
||||||
- **Privacy**: Lysand is designed to be as private as possible. Unnecessary data is not stored, and data that is stored is done so securely.
|
- **Privacy**: Versia Server is designed to be as private as possible. Unnecessary data is not stored, and data that is stored is done so securely.
|
||||||
- **Configurability**: High configurability is a key feature of Lysand. Almost every aspect of the server can be configured to suit your needs. If you feel like something is missing, please open an issue.
|
- **Configurability**: High configurability is a key feature of Versia Server. Almost every aspect of the server can be configured to suit your needs. If you feel like something is missing, please open an issue.
|
||||||
- **Security**: Lysand is designed with security in mind. It is built with modern security practices and technologies, and is constantly updated to ensure the highest level of security.
|
- **Security**: Versia Server is designed with security in mind. It is built with modern security practices and technologies, and is constantly updated to ensure the highest level of security.
|
||||||
- **Performance**: Efficiency and speed are a key focus of Lysand. The design is non-monolithic, and is built to be as fast as possible.
|
- **Performance**: Efficiency and speed are a key focus of Versia Server. The design is non-monolithic, and is built to be as fast as possible.
|
||||||
- **Mastodon API compatibility**: Lysand is designed to be compatible with the Mastodon API, with [`glitch-soc`](https://github.com/glitch-soc/mastodon) extensions.
|
- **Mastodon API compatibility**: Versia Server is designed to be compatible with the Mastodon API, with [`glitch-soc`](https://github.com/glitch-soc/mastodon) extensions.
|
||||||
|
|
||||||
### Anti-Goals
|
### Anti-Goals
|
||||||
|
|
||||||
- **Monolithic design**: Modularity and scaling is important to this project. This means that it is not a single, monolithic application, but rather a collection of smaller, more focused applications. (API layer, queue, database, frontend, etc.)
|
- **Monolithic design**: Modularity and scaling is important to this project. This means that it is not a single, monolithic application, but rather a collection of smaller, more focused applications. (API layer, queue, database, frontend, etc.)
|
||||||
- **Complexity**: Both in code and in function, Lysand should be as simple as possible. This does not mean adding no features or functionality, but rather that the features and functionality that are added should be well-written and easy to understand.
|
- **Complexity**: Both in code and in function, Versia Server should be as simple as possible. This does not mean adding no features or functionality, but rather that the features and functionality that are added should be well-written and easy to understand.
|
||||||
- **Bloat**: Lysand should not be bloated with unnecessary features, packages, dependencies or code. It should be as lightweight as possible, while still being feature-rich.
|
- **Bloat**: Versia Server should not be bloated with unnecessary features, packages, dependencies or code. It should be as lightweight as possible, while still being feature-rich.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- [x] Fully compliant Lysand 3.0 federation (partial)
|
- [x] Versia 3.0 federation (partial)
|
||||||
- [x] Hyper fast (thousands of HTTP requests per second)
|
- [x] Hyper fast (thousands of HTTP requests per second)
|
||||||
- [x] S3 or local media storage
|
- [x] S3 or local media storage
|
||||||
- [x] Deduplication of uploaded files
|
- [x] Deduplication of uploaded files
|
||||||
|
|
@ -56,11 +56,11 @@
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
You can visit [social.lysand.org](https://social.lysand.org) to see a live instance of Lysand with Lysand-FE.
|
You can visit [social.lysand.org](https://social.lysand.org) to see a live instance of Versia Server with Versia-FE.
|
||||||
|
|
||||||
## How do I run it?
|
## How do I run it?
|
||||||
|
|
||||||
Please see the [installation guide](docs/installation.md) for more information on how to install Lysand.
|
Please see the [installation guide](docs/installation.md) for more information on how to install Versia.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
@ -69,13 +69,13 @@ Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) fil
|
||||||
## Federation
|
## Federation
|
||||||
|
|
||||||
The following extensions are currently supported or being worked on:
|
The following extensions are currently supported or being worked on:
|
||||||
- `org.lysand:custom_emojis`: Custom emojis
|
- `pub.versia:custom_emojis`: Custom emojis
|
||||||
- `org.lysand:polls`: Polls
|
- `pub.versia:polls`: Polls
|
||||||
- `org.lysand:microblogging`: Microblogging
|
- `pub.versia:share`: Share
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
Lysand implements the Mastodon API (as well as `glitch-soc` extensions). The API is currently almost fully complete, with some fringe functionality still being worked on.
|
Versia Server implements the Mastodon API (as well as `glitch-soc` extensions). The API is currently almost fully complete, with some fringe functionality still being worked on.
|
||||||
|
|
||||||
Working endpoints are:
|
Working endpoints are:
|
||||||
|
|
||||||
|
|
@ -206,9 +206,9 @@ Working endpoints are:
|
||||||
- [ ] Reports
|
- [ ] Reports
|
||||||
- [ ] Admin API
|
- [ ] Admin API
|
||||||
|
|
||||||
## Lysand API
|
## Versia Server API
|
||||||
|
|
||||||
For Lysand's own custom API, please see the [API documentation](docs/api/index.md).
|
For Versia Server's own custom API, please see the [API documentation](docs/api/index.md).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|
||||||
For now, only the released latest version of Lysand is supported for security updates. This will change as Lysand exits alpha status.
|
For now, only the released latest version of Veraia Server is supported for security updates. This will change as Versia Server exits alpha status.
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
|
@ -15,8 +15,8 @@ Please do not report vulnerabilities publicly until they have been patched. If y
|
||||||
|
|
||||||
## Vulnerability Disclosure Policy
|
## Vulnerability Disclosure Policy
|
||||||
|
|
||||||
Lysand is an open-source project, and as such, we welcome security researchers to audit our code and report vulnerabilities. We will do our best to patch vulnerabilities as quickly as possible, and will credit researchers for their discoveries if they wish to be credited.
|
Versia Server is an open-source project, and as such, we welcome security researchers to audit our code and report vulnerabilities. We will do our best to patch vulnerabilities as quickly as possible, and will credit researchers for their discoveries if they wish to be credited.
|
||||||
|
|
||||||
For security reasons, we ask that you do not publicly disclose vulnerabilities until they have been patched. We will do our best to patch vulnerabilities as quickly as possible, and will credit researchers for their discoveries if they wish to be credited.
|
For security reasons, we ask that you do not publicly disclose vulnerabilities until they have been patched. We will do our best to patch vulnerabilities as quickly as possible, and will credit researchers for their discoveries if they wish to be credited.
|
||||||
|
|
||||||
Thank you for helping to keep Lysand secure! :3
|
Thank you for helping to keep Versia Server secure! :3
|
||||||
|
|
@ -11,7 +11,7 @@ export type LikeType = InferSelectModel<typeof Likes>;
|
||||||
/**
|
/**
|
||||||
* Represents a Like entity in the database.
|
* Represents a Like entity in the database.
|
||||||
*/
|
*/
|
||||||
export const likeToLysand = (like: LikeType): Like => {
|
export const likeToVersia = (like: LikeType): Like => {
|
||||||
return {
|
return {
|
||||||
id: like.id,
|
id: like.id,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: to be rewritten
|
// biome-ignore lint/suspicious/noExplicitAny: to be rewritten
|
||||||
|
|
|
||||||
|
|
@ -114,14 +114,14 @@ export const getFromHeader = async (value: string): Promise<AuthData> => {
|
||||||
|
|
||||||
export const sendFollowAccept = async (follower: User, followee: User) => {
|
export const sendFollowAccept = async (follower: User, followee: User) => {
|
||||||
await follower.federateToUser(
|
await follower.federateToUser(
|
||||||
followAcceptToLysand(follower, followee),
|
followAcceptToVersia(follower, followee),
|
||||||
followee,
|
followee,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sendFollowReject = async (follower: User, followee: User) => {
|
export const sendFollowReject = async (follower: User, followee: User) => {
|
||||||
await follower.federateToUser(
|
await follower.federateToUser(
|
||||||
followRejectToLysand(follower, followee),
|
followRejectToVersia(follower, followee),
|
||||||
followee,
|
followee,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
@ -258,7 +258,7 @@ export const retrieveToken = async (
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const followRequestToLysand = (
|
export const followRequestToVersia = (
|
||||||
follower: User,
|
follower: User,
|
||||||
followee: User,
|
followee: User,
|
||||||
): Follow => {
|
): Follow => {
|
||||||
|
|
@ -286,7 +286,7 @@ export const followRequestToLysand = (
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const followAcceptToLysand = (
|
export const followAcceptToVersia = (
|
||||||
follower: User,
|
follower: User,
|
||||||
followee: User,
|
followee: User,
|
||||||
): FollowAccept => {
|
): FollowAccept => {
|
||||||
|
|
@ -314,12 +314,12 @@ export const followAcceptToLysand = (
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const followRejectToLysand = (
|
export const followRejectToVersia = (
|
||||||
follower: User,
|
follower: User,
|
||||||
followee: User,
|
followee: User,
|
||||||
): FollowReject => {
|
): FollowReject => {
|
||||||
return {
|
return {
|
||||||
...followAcceptToLysand(follower, followee),
|
...followAcceptToVersia(follower, followee),
|
||||||
type: "FollowReject",
|
type: "FollowReject",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { BaseCommand } from "~/cli/base";
|
||||||
export default class Start extends BaseCommand<typeof Start> {
|
export default class Start extends BaseCommand<typeof Start> {
|
||||||
static override args = {};
|
static override args = {};
|
||||||
|
|
||||||
static override description = "Starts Lysand";
|
static override description = "Starts Versia Server";
|
||||||
|
|
||||||
static override examples = [
|
static override examples = [
|
||||||
"<%= config.bin %> <%= command.id %> --threads 4",
|
"<%= config.bin %> <%= command.id %> --threads 4",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# This schema always follows the latest dev version of Lysand, which may not be what you want
|
# This schema always follows the latest dev version of Versia Server, which may not be what you want
|
||||||
# Change the URL to the commit/tag you are using
|
# Change the URL to the commit/tag you are using
|
||||||
#:schema https://raw.githubusercontent.com/lysand-org/lysand/main/config/config.schema.json
|
#:schema https://raw.githubusercontent.com/lysand-org/lysand/main/config/config.schema.json
|
||||||
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
# Main PostgreSQL database connection
|
# Main PostgreSQL database connection
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
port = 5432
|
port = 5432
|
||||||
username = "lysand"
|
username = "versia"
|
||||||
password = "mycoolpassword"
|
password = "mycoolpassword"
|
||||||
database = "lysand"
|
database = "versia"
|
||||||
|
|
||||||
[redis.queue]
|
[redis.queue]
|
||||||
# Redis instance for storing the federation queue
|
# Redis instance for storing the federation queue
|
||||||
|
|
@ -46,10 +46,10 @@ rules = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[oidc]
|
[oidc]
|
||||||
# Run Lysand with this value missing to generate a new key
|
# Run Versia Server with this value missing to generate a new key
|
||||||
jwt_key = ""
|
jwt_key = ""
|
||||||
|
|
||||||
# If enabled, Lysand will require users to log in with an OAuth provider
|
# If enabled, Versia Server will require users to log in with an OAuth provider
|
||||||
forced = false
|
forced = false
|
||||||
|
|
||||||
# Allow registration with OAuth providers
|
# Allow registration with OAuth providers
|
||||||
|
|
@ -67,16 +67,16 @@ allow_registration = true
|
||||||
# name = "CPlusPatch ID"
|
# name = "CPlusPatch ID"
|
||||||
# id = "cpluspatch-id"
|
# id = "cpluspatch-id"
|
||||||
# This MUST match the provider's issuer URI, including the trailing slash (or lack thereof)
|
# This MUST match the provider's issuer URI, including the trailing slash (or lack thereof)
|
||||||
# url = "https://id.cpluspatch.com/application/o/lysand-testing/"
|
# url = "https://id.cpluspatch.com/application/o/versia-testing/"
|
||||||
# client_id = "XXXX"
|
# client_id = "XXXX"
|
||||||
# client_secret = "XXXXX"
|
# client_secret = "XXXXX"
|
||||||
# icon = "https://cpluspatch.com/images/icons/logo.svg"
|
# icon = "https://cpluspatch.com/images/icons/logo.svg"
|
||||||
|
|
||||||
[http]
|
[http]
|
||||||
# The full URL Lysand will be reachable by (paths are not supported)
|
# The full URL Versia Server will be reachable by (paths are not supported)
|
||||||
base_url = "https://lysand.localhost:9900"
|
base_url = "https://versia.localhost:9900"
|
||||||
# Address to bind to (0.0.0.0 is suggested for proxies)
|
# Address to bind to (0.0.0.0 is suggested for proxies)
|
||||||
bind = "lysand.localhost"
|
bind = "versia.localhost"
|
||||||
bind_port = 9900
|
bind_port = 9900
|
||||||
|
|
||||||
# Bans IPv4 or IPv6 IPs (wildcards, networks and ranges are supported)
|
# Bans IPv4 or IPv6 IPs (wildcards, networks and ranges are supported)
|
||||||
|
|
@ -94,7 +94,7 @@ enabled = false
|
||||||
address = "http://localhost:8118"
|
address = "http://localhost:8118"
|
||||||
|
|
||||||
[http.tls]
|
[http.tls]
|
||||||
# If these values are set, Lysand will use these files for TLS
|
# If these values are set, Versia Server will use these files for TLS
|
||||||
enabled = false
|
enabled = false
|
||||||
key = ""
|
key = ""
|
||||||
cert = ""
|
cert = ""
|
||||||
|
|
@ -104,7 +104,7 @@ ca = ""
|
||||||
[http.bait]
|
[http.bait]
|
||||||
# Enable the bait feature (sends fake data to those who are flagged)
|
# Enable the bait feature (sends fake data to those who are flagged)
|
||||||
enabled = false
|
enabled = false
|
||||||
# Path to file of bait data (if not provided, Lysand will send the entire Bee Movie script)
|
# Path to file of bait data (if not provided, Versia Server will send the entire Bee Movie script)
|
||||||
send_file = ""
|
send_file = ""
|
||||||
# IPs to send bait data to (wildcards, networks and ranges are supported)
|
# IPs to send bait data to (wildcards, networks and ranges are supported)
|
||||||
bait_ips = ["127.0.0.1", "::1"]
|
bait_ips = ["127.0.0.1", "::1"]
|
||||||
|
|
@ -112,15 +112,15 @@ bait_ips = ["127.0.0.1", "::1"]
|
||||||
bait_user_agents = ["curl", "wget"]
|
bait_user_agents = ["curl", "wget"]
|
||||||
|
|
||||||
[frontend]
|
[frontend]
|
||||||
# Enable custom frontends (warning: not enabling this or Glitch will make Lysand only accessible via the Mastodon API)
|
# Enable custom frontends (warning: not enabling this or Glitch will make Versia Server only accessible via the Mastodon API)
|
||||||
# Frontends also control the OAuth flow, so if you disable this, you will need to use the Mastodon frontend
|
# Frontends also control the OAuth flow, so if you disable this, you will need to use the Mastodon frontend
|
||||||
enabled = true
|
enabled = true
|
||||||
# The URL to reach the frontend at (should be on a local network)
|
# The URL to reach the frontend at (should be on a local network)
|
||||||
url = "http://localhost:3000"
|
url = "http://localhost:3000"
|
||||||
|
|
||||||
[frontend.routes]
|
[frontend.routes]
|
||||||
# Special routes for your frontend, below are the defaults for Lysand-FE
|
# Special routes for your frontend, below are the defaults for Versia-FE
|
||||||
# Can be set to a route already used by Lysand, as long as it is on a different HTTP method
|
# Can be set to a route already used by Versia Server, as long as it is on a different HTTP method
|
||||||
# e.g. /oauth/authorize is a POST-only route, so you can serve a GET route at /oauth/authorize
|
# e.g. /oauth/authorize is a POST-only route, so you can serve a GET route at /oauth/authorize
|
||||||
# home = "/"
|
# home = "/"
|
||||||
# login = "/oauth/authorize"
|
# login = "/oauth/authorize"
|
||||||
|
|
@ -179,7 +179,7 @@ convert_vector = false
|
||||||
# access_key = "XXXXX"
|
# access_key = "XXXXX"
|
||||||
# secret_access_key = "XXX"
|
# secret_access_key = "XXX"
|
||||||
# region = ""
|
# region = ""
|
||||||
# bucket_name = "lysand"
|
# bucket_name = "versia"
|
||||||
# public_url = "https://cdn.example.com"
|
# public_url = "https://cdn.example.com"
|
||||||
|
|
||||||
[validation]
|
[validation]
|
||||||
|
|
@ -263,7 +263,7 @@ enforce_mime_types = false
|
||||||
|
|
||||||
[validation.challenges]
|
[validation.challenges]
|
||||||
# "Challenges" (aka captchas) are a way to verify that a user is human
|
# "Challenges" (aka captchas) are a way to verify that a user is human
|
||||||
# Lysand's challenges use no external services, and are Proof of Work based
|
# Versia Server's challenges use no external services, and are Proof of Work based
|
||||||
# This means that they do not require any user interaction, instead
|
# This means that they do not require any user interaction, instead
|
||||||
# they require the user's computer to do a small amount of work
|
# they require the user's computer to do a small amount of work
|
||||||
enabled = false
|
enabled = false
|
||||||
|
|
@ -312,7 +312,7 @@ banners = []
|
||||||
avatars = []
|
avatars = []
|
||||||
|
|
||||||
# For bridge software, such as lysand-org/activitypub
|
# For bridge software, such as lysand-org/activitypub
|
||||||
# Bridges must be hosted separately from the main Lysand process
|
# Bridges must be hosted separately from the main Versia Server process
|
||||||
[federation.bridge]
|
[federation.bridge]
|
||||||
enabled = false
|
enabled = false
|
||||||
# Only lysand-ap exists for now
|
# Only lysand-ap exists for now
|
||||||
|
|
@ -323,11 +323,11 @@ allowed_ips = ["192.168.1.0/24"]
|
||||||
# Token for the bridge software
|
# Token for the bridge software
|
||||||
# Bridge must have the same token!
|
# Bridge must have the same token!
|
||||||
token = "mycooltoken"
|
token = "mycooltoken"
|
||||||
url = "https://ap.lysand.org"
|
url = "https://ap.versia.social"
|
||||||
|
|
||||||
[instance]
|
[instance]
|
||||||
name = "Lysand"
|
name = "Versia"
|
||||||
description = "A Lysand instance"
|
description = "A Versia Server instance"
|
||||||
# Path to a file containing a longer description of your instance
|
# Path to a file containing a longer description of your instance
|
||||||
# This will be parsed as Markdown
|
# This will be parsed as Markdown
|
||||||
# extended_description_path = "config/extended_description.md"
|
# extended_description_path = "config/extended_description.md"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
"database": {
|
"database": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
"default": "lysand"
|
"default": "versia"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["username"],
|
"required": ["username"],
|
||||||
|
|
@ -228,7 +228,7 @@
|
||||||
"base_url": {
|
"base_url": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
"default": "http://lysand.social"
|
"default": "http://versia.social"
|
||||||
},
|
},
|
||||||
"bind": {
|
"bind": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
@ -548,7 +548,7 @@
|
||||||
},
|
},
|
||||||
"bucket_name": {
|
"bucket_name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "lysand"
|
"default": "versia"
|
||||||
},
|
},
|
||||||
"public_url": {
|
"public_url": {
|
||||||
"$ref": "#/properties/http/properties/proxy/properties/address/anyOf/0"
|
"$ref": "#/properties/http/properties/proxy/properties/address/anyOf/0"
|
||||||
|
|
@ -565,7 +565,7 @@
|
||||||
"endpoint": "",
|
"endpoint": "",
|
||||||
"access_key": "",
|
"access_key": "",
|
||||||
"secret_access_key": "",
|
"secret_access_key": "",
|
||||||
"bucket_name": "lysand",
|
"bucket_name": "versia",
|
||||||
"public_url": "https://cdn.example.com"
|
"public_url": "https://cdn.example.com"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -3375,12 +3375,12 @@
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
"default": "Lysand"
|
"default": "Versia"
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
"default": "A Lysand instance"
|
"default": "A Versia instance"
|
||||||
},
|
},
|
||||||
"extended_description_path": {
|
"extended_description_path": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
@ -3437,8 +3437,8 @@
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"default": {
|
"default": {
|
||||||
"name": "Lysand",
|
"name": "Versia",
|
||||||
"description": "A Lysand instance",
|
"description": "A Versia instance",
|
||||||
"keys": {
|
"keys": {
|
||||||
"public": "",
|
"public": "",
|
||||||
"private": ""
|
"private": ""
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
services:
|
services:
|
||||||
lysand:
|
versia:
|
||||||
image: ghcr.io/lysand-org/lysand:latest
|
image: ghcr.io/lysand-org/lysand:latest
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs:/app/dist/logs
|
- ./logs:/app/dist/logs
|
||||||
|
|
@ -7,10 +7,10 @@ services:
|
||||||
- ./uploads:/app/dist/uploads
|
- ./uploads:/app/dist/uploads
|
||||||
- ./glitch:/app/dist/glitch
|
- ./glitch:/app/dist/glitch
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
container_name: lysand
|
container_name: versia
|
||||||
command: "cli start --all-threads"
|
command: "cli start --all-threads"
|
||||||
networks:
|
networks:
|
||||||
- lysand-net
|
- versia-net
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
- redis
|
- redis
|
||||||
|
|
@ -19,44 +19,44 @@ services:
|
||||||
|
|
||||||
fe:
|
fe:
|
||||||
image: ghcr.io/lysand-org/lysand-fe:main
|
image: ghcr.io/lysand-org/lysand-fe:main
|
||||||
container_name: lysand-fe
|
container_name: versia-fe
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- lysand-net
|
- versia-net
|
||||||
environment:
|
environment:
|
||||||
NUXT_PUBLIC_API_HOST: https://yourserver.com
|
NUXT_PUBLIC_API_HOST: https://yourserver.com
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: ghcr.io/lysand-org/postgres:main
|
image: ghcr.io/lysand-org/postgres:main
|
||||||
container_name: lysand-db
|
container_name: versia-db
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: lysand
|
POSTGRES_DB: versia
|
||||||
POSTGRES_USER: lysand
|
POSTGRES_USER: versia
|
||||||
POSTGRES_PASSWORD: _______________
|
POSTGRES_PASSWORD: _______________
|
||||||
networks:
|
networks:
|
||||||
- lysand-net
|
- versia-net
|
||||||
volumes:
|
volumes:
|
||||||
- ./db-data:/var/lib/postgresql/data
|
- ./db-data:/var/lib/postgresql/data
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
container_name: lysand-redis
|
container_name: versia-redis
|
||||||
volumes:
|
volumes:
|
||||||
- ./redis-data:/data
|
- ./redis-data:/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- lysand-net
|
- versia-net
|
||||||
|
|
||||||
sonic:
|
sonic:
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.cfg:/etc/sonic.cfg
|
- ./config.cfg:/etc/sonic.cfg
|
||||||
- ./store/:/var/lib/sonic/store/
|
- ./store/:/var/lib/sonic/store/
|
||||||
image: valeriansaliou/sonic:v1.4.9
|
image: valeriansaliou/sonic:v1.4.9
|
||||||
container_name: lysand-sonic
|
container_name: versia-sonic
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- lysand-net
|
- versia-net
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
lysand-net:
|
versia-net:
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Emoji API
|
# Emoji API
|
||||||
|
|
||||||
An Emoji API is made available to users to manage custom emoji on the instance. We recommend using Lysand's CLI to manage emoji, but this API is available for those who prefer to use it (both admin and non-admin users).
|
An Emoji API is made available to users to manage custom emoji on the instance. We recommend using Versia Server's CLI to manage emoji, but this API is available for those who prefer to use it (both admin and non-admin users).
|
||||||
|
|
||||||
## Create Emoji
|
## Create Emoji
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Federation API
|
# Federation API
|
||||||
|
|
||||||
The Federation API contains a variety of endpoints for interacting with the Lysand remote network.
|
The Federation API contains a variety of endpoints for interacting with the Versia Server remote network.
|
||||||
|
|
||||||
## Refetch User
|
## Refetch User
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
# Frontend API
|
# Frontend API
|
||||||
|
|
||||||
The frontend API contains endpoints that are useful for frontend developers. These endpoints are not part of the Mastodon API, but are specific to Lysand.
|
The frontend API contains endpoints that are useful for frontend developers. These endpoints are not part of the Mastodon API, but are specific to Versia Server.
|
||||||
|
|
||||||
## Routes that the Frontend must implement
|
## Routes that the Frontend must implement
|
||||||
|
|
||||||
These routes can be set to a different URL in the Lysand configuration, at `frontend.routes`. The frontend must implement these routes for the instance to function correctly.
|
These routes can be set to a different URL in the Versia Server configuration, at `frontend.routes`. The frontend must implement these routes for the instance to function correctly.
|
||||||
|
|
||||||
- `GET /oauth/authorize`: (NOT `POST`): Identifier/password login form, submits to [`POST /api/auth/login`](#sign-in) or OpenID Connect flow.
|
- `GET /oauth/authorize`: (NOT `POST`): Identifier/password login form, submits to [`POST /api/auth/login`](#sign-in) or OpenID Connect flow.
|
||||||
- `GET /oauth/consent`: Consent form, submits to [`POST /api/auth/redirect`](#consent)
|
- `GET /oauth/consent`: Consent form, submits to [`POST /api/auth/redirect`](#consent)
|
||||||
|
|
@ -15,7 +15,7 @@ These routes can be set to a different URL in the Lysand configuration, at `fron
|
||||||
GET /api/v1/frontend/config
|
GET /api/v1/frontend/config
|
||||||
```
|
```
|
||||||
|
|
||||||
Retrieves the frontend configuration for the instance. This returns whatever the `frontend.settings` object is set to in the Lysand configuration.
|
Retrieves the frontend configuration for the instance. This returns whatever the `frontend.settings` object is set to in the Versia Server configuration.
|
||||||
|
|
||||||
This behaves like the `/api/v1/preferences` endpoint in the Mastodon API, but is specific to the frontend. These values are arbitrary and can be used for anything.
|
This behaves like the `/api/v1/preferences` endpoint in the Mastodon API, but is specific to the frontend. These values are arbitrary and can be used for anything.
|
||||||
|
|
||||||
|
|
@ -23,8 +23,8 @@ For example, the frontend configuration could contain the following:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"org.lysand.fe:theme": "dark",
|
"pub.versia.fe:theme": "dark",
|
||||||
"org.lysand.fe:custom_css": "body { background-color: black; }",
|
"pub.versia.fe:custom_css": "body { background-color: black; }",
|
||||||
// Googly is an imaginary frontend that uses the `net.googly.frontend` namespace
|
// Googly is an imaginary frontend that uses the `net.googly.frontend` namespace
|
||||||
"net.googly.frontend:spoiler_image": "https://example.com/spoiler.png"
|
"net.googly.frontend:spoiler_image": "https://example.com/spoiler.png"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Lysand API Documentation
|
# Versia Server API Documentation
|
||||||
|
|
||||||
The Lysand API strictly follows the latest available Mastodon API version (Glitch-Soc version). This means that the Lysand API is a superset of the Mastodon API, with additional endpoints and features.
|
The Versia Server API strictly follows the latest available Mastodon API version (Glitch-Soc version). This means that the Versia Server API is a superset of the Mastodon API, with additional endpoints and features.
|
||||||
|
|
||||||
Some more information about the Mastodon API can be found in the [Mastodon API documentation](https://docs.joinmastodon.org/api/).
|
Some more information about the Mastodon API can be found in the [Mastodon API documentation](https://docs.joinmastodon.org/api/).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ Three extra attributes have been added to the `/api/v1/instance` endpoint:
|
||||||
{
|
{
|
||||||
// ...
|
// ...
|
||||||
banner: string | null;
|
banner: string | null;
|
||||||
lysand_version: string;
|
versia_version: string;
|
||||||
sso: {
|
sso: {
|
||||||
forced: boolean;
|
forced: boolean;
|
||||||
providers: {
|
providers: {
|
||||||
|
|
@ -26,9 +26,9 @@ Three extra attributes have been added to the `/api/v1/instance` endpoint:
|
||||||
|
|
||||||
The URL of the instance's banner image. `null` if there is no banner set.
|
The URL of the instance's banner image. `null` if there is no banner set.
|
||||||
|
|
||||||
### `lysand_version`
|
### `versia_version`
|
||||||
|
|
||||||
The version of the Lysand instance.
|
The version of the Versia Server instance.
|
||||||
|
|
||||||
The normal `version` field is always set to `"4.3.0+glitch"` or similar, to not confuse clients that expect a Mastodon instance.
|
The normal `version` field is always set to `"4.3.0+glitch"` or similar, to not confuse clients that expect a Mastodon instance.
|
||||||
|
|
||||||
|
|
@ -55,18 +55,18 @@ Two extra attributes has been adding to all returned account objects:
|
||||||
```ts
|
```ts
|
||||||
{
|
{
|
||||||
// ...
|
// ...
|
||||||
roles: LysandRoles[];
|
roles: VersiaRoles[];
|
||||||
uri: string;
|
uri: string;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### `roles`
|
### `roles`
|
||||||
|
|
||||||
An array of roles from [Lysand Roles](./roles.md).
|
An array of roles from [Versia Server Roles](./roles.md).
|
||||||
|
|
||||||
### `uri`
|
### `uri`
|
||||||
|
|
||||||
The URI of the account's Lysand object (for federation). Similar to Mastodon's `uri` field on notes.
|
The URI of the account's Versia object (for federation). Similar to Mastodon's `uri` field on notes.
|
||||||
|
|
||||||
## `/api/v1/accounts/update_credentials`
|
## `/api/v1/accounts/update_credentials`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> **NOT IMPLEMENTED**
|
> **NOT IMPLEMENTED**
|
||||||
|
|
||||||
The Lysand project uses the Mastodon API to interact with clients. However, the moderation API is custom-made for Lysand Server, as it allows for more fine-grained control over the server's behavior.
|
The Versia Server project uses the Mastodon API to interact with clients. However, the moderation API is custom-made for Versia Server Server, as it allows for more fine-grained control over the server's behavior.
|
||||||
|
|
||||||
## Flags, ModTags and ModNotes
|
## Flags, ModTags and ModNotes
|
||||||
|
|
||||||
Flags are used by Lysand Server to automatically attribute tags to a status or account based on rules. ModTags and ModNotes are used by moderators to manually tag and take notes on statuses and accounts.
|
Flags are used by Versia Server Server to automatically attribute tags to a status or account based on rules. ModTags and ModNotes are used by moderators to manually tag and take notes on statuses and accounts.
|
||||||
|
|
||||||
The difference between flags and modtags is that flags are automatically attributed by the server, while modtags are manually attributed by moderators.
|
The difference between flags and modtags is that flags are automatically attributed by the server, while modtags are manually attributed by moderators.
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ The difference between flags and modtags is that flags are automatically attribu
|
||||||
|
|
||||||
### ModTag Types
|
### ModTag Types
|
||||||
|
|
||||||
ModTag do not have set types and can be anything. Lysand Server autosuggest previously used tags when a moderator is adding a new tag to avoid duplicates.
|
ModTag do not have set types and can be anything. Versia Server Server autosuggest previously used tags when a moderator is adding a new tag to avoid duplicates.
|
||||||
|
|
||||||
### Data Format
|
### Data Format
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
# Lysand CLI
|
# Versia Server CLI
|
||||||
|
|
||||||
Lysand includes a built-in, scripting-compatible CLI that can be used to manage the server. This CLI can be used to create and delete users, manage the database and more. It can also output data in JSON or CSV format, making it easy to use in scripts.
|
Versia Server includes a built-in, scripting-compatible CLI that can be used to manage the server. This CLI can be used to create and delete users, manage the database and more. It can also output data in JSON or CSV format, making it easy to use in scripts.
|
||||||
|
|
||||||
## Using the CLI
|
## Using the CLI
|
||||||
|
|
||||||
Lysand includes a built-in CLI for managing the server. To use it, simply run the following command:
|
Versia Server includes a built-in CLI for managing the server. To use it, simply run the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Development
|
# Development
|
||||||
|
|
@ -12,7 +12,7 @@ bun cli help
|
||||||
# Source installs
|
# Source installs
|
||||||
bun run dist/cli.js help
|
bun run dist/cli.js help
|
||||||
# Docker
|
# Docker
|
||||||
docker compose exec -it lysand /bin/sh /app/entrypoint.sh cli help
|
docker compose exec -it versia /bin/sh /app/entrypoint.sh cli help
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use the `help` command to see a list of available commands. These include creating users, deleting users and more. Each command also has a `--help,-h` flag that you can use to see more information about the command.
|
You can use the `help` command to see a list of available commands. These include creating users, deleting users and more. Each command also has a `--help,-h` flag that you can use to see more information about the command.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Installing the database
|
# Installing the database
|
||||||
|
|
||||||
Lysand uses a special PostgreSQL extension called `pg_uuidv7` to generate UUIDs. This extension is required for Lysand to work properly. To install it, you can either use the pre-made Docker image or install it manually.
|
Versia Server uses a special PostgreSQL extension called `pg_uuidv7` to generate UUIDs. This extension is required for Versia Server to work properly. To install it, you can either use the pre-made Docker image or install it manually.
|
||||||
|
|
||||||
## Using the Docker image
|
## Using the Docker image
|
||||||
|
|
||||||
Lysand offers a pre-made Docker image for PostgreSQL with the extension already installed. Use `ghcr.io/lysand-org/postgres:main` as your Docker image name to use it.
|
Versia Server offers a pre-made Docker image for PostgreSQL with the extension already installed. Use `ghcr.io/lysand-org/postgres:main` as your Docker image name to use it.
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
# Enabling Glitch-Soc
|
# Enabling Glitch-Soc
|
||||||
|
|
||||||
Lysand supports the use of the Glitch-Soc fork of Mastodon's frontend. Here's how to do it:
|
Versia Server supports the use of the Glitch-Soc fork of Mastodon's frontend. Here's how to do it:
|
||||||
|
|
||||||
1. Download the latest Glitch FE package from [the releases page](https://github.com/lysand-org/lysand/releases) (it should be named `glitch.tar.gz` and be inside the assets of a normal Lysand release).
|
1. Download the latest Glitch FE package from [the releases page](https://github.com/lysand-org/lysand/releases) (it should be named `glitch.tar.gz` and be inside the assets of a normal Versia Server release).
|
||||||
2. Extract the contents of the package into a folder, which you can name `glitch` for simplicity. (if using Docker, now is the time to mount that folder into the container, for example with `-v /path/to/glitch:/app/dist/glitch`)
|
2. Extract the contents of the package into a folder, which you can name `glitch` for simplicity. (if using Docker, now is the time to mount that folder into the container, for example with `-v /path/to/glitch:/app/dist/glitch`)
|
||||||
3. Change the config to enable Glitch-FE:
|
3. Change the config to enable Glitch-FE:
|
||||||
```toml
|
```toml
|
||||||
|
|
@ -22,7 +22,7 @@ Lysand supports the use of the Glitch-Soc fork of Mastodon's frontend. Here's ho
|
||||||
server = ["https://tech.lgbt"]
|
server = ["https://tech.lgbt"]
|
||||||
```
|
```
|
||||||
The `server` option can be left as-is, unless you have downloaded your own `index.html` file from a different Glitch instance.
|
The `server` option can be left as-is, unless you have downloaded your own `index.html` file from a different Glitch instance.
|
||||||
4. Start Lysand and navigate to `/` to see the Glitch frontend in action.
|
4. Start Versia Server and navigate to `/` to see the Glitch frontend in action.
|
||||||
|
|
||||||
## How is this package created?
|
## How is this package created?
|
||||||
|
|
||||||
|
|
@ -32,6 +32,6 @@ The package static files were taken from a build of Glitch-Soc, while the index.
|
||||||
|
|
||||||
Then, the paths in the `index.html` file were replaced with the correct paths for the static files (as they have different hashes in their names from the ones in the Glitch-Soc build).
|
Then, the paths in the `index.html` file were replaced with the correct paths for the static files (as they have different hashes in their names from the ones in the Glitch-Soc build).
|
||||||
|
|
||||||
At runtime, Lysand dynamically edits the index.html file to replace the content with correct data, as well as disabling `integrity` checks on the script/link tags.
|
At runtime, Versia Server dynamically edits the index.html file to replace the content with correct data, as well as disabling `integrity` checks on the script/link tags.
|
||||||
|
|
||||||
In the future, I'll find a way to make this less hacky and more user-friendly, but for now, this is the best I can do.
|
In the future, I'll find a way to make this less hacky and more user-friendly, but for now, this is the best I can do.
|
||||||
|
|
@ -3,19 +3,19 @@
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- The [Bun Runtime](https://bun.sh), version 1.1.24 or later (usage of the latest version is recommended)
|
- The [Bun Runtime](https://bun.sh), version 1.1.24 or later (usage of the latest version is recommended)
|
||||||
- Lysand will work on lower versions than 1.1.24, but only the latest version is supported
|
- Versia Server will work on lower versions than 1.1.24, but only the latest version is supported
|
||||||
- A PostgreSQL database
|
- A PostgreSQL database
|
||||||
- (Optional but recommended) A Linux-based operating system
|
- (Optional but recommended) A Linux-based operating system
|
||||||
- (Optional if you want search) A working [Sonic](https://github.com/valeriansaliou/sonic) instance
|
- (Optional if you want search) A working [Sonic](https://github.com/valeriansaliou/sonic) instance
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> Lysand has not been tested on Windows or macOS. It is recommended to use a Linux-based operating system to run Lysand.
|
> Versia Server has not been tested on Windows or macOS. It is recommended to use a Linux-based operating system to run LysVersia Serverand.
|
||||||
>
|
>
|
||||||
> We will not be offering support to Windows or macOS users. If you are using one of these operating systems, please use a virtual machine or container to run Lysand.
|
> We will not be offering support to Windows or macOS users. If you are using one of these operating systems, please use a virtual machine or container to run Versia Server.
|
||||||
|
|
||||||
## With Docker/Podman
|
## With Docker/Podman
|
||||||
|
|
||||||
Docker is the recommended way to run Lysand (Podman also works). To run Lysand with Docker, follow these steps:
|
Docker is the recommended way to run Versia Server (Podman also works). To run Versia Server with Docker, follow these steps:
|
||||||
|
|
||||||
1. Download the `docker-compose.yml` file from the repository
|
1. Download the `docker-compose.yml` file from the repository
|
||||||
|
|
||||||
|
|
|
||||||
14
drizzle/migrations/0032_ambiguous_sue_storm.sql
Normal file
14
drizzle/migrations/0032_ambiguous_sue_storm.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
ALTER TABLE "LysandObject" RENAME TO "VersiaObject";--> statement-breakpoint
|
||||||
|
ALTER TABLE "VersiaObject" DROP CONSTRAINT "LysandObject_authorId_LysandObject_id_fk";
|
||||||
|
--> statement-breakpoint
|
||||||
|
DROP INDEX IF EXISTS "LysandObject_remote_id_index";--> statement-breakpoint
|
||||||
|
DROP INDEX IF EXISTS "LysandObject_uri_index";--> statement-breakpoint
|
||||||
|
ALTER TABLE "Instances" ALTER COLUMN "protocol" SET DEFAULT 'versia';--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "VersiaObject" ADD CONSTRAINT "VersiaObject_authorId_VersiaObject_id_fk" FOREIGN KEY ("authorId") REFERENCES "public"."VersiaObject"("id") ON DELETE cascade ON UPDATE cascade;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS "VersiaObject_remote_id_index" ON "VersiaObject" USING btree ("remote_id");--> statement-breakpoint
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS "VersiaObject_uri_index" ON "VersiaObject" USING btree ("uri");
|
||||||
2126
drizzle/migrations/meta/0032_snapshot.json
Normal file
2126
drizzle/migrations/meta/0032_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -225,6 +225,13 @@
|
||||||
"when": 1722100203904,
|
"when": 1722100203904,
|
||||||
"tag": "0031_mature_demogoblin",
|
"tag": "0031_mature_demogoblin",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 32,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1724073118382,
|
||||||
|
"tag": "0032_ambiguous_sue_storm",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,8 +136,8 @@ export const Likes = pgTable("Likes", {
|
||||||
.notNull(),
|
.notNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const LysandObjects = pgTable(
|
export const VersiaObjects = pgTable(
|
||||||
"LysandObject",
|
"VersiaObject",
|
||||||
{
|
{
|
||||||
id: uuid("id").default(sql`uuid_generate_v7()`).primaryKey().notNull(),
|
id: uuid("id").default(sql`uuid_generate_v7()`).primaryKey().notNull(),
|
||||||
remoteId: text("remote_id").notNull(),
|
remoteId: text("remote_id").notNull(),
|
||||||
|
|
@ -154,7 +154,7 @@ export const LysandObjects = pgTable(
|
||||||
return {
|
return {
|
||||||
remoteIdKey: uniqueIndex().on(table.remoteId),
|
remoteIdKey: uniqueIndex().on(table.remoteId),
|
||||||
uriKey: uniqueIndex().on(table.uri),
|
uriKey: uniqueIndex().on(table.uri),
|
||||||
lysandObjectAuthorIdFkey: foreignKey({
|
versiaObjectAuthorIdFkey: foreignKey({
|
||||||
columns: [table.authorId],
|
columns: [table.authorId],
|
||||||
foreignColumns: [table.id],
|
foreignColumns: [table.id],
|
||||||
})
|
})
|
||||||
|
|
@ -347,8 +347,8 @@ export const Instances = pgTable("Instances", {
|
||||||
.notNull(),
|
.notNull(),
|
||||||
protocol: text("protocol")
|
protocol: text("protocol")
|
||||||
.notNull()
|
.notNull()
|
||||||
.$type<"lysand" | "activitypub">()
|
.$type<"versia" | "activitypub">()
|
||||||
.default("lysand"),
|
.default("versia"),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const OpenIdAccounts = pgTable("OpenIdAccounts", {
|
export const OpenIdAccounts = pgTable("OpenIdAccounts", {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
description = "Lysand Server";
|
description = "Versia Server";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "lysand",
|
"name": "versia-server",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.7.0",
|
"version": "0.7.0",
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
"additionalHelpFlags": ["-h"],
|
"additionalHelpFlags": ["-h"],
|
||||||
"additionalVersionFlags": ["-v"],
|
"additionalVersionFlags": ["-v"],
|
||||||
"plugins": [],
|
"plugins": [],
|
||||||
"description": "CLI to interface with the Lysand project",
|
"description": "CLI to interface with the Versia project",
|
||||||
"topicSeparator": " ",
|
"topicSeparator": " ",
|
||||||
"topics": {
|
"topics": {
|
||||||
"user": {
|
"user": {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ export const configValidator = z.object({
|
||||||
.default(5432),
|
.default(5432),
|
||||||
username: z.string().min(1),
|
username: z.string().min(1),
|
||||||
password: z.string().default(""),
|
password: z.string().default(""),
|
||||||
database: z.string().min(1).default("lysand"),
|
database: z.string().min(1).default("versia"),
|
||||||
}),
|
}),
|
||||||
redis: z.object({
|
redis: z.object({
|
||||||
queue: z
|
queue: z
|
||||||
|
|
@ -109,7 +109,7 @@ export const configValidator = z.object({
|
||||||
jwt_key: z.string().min(3).includes(";").default("").or(z.literal("")),
|
jwt_key: z.string().min(3).includes(";").default("").or(z.literal("")),
|
||||||
}),
|
}),
|
||||||
http: z.object({
|
http: z.object({
|
||||||
base_url: z.string().min(1).default("http://lysand.social"),
|
base_url: z.string().min(1).default("http://versia.social"),
|
||||||
bind: z.string().min(1).default("0.0.0.0"),
|
bind: z.string().min(1).default("0.0.0.0"),
|
||||||
bind_port: z
|
bind_port: z
|
||||||
.number()
|
.number()
|
||||||
|
|
@ -260,7 +260,7 @@ export const configValidator = z.object({
|
||||||
access_key: z.string(),
|
access_key: z.string(),
|
||||||
secret_access_key: z.string(),
|
secret_access_key: z.string(),
|
||||||
region: z.string().optional(),
|
region: z.string().optional(),
|
||||||
bucket_name: z.string().default("lysand"),
|
bucket_name: z.string().default("versia"),
|
||||||
public_url: zUrl,
|
public_url: zUrl,
|
||||||
})
|
})
|
||||||
.default({
|
.default({
|
||||||
|
|
@ -268,7 +268,7 @@ export const configValidator = z.object({
|
||||||
access_key: "",
|
access_key: "",
|
||||||
secret_access_key: "",
|
secret_access_key: "",
|
||||||
region: undefined,
|
region: undefined,
|
||||||
bucket_name: "lysand",
|
bucket_name: "versia",
|
||||||
public_url: "https://cdn.example.com",
|
public_url: "https://cdn.example.com",
|
||||||
}),
|
}),
|
||||||
validation: z
|
validation: z
|
||||||
|
|
@ -507,8 +507,8 @@ export const configValidator = z.object({
|
||||||
}),
|
}),
|
||||||
instance: z
|
instance: z
|
||||||
.object({
|
.object({
|
||||||
name: z.string().min(1).default("Lysand"),
|
name: z.string().min(1).default("Versia"),
|
||||||
description: z.string().min(1).default("A Lysand instance"),
|
description: z.string().min(1).default("A Versia instance"),
|
||||||
extended_description_path: z.string().optional(),
|
extended_description_path: z.string().optional(),
|
||||||
tos_path: z.string().optional(),
|
tos_path: z.string().optional(),
|
||||||
privacy_policy_path: z.string().optional(),
|
privacy_policy_path: z.string().optional(),
|
||||||
|
|
@ -525,8 +525,8 @@ export const configValidator = z.object({
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
.default({
|
.default({
|
||||||
name: "Lysand",
|
name: "Versia",
|
||||||
description: "A Lysand instance",
|
description: "A Versia instance",
|
||||||
extended_description_path: undefined,
|
extended_description_path: undefined,
|
||||||
tos_path: undefined,
|
tos_path: undefined,
|
||||||
privacy_policy_path: undefined,
|
privacy_policy_path: undefined,
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ export class Attachment extends BaseInterface<typeof Attachments> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public toLysand(): ContentFormat {
|
public toVersia(): ContentFormat {
|
||||||
return {
|
return {
|
||||||
[this.data.mimeType]: {
|
[this.data.mimeType]: {
|
||||||
content: this.data.url,
|
content: this.data.url,
|
||||||
|
|
@ -217,7 +217,7 @@ export class Attachment extends BaseInterface<typeof Attachments> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static fromLysand(
|
public static fromVersia(
|
||||||
attachmentToConvert: ContentFormat,
|
attachmentToConvert: ContentFormat,
|
||||||
): Promise<Attachment> {
|
): Promise<Attachment> {
|
||||||
const key = Object.keys(attachmentToConvert)[0];
|
const key = Object.keys(attachmentToConvert)[0];
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ export class Emoji extends BaseInterface<typeof Emojis, EmojiWithInstance> {
|
||||||
|
|
||||||
const foundInstance = host ? await Instance.resolve(host) : null;
|
const foundInstance = host ? await Instance.resolve(host) : null;
|
||||||
|
|
||||||
return await Emoji.fromLysand(emojiToFetch, foundInstance?.id ?? null);
|
return await Emoji.fromVersia(emojiToFetch, foundInstance?.id ?? null);
|
||||||
}
|
}
|
||||||
|
|
||||||
get id() {
|
get id() {
|
||||||
|
|
@ -189,7 +189,7 @@ export class Emoji extends BaseInterface<typeof Emojis, EmojiWithInstance> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public toLysand(): CustomEmojiExtension["emojis"][0] {
|
public toVersia(): CustomEmojiExtension["emojis"][0] {
|
||||||
return {
|
return {
|
||||||
name: this.data.shortcode,
|
name: this.data.shortcode,
|
||||||
url: {
|
url: {
|
||||||
|
|
@ -201,7 +201,7 @@ export class Emoji extends BaseInterface<typeof Emojis, EmojiWithInstance> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static fromLysand(
|
public static fromVersia(
|
||||||
emoji: CustomEmojiExtension["emojis"][0],
|
emoji: CustomEmojiExtension["emojis"][0],
|
||||||
instanceId: string | null,
|
instanceId: string | null,
|
||||||
): Promise<Emoji> {
|
): Promise<Emoji> {
|
||||||
|
|
|
||||||
|
|
@ -133,10 +133,10 @@ export class Instance extends BaseInterface<typeof Instances> {
|
||||||
|
|
||||||
static async fetchMetadata(url: string): Promise<{
|
static async fetchMetadata(url: string): Promise<{
|
||||||
metadata: ServerMetadata;
|
metadata: ServerMetadata;
|
||||||
protocol: "lysand" | "activitypub";
|
protocol: "versia" | "activitypub";
|
||||||
} | null> {
|
} | null> {
|
||||||
const origin = new URL(url).origin;
|
const origin = new URL(url).origin;
|
||||||
const wellKnownUrl = new URL("/.well-known/lysand", origin);
|
const wellKnownUrl = new URL("/.well-known/versia", origin);
|
||||||
const logger = getLogger("federation");
|
const logger = getLogger("federation");
|
||||||
|
|
||||||
const requester = await User.getServerActor().getFederationRequester();
|
const requester = await User.getServerActor().getFederationRequester();
|
||||||
|
|
@ -152,7 +152,7 @@ export class Instance extends BaseInterface<typeof Instances> {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (!(ok && raw.headers.get("content-type")?.includes("json"))) {
|
if (!(ok && raw.headers.get("content-type")?.includes("json"))) {
|
||||||
// If the server doesn't have a Lysand well-known endpoint, it's not a Lysand instance
|
// If the server doesn't have a Versia well-known endpoint, it's not a Versia instance
|
||||||
// Try to resolve ActivityPub metadata instead
|
// Try to resolve ActivityPub metadata instead
|
||||||
const data = await Instance.fetchActivityPubMetadata(url);
|
const data = await Instance.fetchActivityPubMetadata(url);
|
||||||
|
|
||||||
|
|
@ -171,7 +171,7 @@ export class Instance extends BaseInterface<typeof Instances> {
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
|
|
||||||
return { metadata, protocol: "lysand" };
|
return { metadata, protocol: "versia" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error`Instance ${chalk.bold(
|
logger.error`Instance ${chalk.bold(
|
||||||
origin,
|
origin,
|
||||||
|
|
@ -179,7 +179,7 @@ export class Instance extends BaseInterface<typeof Instances> {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error`Failed to fetch Lysand metadata for instance ${chalk.bold(
|
logger.error`Failed to fetch Versia metadata for instance ${chalk.bold(
|
||||||
origin,
|
origin,
|
||||||
)} - Error! ${error}`;
|
)} - Error! ${error}`;
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import type {
|
||||||
import { EntityValidator } from "@lysand-org/federation";
|
import { EntityValidator } from "@lysand-org/federation";
|
||||||
import type {
|
import type {
|
||||||
ContentFormat,
|
ContentFormat,
|
||||||
Note as LysandNote,
|
Note as VersiaNote,
|
||||||
} from "@lysand-org/federation/types";
|
} from "@lysand-org/federation/types";
|
||||||
import {
|
import {
|
||||||
type InferInsertModel,
|
type InferInsertModel,
|
||||||
|
|
@ -193,7 +193,7 @@ export class Note extends BaseInterface<typeof Notes, StatusWithRelations> {
|
||||||
const users = await this.getUsersToFederateTo();
|
const users = await this.getUsersToFederateTo();
|
||||||
|
|
||||||
for (const user of users) {
|
for (const user of users) {
|
||||||
await this.author.federateToUser(this.toLysand(), user);
|
await this.author.federateToUser(this.toVersia(), user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -594,7 +594,7 @@ export class Note extends BaseInterface<typeof Notes, StatusWithRelations> {
|
||||||
* @returns The saved note, or null if the note could not be fetched
|
* @returns The saved note, or null if the note could not be fetched
|
||||||
*/
|
*/
|
||||||
static async saveFromRemote(uri: string): Promise<Note | null> {
|
static async saveFromRemote(uri: string): Promise<Note | null> {
|
||||||
let note: LysandNote | null = null;
|
let note: VersiaNote | null = null;
|
||||||
|
|
||||||
if (uri) {
|
if (uri) {
|
||||||
if (!URL.canParse(uri)) {
|
if (!URL.canParse(uri)) {
|
||||||
|
|
@ -622,16 +622,16 @@ export class Note extends BaseInterface<typeof Notes, StatusWithRelations> {
|
||||||
throw new Error("Invalid object author");
|
throw new Error("Invalid object author");
|
||||||
}
|
}
|
||||||
|
|
||||||
return await Note.fromLysand(note, author);
|
return await Note.fromVersia(note, author);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns a Lysand Note into a database note (saved)
|
* Turns a Versia Note into a database note (saved)
|
||||||
* @param note Lysand Note
|
* @param note Versia Note
|
||||||
* @param author Author of the note
|
* @param author Author of the note
|
||||||
* @returns The saved note
|
* @returns The saved note
|
||||||
*/
|
*/
|
||||||
static async fromLysand(note: LysandNote, author: User): Promise<Note> {
|
static async fromVersia(note: VersiaNote, author: User): Promise<Note> {
|
||||||
const emojis: Emoji[] = [];
|
const emojis: Emoji[] = [];
|
||||||
const logger = getLogger("federation");
|
const logger = getLogger("federation");
|
||||||
|
|
||||||
|
|
@ -653,7 +653,7 @@ export class Note extends BaseInterface<typeof Notes, StatusWithRelations> {
|
||||||
const attachments: Attachment[] = [];
|
const attachments: Attachment[] = [];
|
||||||
|
|
||||||
for (const attachment of note.attachments ?? []) {
|
for (const attachment of note.attachments ?? []) {
|
||||||
const resolvedAttachment = await Attachment.fromLysand(
|
const resolvedAttachment = await Attachment.fromVersia(
|
||||||
attachment,
|
attachment,
|
||||||
).catch((e) => {
|
).catch((e) => {
|
||||||
logger.error`${e}`;
|
logger.error`${e}`;
|
||||||
|
|
@ -886,10 +886,10 @@ export class Note extends BaseInterface<typeof Notes, StatusWithRelations> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a note to the Lysand format
|
* Convert a note to the Versia format
|
||||||
* @returns The note in the Lysand format
|
* @returns The note in the Versia format
|
||||||
*/
|
*/
|
||||||
toLysand(): LysandNote {
|
toVersia(): VersiaNote {
|
||||||
const status = this.data;
|
const status = this.data;
|
||||||
return {
|
return {
|
||||||
type: "Note",
|
type: "Note",
|
||||||
|
|
@ -906,7 +906,7 @@ export class Note extends BaseInterface<typeof Notes, StatusWithRelations> {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
attachments: (status.attachments ?? []).map((attachment) =>
|
attachments: (status.attachments ?? []).map((attachment) =>
|
||||||
new Attachment(attachment).toLysand(),
|
new Attachment(attachment).toVersia(),
|
||||||
),
|
),
|
||||||
is_sensitive: status.sensitive,
|
is_sensitive: status.sensitive,
|
||||||
mentions: status.mentions.map((mention) =>
|
mentions: status.mentions.map((mention) =>
|
||||||
|
|
@ -925,7 +925,7 @@ export class Note extends BaseInterface<typeof Notes, StatusWithRelations> {
|
||||||
extensions: {
|
extensions: {
|
||||||
"org.lysand:custom_emojis": {
|
"org.lysand:custom_emojis": {
|
||||||
emojis: status.emojis.map((emoji) =>
|
emojis: status.emojis.map((emoji) =>
|
||||||
new Emoji(emoji).toLysand(),
|
new Emoji(emoji).toVersia(),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// TODO: Add polls and reactions
|
// TODO: Add polls and reactions
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import {
|
||||||
type HttpVerb,
|
type HttpVerb,
|
||||||
SignatureConstructor,
|
SignatureConstructor,
|
||||||
} from "@lysand-org/federation";
|
} from "@lysand-org/federation";
|
||||||
import type { Entity, User as LysandUser } from "@lysand-org/federation/types";
|
import type { Entity, User as VersiaUser } from "@lysand-org/federation/types";
|
||||||
import chalk from "chalk";
|
import chalk from "chalk";
|
||||||
import {
|
import {
|
||||||
type InferInsertModel,
|
type InferInsertModel,
|
||||||
|
|
@ -34,7 +34,7 @@ import { htmlToText } from "html-to-text";
|
||||||
import {
|
import {
|
||||||
type UserWithRelations,
|
type UserWithRelations,
|
||||||
findManyUsers,
|
findManyUsers,
|
||||||
followRequestToLysand,
|
followRequestToVersia,
|
||||||
} from "~/classes/functions/user";
|
} from "~/classes/functions/user";
|
||||||
import { searchManager } from "~/classes/search/search-manager";
|
import { searchManager } from "~/classes/search/search-manager";
|
||||||
import { db } from "~/drizzle/db";
|
import { db } from "~/drizzle/db";
|
||||||
|
|
@ -232,7 +232,7 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
||||||
|
|
||||||
if (otherUser.isRemote()) {
|
if (otherUser.isRemote()) {
|
||||||
const { ok } = await this.federateToUser(
|
const { ok } = await this.federateToUser(
|
||||||
followRequestToLysand(this, otherUser),
|
followRequestToVersia(this, otherUser),
|
||||||
otherUser,
|
otherUser,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -412,8 +412,8 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
||||||
|
|
||||||
const instance = await Instance.resolve(uri);
|
const instance = await Instance.resolve(uri);
|
||||||
|
|
||||||
if (instance.data.protocol === "lysand") {
|
if (instance.data.protocol === "versia") {
|
||||||
return await User.saveFromLysand(uri, instance);
|
return await User.saveFromVersia(uri, instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instance.data.protocol === "activitypub") {
|
if (instance.data.protocol === "activitypub") {
|
||||||
|
|
@ -428,18 +428,18 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
||||||
config.federation.bridge.url,
|
config.federation.bridge.url,
|
||||||
);
|
);
|
||||||
|
|
||||||
return await User.saveFromLysand(bridgeUri.toString(), instance);
|
return await User.saveFromVersia(bridgeUri.toString(), instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(`Unsupported protocol: ${instance.data.protocol}`);
|
throw new Error(`Unsupported protocol: ${instance.data.protocol}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async saveFromLysand(
|
private static async saveFromVersia(
|
||||||
uri: string,
|
uri: string,
|
||||||
instance: Instance,
|
instance: Instance,
|
||||||
): Promise<User> {
|
): Promise<User> {
|
||||||
const requester = await User.getServerActor().getFederationRequester();
|
const requester = await User.getServerActor().getFederationRequester();
|
||||||
const { data: json } = await requester.get<Partial<LysandUser>>(uri, {
|
const { data: json } = await requester.get<Partial<VersiaUser>>(uri, {
|
||||||
// @ts-expect-error Bun extension
|
// @ts-expect-error Bun extension
|
||||||
proxy: config.http.proxy.address,
|
proxy: config.http.proxy.address,
|
||||||
});
|
});
|
||||||
|
|
@ -447,12 +447,12 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
||||||
const validator = new EntityValidator();
|
const validator = new EntityValidator();
|
||||||
const data = await validator.User(json);
|
const data = await validator.User(json);
|
||||||
|
|
||||||
const user = await User.fromLysand(data, instance);
|
const user = await User.fromVersia(data, instance);
|
||||||
|
|
||||||
const userEmojis =
|
const userEmojis =
|
||||||
data.extensions?.["org.lysand:custom_emojis"]?.emojis ?? [];
|
data.extensions?.["org.lysand:custom_emojis"]?.emojis ?? [];
|
||||||
const emojis = await Promise.all(
|
const emojis = await Promise.all(
|
||||||
userEmojis.map((emoji) => Emoji.fromLysand(emoji, instance.id)),
|
userEmojis.map((emoji) => Emoji.fromVersia(emoji, instance.id)),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (emojis.length > 0) {
|
if (emojis.length > 0) {
|
||||||
|
|
@ -475,8 +475,8 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
||||||
return finalUser;
|
return finalUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async fromLysand(
|
static async fromVersia(
|
||||||
user: LysandUser,
|
user: VersiaUser,
|
||||||
instance: Instance,
|
instance: Instance,
|
||||||
): Promise<User> {
|
): Promise<User> {
|
||||||
const data = {
|
const data = {
|
||||||
|
|
@ -707,14 +707,14 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
||||||
newUser.endpoints ||
|
newUser.endpoints ||
|
||||||
newUser.isDiscoverable)
|
newUser.isDiscoverable)
|
||||||
) {
|
) {
|
||||||
await this.federateToFollowers(this.toLysand());
|
await this.federateToFollowers(this.toVersia());
|
||||||
}
|
}
|
||||||
|
|
||||||
return updated.data;
|
return updated.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signs a Lysand entity with that user's private key
|
* Signs a Versia entity with that user's private key
|
||||||
*
|
*
|
||||||
* @param entity Entity to sign
|
* @param entity Entity to sign
|
||||||
* @param signatureUrl URL to embed in signature (must be the same URI of queries made with this signature)
|
* @param signatureUrl URL to embed in signature (must be the same URI of queries made with this signature)
|
||||||
|
|
@ -754,7 +754,7 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to get the appropriate Lysand SDK requester with this user's private key
|
* Helper to get the appropriate Versia SDK requester with this user's private key
|
||||||
*
|
*
|
||||||
* @returns The requester
|
* @returns The requester
|
||||||
*/
|
*/
|
||||||
|
|
@ -894,9 +894,9 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
toLysand(): LysandUser {
|
toVersia(): VersiaUser {
|
||||||
if (this.isRemote()) {
|
if (this.isRemote()) {
|
||||||
throw new Error("Cannot convert remote user to Lysand format");
|
throw new Error("Cannot convert remote user to Versia format");
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = this.data;
|
const user = this.data;
|
||||||
|
|
@ -958,7 +958,7 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
||||||
extensions: {
|
extensions: {
|
||||||
"org.lysand:custom_emojis": {
|
"org.lysand:custom_emojis": {
|
||||||
emojis: user.emojis.map((emoji) =>
|
emojis: user.emojis.map((emoji) =>
|
||||||
new Emoji(emoji).toLysand(),
|
new Emoji(emoji).toVersia(),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -216,17 +216,17 @@ const brandingTransforms = (
|
||||||
|
|
||||||
newFileContents = newFileContents.replaceAll(
|
newFileContents = newFileContents.replaceAll(
|
||||||
"Glitch-soc is free open source software forked from Mastodon.",
|
"Glitch-soc is free open source software forked from Mastodon.",
|
||||||
"Lysand is free and open-source software using the Glitch-Soc frontend.",
|
"Versia Server is free and open-source software using the Glitch-Soc frontend.",
|
||||||
);
|
);
|
||||||
newFileContents = newFileContents.replaceAll("Mastodon", "Lysand");
|
newFileContents = newFileContents.replaceAll("Mastodon", "Versia Server");
|
||||||
newFileContents = newFileContents.replaceAll(
|
newFileContents = newFileContents.replaceAll(
|
||||||
"Lysand is free, open-source software, and a trademark of Lysand gGmbH.",
|
"Versia is free, open-source software, and a trademark of Versia gGmbH.",
|
||||||
"This is not a Mastodon instance.",
|
"This is not a Mastodon instance.",
|
||||||
);
|
);
|
||||||
|
|
||||||
newFileContents = newFileContents.replaceAll(
|
newFileContents = newFileContents.replaceAll(
|
||||||
"joinmastodon.org",
|
"joinmastodon.org",
|
||||||
"lysand.org",
|
"versia.pub",
|
||||||
);
|
);
|
||||||
|
|
||||||
return newFileContents;
|
return newFileContents;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "@lysand-org/kit",
|
"name": "@versia-org/kit",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "Framework for building Lysand Server plugins",
|
"description": "Framework for building Versia Server plugins",
|
||||||
"author": {
|
"author": {
|
||||||
"email": "contact@cpluspatch.com",
|
"email": "contact@cpluspatch.com",
|
||||||
"name": "CPlusPatch",
|
"name": "CPlusPatch",
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export class Plugin<ConfigSchema extends z.ZodTypeAny> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the plugin's configuration from the Lysand Server configuration file.
|
* Loads the plugin's configuration from the Versia Server configuration file.
|
||||||
* This will be called when the plugin is loaded.
|
* This will be called when the plugin is loaded.
|
||||||
* @param config Values the user has set in the configuration file.
|
* @param config Values the user has set in the configuration file.
|
||||||
*/
|
*/
|
||||||
|
|
@ -65,7 +65,7 @@ export class PluginConfigManager<Schema extends z.ZodTypeAny> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the configuration from the Lysand Server configuration file.
|
* Loads the configuration from the Versia Server configuration file.
|
||||||
* This will be called when the plugin is loaded.
|
* This will be called when the plugin is loaded.
|
||||||
* @param config Values the user has set in the configuration file.
|
* @param config Values the user has set in the configuration file.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ beforeAll(async () => {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
shortcode: "test1",
|
shortcode: "test1",
|
||||||
element: "https://cdn.lysand.org/logo.webp",
|
element: "https://cdn.versia.social/logo.webp",
|
||||||
global: true,
|
global: true,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|
@ -39,7 +39,7 @@ beforeAll(async () => {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
shortcode: "test2",
|
shortcode: "test2",
|
||||||
element: "https://cdn.lysand.org/logo.webp",
|
element: "https://cdn.versia.social/logo.webp",
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
@ -53,7 +53,7 @@ beforeAll(async () => {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
shortcode: "test3",
|
shortcode: "test3",
|
||||||
element: "https://cdn.lysand.org/logo.webp",
|
element: "https://cdn.versia.social/logo.webp",
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ beforeAll(async () => {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
shortcode: "test",
|
shortcode: "test",
|
||||||
element: "https://cdn.lysand.org/logo.webp",
|
element: "https://cdn.versia.social/logo.webp",
|
||||||
global: true,
|
global: true,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ describe(meta.route, () => {
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
shortcode: "test",
|
shortcode: "test",
|
||||||
element: "https://cdn.lysand.org/logo.webp",
|
element: "https://cdn.versia.social/logo.webp",
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
@ -108,7 +108,7 @@ describe(meta.route, () => {
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
shortcode: "test3",
|
shortcode: "test3",
|
||||||
element: "https://cdn.lysand.org/logo.webp",
|
element: "https://cdn.versia.social/logo.webp",
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,8 @@ describe(meta.route, () => {
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
expect(json).toEqual({
|
expect(json).toEqual({
|
||||||
updated_at: new Date(1970, 0, 0).toISOString(),
|
updated_at: new Date(1970, 0, 0).toISOString(),
|
||||||
// This is a [Lysand](https://lysand.org) server with the default extended description.
|
|
||||||
content:
|
content:
|
||||||
'<p>This is a <a href="https://lysand.org">Lysand</a> server with the default extended description.</p>\n',
|
'<p>This is a <a href="https://versia.pub">Versia</a> server with the default extended description.</p>\n',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ export default (app: Hono) =>
|
||||||
async () => {
|
async () => {
|
||||||
const { content, lastModified } = await renderMarkdownInPath(
|
const { content, lastModified } = await renderMarkdownInPath(
|
||||||
config.instance.extended_description_path ?? "",
|
config.instance.extended_description_path ?? "",
|
||||||
"This is a [Lysand](https://lysand.org) server with the default extended description.",
|
"This is a [Versia](https://versia.pub) server with the default extended description.",
|
||||||
);
|
);
|
||||||
|
|
||||||
return jsonResponse({
|
return jsonResponse({
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ export default (app: Hono) =>
|
||||||
streaming_api: "",
|
streaming_api: "",
|
||||||
},
|
},
|
||||||
version: "4.3.0-alpha.3+glitch",
|
version: "4.3.0-alpha.3+glitch",
|
||||||
lysand_version: version,
|
versia_version: version,
|
||||||
sso: {
|
sso: {
|
||||||
forced: false,
|
forced: false,
|
||||||
providers: config.oidc.providers.map((p) => ({
|
providers: config.oidc.providers.map((p) => ({
|
||||||
|
|
@ -92,7 +92,7 @@ export default (app: Hono) =>
|
||||||
contact_account: contactAccount?.toApi() || undefined,
|
contact_account: contactAccount?.toApi() || undefined,
|
||||||
} satisfies Record<string, unknown> & {
|
} satisfies Record<string, unknown> & {
|
||||||
banner: string | null;
|
banner: string | null;
|
||||||
lysand_version: string;
|
versia_version: string;
|
||||||
sso: {
|
sso: {
|
||||||
forced: boolean;
|
forced: boolean;
|
||||||
providers: {
|
providers: {
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ export default (app: Hono) =>
|
||||||
.insert(Applications)
|
.insert(Applications)
|
||||||
.values({
|
.values({
|
||||||
clientId: user.id + randomString(32, "base64"),
|
clientId: user.id + randomString(32, "base64"),
|
||||||
name: "Lysand",
|
name: "Versia",
|
||||||
redirectUri: `${oauthRedirectUri(issuerId)}`,
|
redirectUri: `${oauthRedirectUri(issuerId)}`,
|
||||||
scopes: "openid profile email",
|
scopes: "openid profile email",
|
||||||
secret: "",
|
secret: "",
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export default (app: Hono) =>
|
||||||
domain: new URL(config.http.base_url).hostname,
|
domain: new URL(config.http.base_url).hostname,
|
||||||
title: config.instance.name,
|
title: config.instance.name,
|
||||||
version: "4.3.0-alpha.3+glitch",
|
version: "4.3.0-alpha.3+glitch",
|
||||||
lysand_version: version,
|
versia_version: version,
|
||||||
source_url: "https://github.com/lysand-org/lysand",
|
source_url: "https://github.com/lysand-org/lysand",
|
||||||
description: config.instance.description,
|
description: config.instance.description,
|
||||||
usage: {
|
usage: {
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ export default (app: Hono) =>
|
||||||
meta.route,
|
meta.route,
|
||||||
zValidator("query", schemas.query, handleZodError),
|
zValidator("query", schemas.query, handleZodError),
|
||||||
async (context) => {
|
async (context) => {
|
||||||
// This is the Lysand client's client_id, not the external OAuth provider's client_id
|
// This is the Versia client's client_id, not the external OAuth provider's client_id
|
||||||
const { issuer: issuerId, client_id } = context.req.valid("query");
|
const { issuer: issuerId, client_id } = context.req.valid("query");
|
||||||
const body = await context.req.query();
|
const body = await context.req.query();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { zValidator } from "@hono/zod-validator";
|
||||||
import type { Entity } from "@lysand-org/federation/types";
|
import type { Entity } from "@lysand-org/federation/types";
|
||||||
import { and, eq, inArray, sql } from "drizzle-orm";
|
import { and, eq, inArray, sql } from "drizzle-orm";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { type LikeType, likeToLysand } from "~/classes/functions/like";
|
import { type LikeType, likeToVersia } from "~/classes/functions/like";
|
||||||
import { db } from "~/drizzle/db";
|
import { db } from "~/drizzle/db";
|
||||||
import { Notes } from "~/drizzle/schema";
|
import { Notes } from "~/drizzle/schema";
|
||||||
import { config } from "~/packages/config-manager";
|
import { config } from "~/packages/config-manager";
|
||||||
|
|
@ -56,7 +56,7 @@ export default (app: Hono) =>
|
||||||
inArray(Notes.visibility, ["public", "unlisted"]),
|
inArray(Notes.visibility, ["public", "unlisted"]),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
apiObject = foundObject ? foundObject.toLysand() : null;
|
apiObject = foundObject ? foundObject.toVersia() : null;
|
||||||
foundAuthor = foundObject ? foundObject.author : null;
|
foundAuthor = foundObject ? foundObject.author : null;
|
||||||
|
|
||||||
if (foundObject) {
|
if (foundObject) {
|
||||||
|
|
@ -72,7 +72,7 @@ export default (app: Hono) =>
|
||||||
sql`EXISTS (SELECT 1 FROM "Notes" WHERE "Notes"."id" = ${like.likedId} AND "Notes"."visibility" IN ('public', 'unlisted'))`,
|
sql`EXISTS (SELECT 1 FROM "Notes" WHERE "Notes"."id" = ${like.likedId} AND "Notes"."visibility" IN ('public', 'unlisted'))`,
|
||||||
),
|
),
|
||||||
})) ?? null;
|
})) ?? null;
|
||||||
apiObject = foundObject ? likeToLysand(foundObject) : null;
|
apiObject = foundObject ? likeToVersia(foundObject) : null;
|
||||||
foundAuthor = foundObject
|
foundAuthor = foundObject
|
||||||
? await User.fromId(foundObject.likerId)
|
? await User.fromId(foundObject.likerId)
|
||||||
: null;
|
: null;
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ export default (app: Hono) =>
|
||||||
return errorResponse("Author not found", 404);
|
return errorResponse("Author not found", 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
const newStatus = await Note.fromLysand(
|
const newStatus = await Note.fromVersia(
|
||||||
note,
|
note,
|
||||||
account,
|
account,
|
||||||
).catch((e) => {
|
).catch((e) => {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ export default (app: Hono) =>
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
return response(JSON.stringify(user.toLysand(), null, 4), 200, {
|
return response(JSON.stringify(user.toVersia(), null, 4), 200, {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,7 @@ export default (app: Hono) =>
|
||||||
return redirect(user.toApi().url);
|
return redirect(user.toApi().url);
|
||||||
}
|
}
|
||||||
|
|
||||||
const userString = JSON.stringify(user.toLysand());
|
const userString = JSON.stringify(user.toVersia());
|
||||||
|
|
||||||
// If base_url uses https and request uses http, rewrite request to use https
|
// If base_url uses https and request uses http, rewrite request to use https
|
||||||
// This fixes reverse proxy errors
|
// This fixes reverse proxy errors
|
||||||
|
|
@ -82,7 +82,7 @@ export default (app: Hono) =>
|
||||||
reqUrl.protocol = "https:";
|
reqUrl.protocol = "https:";
|
||||||
}
|
}
|
||||||
|
|
||||||
const { headers } = await user.sign(user.toLysand(), reqUrl, "GET");
|
const { headers } = await user.sign(user.toVersia(), reqUrl, "GET");
|
||||||
|
|
||||||
return response(userString, 200, {
|
return response(userString, 200, {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ export default (app: Hono) =>
|
||||||
config.http.base_url,
|
config.http.base_url,
|
||||||
).toString()
|
).toString()
|
||||||
: undefined,
|
: undefined,
|
||||||
items: notes.map((note) => note.toLysand()),
|
items: notes.map((note) => note.toVersia()),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export const meta = applyConfig({
|
||||||
duration: 60,
|
duration: 60,
|
||||||
max: 60,
|
max: 60,
|
||||||
},
|
},
|
||||||
route: "/.well-known/lysand",
|
route: "/.well-known/versia",
|
||||||
});
|
});
|
||||||
|
|
||||||
export default (app: Hono) =>
|
export default (app: Hono) =>
|
||||||
|
|
@ -28,6 +28,6 @@ export default (app: Hono) =>
|
||||||
logo: urlToContentFormat(config.instance.logo) ?? undefined,
|
logo: urlToContentFormat(config.instance.logo) ?? undefined,
|
||||||
banner: urlToContentFormat(config.instance.banner) ?? undefined,
|
banner: urlToContentFormat(config.instance.banner) ?? undefined,
|
||||||
supported_extensions: ["org.lysand:custom_emojis"],
|
supported_extensions: ["org.lysand:custom_emojis"],
|
||||||
website: "https://lysand.org",
|
website: "https://versia.pub",
|
||||||
} satisfies ServerMetadata);
|
} satisfies ServerMetadata);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ export default (app: Hono) =>
|
||||||
app.on(meta.allowedMethods, meta.route, () => {
|
app.on(meta.allowedMethods, meta.route, () => {
|
||||||
return jsonResponse({
|
return jsonResponse({
|
||||||
version: "2.0",
|
version: "2.0",
|
||||||
software: { name: "lysand", version: manifest.version },
|
software: { name: "versia-server", version: manifest.version },
|
||||||
protocols: ["lysand"],
|
protocols: ["versia"],
|
||||||
services: { outbound: [], inbound: [] },
|
services: { outbound: [], inbound: [] },
|
||||||
usage: {
|
usage: {
|
||||||
users: { total: 0, activeMonth: 0, activeHalfyear: 0 },
|
users: { total: 0, activeMonth: 0, activeHalfyear: 0 },
|
||||||
|
|
|
||||||
4
setup.ts
4
setup.ts
|
|
@ -12,7 +12,7 @@ await configureLoggers();
|
||||||
|
|
||||||
const serverLogger = getLogger("server");
|
const serverLogger = getLogger("server");
|
||||||
|
|
||||||
serverLogger.info`Starting Lysand...`;
|
serverLogger.info`Starting Versia Server...`;
|
||||||
|
|
||||||
await setupDatabase();
|
await setupDatabase();
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ const postCount = await Note.getCount();
|
||||||
|
|
||||||
await checkConfig(config);
|
await checkConfig(config);
|
||||||
|
|
||||||
serverLogger.info`Lysand started at ${config.http.bind}:${config.http.bind_port} in ${(performance.now() - timeAtStart).toFixed(0)}ms`;
|
serverLogger.info`Versia Server started at ${config.http.bind}:${config.http.bind_port} in ${(performance.now() - timeAtStart).toFixed(0)}ms`;
|
||||||
|
|
||||||
serverLogger.info`Database is online, now serving ${postCount} posts`;
|
serverLogger.info`Database is online, now serving ${postCount} posts`;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue