Skip to content

Commit

Permalink
zorg Code v4.8.0
Browse files Browse the repository at this point in the history
Merge pull request #71 from zorgch/develop
  • Loading branch information
oliveratgithub authored Dec 27, 2023
2 parents 07bc750 + bf8f73c commit 9b011a5
Show file tree
Hide file tree
Showing 76 changed files with 3,938 additions and 3,517 deletions.
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 86

# Matches multiple files with brace expansion notation
# Set default charset
[*.{php,tpl,js,css,xml,py,json,md}]
charset = utf-8

# 4 space indentation
[*.{py,md}]
indent_style = space
indent_size = 4

# Tab indentation for everything else
[*.{php,tpl,js,css,xml,json}]
indent_style = tab
indent_size = 4
62 changes: 33 additions & 29 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,32 @@ USERIMAGE_EXTENSION=".jpg" # Extension with .-prefix
USERIMAGE_SIZE_LARGE=
USERIMAGE_SIZE_SMALL=
USERIMAGE_DEFAULT="none${USERIMAGE_EXTENSION}" # Must be within USERIMAGES_DIR
ADDLE_MAX_GAMES=
ADDLE_BASE_POINTS=
ADDLE_MAX_POINTS_TRANSFERABLE=
APOD_GALLERY_ID= # Match to gallery_albums-Table `id`
ADDLE_MAX_GAMES=1
ADDLE_BASE_POINTS=1600
ADDLE_MAX_POINTS_TRANSFERABLE=32
BUGTRACKER_FILTER_DEFAULT="?show[]=open&show[]=notdenied&show[]=assigned&show[]=unassigned"
CHESS_DWZ_BASE_POINTS=
CHESS_DWZ_MAX_POINTS_TRANSFERABLE=
FORUM_DEFAULT_MAXDEPTH=
FORUM_THREAD_CLEARCACHE_AFTER= # In Tagen
GALLERY_MAX_PIC_SIZE="['width'=>800, 'height'=>800]"
GALLERY_MAX_THUMBNAIL_SIZE="['width'=>150, 'height'=>150]"
GALLERY_THUMBPAGE="['width'=>4, 'height'=>3, 'padding'=>10]"
GO_OFFSET_PIC=
GO_LINKRADIUS=
GO_FIELDSIZE=
GO_LINEWIDTH=
GO_STARDOTWIDTH=
GO_STONEBIGWIDTH=
GO_LASTSTONEWIDTH=
CHESS_DWZ_BASE_POINTS=1600
CHESS_DWZ_MAX_POINTS_TRANSFERABLE=32
FORUM_DEFAULT_MAXDEPTH=10
FORUM_THREAD_CLEARCACHE_AFTER=30 # In Tagen
GALLERY_MAX_PIC_WIDTH=800 # In Pixel
GALLERY_MAX_PIC_HEIGHT=600 # In Pixel
GALLERY_MAX_THUMB_WIDTH=150 # In Pixel
GALLERY_MAX_THUMB_HEIGHT=150 # In Pixel
APOD_GALLERY_ID= # Match to gallery_albums-Table `id`
GO_OFFSET_PIC=250 # In Pixel
GO_LINKRADIUS=15 # In Pixel
GO_FIELDSIZE=40 # In Pixel
GO_LINEWIDTH=2 # In Pixel
GO_STARDOTWIDTH=10 # In Pixel
GO_STONEBIGWIDTH=190 # In Pixel
GO_LASTSTONEWIDTH=10 # In Pixel
URLPATH_HZ_IMAGES="${URLPATH_IMAGES}hz/"
HZ_MAPS_EXTENSION=".gif"
HZ_MAX_GAMES=
HZ_TURN_TIME= # In Sekunden: 3 Tage
HZ_TURN_COUNT=
HZ_TURN_ADD_MONEY=
HZ_MAX_GAMES=5
HZ_TURN_TIME=259200 # In Sekunden: 3 Tage
HZ_TURN_COUNT=4
HZ_TURN_ADD_MONEY=10
SETI_TEAM_NAME=""
SETI_EMAIL=""
STRING_NOT_FOUND="Reference not found in String list"
Expand All @@ -124,8 +125,8 @@ COOKIE_USERPW="autologin_pw"
SMARTY_CACHE="${APP_ROOT}/data/smartylib/cache/"
SMARTY_COMPILE="${APP_ROOT}/data/smartylib/templates_c/"
SMARTY_DIR="${WWW_ROOT}/smartylib/"
SMARTY_TRUSTED_DIRS="${WWW_ROOT}/scripts/" # (array) with strings
SMARTY_TEMPLATES_HTML="${VIEWS_DIR}" # (array) with strings
SMARTY_TRUSTED_DIRS="${WWW_ROOT}/scripts/" # Comma-separated list of paths
SMARTY_TEMPLATES_HTML="${VIEWS_DIR}" # Comma-separated list of paths
SMARTY_PACKAGES_DIR="${WWW_ROOT}/packages/"
SMARTY_PACKAGES_EXTENSION=".php"
SMARTY_DEFAULT_TPL_ID=
Expand Down Expand Up @@ -166,12 +167,12 @@ TELEGRAM_BOT="" # as registered with @BotFather
TELEGRAM_BOT_API_KEY="" # as provided by @BotFather
TELEGRAM_BOT_API="https://api.telegram.org/bot${TELEGRAM_BOT_API_KEY}/"
TELEGRAM_BOT_API_AUTH_PASSWORD="" # (string) A secret password required to authorise access to the webhook
TELEGRAM_BOT_API_IPWHITELIST="[]" # (array) When using `validate_request`, like: [ '1.2.3.4', '1.1.1.1-2.2.2.2']
TELEGRAM_BOT_API_USERWHITELIST="[]" # (array) An array of Telegram UserIDs that have admin access to your bot (must be integers)
TELEGRAM_BOT_API_SSLCERT_PATH="" # (string) Path to a self-signed certificate (if necessary), like: "/server.crt"
TELEGRAM_BOT_API_IPWHITELIST="" # (comma separated list) When using `validate_request`, like: 1.2.3.4,1.1.1.1-2.2.2.2
TELEGRAM_BOT_API_USERWHITELIST="" # (comma separated list) A list of Telegram UserIDs that have admin access to your bot
TELEGRAM_BOT_API_SSLCERT_PATH="" # (string) Path to a self-signed certificate (if necessary), like: /server.crt
TELEGRAM_BOT_API_CHAT="" # (integer) Chat-ID where the Telegram Bot will post to
TELEGRAM_BOT_API_FILES_DIR="" # (array) List of configurable paths.
TELEGRAM_BOT_API_LOG_DIR="${ERRORLOG_DIR}" # (array) Paths where the log files should be put.
TELEGRAM_BOT_API_FILES_DIR="" # Comma-separated list of paths.
TELEGRAM_BOT_API_LOG_DIR="${ERRORLOG_DIR}" # (string) Path to where the log files should be put.
# - Twitter API
TWITTER_API_KEY=""
TWITTER_API_SECRET=""
Expand All @@ -198,3 +199,6 @@ ZORG_VEREIN_KONTO_IBAN="CH7500781622431172000"
ZORG_VEREIN_KONTO_IBAN_QRBILL="CH9730781622431172000"
ZORG_VEREIN_KONTO_CURRENCY="CHF"
ZORG_VEREIN_KONTO_BESRID=""

