Skip to content
This repository was archived by the owner on Feb 2, 2020. It is now read-only.

Commit 8ac2342

Browse files
author
RAnders00
committed
Update readme + sample config in dist zip/tar + no more non-boot dist zip/tar
1 parent 5c573c5 commit 8ac2342

File tree

5 files changed

+61
-26
lines changed

5 files changed

+61
-26
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,5 @@ com_crashlytics_export_strings.xml
8787
crashlytics.properties
8888
crashlytics-build.properties
8989
fabric.properties
90+
91+
./application.properties

README.md

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,59 @@ I recommend downloading the `twitch-api-v3-proxy-boot.tar`
1515
(or zip if you prefer) for a full package including
1616
start scripts.
1717

18-
## Build
18+
## Install Java 8
1919

20-
Ensure you have a Java 8 JDK installed, and run:
20+
Java 8 is required, older releases are not supported.
2121

22-
./gradlew build
22+
On Debian, for example:
2323

24-
On windows, run:
24+
sudo apt update
25+
sudo apt install openjdk-8-jre-headless
26+
java -version
2527

26-
gradlew build
28+
Other distributions - google yourself!
2729

28-
Note you do not need to build the project on the target machine,
29-
you can simply copy the result artifact that you built on your
30-
local machine to your server without any problems.
30+
## Unzip
31+
32+
For a fresh install:
33+
34+
sudo mkdir /opt/twitch-api-v3-proxy
35+
sudo tar xvf twitch-api-v3-proxy-boot.tar \
36+
-C /opt/twitch-api-v3-proxy \
37+
--strip-components=1
38+
39+
If you are upgrading (where you dont want to override the configuration file):
40+
41+
sudo mkdir /opt/twitch-api-v3-proxy
42+
sudo tar xvf twitch-api-v3-proxy-boot.tar \
43+
-C /opt/twitch-api-v3-proxy \
44+
--strip-components=1 \
45+
--exclude='./twitch-api-v3-proxy-boot/application.properties'
3146

3247
## Configure
3348

49+
If you downloaded a dist zip/tar, the application.properties
50+
will be included inside the zip/tar. If you are building from source,
51+
copy it from `./src/dist/application.properties.`
52+
3453
Edit `application.properties` with your own client ID.
3554
This client ID is used to look up usernames to user IDs.
3655
For the actual API requests, the proxy passes on your existing sent
3756
`Authorization` header as-is.
3857

39-
You can also set host and address to have the webserver listen on.
40-
41-
Note: If the application.properties is not present in the
42-
working directory, you will get an error message like this:
43-
44-
> `ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'apiResponseController' defined in URL [jar:file:/C:/Users/username/Projects/twitch-api-v3-proxy/build/libs/twitch-api-v3-proxy.jar!/BOOT-INF/classes!/de/zwb3/apiproxy/ApiResponseController.class]: Unexpected exception during bean creation; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'clientId' in value "${clientId}"`
58+
You can also set a different host and address to have the webserver listen on.
4559

4660
## Run
4761

48-
Ensure you have a Java 8 JRE installed, and run:
49-
50-
sudo mkdir /opt/twitch-api-v3-proxy
51-
sudo tar xvf ./build/distributions/twitch-api-v3-proxy-boot.tar -C /opt/twitch-api-v3-proxy --strip-components=1
52-
sudo cp ./application.properties /opt/twitch-api-v3-proxy/
5362
cd /opt/twitch-api-v3-proxy
5463
# run as www-data for security reasons!
5564
sudo -u www-data ./bin/twitch-api-v3-proxy
5665

57-
To run the application, make sure `application.properties`
58-
is present in the working directory.
66+
## Usage with pajbot1
67+
68+
If you are planning on using this proxy service with pajbot1,
69+
update your pajbot1 with the latest patches from:
70+
https://github.com/pajlada/pajbot
5971

6072
## Usage
6173

@@ -71,11 +83,19 @@ which returns a plain text response like this:
7183
> twitch-api-v3-proxy online for 10H6M49.308S,
7284
> 2 usernames in cache, 2016 requests served!
7385
74-
## Usage with pajbot1
86+
## Build
7587

76-
If you are planning on using this proxy service with pajbot1,
77-
update your pajbot1 with the latest patches from:
78-
https://github.com/pajlada/pajbot
88+
Ensure you have a Java 8 JDK installed, and run:
89+
90+
./gradlew build
91+
92+
On windows, run:
93+
94+
gradlew build
95+
96+
Note you do not need to build the project on the target machine,
97+
you can simply copy the result artifact that you built on your
98+
local machine to your server without any problems.
7999

80100
## Known endpoint differences
81101

build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ repositories {
1414
jcenter()
1515
}
1616

17+
def addConfig = {
18+
into('twitch-api-v3-proxy-boot') {
19+
from 'src/dist'
20+
include '*'
21+
}
22+
}
23+
24+
distZip.enabled = false
25+
distTar.enabled = false
26+
27+
bootDistTar addConfig
28+
bootDistZip addConfig
29+
1730
dependencyManagement {
1831
imports {
1932
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Finchley.SR2"

gradlew

100755100644
File mode changed.

application.properties renamed to src/dist/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ logging.level.de.zwb3=DEBUG
44
server.address=127.0.0.1
55
server.port=7221
66

7-
clientId=abcabcabcacbehwuiehfiwhuefiwe
7+
clientId=youNeedToEditThisValue

0 commit comments

Comments
 (0)