Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.34.0 #374

Merged
merged 97 commits into from
Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
adfa77b
fix api docs
zekroTJA Feb 21, 2022
0712756
replace web app
zekroTJA Feb 21, 2022
7d48b3a
add header project file
zekroTJA Feb 21, 2022
5efcc35
update gitignore
zekroTJA Feb 21, 2022
e80779f
add endpoints to wrapper
zekroTJA Feb 22, 2022
d818d2c
add theme provider
zekroTJA Feb 22, 2022
7890edd
Merge branch 'dev' into dev-ferework
zekroTJA Mar 12, 2022
2d49153
update dependencies
zekroTJA Mar 13, 2022
73c1e42
migrate to vite
zekroTJA Mar 13, 2022
1d9c2eb
fix path replacement
zekroTJA Mar 13, 2022
9db60df
update app to work with vite properly
zekroTJA Mar 13, 2022
c008780
remove unnecessary log output
zekroTJA Mar 13, 2022
a11439f
implement login page
zekroTJA Mar 13, 2022
71bdbbc
add localization; add dashboard route
zekroTJA Mar 14, 2022
a1c4c43
add guild dashboard route
zekroTJA Mar 14, 2022
fd59ad7
add members view
zekroTJA Mar 16, 2022
631723e
assure that access token request is sent only once
zekroTJA Mar 16, 2022
1619c4e
add paging to guild member request
zekroTJA Mar 16, 2022
ed2efed
add self member component
zekroTJA Mar 16, 2022
7e42f3e
add member fetching
zekroTJA Mar 17, 2022
ecc13cf
Merge branch 'dev' into dev-ferework
zekroTJA Mar 18, 2022
6a52389
move _web to web
zekroTJA Mar 18, 2022
c9c9b8e
fix request replay on invalid access token
zekroTJA Mar 18, 2022
ca674b4
update members view
zekroTJA Mar 18, 2022
8dfa16f
add skeleton loader
zekroTJA Mar 19, 2022
b5db389
add member route
zekroTJA Mar 19, 2022
c17c7a2
fix routing; add member view content
zekroTJA Mar 19, 2022
440caec
update navbar
zekroTJA Mar 19, 2022
5a6e330
update bot icon; add join and creation dates
zekroTJA Mar 20, 2022
2e4a789
add user hint
zekroTJA Mar 20, 2022
e04910c
use ken for command and sub command perms
zekroTJA Mar 22, 2022
2330006
update banner image
zekroTJA Mar 22, 2022
ecec773
add member reports list
zekroTJA Mar 22, 2022
32da42b
make list responses generic
zekroTJA Mar 23, 2022
b2fbb2e
add notifications
zekroTJA Mar 23, 2022
c06795c
add lazyloading to routes
zekroTJA Mar 23, 2022
74c8932
include locale files in build
zekroTJA Mar 23, 2022
cf9a165
update build dist
zekroTJA Mar 23, 2022
1927b3e
remove unnecessary import
zekroTJA Mar 23, 2022
56ba98b
add modals
zekroTJA Mar 24, 2022
622efdd
add button variants
zekroTJA Mar 24, 2022
0bebe3e
eslint fix
zekroTJA Mar 24, 2022
a8e4af9
add web ci workflow
zekroTJA Mar 24, 2022
9d668cb
only run packages CI when packages are updated
zekroTJA Mar 24, 2022
7dfc06a
add global modal hook
zekroTJA Mar 24, 2022
f15f1a1
add report revoking
zekroTJA Mar 24, 2022
72c241c
fix login button color
zekroTJA Mar 24, 2022
241dbb6
add ability to export app in a sub base path
zekroTJA Mar 24, 2022
baf9689
replace `web` with old angular app
zekroTJA Mar 25, 2022
7c94103
move new react app to `web.new`
zekroTJA Mar 25, 2022
bca8f3d
apply `web-ci` workflow only on `web.new`
zekroTJA Mar 25, 2022
eb2c9f0
ignore dist directory
zekroTJA Mar 25, 2022
811da11
add `/beta` web route
zekroTJA Mar 25, 2022
786d915
update Dockerfile to build new web frontend
zekroTJA Mar 25, 2022
db19f41
fix Dockerfile
zekroTJA Mar 25, 2022
e25b090
add greeter
zekroTJA Mar 25, 2022
0822f88
add placeholder start page
zekroTJA Mar 25, 2022
231e3e3
fix english texts
zekroTJA Mar 25, 2022
8908a25
add german translation
zekroTJA Mar 25, 2022
7806752
hide errors in login screen
zekroTJA Mar 25, 2022
2ee7461
replace font in header with curves
zekroTJA Mar 25, 2022
d894902
fix safari support
zekroTJA Mar 25, 2022
261f427
update guild routing
zekroTJA Mar 25, 2022
c2ef38a
add missing translation key
zekroTJA Mar 25, 2022
52f4a34
make sidebar a bit more mobile friendly
zekroTJA Mar 25, 2022
c01e4c5
fix text overflow of guild select
zekroTJA Mar 26, 2022
1200f22
remove unnecessary log output
zekroTJA Mar 26, 2022
b399038
add member reporting and modal
zekroTJA Mar 28, 2022
5ff2d03
add drag and drop
zekroTJA Mar 29, 2022
19e7d7a
add member reporting
zekroTJA Mar 29, 2022
a40ac7c
use key prefix for component translations
zekroTJA Mar 29, 2022
908784e
add `attachment_data` property to reports
zekroTJA Mar 29, 2022
e18e457
fix prefix selectors
zekroTJA Mar 29, 2022
3e9158f
use std encoding for base64 data
zekroTJA Mar 29, 2022
19250f1
add duration picker
zekroTJA Mar 29, 2022
8430cbc
add info text and pasting files from clipboard
zekroTJA Mar 29, 2022
d5fb14e
update translations
zekroTJA Mar 29, 2022
4b31367
update navbar
zekroTJA Mar 29, 2022
71dd2f4
re-style navbar
zekroTJA Mar 30, 2022
c390e75
go back on ban/kick
zekroTJA Mar 30, 2022
9997d22
make unban requests more rich
zekroTJA Mar 31, 2022
6e3a7ed
add `unbanme` route
zekroTJA Mar 31, 2022
b8b55aa
update translations
zekroTJA Mar 31, 2022
8ab958d
fix unbanrequest hydration mapping
zekroTJA Apr 1, 2022
1456fe0
implement unban requests
zekroTJA Apr 1, 2022
894399b
update german translation
zekroTJA Apr 1, 2022
de88019
add terraform template
zekroTJA Jul 3, 2022
49e4763
add angular cli to coder image
Jul 4, 2022
7008a28
use better duration parsing [fix #372]
Jul 4, 2022
0bcd56b
add general settings
Jul 8, 2022
c498b18
fix ssh port for auto deployment
Jul 8, 2022
f7f8a13
update web dependencies
Jul 8, 2022
6d42e26
update react app
Jul 8, 2022
1d656fe
add backups list and toggle
Jul 9, 2022
2eb9172
add antiraid route - totally unfinished but yolo
Jul 10, 2022
b04e5f6
fix tagsinput
Jul 10, 2022
b004a59
update changelog
Jul 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
uses: appleboy/ssh-action@master
with:
host: zekro.de
port: 2201
port: 22
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches:
- '*'
paths-ignore:
- '**.md'
paths:
- "pkg/**"

jobs:
tests:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/web-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Web CI

on:
workflow_dispatch:
push:
branches:
- "*"
paths:
- "web.new/**"
pull_request:
types:
- opened
- reopened
- edited
paths:
- "web.new/**"

jobs:
lint:
name: Lint Checks
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v2
- name: Check out Code
uses: actions/checkout@v2
- name: Install Dependencies
working-directory: 'web.new'
run: yarn
- name: ESLint
working-directory: 'web.new'
run: yarn lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cmd/test/*
web/.angular/
internal/util/embedded/webdist/*
!internal/util/embedded/webdist/keep
web_old/
34 changes: 34 additions & 0 deletions .media/header-brand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .media/header.afdesign
Binary file not shown.
Binary file added .media/rendered/icon-38px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .media/rendered/sp-banner-slim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .media/rendered/sp-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .media/sp-banner.afphoto
Binary file not shown.
57 changes: 57 additions & 0 deletions .media/sp-header.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 26 additions & 18 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/shinpuru",
"cwd": "${workspaceFolder}",
"env": {},
"args": ["-c", "config/private.config.yml"]
}
]
}
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "firefox",
"request": "launch",
"name": "Debug Webapp",
"webRoot": "${workspaceFolder}",
"url": "http://localhost:8081",
"preLaunchTask": "run-vite-server"
},
{
"name": "Debug Backend",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/shinpuru",
"cwd": "${workspaceFolder}",
"env": {},
"args": ["-c", "config/private.config.yml"]
}
]
}
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "run-vite-server",
"type": "shell",
"command": "yarn",
"args": ["start"],
"options": {
"cwd": "web/"
},
"isBackground": true
}
]
}
49 changes: 49 additions & 0 deletions .vscode/web.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
// Place your shinpuru workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }

"Create React Route": {
"scope": "typescriptreact",
"prefix": "route",
"description": "Create a React Route",
"body": [
"import React, { useEffect } from 'react';",
"import { useTranslation } from 'react-i18next';",
"import { useParams } from 'react-router';",
"import styled from 'styled-components';",
"import { useApi } from '../../../hooks/useApi';",
"import { useNotifications } from '../../../hooks/useNotifications';",
"",
"type Props = {}",
"",
"const $1Route: React.FC<Props> = ({}) => {",
" const { t } = useTranslation('routes.$2');",
" const { pushNotification } = useNotifications();",
" const { guildid } = useParams();",
" const fetch = useApi();",
"",
" useEffect(() => {",
" if (!guildid) return;",
" }, [guildid]);",
"",
" return <></>;",
"}",
"",
"export default $1Route;"
]
}
}
42 changes: 5 additions & 37 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,15 @@
<!-- > **Attention**
> This is a hotfix patch. If you want to see the changelog for release 1.30.0, please look [**here**](https://github.com/zekroTJA/shinpuru/releases/tag/1.30.0). -->

# Interactive Setup
# New Web Interface Beta

Recently, a lot of questions about the setup of shinpuru received me. shinpuru has a lot of configuration values and ways to configure it, so I decided to create a small tool where you can enter all your settings and credentials and which creates a pre-configured `docker-compose.yml` which you can simply use to set up shinpuru on your server.
Currently, I am in the process of re-implementing the whole web interface of shinpuru. If you want to know why and how far it already has been processed yet, please take a look at issue #370. With this release, you can check out the new interface by going to the `/beta` route in the web interface. But please, keep in mind that this is a very early state of development. A lot of features are still missing or only partly implemented and the user experience might be impaired.

https://user-images.githubusercontent.com/16734205/158845896-50eb4869-fa2a-42f0-887c-0b946ddcecd0.mp4
![](https://user-images.githubusercontent.com/16734205/178149927-2b100aa8-f33e-403c-8b38-2d2d4afdca18.gif)

Simply download the tool from the releases below, execute it in your terminal, enter your settings and credentials and then you will have a ready to go Docker Compose set up to be deployed to your server.
# Duration UX Improvements

# Report QoL Changes

Previosuly, you were able to report, kick and ban users using the `type` parameter of the report command. On the one side, this is highly unintuitive because people more likely expect a ban and kick command for each action separately. Also, this is very inconsistent with the `mute` command, which is actually also just a report type with extra actions like banning an kicking as well at it has its own command.

So, with report you can now only create, list and revoke reports and banning as well as kicking members is done with both separate commands `ban` and `kick`.

This change also results in some changes to the permissions.
- `sp.guild.mod.report.kick` is now `sp.guild.mod.kick`
- `sp.guild.mod.report.ban` is now `sp.guild.mod.ban`

# Starboard Changes [#369 <small>*nice*</small>]

When posing message with links to images or videos, these are extracted from the message and put into the embed itself when voted into the starboard.

Also, videos are now properly displayed in the web interface. And yes, autoplay is disabled and the volume is muted by default. 😉

![](https://user-images.githubusercontent.com/16734205/158994685-eae81863-77c0-4e82-b05e-a01b273a1577.gif)

# Minor Changes

- The guild log order in the web inetrface is now descending starting with the latest entries. This is way more intuitive and easier to look for recent issues. [#366]

- shinpuru now reads a `.env` file in the directory of the executable and applies it to the environment vaiables.

# Bug Fixes

- Fixed a bug which results in a `nil` author on a message retrieved from the cache which lead to a panic when voting such a message into the starboard. [#366]

- Not available or deleted starboard channels are now properly cleared from the settings when voting messages into it.

# Code Base

So that go 1.18 has now officially being released, you can now compile shinpuru with the latest version of the Go toolchain instead of using a pre-release build.
All duration parsing of commands has now been exchanged from the [default Go Implementation](https://pkg.go.dev/time#ParseDuration) to a [custom implementation](https://github.com/zekroTJA/shinpuru/blob/dev/pkg/timeutil/timeutil.go#L49-L117) which allows more time units like days (`d`) or weeks (`w`). Also, it makes the parsing more flexible. For example, you can use spaces between units (example `1d 3h`) or you can even subtract values (example `1d-2h` == `22h`). This affects all commands which take a duration parameter like `/ban` or `/mute`.

# Docker

Expand Down
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN go mod download
RUN go build -o ./bin/shinpuru ./cmd/shinpuru/main.go

# ------------------------------------------------------------
# --- STAGE 2: Build Web App Package
# --- STAGE 2.1: Build Web App Package
FROM node:16-alpine AS build-fe
WORKDIR /build

Expand All @@ -27,6 +27,18 @@ RUN yarn
RUN npx ng build --configuration production \
--output-path dist

# ------------------------------------------------------------
# --- STAGE 2.2: Build Web App Package
FROM node:16-alpine AS build-fenew
WORKDIR /build

# Copy web source files
COPY web.new .
# Get dependencies
RUN yarn
# Build static web app files
RUN yarn build --base=/beta/ --outDir=dist

# ------------------------------------------------------------
# --- STAGE 3: Final runtime environment
FROM alpine:3 AS final
Expand All @@ -35,6 +47,7 @@ WORKDIR /app
# Copy build artifacts from previous stages
COPY --from=build-be /build/bin .
COPY --from=build-fe /build/dist web/dist/web
COPY --from=build-fenew /build/dist web.new/dist/web
# Add CA certificates
RUN apk add ca-certificates
# Prepare directories
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ GOLINT = golint
GREP = grep
NPM = npm
PRETTIER = prettier
NG = npx ng
YARN = yarn
DOCKERCOMPOSE = docker-compose
SWAGGO = swag
SWAGGO = swag
SWAGGER2MD = swagger-markdown
###############################################

Expand Down Expand Up @@ -99,16 +99,15 @@ cleanup:
PHONY += fe
fe:
cd $(CURDIR)/web && \
$(NG) build --configuration production
$(YARN) run build

PHONY += copyfe
copyfe:
cp -R web/dist/web/* internal/util/embedded/webdist

PHONY += runfe
runfe:
cd ./web && \
$(NG) serve --port=8081
cd ./web && $(YARN) start

PHONY += prettify
prettify:
Expand Down
Loading