Archived
1
0
Fork 0

Compare commits

..

No commits in common. "951220a537714cd576f1085b42205692e42bdee0" and "bcbf9ad365c3910f1e03fc52c222491f3ee6575b" have entirely different histories.

2 changed files with 52 additions and 73 deletions

View file

@ -1,49 +1,28 @@
--- ---
kind: pipeline kind: pipeline
type: docker type: docker
name: build and test name: default
trigger: trigger:
event: event:
include: include:
- push - push
steps:
- name: test build docker image
image: plugins/docker
environment:
REVISION: ${DRONE_COMMIT_SHA}
CREATED: ${DRONE_BUILD_CREATED}
SOURCE_URL: ${DRONE_GIT_HTTP_URL}
settings:
purge: true
dry_run: true
repo: varakh/ts3web
username:
from_secret: dockerhub_user
password:
from_secret: dockerhub_key
tags:
- ${DRONE_COMMIT_SHA}
---
kind: pipeline
type: docker
name: publish
trigger:
event:
include:
- cron - cron
branch: branch:
- master - master
steps: environment: &default_environment
- name: publish docker image
image: plugins/docker
environment:
REVISION: ${DRONE_COMMIT_SHA} REVISION: ${DRONE_COMMIT_SHA}
CREATED: ${DRONE_BUILD_CREATED} CREATED: ${DRONE_BUILD_CREATED}
SOURCE_URL: ${DRONE_GIT_HTTP_URL} SOURCE_URL: ${DRONE_GIT_HTTP_URL}
# also change in 'tags' of build docker
TS3WEB_VERSION: 2.2.5
steps:
- name: build docker image
image: plugins/docker
environment:
<<: *default_environment
settings: settings:
purge: true purge: true
repo: varakh/ts3web repo: varakh/ts3web
@ -53,10 +32,9 @@ steps:
from_secret: dockerhub_key from_secret: dockerhub_key
tags: tags:
- latest - latest
# adapt for new releases - 2.2.5
- 2.2.7-SNAPSHOT
- name: notify about publish - name: notify
image: drillster/drone-email image: drillster/drone-email
settings: settings:
subject: "Build failed" subject: "Build failed"
@ -72,4 +50,8 @@ steps:
when: when:
status: status:
- failure - failure
---
kind: signature
hmac: f575a63bd85c4a95593be5e077373216fbd50ad57e6b3d1db56f950e881ed2a5
...

View file

