Skip to content

Commit

Permalink
Updating readme and config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jenga201 committed Jun 10, 2019
1 parent 79f3da1 commit 268d024
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 48 deletions.
49 changes: 15 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,28 @@
# Intro
The NIBL API will be used to view XDCC bots and search for pack listings

This is written in Spring Boot (of which I have little experience) and uses a MySQL database.
This is written in Spring Boot and uses a MySQL database.

Documentation on RESTful calls is handled in Swagger

#### Swagger URL
http://{Server IP}:8080/swagger-ui.html
http://{Server IP}/swagger-ui.html

# Setup

## Required Software
1) Java 1.8
2) Maven
3) MySQL
Docker

## Database
1) Import the database schema (db/schema.sql) and data (db/data.sql)
2) Update the mysql username and password (src/main/resources/application.properties)

Yes, I know the schema is not perfect, it was written in 2007.
I will eventually update the schema to JPA standards while rewriting the software that populates it.

## App
1) mvn clean install
2) java -jar target/nibl-api.jar

# Debug

## Database
JPA is good about throwing errors if the database structure does not map to annotations
or Java objects properly.

You should see errors during start-up which tell you what is wrong.

## App
Log levels can be adjusted in the application.yml file.

Defaults are;

org.springframework.boot.env.PropertySourcesLoader: ERROR
org.springframework.web: ERROR
com.nibl: ERROR
org.hibernate.SQL: ERROR


Uses the same database from ircBot

## Run App
```
sudo docker build -f Dockerfile -t niblapi . \
&& \
sudo docker run -d \
--net='my-bridge' \
--name=niblapi \
-v /opt/niblapi/logs/:'/logs':'rw' \
niblapi
```
13 changes: 3 additions & 10 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spring.datasource.url=jdbc:mysql://mysql:3306/ooinuza?zeroDateTimeBehavior=convertToNull&useSSL=false&useUnicode=yes&characterEncoding=UTF-8
spring.datasource.username=x
spring.datasource.password=x
spring.datasource.url=jdbc:mysql://niblmysql:3306/ooinuza?zeroDateTimeBehavior=convertToNull&useSSL=false&useUnicode=yes&characterEncoding=UTF-8
spring.datasource.username=ooinuza
spring.datasource.password=niblempire

server.compression.enabled=true
server.compression.mime-types=application/json
Expand All @@ -24,12 +24,5 @@ logging.level.*=ERROR
logging.level.com.nibl.api.*=INFO

nibl.cache.refresh.time=900000
nibl.anilist.id=x
nibl.anilist.secret=x

server.port: 80
#security.require-ssl=true
#server.ssl.key-store:x
#server.ssl.key-store-password: x
#server.ssl.keyStoreType: PKCS12
#server.ssl.keyAlias: tomcat
4 changes: 0 additions & 4 deletions start.sh

This file was deleted.

0 comments on commit 268d024

Please sign in to comment.