-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #418 from zaanposni/release/v1.14
Version 2
- Loading branch information
Showing
548 changed files
with
23,505 additions
and
10,045 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: DockerPublish | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
jobs: | ||
DockerPublish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Determine version | ||
run: | | ||
VERSION=$(cat nginx/static/version.json | jq -r '.version')$($(cat nginx/static/version.json | jq -r '.pre_release') && echo "a" || :) | ||
echo "I found version: $VERSION" | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Build backend | ||
run: | | ||
cd backend | ||
docker build -t ghcr.io/${{ github.repository_owner }}/masz_backend:latest -t ghcr.io/${{ github.repository_owner }}/masz_backend:${{ env.VERSION }} . | ||
- name: Build frontend | ||
run: | | ||
cd nginx | ||
docker build -t ghcr.io/${{ github.repository_owner }}/masz_nginx:latest -t ghcr.io/${{ github.repository_owner }}/masz_nginx:${{ env.VERSION }} . | ||
- name: Push images | ||
run: | | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u zaanposni --password-stdin | ||
docker push ghcr.io/${{ github.repository_owner }}/masz_backend:latest | ||
docker push ghcr.io/${{ github.repository_owner }}/masz_backend:${{ env.VERSION }} | ||
docker push ghcr.io/${{ github.repository_owner }}/masz_nginx:latest | ||
docker push ghcr.io/${{ github.repository_owner }}/masz_nginx:${{ env.VERSION }} | ||
- name: Calculate image sizes | ||
run: | | ||
SIZE_BACKEND=$(docker image inspect ghcr.io/${{ github.repository_owner }}/masz_backend:latest | jq -r '.[0].Size' | numfmt --to=si) | ||
SIZE_NGINX=$(docker image inspect ghcr.io/${{ github.repository_owner }}/masz_nginx:latest | jq -r '.[0].Size' | numfmt --to=si) | ||
echo "I found backend size: $SIZE_BACKEND" | ||
echo "I found nginx size: $SIZE_NGINX" | ||
echo "SIZE_BACKEND=$SIZE_BACKEND" >> $GITHUB_ENV | ||
echo "SIZE_NGINX=$SIZE_NGINX" >> $GITHUB_ENV | ||
- name: Send discord notification | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
uses: Ilshidur/action-discord@master | ||
with: | ||
args: "🚀 Published `masz_backend:${{ env.VERSION }}` and `masz_backend:latest` with `${{ env.SIZE_BACKEND }}`.\n🚀 Published `masz_nginx:${{ env.VERSION }}` and `masz_nginx:latest` with `${{ env.SIZE_NGINX }}`." |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,27 @@ Feel free to comment existing issues/discussions or create a new one if you have | |
- Discord: `zaanposni#9295` | ||
- [mail me](mailto:[email protected]) | ||
|
||
## Translations | ||
|
||
Contributions to add new translations/languages or correcting existing ones are welcome!<br/> | ||
Tranlating in MASZ is fairly simple and done via i18n (on the website).<br/> | ||
The Backend uses custom generated code but this does not concerns you as a translator.<br/> | ||
|
||
There are json files that include translation nodes and look like this:<br/> | ||
![](/docs/translation_example.png) | ||
|
||
As you can see there is a `description` that tells you what this translation node is about.<br/> | ||
To add your translation - lets say for french - simply add `'fr': 'Sourdine'`. | ||
|
||
Backend translation (used for notifications) are located in the `./translations` directory while translations for the website are located in every subfolder of `./nginx/MASZ/src/app`.<br/> | ||
To quickly find your translation node either search for a known english translation or the existing translation you want to adjust.<br/> | ||
You can use tools like `Visual Studio Code` to search through the entire codebase. | ||
|
||
## How to publish my changes | ||
|
||
You have to follow the process of `branch -> commit -> pull request`.<br/> | ||
If you are not sure what that means, check out [this tutorial](https://github.com/firstcontributions/first-contributions). <br/> | ||
|
||
## Issues and Discussions | ||
|
||
Feel free to open issues and discussions of any type. No matter if support, questions or feature requests! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using DSharpPlus; | ||
using DSharpPlus.Entities; | ||
using masz.Models; | ||
|
||
namespace masz.AutoModerations | ||
{ | ||
public static class AttachmentCheck | ||
{ | ||
public static bool Check(DiscordMessage message, AutoModerationConfig config, DiscordClient client) | ||
{ | ||
if (config.Limit == null) | ||
{ | ||
return false; | ||
} | ||
if (message.Attachments == null) | ||
{ | ||
return false; | ||
} | ||
return message.Attachments.Count > config.Limit; | ||
} | ||
} | ||
} |
Oops, something went wrong.