Skip to content

Commit 4c2e37a

Browse files
authored
Merge pull request #6 from derogab/dev
v1.4.1
2 parents 01d0135 + 66876d4 commit 4c2e37a

File tree

9 files changed

+965
-2198
lines changed

9 files changed

+965
-2198
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Node
2+
node_modules
3+
# Logs
4+
logs/*.log
5+
# Private contents
6+
private/*
7+
!private/*.tpl

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
config.yml
1+
# Node
22
node_modules
3+
# Logs
34
logs/*.log
4-
routes/explicit.js
5+
# Private contents
6+
private/*
7+
!private/*.tpl

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM node:10
2+
3+
# Create app directory
4+
WORKDIR /bot
5+
6+
# Install app dependencies
7+
# A wildcard is used to ensure both package.json AND package-lock.json are copied
8+
# where available (npm@5+)
9+
COPY package*.json ./
10+
RUN yarn
11+
12+
# Copy app
13+
COPY . .
14+
15+
# Run command
16+
CMD [ "node", "bot.js" ]

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@
33
</p>
44
<h2 align="center">A clown bot to cheer up conversations in own university chat group</h2>
55

6-
### Installation
7-
```
8-
npm install
9-
```
10-
116
### Configuration
12-
Copy `config.yml.tpl` template in `config.yml` w/ your info.
7+
Copy `config.yml.tpl` template in `config.yml` with your info.
138

14-
### Usage
9+
### Extra
10+
Copy `extra.js.tpl` template in `extra.js` to add extra features.
11+
12+
### Start
13+
##### Using docker
14+
```
15+
docker run \
16+
-dit \
17+
--mount type=bind,source=/path/to/host/private/,target=/bot/private \
18+
derogab/unisharebot
19+
```
20+
Replace `/path/to/host/private/` with absolute path to your private folder (containing config and extra).
21+
##### Using source
1522
```
16-
npm start
23+
npm install && npm start
1724
```
1825

1926
### License

bot.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const YAML = require('yaml');
77
* =====================
88
* Get data from /config.yml and /package.json
99
*/
10-
const file = fs.readFileSync('./config.yml', 'utf8');
10+
const file = fs.readFileSync('./private/config.yml', 'utf8');
1111
const config = YAML.parse(file);
1212
const info = require('./package.json');
1313

@@ -42,14 +42,14 @@ require(__dirname + '/routes/callbacks')(bot, info, config, auth);
4242
require(__dirname + '/routes/inline_query')(bot, info, config, auth);
4343

4444
/**
45-
* Router Explicit
45+
* Router Extra
4646
* =====================
47-
* Uncensored content / Parental Advisory disabled
47+
* Extra private contents
4848
*/
4949

50-
fs.stat('routes/explicit.js', function(err, stat) {
50+
fs.stat('private/extra.js', function(err, stat) {
5151
if(err == null) {
52-
require(__dirname + '/routes/explicit')(bot, info, config, auth);
52+
require(__dirname + '/private/extra')(bot, info, config, auth);
5353
}
5454
});
5555

0 commit comments

Comments
 (0)