diff --git a/README.md b/README.md index 8afc0c7..7bcaee2 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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. @@ -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**: @@ -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 @@ -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. @@ -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) diff --git a/bin/labels.sh b/bin/labels.sh index b30973d..9c274b1 100755 --- a/bin/labels.sh +++ b/bin/labels.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash CONTAINER="${1:-docker-glftpd}" docker image inspect --format='{{ index .Config.Labels "gl.sitebot.setup" }}' "$CONTAINER" diff --git a/docs/Build.md b/docs/Build.md index 9eabc81..872504b 100644 --- a/docs/Build.md +++ b/docs/Build.md @@ -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). diff --git a/docs/Changelog.md b/docs/Changelog.md index adb1456..85f5289 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -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 diff --git a/docs/Compose.md b/docs/Compose.md index 8221b31..df0ce63 100644 --- a/docs/Compose.md +++ b/docs/Compose.md @@ -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" \ diff --git a/docs/Customization.md b/docs/Customization.md index 1ab92bf..22904ee 100644 --- a/docs/Customization.md +++ b/docs/Customization.md @@ -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`. diff --git a/docs/Files.md b/docs/Files.md index f85214c..d91085c 100644 --- a/docs/Files.md +++ b/docs/Files.md @@ -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** || @@ -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 | | ||| diff --git a/docs/Run.md b/docs/Run.md index 403d393..3ab4cf8 100644 --- a/docs/Run.md +++ b/docs/Run.md @@ -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). diff --git a/docs/Variables.md b/docs/Variables.md new file mode 100644 index 0000000..fd7127d --- /dev/null +++ b/docs/Variables.md @@ -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=" url to download gl +GLFTPD_SHA="" 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="" set user 'glftpd' (needs PERM_UDB) +GLFTPD_SITE=1 mount host dir ./glftpd/site /glftpd/site +GLFTPD_PORT="<1234>" change listen (default is 1337) +GLFTPD_PASV_PORTS="<5000-5100>" set passive , set GLFTPD_CONF=1 +GLFTPD_PASV_ADDR="<1.2.3.4>" set passive
, add "1" for internal + NAT e.g. "10.0.1.2 1"; needs GLFTPD_CONF=1 +IRC_SERVERS="" 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 +``` diff --git a/docs/images/glcc.png b/docs/images/glcc.png deleted file mode 100644 index f61c0b0..0000000 Binary files a/docs/images/glcc.png and /dev/null differ diff --git a/docs/images/glcc_small.png b/docs/images/glcc_small.png deleted file mode 100644 index ec7cc3e..0000000 Binary files a/docs/images/glcc_small.png and /dev/null differ