GithubHelp home page GithubHelp logo

testauskoira-rs's Introduction

Testauskoira

Testauskoira-rs on yleisbotti, jota käytetään erilaisissa Testausserverin kylmää konetta vaativissa tehtävissä Discordin puolella. Botin tarkoituksena on tukea palvelimen toimintaa. Tämä README.md on varastettu suoraan originaalin testauskoiran repoista.

Botin toimintaa ja sen tietoturvallisuutta voi tutkia tässä repositoriossa, johon on sen lähdekoodi julkaistuna kokonaisuudessaan läpinäkyvyyttä varten. Otamme mieluusti vastaan myös kaikenmuotoisia ominaisuuksia, jos haluat sellaisen koodata ja tehdä pr. Myös issuesissa voit antaa feature requestejä, joita ylläpitäjät tai muut vapaaehtoiset voivat toteuttaa.

Parhaiten apua bottiin saa discordista käyttäjiltä DrVilepis#5329 ja Luukasa#9330.

Ominaisuudet ja tehtävät

Viestistatistiikan kerääminen lukuina tietokantaan

Testauskoira tallentaa tietokantaan viestien määrä/päivä/käyttäjä-dataa. Dataa käytetään analytiikkaan, statistiikan esittämiseen julkisesti kokonaisuutena (viestejä koko palvelimella päivän aikana), sekä aktiivisten käyttäjien palkitsemiseen. Käyttäjien viestien sisältöjä ei tallenneta.

Roolien myöntäminen jäsenille

Testausserverin tarpeiden mukaan Testauskoira toimii apulaisbottina, joka myöntää rooleja jäsenille erilaisten ehtojen täyttyessä. Esimerkiksi itsepalveluna pyytäessä tai jokaiselle jäsenelle palvelimelle liittyessä.

GitHub-organisaatioon kutsuminen

Käyttäjät voivat kutsua itsensä Testausserverin GitHub-organisaatioon sisään itsepalveluna.

Kielletyn sisällön moderoiminen

Botti poistaa kaikki kielletyt tekstinpätkät jotka löytyvät blacklist.txt tiedostosta tässä repositoriossa

Miten tätä vehjettä ajetaan?

Tarvitset .env tiedoston joka sisältää kyseiset arvot:

DATABASE_URL=
DISCORD_TOKEN=
MOD_CHANNEL_ID=
APPLICATION_ID=
GUILD_ID=
AWARD_CHANNEL_ID=
NO_REPORTS_ROLE_ID=
AWARD_ROLE_ID=
SILENCED_ROLE_ID=
GIVEAWAY_DEFAULT_DURATION=
GIVEAWAY_DEFAULT_WINNERS=
GIVEAWAY_DEFAULT_PRIZE=
GIVEAWAY_REACTION_EMOJI=
STATUS_CHANNEL_ID=
RULES_CHANNEL_ID=

Lisäksi sinun tulee ottaa käytöön discordin developer consolesta seuraavat INTENTit:

  • Presence Intent
  • Server Members Intent

Kehitysympäristön pystyttäminen

Vaadittavat ohjelmistot

  • Rust (nightly) (suositellaan asennettavan rustupin avulla)
  • MySQL/MariaDB
  • diesel_cli (Asennetaan esim. cargolla cargo install diesel_cli)

Vaiheittain

  1. Kloonaa tämä repository
  2. Pystytä MySQL/MariaDB tietokanta laitteellesi ja lisää url .env tiedostoon seuraavanlaisesti: DATABASE_URL=mysql://kayttaja:salasana@localhost/TietokannanNimi
  3. Aja komento diesel setup joka valmistelee tietokannan
  4. Lisää loput muuttujat .env:iin
  5. Olet valmis. Nyt voit ajaa cargo run ja aloittaa Testauskoiran devaamisen ;)

Automaattinen julkaiseminen

Repository on konfiguroitu automaattisesti julkaisemaan itsensä halutulle palvelimelle. Palvelin pitää tosin valmistella ensiksi kloonaamalla tämä repository sinne ja asettamalla tiedoston .env-arvot. Kun joku puskee uuden muutoksen myöhemmin main-haaraan ohjelma rakennetaan Githubin palvelimella, pusketaan heidän dockerkuva-arkistoon, ladataan arkistosta tuotantopalvelimelle ja käynnistetään.

