Commit 1a86d5e6 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

[TASK] Inital commit.

* Copy from TER
* Changes folders and documentation
parents
TYPO3_SITENAME=TYPO3 Extension Repository
TYPO3_CONTEXT=Development
DATABASE_USER=t3o
DATABASE_USER_PASSWORD=k6mdcMp0MATlzKAE1RW6qFmmilqt2HNkQhbVgztu
DATABASE_HOST_NAME=db
DATABASE_PORT=3306
DATABASE_NAME=t3o
DATABASE_ROOT_PASSWORD=uf5c92eCULghtfdEdqH0hsfvnPSuEY7cnPKk5MAz
ADMIN_USER_NAME=t3o
ADMIN_PASSWORD=x2VsAVQNJd8UiDdu9a76
# Created by .ignore support plugin (hsz.mobi)
.idea
typo3_src
bin/*
!bin/scripts/
vendor
htdocs/fileadmin
htdocs/typo3temp
htdocs/uploads
htdocs/typo3
htdocs/index.php
htdocs/typo3conf/ext/*
htdocs/typo3conf/PackageStates.php
!htdocs/typo3conf/ext/ter*
DOCKER_COMPOSE="$$(pwd)/data/scripts/docker-compose.sh"
COMPOSER="$$(pwd)/data/scripts/composer.sh"
include .env
init: composer-install install-typo3
reset: kill down init
up:
$(DOCKER_COMPOSE) up -d
ps:
$(DOCKER_COMPOSE) ps
stop:
$(DOCKER_COMPOSE) stop
kill:
$(DOCKER_COMPOSE) kill
build:
$(DOCKER_COMPOSE) build --no-cache
pull:
$(DOCKER_COMPOSE) pull
log:
$(DOCKER_COMPOSE) logs -f --tail=100
down:
$(DOCKER_COMPOSE) down --remove-orphans
composer-install:
$(COMPOSER) --working-dir=data/typo3 install
composer-update:
$(COMPOSER) --working-dir=data/typo3 up
install-typo3: up
$(DOCKER_COMPOSE) run --rm db /src/data/scripts/wait-for-it.sh -h $(DATABASE_HOST_NAME) -p $(DATABASE_PORT) -t 30
$(DOCKER_COMPOSE) run --rm php ./bin/typo3cms install:setup \
--non-interactive \
--force \
--database-user-name $(DATABASE_USER) \
--database-user-password $(DATABASE_USER_PASSWORD) \
--database-host-name $(DATABASE_HOST_NAME) \
--database-port $(DATABASE_PORT) \
--database-name $(DATABASE_NAME) \
--use-existing-database \
--admin-user-name $(ADMIN_USER_NAME) \
--admin-password $(ADMIN_PASSWORD) \
--site-name $(TYPO3_SITENAME) \
--site-setup-type site
# TYPO3.org main page
## typo3.org
### Prerequisites
[docker engine](https://docs.docker.com/engine/installation/)
Make sure to have an instance of [jwilder/nginx-proxy](https://github.com/jwilder/nginx-proxy) running on your development box.
An easy way to get it up and running is using [torvitas/nginx-proxy-configuration](https://github.com/torvitas/docker-nginx-proxy-configuration).
### Quickstart
`
git clone https://git-t3o.typo3.org/t3o/typo3.org.git
go in "typo3.org" directory
make init up log
go to folder ``data/typo3/html/typo3conf`` and copy ``AdditionalConfiguration.sample.php`` to ``AdditionalConfiguration.php``
... and finally [click here](https://ter.typo3.127.0.0.1.xip.io)
### Composer
Example:
`
./data/scripts/composer.sh --working-dir=data/typo3/ info
`
For your convenience there are the following make jobs:
`
make composer-install
make composer-update
`
access_log /proc/self/fd/1;
error_log /proc/self/fd/2;
server {
server_name ter.typo3.localhost;
listen 80;
index index.php index.html;
root /var/www/html/;
include /etc/nginx/conf.d/typo3.base;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_param TYPO3_CONTEXT Development;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_read_timeout 1200;
}
client_max_body_size 100M;
location ~ /\.(js|css)$ {
expires 604800s;
}
if (!-e $request_filename){
rewrite ^/(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ /$1.$3 last;
}
location ~* ^/fileadmin/(.*/)?_recycler_/ {
deny all;
}
location ~* ^/fileadmin/templates/.*(\.txt|\.ts)$ {
deny all;
}
location ~* ^/typo3conf/ext/[^/]+/Resources/Private/ {
deny all;
}
location ~* ^/(typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) {
}
location / {
if ($query_string ~ ".+") {
return 405;
}
if ($http_cookie ~ 'nc_staticfilecache|be_typo_user|fe_typo_user' ) {
return 405;
} # pass POST requests to PHP
if ($request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_pragma = 'no-cache') {
return 405;
}
if ($http_cache_control = 'no-cache') {
return 405;
}
error_page 405 = @nocache;
try_files /typo3temp/tx_ncstaticfilecache/$host${request_uri}index.html @nocache;
}
location @nocache {
try_files $uri $uri/ /index.php$is_args$args;
}
#!/bin/bash
#
# Run composer in a container
#
# This script will attempt to mirror the host paths by using volumes for the
# following paths:
# * $(pwd)
# * $(dirname $COMPOSE_FILE) if it's set
# * $HOME if it's set
#
# You can add additional volumes (or any docker run options) using
# the $COMPOSER_OPTIONS environment variable.
COMPOSER_OPTIONS=${COMPOSER_OPTIONS:-}
# You can set the composer cache directory using the $COMPOSER_CACHE
# environment variable.
COMPOSER_CACHE=${COMPOSER_CACHE:-/tmp/composer}
# You can set the ssh key to be used using the $SSH_IDENTITY_FILE
# environment variable.
SSH_IDENTITY_FILE=${SSH_IDENTITY_FILE:-~/.ssh/id_rsa}
set -e
VERSION="1.2-alpine"
IMAGE="composer/composer:$VERSION"
# Setup volume mounts for composer config, context and ssh keys
if [ "$(pwd)" != '/' ]; then
VOLUMES="-v $(pwd):$(pwd)"
fi
if [ -n "$COMPOSER_FILE" ]; then
composer_dir=$(dirname $COMPOSER_FILE)
fi
# TODO: also check --file argument
if [ -n "$composer_dir" ]; then
VOLUMES="$VOLUMES -v $composer_dir:$composer_dir"
fi
if [ -n "$SSH_IDENTITY_FILE" ]; then
ssh_identity_dir=$(dirname $SSH_IDENTITY_FILE)
fi
# TODO: also check --file argument
if [ -n "$ssh_identity_dir" ]; then
VOLUMES="$VOLUMES -v $ssh_identity_dir:/root/.ssh"
fi
if [ -n "$COMPOSER_CACHE" ]; then
composer_cache_dir=$(dirname $COMPOSER_CACHE)
fi
# TODO: also check --file argument
if [ -n "$composer_cache_dir" ]; then
VOLUMES="$VOLUMES -v $composer_cache_dir:/composer/cache"
fi
if [ -n "$HOME" ]; then
VOLUMES="$VOLUMES -v $HOME:$HOME -v $HOME:/root" # mount $HOME in /root to share docker.config
fi
# Only allocate tty if we detect one
if [ -t 1 ]; then
DOCKER_RUN_OPTIONS="-t"
fi
if [ -t 0 ]; then
DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS -i"
fi
exec docker run --rm -u $(id -u) $DOCKER_RUN_OPTIONS $COMPOSER_OPTIONS $VOLUMES -w "$(pwd)" $IMAGE "$@"
#!/bin/bash
#
# Run docker-compose in a container
#
# This script will attempt to mirror the host paths by using volumes for the
# following paths:
# * $(pwd)
# * $(dirname $COMPOSE_FILE) if it's set
# * $HOME if it's set
#
# You can add additional volumes (or any docker run options) using
# the $COMPOSE_OPTIONS environment variable.
#
set -e
VERSION="1.8.1"
IMAGE="docker/compose:$VERSION"
# Setup options for connecting to docker host
if [ -z "$DOCKER_HOST" ]; then
DOCKER_HOST="/var/run/docker.sock"
fi
if [ -S "$DOCKER_HOST" ]; then
DOCKER_ADDR="-v $DOCKER_HOST:$DOCKER_HOST -e DOCKER_HOST"
else
DOCKER_ADDR="-e DOCKER_HOST -e DOCKER_TLS_VERIFY -e DOCKER_CERT_PATH"
fi
# Setup volume mounts for compose config and context
if [ "$(pwd)" != '/' ]; then
VOLUMES="-v $(pwd):$(pwd)"
fi
if [ -n "$COMPOSE_FILE" ]; then
compose_dir=$(dirname $COMPOSE_FILE)
fi
# TODO: also check --file argument
if [ -n "$compose_dir" ]; then
VOLUMES="$VOLUMES -v $compose_dir:$compose_dir"
fi
if [ -n "$HOME" ]; then
VOLUMES="$VOLUMES -v $HOME:$HOME -v $HOME:/root" # mount $HOME in /root to share docker.config
fi
# Only allocate tty if we detect one
if [ -t 1 ]; then
DOCKER_RUN_OPTIONS="-t"
fi
if [ -t 0 ]; then
DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS -i"
fi
exec docker run --rm $DOCKER_RUN_OPTIONS $DOCKER_ADDR $COMPOSE_OPTIONS $VOLUMES -w "$(pwd)" $IMAGE "$@"
#!/usr/bin/env bash
# Use this script to test if a given TCP host/port are available
cmdname=$(basename $0)
echoerr() { if [[ $QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
usage()
{
cat << USAGE >&2
Usage:
$cmdname host:port [-s] [-t timeout] [-- command args]
-h HOST | --host=HOST Host or IP under test
-p PORT | --port=PORT TCP port under test
Alternatively, you specify the host and port as host:port
-s | --strict Only execute subcommand if the test succeeds
-q | --quiet Don't output any status messages
-t TIMEOUT | --timeout=TIMEOUT
Timeout in seconds, zero for no timeout
-- COMMAND ARGS Execute command with args after the test finishes
USAGE
exit 1
}
wait_for()
{
if [[ $TIMEOUT -gt 0 ]]; then
echoerr "$cmdname: waiting $TIMEOUT seconds for $HOST:$PORT"
else
echoerr "$cmdname: waiting for $HOST:$PORT without a timeout"
fi
start_ts=$(date +%s)
while :
do
(echo > /dev/tcp/$HOST/$PORT) >/dev/null 2>&1
result=$?
if [[ $result -eq 0 ]]; then
end_ts=$(date +%s)
echoerr "$cmdname: $HOST:$PORT is available after $((end_ts - start_ts)) seconds"
break
fi
sleep 1
done
return $result
}
wait_for_wrapper()
{
# In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692
if [[ $QUIET -eq 1 ]]; then
timeout $TIMEOUT $0 --quiet --child --host=$HOST --port=$PORT --timeout=$TIMEOUT &
else
timeout $TIMEOUT $0 --child --host=$HOST --port=$PORT --timeout=$TIMEOUT &
fi
PID=$!
trap "kill -INT -$PID" INT
wait $PID
RESULT=$?
if [[ $RESULT -ne 0 ]]; then
echoerr "$cmdname: timeout occurred after waiting $TIMEOUT seconds for $HOST:$PORT"
fi
return $RESULT
}
# process arguments
while [[ $# -gt 0 ]]
do
case "$1" in
*:* )
hostport=(${1//:/ })
HOST=${hostport[0]}
PORT=${hostport[1]}
shift 1
;;
--child)
CHILD=1
shift 1
;;
-q | --quiet)
QUIET=1
shift 1
;;
-s | --strict)
STRICT=1
shift 1
;;
-h)
HOST="$2"
if [[ $HOST == "" ]]; then break; fi
shift 2
;;
--host=*)
HOST="${1#*=}"
shift 1
;;
-p)
PORT="$2"
if [[ $PORT == "" ]]; then break; fi
shift 2
;;
--port=*)
PORT="${1#*=}"
shift 1
;;
-t)
TIMEOUT="$2"
if [[ $TIMEOUT == "" ]]; then break; fi
shift 2
;;
--timeout=*)
TIMEOUT="${1#*=}"
shift 1
;;
--)
shift
CLI="$@"
break
;;
--help)
usage
;;
*)
echoerr "Unknown argument: $1"
usage
;;
esac
done
if [[ "$HOST" == "" || "$PORT" == "" ]]; then
echoerr "Error: you need to provide a host and port to test."
usage
fi
TIMEOUT=${TIMEOUT:-15}
STRICT=${STRICT:-0}
CHILD=${CHILD:-0}
QUIET=${QUIET:-0}
if [[ $CHILD -gt 0 ]]; then
wait_for
RESULT=$?
exit $RESULT
else
if [[ $TIMEOUT -gt 0 ]]; then
wait_for_wrapper
RESULT=$?
else
wait_for
RESULT=$?
fi
fi
if [[ $CLI != "" ]]; then
if [[ $RESULT -ne 0 && $STRICT -eq 1 ]]; then
echoerr "$cmdname: strict mode, refusing to execute subprocess"
exit $RESULT
fi
exec $CLI
else
exit $RESULT
fi
/bin
/vendor
/typo3_src
/html/index.php
/html/typo3
/html/fileadmin/
/html/typo3conf/ext/*
/html/typo3conf/AdditionalConfiguration.php
/html/typo3conf/PackageStates.php
/html/typo3conf/l10n
/html/typo3temp/
/html/uploads/
!/html/typo3conf/ext/t3o*
{
"name": "t3o/typo3.org",
"description": "Website for TYPO3.org",
"minimum-stability": "stable",
"authors": [
{
"name": "t3o team",
"email": "maintenance@typo3.org"
}
],
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org"
}
],
"require": {
"typo3/cms": "^7.6",
"helhum/typo3-console": "4.0.0",
"dmitryd/typo3-realurl": "^2.1"
},
"config": {
"bin-dir": "bin"
},
"extra": {
"typo3/cms": {
"web-dir": "html"
},
"helhum/typo3-console": {
"install-binary": true,
"install-extension-dummy": false
}
}
}
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "74d512c446a170bb294c6549c017b8bd",
"content-hash": "d086de9814a6bf144c1c0dda56e1d380",
"packages": [
{
"name": "cogpowered/finediff",
"version": "0.3.1",
"source": {
"type": "git",
"url": "https://github.com/cogpowered/FineDiff.git",
"reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cogpowered/FineDiff/zipball/339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
"reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"mockery/mockery": "*",
"phpunit/phpunit": "*"
},
"type": "library",
"autoload": {
"psr-0": {
"cogpowered\\FineDiff": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Rob Crowe",
"email": "rob@cogpowered.com"
},
{
"name": "Raymond Hill"
}
],
"description": "PHP implementation of a Fine granularity Diff engine",
"homepage": "https://github.com/cogpowered/FineDiff",
"keywords": [
"diff",
"finediff",
"opcode",
"string",
"text"
],
"time": "2014-05-19 10:25:02"
},
{
"name": "dmitryd/typo3-realurl",
"version": "2.1.5",
"source": {
"type": "git",
"url": "https://github.com/dmitryd/typo3-realurl.git",
"reference": "9a233f2b891cc1fd5c8baeba2df63b6915497821"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dmitryd/typo3-realurl/zipball/9a233f2b891cc1fd5c8baeba2df63b6915497821",
"reference": "9a233f2b891cc1fd5c8baeba2df63b6915497821",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"typo3/cms-core": ">=6.2.0,<8.5.0"
},
"conflict": {
"bednee/cooluri": ">0.0.1",
"typo3-ter/cooluri": ">=0.0.1",
"typo3-ter/simulatestatic": ">0.0.1"
},
"replace": {
"realurl": "self.version",
"typo3-ter/realurl": "self.version"
},
"require-dev": {
"phpunit/phpunit": "~4.8.0"
},
"suggest": {
"typo3-ter/static-info-tables": ">=6.2.0"
},
"type": "typo3-cms-extension",
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": ".Build/Web"
}
},
"autoload": {
"psr-4": {
"DmitryDulepov\\Realurl\\": "Classes"
}