Skip to content

Commit 3d060b2

Browse files
authored
Merge pull request #4 from LickABrick/master
Update base to 1.3.23
2 parents cebee01 + bbc0686 commit 3d060b2

File tree

96 files changed

+3677
-1504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3677
-1504
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report [DE]
3+
about: Melde uns dein Problem, um zur Verbesserung beizutragen.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Beschreibung | unterhalb ausfüllen
11+
-- | --
12+
Ranksystem Version | 1.3._XX_
13+
Nutzt du TeamSpeak oder TeaSpeak? |
14+
Link zu deiner Ranksystem Statistik Seite | _optional_
15+
Pastebin Link zu deiner Ranksystem Log *¹ |
16+
17+
---
18+
19+
### 1) Was hast du getan?
20+
21+
22+
### 2) Was war deine Erwartung?
23+
24+
25+
### 3) Was ist stattdessen passiert?
26+
27+
28+
---
29+
30+
#### *¹ Ranksystem Log - HOW-TO
31+
- Wechsel den Log-Level zu `6 - Debug` (-> Webinterface -> Anderes -> Log-Level).
32+
- Wechsel die Sprache zu `EN english` (-> Webinterface -> Anderes -> Sprache).
33+
- Starte den Ranksystem Bot neu und lasse ihn für mind. 10 Minuten laufen (-> Webinterface -> Start / Stop Bot -> Bot neu starten).
34+
- Kopiere einen Auszug aus der Ranksystem Log, welche mindestens auch den letzten Neustart enthält (-> Webinterface -> Start / Stop Bot -> unten).
35+
- Bitte nutze https://pastebin.com/ um die Log zu teilen.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report [EN]
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
11+
Description | Fill out below
12+
-- | --
13+
Ranksystem Version | 1.3._XX_
14+
Are you using TeamSpeak or TeaSpeak? |
15+
Link to your Ranksystem Stats page | _optional_
16+
Pastebin Link to your Ranksystem Log *¹ |
17+
18+
---
19+
20+
### 1) What did you do?
21+
22+
23+
### 2) What result did you get?
24+
25+
26+
### 3) What result did you expect?
27+
28+
29+
---
30+
31+
#### *¹ Ranksystem Log - HOW-TO
32+
- Change the Log-Level to `6 - Debug` (-> Webinterface -> Other -> Log-Level).
33+
- Change the default language to `EN english` (-> Webinterface -> Other -> Language).
34+
- Restart the Ranksystem Bot and let it run for at least 10 minutes (-> Webinterface -> Start / Stop bot -> Restart bot).
35+
- Add a Ranksystem-Log extract which contains all since the last restart (-> Webinterface -> Start / Stop bot -> at bottom).
36+
- Please use https://pastebin.com/ for sharing the log.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Feature request [DE]
3+
about: Schlage eine Idee für das Projekt vor
4+
title: ''
5+
labels: Feature request
6+
assignees: ''
7+
8+
---
9+
10+
Unterscheide, ob es sich um ein bestehendes oder ein neues Feature handelt....
11+
12+
**Vorhandenes Feature**
13+
14+
***1) Ich beziehe mich auf das folgende bestehende Feature:*****
15+
16+
***2) Was möchtest du hinzufügen oder ändern?*****
17+
18+
***3) Was wäre der Vorteil?*****
19+
_Bitte schlage die Funktion nur vor, wenn du denkst, dass auch andere davon profitieren würden._
20+
21+
**Neue Funktion**
22+
23+
***1) Was sollte dieses Feature tun?*****
24+
25+
***2) Wo soll es sich befinden? *****
26+
_In welchem bestehenden Teil des Ranksystems würdest du diese neue Funktion hinzufügen?_
27+
28+
***3) Was wäre der Nutzen?*****
29+
_Bitte schlage die Funktion nur vor, wenn du denkst, dass auch andere davon profitieren würden._
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Feature request [EN]
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: Feature request
6+
assignees: ''
7+
8+
---
9+
10+
Distinguish whether it refers to an existing or new feature..
11+
12+
**Existing Feature**
13+
14+
***1) I am referring to the following existing feature:***
15+
16+
***2) What do you want to add or change on it?***
17+
18+
***3) What would be the benefit?***
19+
_Please only report this feature, when you think also other people would have a benefit of it._
20+
21+
**New Feature**
22+
23+
***1) What should this feature do?***
24+
25+
***2) Where should it be located?***
26+
_On which existing part of the Ranksystem you would add this new feature?_
27+
28+
***3) What would be the benefit?***
29+
_Please only report this feature, when you think also other people would have a benefit of it._

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.4-apache
1+
FROM php:8.2-apache
22

33
RUN apt-get update && \
44
apt-get install -y libcap2-bin tini libzip-dev && \

api/index.php

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
require_once('../other/config.php');
44

55
start_session($cfg);
6+
$lang = set_language(get_language());
67

78
error_reporting(E_ALL);
89
ini_set("log_errors", 1);
910
set_error_handler("php_error_handling");
10-
ini_set("error_log", $cfg['logs_path'].'ranksystem.log');
11+
ini_set("error_log", $GLOBALS['logfile']);
1112

1213
header("Content-Type: application/json; charset=UTF-8");
1314

