1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-09 12:12:35 +01:00

prettier formatted and simplified README links

This commit is contained in:
developomp 2021-10-20 08:45:42 +09:00
parent cbcb9edcaa
commit 87613b7447
12 changed files with 218 additions and 232 deletions

View File

@ -1,2 +1,2 @@
node_modules/
db/
db/

2
.github/FUNDING.yml vendored
View File

@ -1 +1 @@
open_collective: fosscord
open_collective: fosscord

View File

@ -1,47 +1,41 @@
name: docker-publish-api
on:
push:
paths:
- 'api/**'
push:
paths:
- "api/**"
jobs:
docker-api:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache/api
key: ${{ runner.os }}-buildx-api-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-api-
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: ./api
push: true
tags: ${{ secrets.DOCKERHUB_TAGS_API }}
cache-from: type=local,src=/tmp/.buildx-cache/api
cache-to: type=local,dest=/tmp/.buildx-cache-new/api
-
# Hackfix to cleanup cache; replace after buildx 0.6 and BuildKit 0.9 are GA
# https://github.com/docker/build-push-action/pull/406#issuecomment-879184394
name: Move cache fix
run: |
rm -rf /tmp/.buildx-cache/api
mv /tmp/.buildx-cache-new/api /tmp/.buildx-cache/api
docker-api:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache/api
key: ${{ runner.os }}-buildx-api-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-api-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./api
push: true
tags: ${{ secrets.DOCKERHUB_TAGS_API }}
cache-from: type=local,src=/tmp/.buildx-cache/api
cache-to: type=local,dest=/tmp/.buildx-cache-new/api
- # Hackfix to cleanup cache; replace after buildx 0.6 and BuildKit 0.9 are GA
# https://github.com/docker/build-push-action/pull/406#issuecomment-879184394
name: Move cache fix
run: |
rm -rf /tmp/.buildx-cache/api
mv /tmp/.buildx-cache-new/api /tmp/.buildx-cache/api

View File

@ -1,47 +1,41 @@
name: docker-publish-cdn
on:
push:
paths:
- 'cdn/**'
push:
paths:
- "cdn/**"
jobs:
docker-cdn:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache/cdn
key: ${{ runner.os }}-buildx-cdn-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-cdn-
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: ./cdn
push: true
tags: ${{ secrets.DOCKERHUB_TAGS_CDN }}
cache-from: type=local,src=/tmp/.buildx-cache/cdn
cache-to: type=local,dest=/tmp/.buildx-cache-new/cdn
-
# Hackfix to cleanup cache; replace after buildx 0.6 and BuildKit 0.9 are GA
# https://github.com/docker/build-push-action/pull/406#issuecomment-879184394
name: Move cache fix
run: |
rm -rf /tmp/.buildx-cache/cdn
mv /tmp/.buildx-cache-new/cdn /tmp/.buildx-cache/cdn
docker-cdn:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache/cdn
key: ${{ runner.os }}-buildx-cdn-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-cdn-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./cdn
push: true
tags: ${{ secrets.DOCKERHUB_TAGS_CDN }}
cache-from: type=local,src=/tmp/.buildx-cache/cdn
cache-to: type=local,dest=/tmp/.buildx-cache-new/cdn
- # Hackfix to cleanup cache; replace after buildx 0.6 and BuildKit 0.9 are GA
# https://github.com/docker/build-push-action/pull/406#issuecomment-879184394
name: Move cache fix
run: |
rm -rf /tmp/.buildx-cache/cdn
mv /tmp/.buildx-cache-new/cdn /tmp/.buildx-cache/cdn

View File

