Skip to content

Commit

Permalink
docs: added variables
Browse files Browse the repository at this point in the history
  • Loading branch information
silv3rr committed Aug 22, 2024
1 parent 98554f3 commit 36b2b67
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 30 deletions.
52 changes: 30 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GitHub container registry: [docker-glftpd](https://github.com/users/silv3rr/pack

Usage: `./docker-run.sh` or `docker run ghcr.io/silv3rr/docker-glftpd`

Without changing anything, this gets a (temp) ftp up and running. Good for testing.
This gets a non-persistent ftp up and running. Good for trying things out.

It uses these default settings:

Expand All @@ -21,31 +21,25 @@ It uses these default settings:
- no permanent config, udb or storage
- does not include zs, bot or webui components

Test connection: `./test/login.sh` (also shows bind ip ;p)

Change password for 'glftpd' user: `GLFTPD_PASSWD="MyPassw0rd" ./docker-run.sh`

## Contents

so, i heard you like reading..

- [docs/Build.md](docs/Build.md)
- [docs/Customization.md](docs/Customization.md)
- [docs/Files.md](docs/Files.md)
- [docs/Run.md](docs/Run.md)
- [docs/Compose.md](docs/Compose.md)

## Customizing

To use permanent configuration, add zipscript, bot and webui components you can set variables before staring docker build/run scripts.
To use permanent configuration, add zipscript, bot and webui components you can set environment variables before starting docker build/run scripts.

**Example**:

```
# run a 'full' permanent glftpd setup, with bot:
GLFTPD_PERM_UDB=1 GLFTPD_CONF=1 GLFTPD_SITE=1 \
IRC_SERVERS="irc.efnet.org:6667 irc2.example.org:6697" IRC_CHANNELS="#pzs #pzs-staff" \
USE_FULL=1 WEBUI=1 ./docker-run.sh
# copy/paste to run a 'full' permanent glftpd setup, with bot and webui:
GLFTPD_PERM_UDB=1 \
GLFTPD_CONF=1 \
GLFTPD_SITE=1 \
IRC_SERVERS="irc.efnet.org:6667 irc2.example.org:6697" \
IRC_CHANNELS="#pzs #pzs-staff" \
USE_FULL=1 \
WEBUI=1 \
./docker-run.sh
```

For details about an even more tailored setup (diferrent ip/port, gl ver etc), or changing the images, see [docs/Customization.md](docs/Customization.md). Also check this page for using sitebot and info about adding 3rd party scripts.
Expand All @@ -62,7 +56,7 @@ Or, for the 'full' glftpd image: `USE_FULL=1 ./docker-run.sh`

Main script that takes care of creating/changing config files and docker runtime args for you. Then it starts glftpd and web-gui container.

Uses environment variables to change settings. Put them in front of script, e.g.
Uses env vars to change settings. Put them in front of script, e.g.
`FORCE=1 GLFTPD_PASV_ADDR="1.2.3.4" ./docker-run.sh`.

**Example**:
Expand All @@ -73,9 +67,6 @@ GLFTPD_CONF=1 GLFTPD_PORT="7113" GLFTPD_PASV_PORTS="8888-9999" ./docker-run.sh
# permanent glftpd.conf, udb and storage:
GLFTPD_CONF=1 GLFTPD_PERM_UDB=1 GLFTPD_SITE=1 ./docker-run.sh
# or, add your own docker args:
./docker-run.sh --network host --volume $(pwd)/site/mp3:/glftpd/site/mp3:rw --volume $(pwd)/site/xxx:/glftpd/site/xxx:rw
```

### docker-build.sh
Expand All @@ -88,6 +79,10 @@ See [docs/Build.md](docs/Build.md)

What about docker compose you ask? Sure, just run `docker compose up --detach`. Details: [docs/Compose.md](docs/Compose.md).

## Variables

See [docs/Variables.md](docs/Variables.md) for all available options.

## WebUI

A web interface can optionally be installed as a bonus. This container an be used to manage glftpd and bot etc from the comfort of your browser.. it's quite the prize.
Expand All @@ -112,6 +107,19 @@ See [docs/Files.md](docs/Files.md) for directory structure.
- why bind mounts? if you want volumes instead .. change `type` in docker-run.sh / docker-compose.yml
- other than that, just `rm -rf ./glftpd; docker rm -f glftpd` to start over

## Contents

so, i heard you like reading..

check these pages for more details about how the docker image and scripts work

- [docs/Build.md](docs/Build.md)
- [docs/Compose.md](docs/Compose.md)
- [docs/Customization.md](docs/Customization.md)
- [docs/Files.md](docs/Files.md)
- [docs/Run.md](docs/Run.md)
- [docs/Variables.md](docs/Variables.md)

## Changes

See [docs/Changelog.md](docs/Changelog.md)
2 changes: 1 addition & 1 deletion bin/labels.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -x
#!/bin/bash

CONTAINER="${1:-docker-glftpd}"
docker image inspect --format='{{ index .Config.Labels "gl.sitebot.setup" }}' "$CONTAINER"
Expand Down
2 changes: 1 addition & 1 deletion docs/Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ After build, `docker-run.sh` should auto detect the new local image.

To update glftpd when there's a new glftpd version out (come December), change `GLFTPD_URL` and `GLFTPD_SHA` in docker-build.sh and rerun script.

For all available build args, see comments inside [/docker-build.sh](/docker-build.sh).
For defaults, current and all available build args: see settings/comments in [docker-build.sh](/docker-build.sh) and [docs/Variables.md](docs/Variables.md).
2 changes: 1 addition & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

moved files to /bin /etc

moved web to own glftpd-gui repo
moved web to own [glftpd-gui](https://github.com/silv3rr/glftpd-webui) repo

- added: gltool
- added: custom commands
Expand Down
2 changes: 1 addition & 1 deletion docs/Compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The customizer script can be run to modify gl/bot config files.

```
# run 'full' permanent glftpd with compose
# ( first set volumes, ports and args etc in yml )
# ( first set volumes, ports and args etc in docker-compose.yml )
GLFTPD_PERM_UDB=1 GLFTPD_CONF=1 GLFTPD_SITE=1 ZS_STATUS=1 BOT_STATUS=1 \
IRC_SERVERS="irc.efnet.org:6667 irc2.example.org:6697" IRC_CHANNELS="#pzs #pzs-staff" \
Expand Down
2 changes: 2 additions & 0 deletions docs/Customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Check labels to see if zs, bot webui or are enabled:

`docker image inspect --format='{{ index .Config.Labels "gl.web.setup" }}' docker-glftpd`

or: `bin/labels.sh`

## ZS

Adds pzs-ng. Configured by editing 'etc/pzs-ng/zsconfig.h' as usual (needs image rebuild to recompile after changing). Requires an image that's build with `INSTALL_ZS=1`.
Expand Down
3 changes: 2 additions & 1 deletion docs/Files.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
| bin/gltool.sh | handles user/group mgmt for webui | |
| bin/hashgen.c | generates gl passwd hash | |
| bin/passwd.sh | | |
| bin/labels.sh | | |
| test/*.sh | test ftp using lftp | |
|||
| **Config templates** ||
Expand All @@ -35,6 +36,6 @@
| entrypoint.d/*.sh | custom commands | |
| custom | custom files | |
|||
| **Web** ||
| **Web** | _moved to own repo_|W
| | nginx cfg, html, css and js for webui | |
|||
18 changes: 15 additions & 3 deletions docs/Run.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,21 @@ The script uses bind mounts with relative paths, e.g.

After config it will check for a local image to start first or if it's not available it'll get the image from github registry.

The container name will be `glftpd` with same hostname, and a `glftpd-web` container using `web` as hostname. Both use the 'shit' network. By default containers gets removed when stopped.
The container name will be `glftpd` with same hostname, and a `glftpd-web` container using `web` as hostname. Both use the 'shit' network. By default containers get removed when stopped.

Runs `docker run --rm --detach --name glftpd --hostname glftpd --publish 1337:1337 --workdir /glftpd docker-glftpd:latest` and any options

For details, see
For all available options, see comments inside [docs/Run.md](docs/Run.md)
**Example**:

```
# remove existing container and run permanent gl on port 9999, with bot and webui:
GLFTPD_PERM_UDB=1 GLFTPD_CONF=1 GLFTPD_SITE=1 GLFTPD_PORT=9999 \
IRC_SERVERS="irc.efnet.org:6667 irc2.example.org:6697" IRC_CHANNELS="#pzs #pzs-staff" \
FORCE=1 USE_FULL=1 WEBUI=1 ./docker-run.sh
# or, to add your own docker args:
./docker-run.sh --network host --volume $(pwd)/site/mp3:/glftpd/site/mp3:rw --volume $(pwd)/site/xxx:/glftpd/site/xxx:rw
```

For defaults, current and all available options: see settings/comments in [docker-run.sh](/docker-run.sh) and [docs/Variables.md](docs/Variables.md).
32 changes: 32 additions & 0 deletions docs/Variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Variables

Build: can be used as env vars, set in `docker-build.sh`, `docker build` or compose

Runtime: can be used as env vars, set in `docker-run.sh`, `docker run` or compose

All build arguments:

```
GLFTPD_URL="<https://...> url to download gl
GLFTPD_SHA="<abc123def>" sha512 hash for downloaded file
INSTALL_ZS=1 uses etc/pzs-ng/zsconfig.h
INSTALL_BOT=1 install eggdrop and ngBot
INSTALL_WEBUI=1 install web interface
```

All runtime options:

```
GLFTPD_CONF=1 mount glftpd/glftpd.conf from host
GLFTPD_PERM_UDB=1 use permanent userdb
GLFTPD_PASSWD="<Passw0rd>" set user 'glftpd' <passwd> (needs PERM_UDB)
GLFTPD_SITE=1 mount host dir ./glftpd/site /glftpd/site
GLFTPD_PORT="<1234>" change listen <port> (default is 1337)
GLFTPD_PASV_PORTS="<5000-5100>" set passive <ports range>, set GLFTPD_CONF=1
GLFTPD_PASV_ADDR="<1.2.3.4>" set passive <address>, add "1" for internal
NAT e.g. "10.0.1.2 1"; needs GLFTPD_CONF=1
IRC_SERVERS="<irc.foo.com:6667>" set bot irc server(s), space delimited
IRC_CHANNELS="<#mychan>" set bot irc channels(s), space delimited
USE_FULL=1 use 'docker-glftpd:full' image
FORCE=1 remove any existing container first
```
Binary file removed docs/images/glcc.png
Binary file not shown.
Binary file removed docs/images/glcc_small.png
Binary file not shown.

0 comments on commit 36b2b67

Please sign in to comment.