# Local Development and Debugging settings:
DEBUG_SCOPE="" # (Optional) A File or Function name to debug
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.log
/vendor
.env
*.code-workspace

# ...and DON'T ignore these things
!.github/
Expand All @@ -21,4 +22,3 @@
!/keys
!/migration
!/scripts
Docker/mysql57
15 changes: 9 additions & 6 deletions Docker/.env.docker
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# === Docker ===
COMPOSE_PROJECT_NAME="zorg"
OS_PLATFORM="linux/x86_64"
HTTP_PORT="80"
HTTPS_PORT="443"
HTTP_PORT=80
HTTPS_PORT=443
DOMAINNAME="zorg.local"
APACHE_USER="www-data"
APACHE_GROUP="www-data"
APACHE_WEBROOT="/var/www"
PHP_Version="7.4"
PHP_Version=7.4
PHP_INI_DIR="/usr/local/etc/php"
MYSQL_VERSION="5.7"
XDEBUG_PORT=9003
XDEBUG_MODES="develop,debug,profile"
XDEBUG_LOGLEVEL=7
MYSQL_VERSION=5.7
MYSQL_LOCAL_DATABASE_PATH="./Docker/mysql57"
MYSQL_PORT="3306"
MYSQL_PORT=3306
MYSQL_DATABASE="zooomclan"
MYSQL_USER="root"
MYSQL_PASSWORD=""
PHPMYADMIN_PORT="8080"
PHPMYADMIN_PORT=8080
5 changes: 4 additions & 1 deletion Docker/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Ignore changes within the Docker database volume
mysql57
/mysql57