@@ -48,7 +49,93 @@
4849
$order = (isset($_GET['order']) && strtolower($_GET['order']) == 'desc') ? 'DESC' : 'ASC';
4950
$part = (isset($_GET['part']) && is_numeric($_GET['part']) && $_GET['part'] > 0) ? (($_GET['part'] - 1) * $limit) : 0;
5051

51-
if (isset($_GET['groups'])) {
52+
if (isset($_GET['bot'])) {
53+
if(!isset($_GET['check']) && !isset($_GET['restart']) && !isset($_GET['start']) && !isset($_GET['stop'])) {
54+
$json = array(
55+
"usage" => array(
56+
"_desc" => array(
57+
"0" => "You are able to use bot commands with this function (start, stop, ..).",
58+
"1" => "Use the Parameter, which are described below!",
59+
"2" => "",
60+
"3" => "Return values are:",
61+
"4" => "- 'rc'",
62+
"5" => "- 'msg'",
63+
"6" => "- 'ranksystemlog'",
64+
"7" => "",
65+
"8" => "# RC",
66+
"9" => "The return Code of the transaction (i.e. start process):",
67+
"10" => "0 - EXIT_SUCCESS",
68+
"11" => "1 - EXIT_FAILURE",
69+
"12" => "",
70+
"13" => "# MSG",
71+
"14" => "An additional message of the process. In case of EXIT_FAILURE, you will receive here an error message.",
72+
"15" => "",
73+
"16" => "# RANKSYSTEMLOG",
74+
"17" => "A short log extract of the last rows of the Ranksystem logfile to get more information about the Bot itself.",
75+
),
76+
"check" => array(
77+
"desc" => "Check the Ranksystem Bot is running. If not, it will be started with this.",
78+
"usage" => "Use \$_GET parameter 'check' without any value",
79+
"example" => "/api/?bot&check"
80+
),
81+
"restart" => array(
82+
"desc" => "Restarts the Ranksystem Bot.",
83+
"usage" => "Use \$_GET parameter 'restart' without any value",
84+
"example" => "/api/?bot&restart"
85+
),
86+
"start" => array(
87+
"desc" => "Starts the Ranksystem Bot.",
88+
"usage" => "Use \$_GET parameter 'start' without any value",
89+
"example" => "/api/?bot&start"
90+
),
91+
"stop" => array(
92+
"desc" => "Stops the Ranksystem Bot",
93+
"usage" => "Use \$_GET parameter 'stop' without any value",
94+
"example" => "/api/?bot&stop"
95+
)
96+
)
97+
);
98+
} else {
99+
$check_permission = 0;
100+
foreach($cfg['stats_api_keys'] as $apikey => $desc) {
101+
if (hash_equals($apikey, $_GET['apikey']) && $desc['perm_bot'] == 1) {
102+
$check_permission = 1;
103+
break;
104+
}
105+
}
106+
if ($check_permission == 1) {
107+
if(isset($_GET['check'])) {
108+
$result = bot_check();
109+
} elseif(isset($_GET['restart'])) {
110+
$result = bot_restart();
111+
} elseif(isset($_GET['start'])) {
112+
$result = bot_start();
113+
} elseif(isset($_GET['stop'])) {
114+
$result = bot_stop();
115+
}
116+
if(isset($result['log']) && $result['log'] != NULL) {
117+
$ranksystemlog = $result['log'];
118+
} else {
119+
$ranksystemlog = "NULL";
120+
}
121+
$json = array(
122+
"rc" => $result['rc'],
123+
"msg" => $result['msg'],
124+
"ranksystemlog" => $ranksystemlog
125+
);
126+
} else {
127+
$json = array(
128+
"Error" => array(
129+
"invalid" => array(
130+
"permissions" => "API Key is not permitted to start/stop the Ranksystem Bot"
131+
)
132+
)
133+
);
134+
echo json_encode($json);
135+
exit;
136+
}
137+
}
138+
} elseif (isset($_GET['groups'])) {
52139
$sgidname = $all = '----------_none_selected_----------';
53140
$sgid = -1;
54141
if(isset($_GET['all'])) $all = 1;
@@ -463,6 +550,11 @@
463550
} else {
464551
$json = array(
465552
"usage" => array(
553+
"bot" => array(
554+
"desc" => "Use this to trigger Bot commands as starting or stopping the Ranksystem Bot.",
555+
"usage" => "Use \$_GET parameter 'bot'",
556+
"example" => "/api/?bot"
557+
),
466558
"groups" => array(
467559
"desc" => "Get details about the TeamSpeak servergroups",
468560
"usage" => "Use \$_GET parameter 'groups'",
@@ -493,4 +585,4 @@
493585
}
494586

495587
echo json_encode($json);
496-
?>
588+
?>

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ volumes:
66

77
services:
88
ranksystem:
9+
hostname: ranksystem
910
image: jvmerkle/ts3-ranksystem
1011
restart: always
1112
stop_signal: SIGTERM
@@ -28,6 +29,7 @@ services:
2829
- DB_PASSWORD=ts3_ranksystem
2930

3031
ranksystem-db:
32+
hostname: ranksystem-db
3133
image: mariadb
3234
restart: always
3335
volumes:

0 commit comments

Comments
 (0)