@ -1,47 +1,41 @@
name: docker-publish-gw
on:
push:
paths:
- 'gateway/**'
push:
paths:
- "gateway/**"
jobs:
docker-gw:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache/gw
key: ${{ runner.os }}-buildx-gw-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-gw-
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: ./gateway
push: true
tags: ${{ secrets.DOCKERHUB_TAGS_GW }}
cache-from: type=local,src=/tmp/.buildx-cache/gw
cache-to: type=local,dest=/tmp/.buildx-cache-new/gw
-
# Hackfix to cleanup cache; replace after buildx 0.6 and BuildKit 0.9 are GA
# https://github.com/docker/build-push-action/pull/406#issuecomment-879184394
name: Move cache fix
run: |
rm -rf /tmp/.buildx-cache/gw
mv /tmp/.buildx-cache-new/gw /tmp/.buildx-cache/gw
docker-gw:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache/gw
key: ${{ runner.os }}-buildx-gw-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-gw-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./gateway
push: true
tags: ${{ secrets.DOCKERHUB_TAGS_GW }}
cache-from: type=local,src=/tmp/.buildx-cache/gw
cache-to: type=local,dest=/tmp/.buildx-cache-new/gw
- # Hackfix to cleanup cache; replace after buildx 0.6 and BuildKit 0.9 are GA
# https://github.com/docker/build-push-action/pull/406#issuecomment-879184394
name: Move cache fix
run: |
rm -rf /tmp/.buildx-cache/gw
mv /tmp/.buildx-cache-new/gw /tmp/.buildx-cache/gw

View File