Automaattisen julkaisemisen toimiminen vaatii seuraavien salaisten arvojen asettaminen repositoryn (tapahtuu osoitteessa: https://github.com/user/repository/settings/secrets/actions. Arvojen tulee olla:

Avain Arvo
SSH_DIR Hakemisto, jossa kloonattu repo sijaitsee. Esim /home/testauskoira/testauskoira-rs
SSH_IP Tämän tulee olla IP-osoite tai palvelin, jolle halutaan julkaista ohjelma.
SSH_PRIVATE_KEY   Yksityinen SSH-avain, jolla voi tunnistautua palvelimelle.
SSH_USER   Käyttäjänimi, jolla yritetään kirjautua SSH:n yli.

testauskoira-rs's People

Contributors

lajp avatar drvilepis avatar roytakanen avatar mixu78 avatar chicken avatar ihmemaassa avatar ahnl avatar eldemarkki avatar kymppi avatar romeq avatar

Stargazers

 avatar Jesse Keskelä avatar  avatar zeriax avatar Lukáš Hozda [magnusi] avatar Kostas Thelouras avatar Iiro Heinonen avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

testauskoira-rs's Issues

Use timeout

Use the Discord provided timeout moderation for silencing offenders instead of a role. The current role system is vulnerable to permission misconfiguration.

Message count logging mismatch

It seems like the message counts don't match with the actual count of Discord messages.

Example

Messages counted by Discord: (422)
image

Messages counted by Testauskoira: (303)
image

Add a timeout command

Discord's UI is crap so a command to timeout someone for a custom period of time would be nice

Add a warn command

Command to keep track of warnings on users, Like shared notes for moderators. /warn add and /warn list. Maybe also DM the warned user.

Self-service roles

Create a slash command to add roles to oneself. The idea is to let people add custom roles to itself, such as @csgo @karhu or other roles.

  • /rooli (no params)
  • Returns an interaction response with multiselect dropdown to choose roles

More restrictive vote command duration

Currently there is possibility to input negative values for duration which makes the vote duration 100+ years although vote instantly ends. I dont think this is intended behavior / there shouldn't be need for longer votes than max 1month or so?

Add contribution guidelines

This is more of a reminder for me to add contribution guidelines, as the project is becoming more important, and this would mean less work for the owner.

Vote feature

Testauskoira could be even more useful, if it had a voting feature.

A vote should be initiated with a command by admins, and a message/embed should appear on channel defined in settings.

By adding reactions, people should be able to vote.

Add a way for admins to un-silence a member

Currently there is no way to un-silence a member aka. remove them from the SilencedMembers table.
I suggest we add a /unsilence (or similar) that is available for the admins.

Don't hard-code the rules channel id

The channel id at the end of this line should probably be specified in the .env file:

m.content("Sinut on hiljennetty huonon käyttäytymisen vuoksi arvojäsenten toimesta.\n\nMikäli haluat keskusteluoikeutesi takaisin, voit olla yhteydessä Mastermindeihin joko yksityisviestitse tai sähköpostitse [email protected]. Tarkistathan sääntömme kanavalta <#798799175072219136>.")

Remove notification to offenders

Remove the direct message sent to users about being reported. This is an easily abusable feature to send unsolicited direct messages to users. There's also absolutely no need for this as only the council needs to know the reported messages. In fact this only benefits the trolls because it serves as a warning to do as much damage as possible before being silenced.

Inform offender of being silenced by direct message

Send a direct message to the reported offender when being silenced, to inform them about being silenced for breaking rules and explain how to get unsilenced.

Direct message along these lines:

Sinut on hiljennetty huonon käyttäytymisen vuoksi arvojäsenten toimesta.

Mikäli haluat keskusteluoikeutesi takaisin, voit olla yhteydessä Mastermindeihin joko yksityisviestitse tai sähköpostitse [email protected]. Tarkistathan sääntömme kanavalta <#798799175072219136>.

Database uses unoptimal datatypes

the database currently stores information that is handled as an u64 in i64, which causes less clean code and more lines of code, that is harder to work with, and is in general just dumb that it uses i64 instead of u64.

Translate UI to Finnish

It is weird that in the current state some of the buttons and messages are in English while others are in Finnish.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.