mirror of
https://github.com/tiyn/wiki.git
synced 2025-04-19 06:07:44 +02:00
Compare commits
6 Commits
ec908428da
...
8a80618378
Author | SHA1 | Date | |
---|---|---|---|
8a80618378 | |||
f6d0bff2c3 | |||
6271756ac5 | |||
df7a8e3955 | |||
|
dd708095ad | ||
|
47d92e4e94 |
@ -1,11 +1,11 @@
|
||||
# jonohill - docker-openvpn-proxy
|
||||
|
||||
This is a [Docker](/wiki/docker.md) container for an
|
||||
[OpenVPN proxy](/wiki/vpn.md#proxy).
|
||||
[OpenVPN proxy](/wiki/vpn.md#proxy-ovpn).
|
||||
The official container and documentation was made by
|
||||
[jonohill](https://github.com/jonohill/docker-openvpn-proxy).
|
||||
|
||||
## Set-up
|
||||
## Set-Up
|
||||
|
||||
Create the file `rebuild.sh`.
|
||||
Change the settings according to your needs and run `./rebuild.sh` afterwards.
|
||||
@ -26,7 +26,7 @@ Set the following ports with the -p tag.
|
||||
| -------------- | ------------------------ | -------- | ------------ |
|
||||
| `9050` | `8080` | HTTP | proxy port |
|
||||
|
||||
## Environment-variables
|
||||
## Environment-Variables
|
||||
|
||||
Set the following variables with the -e tag.
|
||||
|
||||
|
@ -8,7 +8,33 @@ The official container and documentation was made by
|
||||
## Set-up
|
||||
|
||||
Create the file `rebuild.sh`.
|
||||
Change the settings according to your needs and run `./rebuild.sh` afterwards.
|
||||
Change the settings according to your needs.
|
||||
|
||||
Then run the following commands.
|
||||
Change `<VPN.SERVERNAME.COM>` to the URL the VPN is accessible at.
|
||||
If not already done set a port forward or something similar.
|
||||
|
||||
```sh
|
||||
docker volume create --name openvpn
|
||||
docker run -v openvpn:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://<VPN.SERVERNAME.COM>
|
||||
docker run -v openvpn:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki
|
||||
```
|
||||
|
||||
Afterwards run `./rebuild.sh`.
|
||||
|
||||
## Usage
|
||||
|
||||
### Create Certificates
|
||||
|
||||
Each device that connects to the [OpenVPN](/wiki/vpn.md#openvpn) server should
|
||||
have a certificate to connect by.
|
||||
Create a certificate and retrieve it by running the following commands.
|
||||
Change all occurences of `<CLIENTNAME>` to the name of the client.
|
||||
|
||||
```sh
|
||||
docker run -v openvpn:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full <CLIENTNAME> nopass
|
||||
docker run -v openvpn:/etc/openvpn --rm kylemanna/openvpn ovpn_getclient <CLIENTNAME> > <CLIENTNAME>.ovpn
|
||||
```
|
||||
|
||||
## Volumes
|
||||
|
||||
|
89
wiki/docker-images/linuxserver_-_wireguard.md
Normal file
89
wiki/docker-images/linuxserver_-_wireguard.md
Normal file
@ -0,0 +1,89 @@
|
||||
# linuxserver - airsonic-advanced
|
||||
|
||||
This is a [Docker](/wiki/docker.md) container for a
|
||||
[WireGuard](../vpn.md#WireGuard) server.
|
||||
The official container and documentation was made by
|
||||
[linuxserver](https://hub.docker.com/r/linuxserver/wireguard).
|
||||
|
||||
## Set-Up
|
||||
|
||||
Create the file `rebuild.sh`.
|
||||
Change the settings according to your needs.
|
||||
Especially change `<VPN.SERVERNAME.COM>` to the URL the VPN is accessible at.
|
||||
If not already done set a port forward or something similar.
|
||||
`PEERS` describes the number of configs to create for
|
||||
[clients](/wiki/vpn.md#client-wg).
|
||||
It is also possible to give a list of clients to create.
|
||||
Then run `./rebuild.sh`
|
||||
|
||||
## Usage
|
||||
|
||||
### Retrieve Client Certificates by QR-Code
|
||||
|
||||
The client certificates can be retrieved with the following command.
|
||||
`<peer-number>` is the number or identifier of the peer.
|
||||
|
||||
```sh
|
||||
docker exec -it wireguard /app/show-peer <peer-number>
|
||||
```
|
||||
|
||||
After running the command a QR-code should be displayed that describes the
|
||||
certificate.
|
||||
|
||||
## Environment-Variables
|
||||
|
||||
Set the following variables with the -e tag.
|
||||
|
||||
| Name | Usage | Default |
|
||||
| ----------- | --------------- | ------- |
|
||||
| `PUID` | UserID | |
|
||||
| `PGID` | GroupID | |
|
||||
| `TZ` | Timezone | |
|
||||
| `SERVERURL` | URL of server | |
|
||||
| `PEERS` | Number of peers | |
|
||||
|
||||
## Volumes
|
||||
|
||||
Set the following volumes with the -v tag.
|
||||
|
||||
| Outside mount/volume name | Container mount | Description |
|
||||
| ------------------------- | --------------- | ----------------------- |
|
||||
| `wireguard` | `/config` | Configuration files |
|
||||
|
||||
## Ports
|
||||
|
||||
Set the following ports with the -p tag.
|
||||
|
||||
| Container Port | Recommended outside port | Protocol | Description |
|
||||
| -------------- | ------------------------ | -------- | ----------- |
|
||||
| `51820` | `51820` | UDP | VPN port |
|
||||
|
||||
## Additional
|
||||
|
||||
There are some special variables to set.
|
||||
|
||||
| Flag | Usage |
|
||||
| ----------- | ---------------------- |
|
||||
| `--cap-add` | add linux capabilities |
|
||||
|
||||
## rebuild.sh
|
||||
|
||||
```sh
|
||||
#!/bin/sh
|
||||
docker stop wireguard
|
||||
docker rm wireguard
|
||||
docker pull lscr.io/linuxserver/wireguard:latest
|
||||
docker run --name=wireguard \
|
||||
--cap-add=NET_ADMIN \
|
||||
--cap-add=SYS_MODULE \
|
||||
-e PUID=1000 \
|
||||
-e PGID=1000 \
|
||||
-e TZ=Etc/UTC \
|
||||
-e SERVERURL=<VPN.SERVERNAME.COM> \
|
||||
-e PEERS=1 \
|
||||
-p 51820:51820/udp \
|
||||
-v wireguard:/config \
|
||||
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
|
||||
--restart unless-stopped \
|
||||
-d lscr.io/linuxserver/wireguard:latest
|
||||
```
|
@ -36,6 +36,57 @@ mdadm --grow --raid-disks=5 /dev/md0
|
||||
`5` is the number of disks that should be active.
|
||||
For adding disks view the [previous section](#add-diskpartition-to-raid-device).
|
||||
|
||||
In the [following section](#changing-reshape-speed) methods are described that
|
||||
can be tried to affect the performance of the reshaping of a Raid array.
|
||||
|
||||
### Changing Reshape Speed
|
||||
|
||||
Reshaping can take a long time.
|
||||
It can be useful to increase or decrease the speed of it depending on the usage
|
||||
of the raid array while resizing.
|
||||
The following section is based on a guide by
|
||||
[nixCraft](https://www.cyberciti.biz/tips/linux-raid-increase-resync-rebuild-speed.html)
|
||||
and addresses the temporary change of speed of the reshape process of a raid
|
||||
array.
|
||||
|
||||
There are two values that can be temporarily changed to limit the reshape speed.
|
||||
Those are `dev.raid.speed_limit_min` which defaults to `1000` and
|
||||
`dev.raid.speed_limit_max` which defaults to `10000`.
|
||||
|
||||
```sh
|
||||
sysctl -w dev.raid.speed_limit_min=100000
|
||||
sysctl -w dev.raid.speed_limit_max=500000
|
||||
```
|
||||
|
||||
Another value to change is the read-ahead.
|
||||
The current value can be displayed with the following command.
|
||||
|
||||
```sh
|
||||
blockdev --getra /dev/md0
|
||||
```
|
||||
|
||||
And it can be set with the following command.
|
||||
This commands sets the read-ahead to `32MB`.
|
||||
|
||||
```sh
|
||||
blockdev --setra 65536 /dev/md0
|
||||
```
|
||||
|
||||
For [Raid 5](#raid-5) the value `stripe_cache_size` can be important too.
|
||||
It can be changed with the following command which sets it to `32 MiB`.
|
||||
|
||||
```sh
|
||||
echo 32768 > /sys/block/md3/md/stripe_cache_size
|
||||
```
|
||||
|
||||
However make sure not to set it too large, as this can result in a
|
||||
"out of memory" condition.
|
||||
The memory consumed can be calculated with the following formula.
|
||||
|
||||
```txt
|
||||
memory_consumed = system_page_size * nr_disks * stripe_cache_size
|
||||
```
|
||||
|
||||
### Raid 1
|
||||
|
||||
Raid 1 creates a mirror with even amount of drives.
|
||||
|
@ -8,7 +8,7 @@ For Nvidia GPUs to work install the `nvidia` and the `nvidia-utils` package.
|
||||
If you want to easily configure the monitors as described in a later section of
|
||||
this file you can also install `nvidia-settings`.
|
||||
|
||||
There is no initial setup in for of a `xorg.conf` in `/etc/X11` needed
|
||||
There is no initial setup for a `xorg.conf` in `/etc/X11` needed
|
||||
(except for a multiple GPU/APU setup).
|
||||
|
||||
### Configuration
|
||||
|
32
wiki/vpn.md
32
wiki/vpn.md
@ -11,27 +11,51 @@ VPNs feature a server and a client side.
|
||||
[OpenVPN](https://openvpn.net) is a free software to create a VPN via an
|
||||
encrypted TLS connection.
|
||||
|
||||
### Set up
|
||||
### Set up (OVPN)
|
||||
|
||||
In the following sections the different set ups of OpenVPN usages are described.
|
||||
|
||||
#### Server
|
||||
#### Server (OVPN)
|
||||
|
||||
The software can be set up via [Docker](/wiki/docker.md) with the
|
||||
[kylemanna image](./docker-images/kylemanna_-_openvpn.md).
|
||||
Additionally to this a client is needed on the system that need access to the
|
||||
server software.
|
||||
|
||||
#### Client
|
||||
#### Client (OVPN)
|
||||
|
||||
OpenVPN clients can be found for many devices.
|
||||
For Android for example there is
|
||||
[OpenVPN for Android in the F-Droid store](https://f-droid.org/de/packages/de.blinkt.openvpn/).
|
||||
For most linux distributions there is a package called `openvpn`.
|
||||
|
||||
#### Proxy
|
||||
#### Proxy (OVPN)
|
||||
|
||||
For OpenVPN a proxy acts as an imntermediary between the system communicating
|
||||
with the proxy and the OpenVPN server.
|
||||
A proxy can be set up via [Docker](/wiki/docker.md) with the
|
||||
[jonohill image](./docker-images/jonohill_-_docker-openvpn-proxy.md).
|
||||
|
||||
## WireGuard
|
||||
|
||||
[WireGuard](https://www.wireguard.com/) is a free and open-source software that
|
||||
implements encrypted VPNs.
|
||||
It was designed to be especially fast and secure.
|
||||
|
||||
### Setup (WG)
|
||||
|
||||
In the following sections the different set ups of WireGuard usages are described.
|
||||
|
||||
#### Server (WG)
|
||||
|
||||
The software can be set up via [Docker](/wiki/docker.md) with the
|
||||
[linuxserver image](/wiki/docker-images/linuxserver_-_wireguard.md).
|
||||
Additionally to this a [client](#client-wg) is needed on the system that
|
||||
accesses the server.
|
||||
|
||||
#### Client (WG)
|
||||
|
||||
WireGuard clients can be found for many devices.
|
||||
For Android for example there is
|
||||
[Wireguard for Android in the F-Droid store](https://f-droid.org/de/packages/com.wireguard.android/).
|
||||
For most linux distributions there is a package called `wireguard`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user