Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
JVMerkle committed Apr 16, 2021
2 parents b7d1179 + 6449e7a commit 9904916
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 149 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.git/
.github/

.gitattributes
docker-compose.yml
Expand Down
35 changes: 0 additions & 35 deletions .github/ISSUE_TEMPLATE/bug-report--de-.md

This file was deleted.

36 changes: 0 additions & 36 deletions .github/ISSUE_TEMPLATE/bug-report--en-.md

This file was deleted.

29 changes: 0 additions & 29 deletions .github/ISSUE_TEMPLATE/feature-request--de-.md

This file was deleted.

29 changes: 0 additions & 29 deletions .github/ISSUE_TEMPLATE/feature-request--en-.md

This file was deleted.

11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# TS3 Ranksystem
![latest-tsn-rs-compat](https://jvmerkle.de/badges/latest-tsn-rs-compat.svg)
![docker-build](https://img.shields.io/docker/cloud/build/jvmerkle/ts3-ranksystem.svg)
![docker-automated](https://img.shields.io/docker/cloud/automated/jvmerkle/ts3-ranksystem.svg)
![docker-pulls](https://img.shields.io/docker/pulls/jvmerkle/ts3-ranksystem.svg)
![compat](https://jvmerkle.de/badges/latest-tsn-rs-compat.svg) ![build](https://img.shields.io/docker/cloud/build/jvmerkle/ts3-ranksystem.svg) ![auto](https://img.shields.io/docker/cloud/automated/jvmerkle/ts3-ranksystem.svg) ![pulls](https://img.shields.io/docker/pulls/jvmerkle/ts3-ranksystem.svg)

System that automatically grants ranks in the form of server groups for online time or online activity to users, using the given server groups of the TS3 server.

This is a modified fork of the TSN-Ranksystem which is updated irregularly to a stable version. It is intended to be fully compatible to TSN-Ranksystem at all times. The changeset on branch `develop` is always rebased onto TSN-Ranksystem and later on merged into `master`.
This is a modified fork of the TSN-Ranksystem which is updated irregularly to a stable version. It is intended to be **fully compatible to TSN-Ranksystem at all times**. The changeset on branch `develop` is always rebased onto TSN-Ranksystem and later on merged into `master`.

Please make sure that your TSN-Ranksystem (database) version is not above the (database) version of this fork (downgrade).

## Docker
You can find the docker images on docker hub as [jvmerkle/ts3-ranksystem](https://hub.docker.com/r/jvmerkle/ts3-ranksystem).
Please note that the container **MUST BE accessed via a trusted proxy server only** (e.g. nginx).
Make sure to set `BASE_HREF` to the relative URL path of the rank system (e.g. `https://foobar.com/frank/ranksystem` => `BASE_HREF=/frank/ranksystem/`) in the `docker-compose.yml`
Make sure to set `BASE_HREF` to the absolute URL path of the rank system (e.g. `https://foobar.com/frank/ranksystem` => `BASE_HREF=/frank/ranksystem/`) in the `docker-compose.yml`

### First time setup
Enable the `INSTALL_MODE=1` in the file `docker-compose.yml` by uncommenting the line. Then start the rank system with:
```sh
docker-compose up
docker-compose up -d
```
Navigate to the `install.php` with your browser and set up the rank system.
After performing the first time setup re-edit the `docker-compose.yml` by commenting or removing the `INSTALL_MODE`.
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ volumes:
services:
ranksystem:
image: jvmerkle/ts3-ranksystem
restart: on-failure
restart: always
stop_signal: SIGTERM
depends_on:
- ranksystem-db
Expand All @@ -29,7 +29,7 @@ services:

ranksystem-db:
image: mariadb
restart: on-failure
restart: always
volumes:
- ranksystem-db:/var/lib/mysql
environment:
Expand Down
23 changes: 18 additions & 5 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms
}

if ((!isset($_POST['install']) && !isset($_POST['confweb'])) || $err_lvl == 1 || $err_lvl == 2 || $err_lvl == 3) {
$dbtype = "";
$dbhost = "";
$dbname = "";
$dbuser = "";
$dbpass = "";

if(isset($show_warning)) {
$dbhost = $_POST['dbhost'];
$dbname = $_POST['dbname'];
Expand All @@ -420,10 +426,17 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms
$dbuser = $_GET['dbuser'];
$dbpass = $_GET['dbpass'];
} else {
$dbhost = "";
$dbname = "";
$dbuser = "";
$dbpass = "";
try {
include "other/dbconfig.php";
$dbtype = $db['type'];
$dbhost = $db['host'];
$dbname = $db['dbname'];
$dbuser = $db['user'];
$dbpass = $db['pass'];
}
catch (ErrorException $ex) {

}
}
?>
<div id="page-wrapper">
Expand All @@ -446,7 +459,7 @@ function install($type, $host, $user, $pass, $dbname, $lang, $mysqlcon, &$err_ms
<div class="form-group">
<label class="col-sm-4 control-label" data-toggle="modal" data-target="#isntwidbtypedesc"><?php echo $lang['isntwidbtype']; ?><i class="help-hover fas fa-question-circle"></i></label>
<div class="col-sm-8">
<select class="selectpicker show-tick form-control required" id="basic" name="dbtype" required>
<select class="selectpicker show-tick form-control required" id="basic" name="dbtype" value="<?php echo $dbtype; ?>" required>
<option disabled value=""> -- select database -- </option>
<option data-subtext="Cubrid" value="cubrid">cubrid</option>
<option data-subtext="FreeTDS / Microsoft SQL Server / Sybase" value="dblib">dblib</option>
Expand Down
10 changes: 5 additions & 5 deletions other/dbconfig.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$db['type']="type";
$db['host']="hostname";
$db['user']="dbuser";
$db['pass']="dbpass";
$db['dbname']="ts3_ranksystem";
$db['type']=""; // Database type
$db['host']=""; // IP address or hostname
$db['user']=""; // Database user name
$db['pass']=""; // Database password
$db['dbname']=""; // Database name
?>

0 comments on commit 9904916

Please sign in to comment.