@ -1,101 +1,101 @@
on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
name: Publish Release
jobs:
insiders-build:
strategy:
matrix:
os: [windows, macos, ubuntu]
include:
- os: windows
file: fosscord-server-windows.exe
package: ""
artifact: fosscord-server-windows.exe
- os: macos
file: fosscord-server.app
package: tar -czf 'fosscord-server-macos.app.tgz' 'fosscord-server.app'
artifact: fosscord-server-macos.app.tgz
- os: ubuntu
file: fosscord
package: chmod +x fosscord && tar -czf 'fosscord-server-linux.tgz' 'fosscord'
artifact: fosscord-server-linux.tgz
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
env:
MONGOMS_VERSION: 4.4.3
with:
node-version: 14
- run: |
cd bundle
npm run setup
npx caxa -i . -m 'This_may_take_a_while_to_run_the_first_time_please_wait...' --output '${{matrix.file}}' -- '{{caxa}}/node_modules/.bin/node' '{{caxa}}/dist/bundle/src/start.js'
${{ matrix.package }}
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: bundle/${{ matrix.artifact }}
insiders-build:
strategy:
matrix:
os: [windows, macos, ubuntu]
include:
- os: windows
file: fosscord-server-windows.exe
package: ""
artifact: fosscord-server-windows.exe
- os: macos
file: fosscord-server.app
package: tar -czf 'fosscord-server-macos.app.tgz' 'fosscord-server.app'
artifact: fosscord-server-macos.app.tgz
- os: ubuntu
file: fosscord
package: chmod +x fosscord && tar -czf 'fosscord-server-linux.tgz' 'fosscord'
artifact: fosscord-server-linux.tgz
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
env:
MONGOMS_VERSION: 4.4.3
with:
node-version: 14
- run: |
cd bundle
npm run setup
npx caxa -i . -m 'This_may_take_a_while_to_run_the_first_time_please_wait...' --output '${{matrix.file}}' -- '{{caxa}}/node_modules/.bin/node' '{{caxa}}/dist/bundle/src/start.js'
${{ matrix.package }}
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: bundle/${{ matrix.artifact }}
release:
needs: [insiders-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: fosscord-server-windows.exe
- uses: actions/download-artifact@v2
with:
name: fosscord-server-macos.app.tgz
- uses: actions/download-artifact@v2
with:
name: fosscord-server-linux.tgz
- uses: actions/create-release@v1
id: create-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ secrets.RELEASE_VERSION }}
release_name: Server v${{ secrets.RELEASE_VERSION }}
draft: false
prerelease: true # TODO: change this to false
body: >
## Download
release:
needs: [insiders-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: fosscord-server-windows.exe
- uses: actions/download-artifact@v2
with:
name: fosscord-server-macos.app.tgz
- uses: actions/download-artifact@v2
with:
name: fosscord-server-linux.tgz
- uses: actions/create-release@v1
id: create-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ secrets.RELEASE_VERSION }}
release_name: Server v${{ secrets.RELEASE_VERSION }}
draft: false
prerelease: true # TODO: change this to false
body: >
## Download
- [Windows](https://github.com/fosscord/fosscord-server/releases/download/v${{ secrets.RELEASE_VERSION }}/fosscord-server-windows.exe)
- [Windows](https://github.com/fosscord/fosscord-server/releases/download/v${{ secrets.RELEASE_VERSION }}/fosscord-server-windows.exe)
- [MacOS](https://github.com/fosscord/fosscord-server/releases/download/v${{ secrets.RELEASE_VERSION }}/fosscord-server-macos.app.tgz)
- [MacOS](https://github.com/fosscord/fosscord-server/releases/download/v${{ secrets.RELEASE_VERSION }}/fosscord-server-macos.app.tgz)
- [Linux](https://github.com/fosscord/fosscord-server/releases/download/v${{ secrets.RELEASE_VERSION }}/fosscord-server-linux.tgz)
- [Linux](https://github.com/fosscord/fosscord-server/releases/download/v${{ secrets.RELEASE_VERSION }}/fosscord-server-linux.tgz)
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: fosscord-server-windows.exe
asset_name: fosscord-server-windows.exe
asset_content_type: application/vnd.microsoft.portable-executable
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: fosscord-server-macos.app.tgz
asset_name: fosscord-server-macos.app.tgz
asset_content_type: application/gzip
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: fosscord-server-linux.tgz
asset_name: fosscord-server-linux.tgz
asset_content_type: application/gzip
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: fosscord-server-windows.exe
asset_name: fosscord-server-windows.exe
asset_content_type: application/vnd.microsoft.portable-executable
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: fosscord-server-macos.app.tgz
asset_name: fosscord-server-macos.app.tgz
asset_content_type: application/gzip
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: fosscord-server-linux.tgz
asset_name: fosscord-server-linux.tgz
asset_content_type: application/gzip

2
.gitignore vendored
View File

@ -8,4 +8,4 @@ database.db
tsconfig.tsbuildinfo
files/
.env
config.json
config.json

4
.prettierrc Normal file
View File

@ -0,0 +1,4 @@
{
"tabWidth": 4,
"useTabs": true
}

View File

@ -18,13 +18,13 @@
This repository contains:
- [Fosscord HTTP API Server](https://github.com/fosscord/fosscord-server/tree/master/api)
- [WebSocket Gateway Server](https://github.com/fosscord/fosscord-server/tree/master/gateway)
- [HTTP CDN Server](https://github.com/fosscord/fosscord-server/tree/master/cdn)
- [Utility and Database Models](https://github.com/fosscord/fosscord-server/tree/master/util)
- [RTC Server](https://github.com/fosscord/fosscord-server/tree/master/rtc)
- [WebRTC Server](https://github.com/fosscord/fosscord-server/tree/master/webrtc)
- [Admin Dashboard](https://github.com/fosscord/fosscord-server/tree/master/dashboard)
- [Fosscord HTTP API Server](/api)
- [WebSocket Gateway Server](/gateway)
- [HTTP CDN Server](/cdn)
- [Utility and Database Models](/util)
- [RTC Server](/rtc)
- [WebRTC Server](/webrtc)
- [Admin Dashboard](/dashboard)
## [Resources](https://docs.fosscord.com/resources/)
@ -32,4 +32,4 @@ This repository contains:
## [Setup](https://docs.fosscord.com/setup/server/)
- [Download](https://github.com/fosscord/fosscord-server/releases)
- [Download](https://github.com/fosscord/fosscord-server/releases)

View File

@ -1,3 +1,3 @@
files:
- source: /api/locales/en/*.json
translation: /api/locales/%two_letters_code%/%original_file_name%
- source: /api/locales/en/*.json
translation: /api/locales/%two_letters_code%/%original_file_name%

View File

@ -21,4 +21,4 @@ services:
- db
ports:
- 3002:3002
env_file: ./.docker/env
env_file: ./.docker/env

View File

@ -26,4 +26,4 @@
}
],
"settings": {}
}
}