# ...and DON'T ignore the DB template
!/mysql57/zooomclan-empty
107 changes: 79 additions & 28 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,24 @@
## Docker configs
Edit the file: `.env.docker`

### Using docker-sync
`docker-sync` greatly improves the performance of synced volumes from the local file system to Docker, giving a nearly live-performance for read/write operations.

#### Setup on macOS
(The following steps are copied from [this online documentation](https://reece.tech/posts/osx-docker-performance/))
* **Recommendation**: use [OrbStack](https://orbstack.dev/) instead of Docker Desktop for Mac!

##### Install docker-sync

```
gem install --user-install docker-sync
brew install fswatch
brew install unison
brew install eugenmayer/dockersync/unox
```

#### Configuring docker-sync
Docker sync requires a valid configuration file (docker-sync.yaml), the below file creates a named volume for Docker called osx-sync and mounts the local macOS directory.

Add `docker-sync` to your $PATH using `nano ~/.zshrc`

```
if which ruby >/dev/null && which gem >/dev/null; then
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
fi
```

Now run `source ~/.zshrc` to apply the $PATH settings.

## Build the Docker container and docker-sync
## Build the Docker container & start the services
Start container with all services.

* in "detached mode" - without interative log in the Shell

```
cd /path/to/zorg-code/
docker-sync start -c ./Docker/docker-sync.yml
docker compose --project-directory ./ --file ./Docker/docker-compose.yml --env-file ./Docker/.env.docker up -d
```

* or with an interactive log in the Shell

```
cd /path/to/zorg-code/
docker-sync-stack start -c ./Docker/docker-sync.yml
docker compose --project-directory ./ --file ./Docker/docker-compose.yml --env-file ./Docker/.env.docker up
```

Expand Down Expand Up @@ -122,6 +96,10 @@ Enter into interactive shell mode for a container service

`docker exec -it SERVICENAME sh`

List all Environment Variables for a container service

`docker exec SERVICENAME env`

### docker-sync inspection
!! Refresh docker-sync after updating the `docker-compose.yml`-file

Expand All @@ -135,3 +113,76 @@ Inspect running docker-sync services:
Inspect the logfile for sendmail / msmtprc:

`docker exec -it zorg-web cat /var/log/sendmail.log`


## Archive / Deprecated
### Using docker-sync (not recommended!)
`docker-sync` greatly improves the performance of synced volumes from the local file system to Docker, giving a nearly live-performance for read/write operations.

##### Install docker-sync

```
gem install --user-install docker-sync
brew install fswatch
brew install unison
brew install eugenmayer/dockersync/unox
```

#### Configuring docker-sync
Docker sync requires a valid configuration file (docker-sync.yaml), the below file creates a named volume for Docker called osx-sync and mounts the local macOS directory.

Add `docker-sync` to your $PATH using `nano ~/.zshrc`

```
if which ruby >/dev/null && which gem >/dev/null; then
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
fi
```

Now run `source ~/.zshrc` to apply the $PATH settings.

##### Add `docker-sync.yml` to `/Docker/` dir
Here's an example `docker-sync` YAML configuration:

```yaml
version: "2"
options:
config_path: './../'
compose-file-path: './docker-compose.yml'
verbose: true
syncs:
# sync_strategy: see https://docker-sync.readthedocs.io/en/latest/getting-started/configuration.html#sync-strategy
zorg-web-root-git-sync:
src: './.git'
sync_strategy: 'unison'
zorg-web-root-data-sync:
src: './data'
sync_strategy: 'unison'
#sync_excludes: [ ]
zorg-web-root-vendor-sync:
src: './vendor'
sync_strategy: 'unison'
# sync_host_ip: 'auto'
# sync_host_port: 10873
sync_excludes: [ ]
zorg-web-root-www-sync:
src: './www'
sync_strategy: 'unison'
sync_excludes: [ ]
zorg-db-mysql-sync:
src: './Docker/mysql57'
sync_strategy: 'unison'
sync_excludes: [ ]

```

#### Build the Docker container with docker-sync
Start container with all services.

* in "detached mode" - without interative log in the Shell

```
cd /path/to/zorg-code/
docker-sync start -c ./Docker/docker-sync.yml
docker compose --project-directory ./ --file ./Docker/docker-compose.yml --env-file ./Docker/.env.docker up -d
```
Loading

0 comments on commit 9b011a5

Please sign in to comment.