@ -2,14 +2,14 @@
[![Build Status](https://drone.myservermanager.com/api/badges/varakh/ts3web/status.svg)](https://drone.myservermanager.com/varakh/ts3web) [![Build Status](https://drone.myservermanager.com/api/badges/varakh/ts3web/status.svg)](https://drone.myservermanager.com/varakh/ts3web)
_ts3web_ is a free and open-source web interface for TeamSpeak 3 instances. ts3web is a free and open-source web interface for TeamSpeak 3 instances.
The minimalistic approach of this application is intentional. The minimalistic approach of this application is intentional.
* Docker images available on [https://hub.docker.com/r/varakh/ts3web](https://hub.docker.com/r/varakh/ts3web) * Docker images available on [https://hub.docker.com/r/varakh/ts3web](https://hub.docker.com/r/varakh/ts3web)
* Sources are hosted on [https://git.myservermanager.com/varakh/ts3web](https://git.myservermanager.com/varakh/ts3web) * Sources are hosted on [https://git.myservermanager.com/varakh/ts3web](https://git.myservermanager.com/varakh/ts3web)
There are many TeamSpeak 3 web interfaces out. Why should I pick _ts3web_? Free, simple, stateless, easy to extend, There are many TeamSpeak 3 web interfaces out. Why should I pick ts3web? Free, simple, stateless, easy to extend,
standard bootstrap theme. standard bootstrap theme.
The main git repository is hosted at The main git repository is hosted at
@ -45,14 +45,12 @@ General remarks:
* By default, `/var/www/html/application/config/env` is used for bootstrapping necessary configuration, can be set to another parent directory with `ENV_DIR` in docker environment variable, e.g., `ENV_DIR=/data` * By default, `/var/www/html/application/config/env` is used for bootstrapping necessary configuration, can be set to another parent directory with `ENV_DIR` in docker environment variable, e.g., `ENV_DIR=/data`
* By default, `/var/www/html/application/data/snapshots` is used for storing snapshots, path can be changed in the `env` file with `snapshot_dir` * By default, `/var/www/html/application/data/snapshots` is used for storing snapshots, path can be changed in the `env` file with `snapshot_dir`
* By default, `/var/www/html/application/log` is used for storing and reading logs, path can be changed in the `env` file with `log_dir` * By default, `/var/www/html/application/log` is used for storing and reading logs, path can be changed in the `env` file with `log_dir`
* Other `env` configuration values are outlined in the [env example](./config/env.example) file which is also present in the default docker image. * Other `env` configuration values are outlined in the [env.example](./config/env.example) file which is also present in the default docker image.
It's recommended to use the `network=HOST` option for the docker setup. You can also work with other network modes. It's recommended to use the `network=HOST` option for the docker setup, and it will be the only example in this `README` file.
In that case you'll need to assign static networks though for the web interface to work.
Let's start with the `network=HOST` example. Create the docker volumes first. You could also use automatically generated Let's create the docker volumes first. You could also use automatically generated ones by the `docker-compose` file, you
ones by the `docker-compose` file, you would need to remove the `external: true` in the `volumes` section of the would need to remove the `external: true` in the `volumes` section of the `docker-compose.yml` then.
`docker-compose.yml` then.
Create the external volumes: Create the external volumes:
@ -109,11 +107,12 @@ Let's populate our docker volumes **before** we start!
docker run -d --rm --name ts3web_creator -v ts3web-vol:/mnt alpine tail -f /dev/null docker run -d --rm --name ts3web_creator -v ts3web-vol:/mnt alpine tail -f /dev/null
docker exec -it ts3web_creator sh docker exec -it ts3web_creator sh
# edit the env file to your liking, you can start by copying the env.example of this git repository # inside the container, edit the env by copying the example to the docker volume mount path at /data/env
# in config/ and edit to your liking cp /var/www/html/application/config/env /data/env
# edit the env file to your liking
# #
# IMPORTANT: the teamspeak_host should point to your public ip address and # the teamspeak_host should point to your public ip address and must be whitelisted inside the teamspeak server itself
# it must be whitelisted inside the teamspeak server itself
vi env vi env
# create necessary directories and set permissions # create necessary directories and set permissions
@ -129,8 +128,7 @@ exit
docker stop ts3web_creator docker stop ts3web_creator
``` ```
Let's populate the teamspeak container with a proper `whitelist.txt` file. **Ensure that you're Let's populate the teamspeak container with a proper `whitelist.txt` file. See [ensure that you're whitelisting the IP from which the webinterface will issue commands](#whitelisttextfile).
[whitelisting](#whitelist.txt) the IP from which the webinterface will issue commands inside the teamspeak server.
```shell ```shell
docker run -d --rm --name ts3_creator -v ts3-vol:/mnt alpine tail -f /dev/null docker run -d --rm --name ts3_creator -v ts3-vol:/mnt alpine tail -f /dev/null
@ -158,7 +156,7 @@ _Finally_, start the stack with `docker-compose up -d`. Please see the **Reverse
### Reverse proxy ### Reverse proxy
Here's an example on how to configure a reverse proxy for _ts3web_ docker container Here's an example on how to configure a reverse proxy for the web interface docker container
```shell ```shell
root .../public; root .../public;
@ -197,15 +195,16 @@ include fastcgi_params;
* Change directory to project home * Change directory to project home
* Execute `composer install` * Execute `composer install`
* `composer install` * `composer install`
* Do the configuration by coping the `env.example` file to `env` inside the `config/` directory * Do the configuration by coping the `env.example` file (see information above)
* Use a web server _or_ run directly via the embedded PHP server: `php -S localhost:8080 -t public public/index.php`. * Use a web server _or_ run directly via the embedded PHP server: `php -S localhost:8080 -t public public/index.php`.
* Point your browser to [localhost:8080](http://localhost:8080) * Point your browser to [localhost:8080](http://localhost:8080)
* Apply any [whitelist.txt](#whitelist-text-file) changes if you configured `teamspeak_host` differently than `localhost` * Apply any [whitelist.txt](#whitelist-text-file) changes if you configured `teamspeak_host` differently
than `localhost`
### Upgrade ### Upgrade
* Change directory to project home * Change directory to project home
* `git pull` (be sure to be on `master` branch!) * `git pull`
* `composer update` * `composer update`
## Troubleshooting / F.A.Q ## Troubleshooting / F.A.Q
@ -217,8 +216,8 @@ You might get one of these messages:
> I always get `flood client` message when clicking anywhere in the web interface. > I always get `flood client` message when clicking anywhere in the web interface.
The web UI uses query commands _a lot_ to the TeamSpeak server! When your instance is up and running, you should be The web UI uses query commands _a lot_! When your instance is up and running, you should be able to change the following
able to change the following setting, e.g. directly in your database (MySQL or sqlite). setting, e.g. directly in your database (MySQL or sqlite).
```ini ```ini
serverinstance_serverquery_flood_commands = 9999 serverinstance_serverquery_flood_commands = 9999
@ -233,26 +232,12 @@ You're probably on a docker environment and the TeamSpeak server is queried thro
resides behind a web server, so the TeamSpeak server thinks that the _remote web server IP address_ invokes the query resides behind a web server, so the TeamSpeak server thinks that the _remote web server IP address_ invokes the query
commands and thus blacklists it. commands and thus blacklists it.
You need define an exception for you server's IP in a [`whitelist.txt`](#whitelist.txt) file and include it in You need define an exception for you server's IP in a [`whitelist.txt`](#whitelisttextfile) file and include it in
your TeamSpeak application. your TeamSpeak application.
You can also add the desired IP to `query_ip_allowlist.txt` and `query_ip_whitelist.txt` within the TeamSpeak 3 Server You can also add the desired IP to `query_ip_allowlist.txt` and `query_ip_whitelist.txt` within the TeamSpeak 3 Server
data directory. data directory.
<a name="whitelist.txt"></a>
### What do I need to type into the `whitelist.txt`?
The following illustrates a valid `whitelist.txt` file which can be used for the above `docker-compose` setups. You need
to replace `your-public-ip` with the TeamSpeak's public IP address if required or remove the fixed internal docker IP if
you're on `network=HOST` mode.
```
127.0.0.1
::1
10.5.0.5
your-public-ip
```
<a name="dockerperms"></a> <a name="dockerperms"></a>
### I always get `no write permissions` or something similar when trying to save snapshots or when a log entry is created. ### I always get `no write permissions` or something similar when trying to save snapshots or when a log entry is created.
@ -261,6 +246,20 @@ docker volume has the correct permissions. The user which is used in the docker
Change owner permissions recursively with `chown -R 65534:65534 /path/to/dir`. Change owner permissions recursively with `chown -R 65534:65534 /path/to/dir`.
<a name="whitelisttextfile"></a>
### What's a whitelist.txt and why do I need it?
The following illustrates a valid `whitelist.txt` file which can be used for the above `docker-compose` setups. You need
to replace `your-public-ip` with the TeamSpeak's public IP address if required or remove the fixed internal docker IP if
you're on 'host' mode.
```
127.0.0.1
::1
10.5.0.5
your-public-ip
```
## Development ## Development
Contributions are welcome! Contributions are welcome!
@ -269,7 +268,6 @@ Contributions are welcome!
* Set a date in the `CHANGELOG.md` file * Set a date in the `CHANGELOG.md` file
* Remove `SNAPSHOT` from the version in `Constants.php` * Remove `SNAPSHOT` from the version in `Constants.php`
* Adapt the occurrences inside the `.drone.yml` with the new version
* Build the docker image from the project * Build the docker image from the project
* if necessary, add GitHub access token to let composer pull dependencies within the image correctly: * if necessary, add GitHub access token to let composer pull dependencies within the image correctly:
add `&& composer config --global --auth github-oauth.github.com <token> \` before the `composer install` command, add `&& composer config --global --auth github-oauth.github.com <token> \` before the `composer install` command,
@ -282,9 +280,8 @@ Contributions are welcome!
1. Branch from `master` to `release/prepare-newVersionNumber` 1. Branch from `master` to `release/prepare-newVersionNumber`
2. Add `-SNAPSHOT` to the version in `Constants.php` and increase it 2. Add `-SNAPSHOT` to the version in `Constants.php` and increase it
3. Adapt the occurrences inside the `.drone.yml` with the new version 3. Merge this branch to `patch` or/and `dev` respectively
4. Merge this branch to `patch` or/and `dev` respectively 4. Don't forget to clean up all created branches
5. Don't forget to clean up all created branches
### Helpers ### Helpers