- JDK >= 17
- Maven 3
- MySQL Server >= 8.0.26
application.properties
in the working directoryvernite-2022.private-key.der
in the working directory
To install Java 17 on Windows download it from Oracle.
To install on Debian-based distributions:
$ sudo apt install openjdk-17-jdk-headless
To install Maven 3 follow this guide.
On Debian-based distros you can just:
$ sudo apt install maven
MySQL can be downloaded from dev.mysql.com. Create an empty databases named vernite
and vernite_test
.
Secrets are held in application.properties
in the working directory. Create a file with the content:
spring.mail.password=...
spring.datasource.password=...
githubKey=...
maxmindPassword=...
staticFolder=...
slack.signingSecret=...
slack.clientId=...
slack.clientSecret=...
slack.app.level.token=...
github.client.secret=...
recaptcha.secret=...
spring.mail.password
- it's password to SMTP for sending emails. Other SMTP settings can be configured in./src/main/resources/application.properties
.spring.datasource.password
- password to connect to the database. The default username when connecting isvernite
(hostlocalhost:3306
)githubKey
- you need to create GitHub App and copy keymaxmindPassword
- it is used to check the user location on the session list screen. You can generate a license key on the official MaxMind website.staticFolder
- path to where static files will be storedslack.signingSecret
- slack application signing secret obtained from: Slack appsslack.clientId
- slack application client id obtained from: Slack appsslack.clientSecret
- slack application client secret obtained from: Slack appsslack.app.level.token
- slack application app level token obtained from: Slack appsgithub.client.secret
- github app client secret obtained from Github appsrecaptcha.secret
- TODO: add description
To create a GitHub application you need a GitHub account.
Go to your GitHub account setting
-> developer settings
-> new GitHub app
.
In the setup and callback URL fields enter YOUR_URL/pl-PL/github/
and turn on redirect on update in the post installation
section.
In the webhook URL field enter YOUR_URL/api/webhook/github
and generate and enter the webhook secret to the field and application.properties
file as githubkey
.
In the permissions section change:
Contents
- read and writeDiscussions
- read and writeIssues
- read and writePull requests
- read and write
After the app has been created go to edit
-> permissions and events
and subscribe to: Issues
, Pull request
and Push
.
From the general
section go to private keys
and generate private key
. Convert the downloaded pem file to der format:
openssl x509 -in cert.pem -out cert.der -outform DER
Rename der file to vernite-2022.private-key.der
and copy it to the working directory.
To create a Slack application you need a Slack account.
Go to link and create new app.
In basic information tab create App-Level token and add it to application.properties
.
In Add features and functionality
configure Event subscriptions
:
- Turn them on
- Set request url to
YOUR_URL/api/integration/slack/events
- In section
Subscribe to events on behalf of users
select:message.channels
,message.groups
,message.im
In OAuth & Permission
section add redirect url: YOUR_URL/api/integration/slack/oauth_redirect
.
In User Token Scopes
choose: message.channels
, message.groups
, message.im
.
TODO: add description
To build the backend and run all unit tests during building, execute:
$ mvn clean package
If you want to skip unit tests, e.g. when you don't want to connect to MySQL during building:
$ mvn clean package -DskipTests
After build you can generate jacoco report and javadocs:
$ mvn jacoco:report javadoc:javadoc
- JaCoCo report is available online at https://vernite.github.io/backend/jacoco/
- Javadocs: https://vernite.github.io/backend/apidocs/
Currently, project does not support 3rd plugins, so javadocs are not needed, but this may change in the future.
$ java -jar target/vernite-VERSION.jar
Replace VERSION
with the current version, e.g. 0.0.1-SNAPSHOT
. After the first run, schema database will be automatically created.