diff --git a/.ddev/config.yaml b/.ddev/config.yaml new file mode 100644 index 0000000..9121450 --- /dev/null +++ b/.ddev/config.yaml @@ -0,0 +1,275 @@ +name: site-surfcamp +type: php +docroot: public +php_version: "8.2" +webserver_type: nginx-fpm +xdebug_enabled: false +additional_hostnames: [] +additional_fqdns: [] +database: + type: mariadb + version: "10.11" +use_dns_when_possible: true +composer_version: "2" +web_environment: [] + +# Key features of DDEV's config.yaml: + +# name: # Name of the project, automatically provides +# http://projectname.ddev.site and https://projectname.ddev.site + +# type: # backdrop, craftcms, django4, drupal6/7/8/9/10, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress +# See https://ddev.readthedocs.io/en/latest/users/quickstart/ for more +# information on the different project types + +# docroot: # Relative path to the directory containing index.php. + +# php_version: "8.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" + +# You can explicitly specify the webimage but this +# is not recommended, as the images are often closely tied to DDEV's' behavior, +# so this can break upgrades. + +# webimage: # nginx/php docker image. + +# database: +# type: # mysql, mariadb, postgres +# version: # database version, like "10.4" or "8.0" +# MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0 +# PostgreSQL versions can be 9-16. + +# router_http_port: # Port to be used for http (defaults to global configuration, usually 80) +# router_https_port: # Port for https (defaults to global configuration, usually 443) + +# xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better, +# as leaving Xdebug enabled all the time is a big performance hit. + +# xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better, +# as leaving Xhprof enabled all the time is a big performance hit. + +# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn + +# timezone: Europe/Berlin +# This is the timezone used in the containers and by PHP; +# it can be set to any valid timezone, +# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +# For example Europe/Dublin or MST7MDT + +# composer_root: +# Relative path to the Composer root directory from the project root. This is +# the directory which contains the composer.json and where all Composer related +# commands are executed. + +# composer_version: "2" +# You can set it to "" or "2" (default) for Composer v2 or "1" for Composer v1 +# to use the latest major version available at the time your container is built. +# It is also possible to use each other Composer version channel. This includes: +# - 2.2 (latest Composer LTS version) +# - stable +# - preview +# - snapshot +# Alternatively, an explicit Composer version may be specified, for example "2.2.18". +# To reinstall Composer after the image was built, run "ddev debug refresh". + +# nodejs_version: "18" +# change from the default system Node.js version to any other version. +# Numeric version numbers can be complete (i.e. 18.15.0) or +# incomplete (18, 17.2, 16). 'lts' and 'latest' can be used as well along with +# other named releases. +# see https://www.npmjs.com/package/n#specifying-nodejs-versions +# Note that you can continue using 'ddev nvm' or nvm inside the web container +# to change the project's installed node version if you need to. + +# additional_hostnames: +# - somename +# - someothername +# would provide http and https URLs for "somename.ddev.site" +# and "someothername.ddev.site". + +# additional_fqdns: +# - example.com +# - sub1.example.com +# would provide http and https URLs for "example.com" and "sub1.example.com" +# Please take care with this because it can cause great confusion. + +# upload_dirs: "custom/upload/dir" +# +# upload_dirs: +# - custom/upload/dir +# - ../private +# +# would set the destination paths for ddev import-files to /custom/upload/dir +# When Mutagen is enabled this path is bind-mounted so that all the files +# in the upload_dirs don't have to be synced into Mutagen. + +# disable_upload_dirs_warning: false +# If true, turns off the normal warning that says +# "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set" + +# ddev_version_constraint: "" +# Example: +# ddev_version_constraint: ">= 1.22.4" +# This will enforce that the running ddev version is within this constraint. +# See https://github.com/Masterminds/semver#checking-version-constraints for +# supported constraint formats + +# working_dir: +# web: /var/www/html +# db: /home +# would set the default working directory for the web and db services. +# These values specify the destination directory for ddev ssh and the +# directory in which commands passed into ddev exec are run. + +# omit_containers: [db, ddev-ssh-agent] +# Currently only these containers are supported. Some containers can also be +# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit +# the "db" container, several standard features of DDEV that access the +# database container will be unusable. In the global configuration it is also +# possible to omit ddev-router, but not here. + +# performance_mode: "global" +# DDEV offers performance optimization strategies to improve the filesystem +# performance depending on your host system. Should be configured globally. +# +# If set, will override the global config. Possible values are: +# - "global": uses the value from the global config. +# - "none": disables performance optimization for this project. +# - "mutagen": enables Mutagen for this project. +# - "nfs": enables NFS for this project. +# +# See https://ddev.readthedocs.io/en/latest/users/install/performance/#nfs +# See https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen + +# fail_on_hook_fail: False +# Decide whether 'ddev start' should be interrupted by a failing hook + +# host_https_port: "59002" +# The host port binding for https can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_webserver_port: "59001" +# The host port binding for the ddev-webserver can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_db_port: "59002" +# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic +# unless explicitly specified. + +# mailpit_http_port: "8025" +# mailpit_https_port: "8026" +# The Mailpit ports can be changed from the default 8025 and 8026 + +# host_mailpit_port: "8025" +# The mailpit port is not normally bound on the host at all, instead being routed +# through ddev-router, but it can be bound directly to localhost if specified here. + +# webimage_extra_packages: [php7.4-tidy, php-bcmath] +# Extra Debian packages that are needed in the webimage can be added here + +# dbimage_extra_packages: [telnet,netcat] +# Extra Debian packages that are needed in the dbimage can be added here + +# use_dns_when_possible: true +# If the host has internet access and the domain configured can +# successfully be looked up, DNS will be used for hostname resolution +# instead of editing /etc/hosts +# Defaults to true + +# project_tld: ddev.site +# The top-level domain used for project URLs +# The default "ddev.site" allows DNS lookup via a wildcard +# If you prefer you can change this to "ddev.local" to preserve +# pre-v1.9 behavior. + +# ngrok_args: --basic-auth username:pass1234 +# Provide extra flags to the "ngrok http" command, see +# https://ngrok.com/docs/ngrok-agent/config or run "ngrok http -h" + +# disable_settings_management: false +# If true, DDEV will not create CMS-specific settings files like +# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php +# In this case the user must provide all such settings. + +# You can inject environment variables into the web container with: +# web_environment: +# - SOMEENV=somevalue +# - SOMEOTHERENV=someothervalue + +# no_project_mount: false +# (Experimental) If true, DDEV will not mount the project into the web container; +# the user is responsible for mounting it manually or via a script. +# This is to enable experimentation with alternate file mounting strategies. +# For advanced users only! + +# bind_all_interfaces: false +# If true, host ports will be bound on all network interfaces, +# not the localhost interface only. This means that ports +# will be available on the local network if the host firewall +# allows it. + +# default_container_timeout: 120 +# The default time that DDEV waits for all containers to become ready can be increased from +# the default 120. This helps in importing huge databases, for example. + +#web_extra_exposed_ports: +#- name: nodejs +# container_port: 3000 +# http_port: 2999 +# https_port: 3000 +#- name: something +# container_port: 4000 +# https_port: 4000 +# http_port: 3999 +# Allows a set of extra ports to be exposed via ddev-router +# Fill in all three fields even if you don’t intend to use the https_port! +# If you don’t add https_port, then it defaults to 0 and ddev-router will fail to start. +# +# The port behavior on the ddev-webserver must be arranged separately, for example +# using web_extra_daemons. +# For example, with a web app on port 3000 inside the container, this config would +# expose that web app on https://.ddev.site:9999 and http://.ddev.site:9998 +# web_extra_exposed_ports: +# - name: myapp +# container_port: 3000 +# http_port: 9998 +# https_port: 9999 + +#web_extra_daemons: +#- name: "http-1" +# command: "/var/www/html/node_modules/.bin/http-server -p 3000" +# directory: /var/www/html +#- name: "http-2" +# command: "/var/www/html/node_modules/.bin/http-server /var/www/html/sub -p 3000" +# directory: /var/www/html + +# override_config: false +# By default, config.*.yaml files are *merged* into the configuration +# But this means that some things can't be overridden +# For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge +# and you can't erase existing hooks or all environment variables. +# However, with "override_config: true" in a particular config.*.yaml file, +# 'use_dns_when_possible: false' can override the existing values, and +# hooks: +# post-start: [] +# or +# web_environment: [] +# or +# additional_hostnames: [] +# can have their intended affect. 'override_config' affects only behavior of the +# config.*.yaml file it exists in. + +# Many DDEV commands can be extended to run tasks before or after the +# DDEV command is executed, for example "post-start", "post-import-db", +# "pre-composer", "post-composer" +# See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more +# information on the commands that can be extended and the tasks you can define +# for them. Example: +#hooks: diff --git a/.ddev/providers/assets.yaml b/.ddev/providers/assets.yaml new file mode 100644 index 0000000..b4683cf --- /dev/null +++ b/.ddev/providers/assets.yaml @@ -0,0 +1,44 @@ +environment_variables: + # todo: change to 1, 2, 3, 4, 5 or 6 + #team: [1-6] + team: 1 + git_url: git@github.com:TYPO3incubator/surfcamp-assets.git + branch: main + checkout_dir: /var/www/html/.ddev/.surfcamp-assets-downloads + +auth_command: + service: web + command: | + set -eu -o pipefail + ssh-add -l >/dev/null || ( echo "Please 'ddev auth ssh' before running this command." && exit 1 ) + +db_pull_command: + service: web + command: | + set -eu -o pipefail + [ ! -d ${checkout_dir}/.git ] && git clone -n --filter=tree:0 ${git_url} ${checkout_dir} + cd ${checkout_dir} + [ -d ${checkout_dir}/.git ] && git -C ${checkout_dir} fetch origin + git -C ${checkout_dir} config advice.detachedHead false + git -C ${checkout_dir} sparse-checkout set --no-clone "team${team}surfcamptypo3com/" + git -C ${checkout_dir} checkout -f origin/main + cp "team${team}surfcamptypo3com/db/db.sql" /var/www/html/.ddev/.downloads/db.sql + +files_pull_command: + service: web + command: | + set -eu -o pipefail + [ ! -d ${checkout_dir}/.git ] && git clone -n --filter=tree:0 ${git_url} ${checkout_dir} + cd ${checkout_dir} + [ -d ${checkout_dir}/.git ] && git -C ${checkout_dir} fetch origin + git -C ${checkout_dir} config advice.detachedHead false + git -C ${checkout_dir} sparse-checkout set --no-clone "team${team}surfcamptypo3com/" + git -C ${checkout_dir} checkout -f origin/main + # temporary workaround until there are files in fileadmin + mkdir -p "${checkout_dir}/team${team}surfcamptypo3com/files/public/fileadmin/" + +files_import_command: + service: web + command: | + set -eu -o pipefail + rsync -avz --delete "${checkout_dir}/team${team}surfcamptypo3com/files/public/fileadmin/" /var/www/html/public/fileadmin/ diff --git a/.env.dist b/.env.dist new file mode 100644 index 0000000..d40f093 --- /dev/null +++ b/.env.dist @@ -0,0 +1,16 @@ +TYPO3_BE_INSTALLTOOLPASSWORD="$argon2id$v=19$m=65536,t=16,p=1$VktrT0J2cXU3SHNtY0c4SA$36zwyPIHD9iUteTlw04ft6NYYmhVA9FtzkR5py/5B0w" # John3:16 +TYPO3_DB_CONNECTIONS_DEFAULT_DBNAME="db" +TYPO3_DB_CONNECTIONS_DEFAULT_HOST="db" +TYPO3_DB_CONNECTIONS_DEFAULT_PASSWORD="db" +TYPO3_DB_CONNECTIONS_DEFAULT_PORT=3306 +TYPO3_DB_CONNECTIONS_DEFAULT_USER="db" +TYPO3_MAIL_DEFAULTMAILFROMADDRESS="noreply@localhost" +TYPO3_MAIL_DEFAULTMAILFROMNAME="TYPO3 Surfcamp" +TYPO3_MAIL_TRANSPORT="sendmail" +TYPO3_MAIL_TRANSPORT_SENDMAIL_COMMAND="/usr/local/bin/mailpit sendmail -t --smtp-addr 127.0.0.1:1025" +TYPO3_MAIL_TRANSPORT_SMTP_ENCRYPT="" +TYPO3_MAIL_TRANSPORT_SMTP_PASSWORD="" +TYPO3_MAIL_TRANSPORT_SMTP_SERVER="" +TYPO3_MAIL_TRANSPORT_SMTP_USERNAME="" +TYPO3_MAIL_TRANSPORT_MBOX_FILE="" +TYPO3_SYS_ENCRYPTIONKEY="c26bc4ffae86d01188fe2ff0e9b5061cf81f612d3acdb41a261e035862d0510d4eea24dbce58d7041f7b6aa090346d41" \ No newline at end of file diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..173117e --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,60 @@ +name: Deployment + +on: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + deployment: + name: Deployment + runs-on: ubuntu-latest + steps: + - name: Setup SSH Key + env: + SSH_AUTH_SOCK: /tmp/ssh-auth.sock + run: | + mkdir -p ~/.ssh + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deployment_key + chmod 0600 ~/.ssh/deployment_key + ssh-keygen -p -P "${{ secrets.SSH_PASSPHRASE }}" -N "" -f ~/.ssh/deployment_key + ssh-agent -a $SSH_AUTH_SOCK > /dev/null + ssh-add ~/.ssh/deployment_key + + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + + - name: Install Magallanes + run: | + composer global require "andres-montanez/magallanes" --no-progress --ansi + /home/runner/.composer/vendor/bin/mage version + mkdir -p ./.mage/logs + + - name: Get Environment + id: environment + run: | + echo "target=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_OUTPUT + + - name: Deployment + env: + SSH_AUTH_SOCK: /tmp/ssh-auth.sock + run: | + /home/runner/.composer/vendor/bin/mage deploy ${{ steps.environment.outputs.target }} + + - name: Archive Logs + uses: actions/upload-artifact@v4 + if: always() + with: + name: logs + path: .mage/logs + + - name: Echo logs + run: find .mage/logs/ -type f -exec cat {} + + if: always() diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4bbf834 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +/bin/ +/public/ +/var/ +/vendor/ +/typo3_core/ +*.idea +*.project +*.vscode +.env +.DS_Store diff --git a/.mage.yml b/.mage.yml new file mode 100644 index 0000000..06b6f79 --- /dev/null +++ b/.mage.yml @@ -0,0 +1,50 @@ +magephp: + log_dir: ./.mage/logs + composer: + path: composer + exclude: + - ./.ddev + - ./.git + - ./.github + - ./.mage + - ./.vscode + - ./public/fileadmin + - ./public/typo3temp + - ./var + - ./.env + - ./.editorconfig + - ./.gitattributes + - ./.gitignore + - ./.mage.yml + - ./composer.json + - ./composer.lock + - ./LICENSE + - ./README.md + environments: + main: + user: surfcamp + from: ./ + host_path: /srv/vhosts/team[1-6].surfcamp.typo3.com/site/mage + releases: 3 + hosts: + - demo.surfcamp.typo3.com + pre-deploy: + - exec: { cmd: "composer install --no-dev --no-progress --optimize-autoloader"} + on-deploy: + - fs/link: { from: "../../../../shared/public/fileadmin", to: "public/fileadmin" } + - fs/link: { from: "../../../../shared/public/typo3conf", to: "public/typo3conf" } + - fs/link: { from: "../../../../shared/public/typo3temp", to: "public/typo3temp" } + - fs/link: { from: "../../../shared/var", to: "var" } + - fs/link: { from: "../../../shared/.env", to: ".env" } + on-release: + post-release: + - exec: { cmd: "[ -d ../../../cachetool ] || mkdir -p ../../../cachetool" } + - exec: { cmd: "[ -f ../../../cachetool/cachetool.phar ] || curl -o ../../../cachetool/cachetool.phar https://gordalina.github.io/cachetool/downloads/cachetool.phar && chmod +x ../../../cachetool/cachetool.phar" } + - exec: { cmd: "/usr/bin/php ../../../cachetool/cachetool.phar opcache:reset --fcgi=/var/run/team[1-6].surfcamp.typo3.com_fpm.sock --tmp-dir=/srv/vhosts/team[1-6].surfcamp.typo3.com/site/cachetool" } + - exec: { cmd: '/usr/bin/php ./bin/typo3 backend:lock', timeout: 9000 } + - exec: { cmd: '/usr/bin/php ./bin/typo3 extension:setup', timeout: 9000 } + - exec: { cmd: '/usr/bin/php ./bin/typo3 cache:flush', timeout: 9000 } + - exec: { cmd: '/usr/bin/php ./bin/typo3 cache:warmup', timeout: 9000 } + - exec: { cmd: '/usr/bin/php ./bin/typo3 upgrade:run', timeout: 9000 } + - exec: { cmd: '/usr/bin/php ./bin/typo3 backend:unlock', timeout: 9000 } + post-deploy: diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9ee62dc --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# TYPO3 Surfcamp Demo Template + +This Git repository is intended for use by our dedicated teams at the [TYPO3 Surfcamp](https://surfcamp.typo3.com/). + +The project is based on the current development branch of TYPO3 v13.x, using Composer. The configuration happens via +`.env` thanks to the underlying package `vlucas/phpdotenv`. + +Deploying the project is triggered by pushed onto the `main` branch via Github Actions, which triggers a Magallanes +workflow that does the actual heavy work. Please note that the configuration needs adaption **per team-based** repository. + +## Requirements + +* having Docker installed locally (see https://docs.docker.com/get-docker/) +* having DDEV installed locally (see https://ddev.readthedocs.io/en/stable/#installation) + + +## Initialization + +```sh +ddev start +ddev composer install +``` + +### Downloading database and files + +Databases and files are synchronized every 10 minutes into +https://github.com/TYPO3incubator/surfcamp-assets and can be downloaded via: + +```sh +ddev auth ssh +# HEADS UP: All files in the local `public/fileadmin/` will be overridden, that means: +# all files that are not present on the surfcamp team vhost will be deleted from fileadmin +ddev pull assets +``` + +### Contributing to the TYPO3 Core + +In case the team decides to, or needs to contribute to the TYPO3 core, this project can be "upgraded". + +```sh +git clone git@github.com:TYPO3/typo3.git typo3_core +ddev composer config repositories.typo3_core --json '{"type": "path", "url": "typo3_core/typo3/sysext/*"}' +ddev composer update 'typo3/cms-*' -W +``` + +The commands above clone TYPO3 core source to the directory `./typo3_core/`, configure +a corresponding local composer-path-repository using that directory and finally +update the sources in `./vendor/` (TYPO3 specific packages will be symlinked). + +Further details are mentioned in the [TYPO3 Contribution Guide](https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/Index.html), +more specifically in the [Git Setup](https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/Setup/Git/Index.html) section of that guide. diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..20c0dc2 --- /dev/null +++ b/composer.json @@ -0,0 +1,63 @@ +{ + "name": "typo3/site-surfcamp-template", + "type": "project", + "license": "GPL-2.0-or-later", + "authors": [ + { + "name": "TYPO3 CMS Core Team", + "role": "Developer", + "homepage": "https://forge.typo3.org/projects/typo3cms-core" + }, + { + "name": "The TYPO3 Community", + "role": "Contributor", + "homepage": "https://typo3.org/community/" + } + ], + "repositories": { + "local_packages": { + "type": "path", + "url": "local_packages/*" + } + }, + "config": { + "bin-dir": "bin", + "platform": { + "php": "8.2.0" + }, + "sort-packages": true, + "allow-plugins": { + "typo3/class-alias-loader": true, + "typo3/cms-composer-installers": true + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": "^8.2", + "typo3/cms-backend": "dev-main", + "typo3/cms-belog": "dev-main", + "typo3/cms-beuser": "dev-main", + "typo3/cms-core": "dev-main", + "typo3/cms-dashboard": "dev-main", + "typo3/cms-extbase": "dev-main", + "typo3/cms-extensionmanager": "dev-main", + "typo3/cms-filelist": "dev-main", + "typo3/cms-filemetadata": "dev-main", + "typo3/cms-fluid": "dev-main", + "typo3/cms-form": "dev-main", + "typo3/cms-frontend": "dev-main", + "typo3/cms-info": "dev-main", + "typo3/cms-install": "dev-main", + "typo3/cms-lowlevel": "dev-main", + "typo3/cms-rte-ckeditor": "dev-main", + "typo3/cms-scheduler": "dev-main", + "typo3/cms-seo": "dev-main", + "typo3/cms-setup": "dev-main", + "typo3/cms-tstemplate": "dev-main", + "vlucas/phpdotenv": "^5.6" + }, + "require-dev": { + "roave/security-advisories": "dev-latest" + } +} diff --git a/config/system/additional.php b/config/system/additional.php new file mode 100644 index 0000000..6d4cd8a --- /dev/null +++ b/config/system/additional.php @@ -0,0 +1,47 @@ +load(); + +if (file_exists(__DIR__ . '/../../.env')) { + $dotenv = Dotenv\Dotenv::createUnsafeImmutable(__DIR__ . '/../../'); + $dotenv->load(); +} + +$GLOBALS['TYPO3_CONF_VARS'] = array_replace_recursive($GLOBALS['TYPO3_CONF_VARS'], [ + 'BE' => [ + 'debug' => getenv('TYPO3_BE_DEBUG') ?: 0, + 'installToolPassword' => getenv('TYPO3_BE_INSTALLTOOLPASSWORD') ?: '', + ], + 'FE' => [ + 'debug' => getenv('TYPO3_FE_DEBUG') ?: 0, + ], + 'DB' => [ + 'Connections' => [ + 'Default' => [ + 'host' => getenv('TYPO3_DB_CONNECTIONS_DEFAULT_HOST'), + 'port' => (int)(getenv('TYPO3_DB_CONNECTIONS_DEFAULT_PORT') ?: 3306), + 'user' => getenv('TYPO3_DB_CONNECTIONS_DEFAULT_USER'), + 'password' => getenv('TYPO3_DB_CONNECTIONS_DEFAULT_PASSWORD'), + 'dbname' => getenv('TYPO3_DB_CONNECTIONS_DEFAULT_DBNAME'), + ], + ], + ], + 'MAIL' => [ + 'defaultMailFromAddress' => getenv('TYPO3_MAIL_DEFAULTMAILFROMADDRESS') ?: '', + 'defaultMailFromName' => getenv('TYPO3_MAIL_DEFAULTMAILFROMNAME') ?: '', + 'transport' => getenv('TYPO3_MAIL_TRANSPORT'), + 'transport_mbox_file' => getenv('TYPO3_MAIL_TRANSPORT_MBOX_FILE'), + 'transport_sendmail_command' => getenv('TYPO3_MAIL_TRANSPORT_SENDMAIL_COMMAND'), + 'transport_smtp_encrypt' => getenv('TYPO3_MAIL_TRANSPORT_SMTP_ENCRYPT'), + 'transport_smtp_password' => getenv('TYPO3_MAIL_TRANSPORT_SMTP_PASSWORD'), + 'transport_smtp_server' => getenv('TYPO3_MAIL_TRANSPORT_SMTP_SERVER'), + 'transport_smtp_username' => getenv('TYPO3_MAIL_TRANSPORT_SMTP_USERNAME'), + ], + 'SYS' => [ + 'devIPmask' => getenv('TYPO3_SYS_DEVIPMASK') ?: '', + 'displayErrors' => getenv('TYPO3_SYS_DISPLAYERRORS') ?: 0, + 'encryptionKey' => getenv('TYPO3_SYS_ENCRYPTIONKEY'), + 'exceptionalErrors' => getenv('TYPO3_SYS_EXCEPTIONALERRORS') ?: 4096, + ], +]); \ No newline at end of file diff --git a/config/system/settings.php b/config/system/settings.php new file mode 100644 index 0000000..a6e34cd --- /dev/null +++ b/config/system/settings.php @@ -0,0 +1,117 @@ + [ + 'debug' => false, + 'installToolPassword' => '', + 'passwordHashing' => [ + 'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2idPasswordHash', + 'options' => [], + ], + ], + 'DB' => [ + 'Connections' => [ + 'Default' => [ + 'charset' => 'utf8mb4', + 'dbname' => '', + 'driver' => 'mysqli', + 'host' => '', + 'password' => '', + 'port' => '', + 'tableoptions' => [ + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_unicode_ci', + ], + 'user' => '', + ], + ], + ], + 'EXTENSIONS' => [ + 'backend' => [ + 'backendFavicon' => '', + 'backendLogo' => '', + 'loginBackgroundImage' => '', + 'loginFootnote' => '', + 'loginHighlightColor' => '', + 'loginLogo' => '', + 'loginLogoAlt' => '', + ], + 'extensionmanager' => [ + 'automaticInstallation' => '1', + 'offlineMode' => '0', + ], + 'scheduler' => [ + 'maxLifetime' => '1440', + ], + ], + 'FE' => [ + 'cacheHash' => [ + 'enforceValidation' => true, + ], + 'debug' => false, + 'disableNoCacheParameter' => true, + 'passwordHashing' => [ + 'className' => 'TYPO3\\CMS\\Core\\Crypto\\PasswordHashing\\Argon2idPasswordHash', + 'options' => [], + ], + ], + 'GFX' => [ + 'processor' => 'GraphicsMagick', + 'processor_effects' => false, + 'processor_enabled' => true, + 'processor_path' => '/usr/bin/', + ], + 'LOG' => [ + 'TYPO3' => [ + 'CMS' => [ + 'deprecations' => [ + 'writerConfiguration' => [ + 'notice' => [ + 'TYPO3\CMS\Core\Log\Writer\FileWriter' => [ + 'disabled' => true, + ], + ], + ], + ], + ], + ], + ], + 'MAIL' => [ + 'transport' => 'sendmail', + 'transport_sendmail_command' => '/usr/local/bin/mailpit sendmail -t --smtp-addr 127.0.0.1:1025', + 'transport_smtp_encrypt' => '', + 'transport_smtp_password' => '', + 'transport_smtp_server' => '', + 'transport_smtp_username' => '', + ], + 'SYS' => [ + 'UTF8filesystem' => true, + 'caching' => [ + 'cacheConfigurations' => [ + 'hash' => [ + 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend', + ], + 'pages' => [ + 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend', + 'options' => [ + 'compression' => true, + ], + ], + 'rootline' => [ + 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend', + 'options' => [ + 'compression' => true, + ], + ], + ], + ], + 'devIPmask' => '', + 'displayErrors' => 0, + 'encryptionKey' => '', + 'exceptionalErrors' => 4096, + 'sitename' => 'Surfcamp Template', + 'systemMaintainers' => [ + 1, + ], + 'trustedHostsPattern' => '.*', + ], +]; diff --git a/local_packages/.gitkeep b/local_packages/.gitkeep new file mode 100644 index 0000000..e69de29