{"id":18515304,"url":"https://github.com/jonnitto/uberspace.deployer","last_synced_at":"2025-04-09T23:11:05.248Z","repository":{"id":43339962,"uuid":"319783530","full_name":"jonnitto/Uberspace.Deployer","owner":"jonnitto","description":"Unofficial deployer recipes for Uberspace interacting with Neos CMS","archived":false,"fork":false,"pushed_at":"2023-03-27T06:57:13.000Z","size":117,"stargazers_count":11,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T23:10:58.740Z","etag":null,"topics":["deployer-php","deployer-recipes","deployment","hacktoberfest","neoscms","uberspace","uberspace7"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonnitto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jonnitto","custom":"https://www.paypal.me/Jonnitto/20eur"}},"created_at":"2020-12-08T23:07:01.000Z","updated_at":"2024-07-16T03:03:27.000Z","dependencies_parsed_at":"2024-11-06T15:53:33.929Z","dependency_job_id":"1c346132-4969-4b33-91d1-1d1e14ab10ba","html_url":"https://github.com/jonnitto/Uberspace.Deployer","commit_stats":{"total_commits":87,"total_committers":4,"mean_commits":21.75,"dds":"0.31034482758620685","last_synced_commit":"ef936fdaafce8337dbf33da5c9b6e4ac58912309"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonnitto%2FUberspace.Deployer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonnitto%2FUberspace.Deployer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonnitto%2FUberspace.Deployer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonnitto%2FUberspace.Deployer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonnitto","download_url":"https://codeload.github.com/jonnitto/Uberspace.Deployer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125606,"owners_count":21051770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployer-php","deployer-recipes","deployment","hacktoberfest","neoscms","uberspace","uberspace7"],"created_at":"2024-11-06T15:47:17.318Z","updated_at":"2025-04-09T23:11:05.225Z","avatar_url":"https://github.com/jonnitto.png","language":"PHP","funding_links":["https://github.com/sponsors/jonnitto","https://www.paypal.me/Jonnitto/20eur"],"categories":[],"sub_categories":[],"readme":"# [Deployer] tasks for [Uberspace] \u0026 [Neos CMS]\n\n![social preview]\n\nThese deployer scripts are built on top of [Deployer]. Most of the tasks are provided by this library already; this package adds just some optimization for the install process and the needed actions for deploying a project. Some helper tasks are available that should make your life as a developer a bit easier. Please run the deployer scripts only in your development environment, as Deployer connects automatically to the needed server.\n\nYou can look at the [example] folder to look how to set up a deployment. The files should be saved at the root of your project.\n\n**For a list of all available commands, enter `dep` in the command line**\n\n## Uberspace\n\n[Uberspace] is a superb hosting provider from Germany. You can find their [complete manual here][uberspace manual].\n\nFirst, you have to [register your own uberspace]. Then, add your SSh key to the admin interface. If you don't know what SSH is, you can read more about this in the [SSH section in the uberspace manual][ssh manual on uberspace] or on the [SSH manual on github].\n\n## Installation of the deployment scripts\n\nEnter this on the root of your project:\n\n```bash\ncomposer require --dev jonnitto/uberspace-deployer\n```\n\nCreate a file with the name `deploy.php` with the following content:\n\n```php\n\u003c?php\n\nnamespace Deployer;\n\nrequire_once 'Build/Uberspace.Deployer/neos.php';\n\n```\n\nCreate a file with the name `deploy.yaml` with the following content and edit it following points:\n\n- Replace `domain.tld` with the corresponding domain, **without** `www.`\n- Replace `__SERVER__` with the corresponding server name. You'll find the info on the [uberspace dashboard].\n- Replace `__USER__` with the corresponding uberspace username\n- Replace `__OWNER__/__REPOSITORY` with the corresponding repository\n- Add the `slack_webhook`. (optional) [You can register it here][slack webhook]\n\n```yaml\n# To start a deployment or the\n# installation run `dep deploy`\n\ndomain.tld:\n  hostname: __SERVER__.uberspace.de\n  user: __USER__\n  repository: git@github.com:__OWNER__/__REPOSITORY__.git\n  slack_webhook: https://hooks.slack.com/services/__YOUR/SLACK/WEBHOOK__\n```\n\nThe command `dep deploy` checks if Neos is installed and starts either the installation process or a fresh deployment.\n\n\u003e **Warning**  \n\u003e Do not delete the file `Settings.yaml` in the `shared/Configuration/` folder.  \n\u003e This file is used to check if Neos is already installed. If the installation fails, please remove the whole folder and start again.\n\n## The `--composer_auth` input option for the tasks\n\nIf you want to pass an authentication configuration (for private repositories) during `deploy` task, you can do this via the `--composer_auth` input option:\n\nExample:\n\n```bash\ndep install --composer_auth \"http-basic.repo.packagist.com token XYZ\"\n```\n\nThis option doesn't add the authentication global to composer on the host, just locally. If you want to install the authentication globally, connect via `dep ssh` to the server and enter (as an example) `composer config --global --auth http-basic.repo.packagist.com token XYZ` in the CLI.\n\n## Add a domain\n\nThe add a domain to your uberspace, you can either follow the instructions on the [uberspace manual]  \nor run the command `dep server:domain:add`.\n\n## Cronjobs\n\nTo edit the cronjobs on the server, run the command `dep server:cronjob`.  \nIn the case you have to run a CLI PHP command, it is essential to set the full path to the PHP binary.\n\n## Publish the document root\n\nIn order for a website to be accessible to visitors, it must be published in the correct directory. The default directory for all requests is `/var/www/virtual/\u003cusername\u003e/html`. But you can also host multiple domains in one instance. You can create folders (and symlinks) in the form of `/var/www/virtual/\u003cusername\u003e/\u003cdomain\u003e`. Make sure your domain is set up and configured correctly. To use RewriteRules, you have to create a `.htaccess` file within the DocumentRoot with the following content: `RewriteBase /`. In the [example] folder, you'll find an example of an `.htaccess` file with a dynamic `FLOW_CONTEXT` configuration based on the URL.\n\n\u003e **Warning**  \n\u003e Do not delete the `/html` folder. If this folder doesn’t exist, the RewriteRules  \n\u003e implementing the additional DocumentRoots don’t work, so all your domains will be unaccessible.\n\nYou can use the command `dep server:symlink:add` to create a correct symlink.\n\n## Set the DNS records\n\nTo go live, the `A` (IPv4) and the `AAAA` (IPv6) Records need to be set in the domain DNS settings. To find out which are the correct IP addresses, take a look at your [uberspace dashboard], or copy the addresses after the `dep server:domain:add` command.\n\n## Set the Flow Context via `.htaccess`\n\nYou must set the `FLOW_CONTEXT` correctly.\n\nExample:\n\n```apache\n# Dynamic context configuration:\nSetEnvIf Host \\.test$ FLOW_CONTEXT=Development\nSetEnvIf Host \\.prod$ FLOW_CONTEXT=Production/Local\n# SetEnvIf Host \\.space$ FLOW_CONTEXT=Development/Live\n\n\u003cIfModule mod_rewrite.c\u003e\n    RewriteEngine On\n    RewriteCond %{HTTP_HOST} !\\.test$\n    RewriteCond %{HTTP_HOST} !\\.prod$\n    # RewriteCond %{HTTP_HOST} !\\.space$\n    RewriteRule (.*) $1 [E=FLOW_CONTEXT:Production/Live]\n\u003c/IfModule\u003e\n```\n\n## General commands\n\nRun these tasks with `dep COMMAND`. If you want to list all commands, enter `dep` or `dep list`\n\n| Command                     | Description                                                                    |\n| --------------------------- | ------------------------------------------------------------------------------ |\n| **Main tasks**              |                                                                                |\n| `deploy`                    | Deploy/install your project                                                    |\n| `rollback`                  | Rollback to previous release                                                   |\n| `ssh`                       | Connect to host through ssh                                                    |\n| `flow`                      | Run any flow command                                                           |\n| `help`                      | Displays help for a command                                                    |\n| **Deploy tasks**            |                                                                                |\n| `deploy`                    | Deploy your project                                                            |\n| `deploy:unlock`             | Unlock deploy                                                                  |\n| **Database task**           |                                                                                |\n| `database:backup`           | Create a backup from the current database on the server                        |\n| `database:delete`           | Delete a database on the server                                                |\n| `database:download:current` | Download current database from the server                                      |\n| `database:download:dump`    | Download dump from the backup folder on the server                             |\n| `database:import`           | Import a database from the backup folder                                       |\n| `database:list`             | List all databases on the server                                               |\n| **Flow tasks**              |                                                                                |\n| `flow`                      | Run any flow command                                                           |\n| `flow:configuration`        | Edit shared configuration yaml files                                           |\n| `flow:create_admin`         | Create a new administrator                                                     |\n| `flow:flush_caches`         | Flush all caches                                                               |\n| `flow:import`               | Import your local content or a site from a package within DistributionPackages |\n| `flow:node:migrate`         | List and run node migrations                                                   |\n| `flow:node:repair`          | Repair inconsistent nodes in the content repository                            |\n| `flow:publish_resources`    | Publish resources                                                              |\n| `flow:run_migrations`       | Apply database migrations                                                      |\n| **Git tasks**               |                                                                                |\n| `git:commit`                | Commit current changes to git                                                  |\n| `git:ssh:key`               | Output private key for `SSH_PRIVATE_KEY` secret and upload public key to host  |\n| `git:ssh:know_hosts`        | Output the know host for the `SSH_KNOWN_HOSTS` secret                          |\n| `git:tag`                   | Create release tag on git                                                      |\n| **Server tasks**            |                                                                                |\n| `server:cronjob`            | Edit the cronjobs                                                              |\n| `server:dns`                | Output the IP addresses for the `A` and `AAAA` record                          |\n| `server:domain:add`         | Add a domain to uberspace                                                      |\n| `server:domain:list`        | List all domains and subdomains                                                |\n| `server:domain:remove`      | Remove a domain from uberspace                                                 |\n| `server:ssh_key`            | Create and/or read the deployment key                                          |\n| `server:symlink:add`        | Set the symbolic link for this site                                            |\n| `server:symlink:list`       | List current symlinks on the web root                                          |\n| `server:symlink:remove`     | Remove a symbolic link from the web root                                       |\n| `server:php:restart`        | Restart PHP                                                                    |\n| `server:php:version`        | Set the PHP version on the server                                              |\n| **Config tasks**            |                                                                                |\n| `config:current`            | Show current paths                                                             |\n| `config:dump`               | Print host configuration                                                       |\n| `config:hosts`              | Print all hosts                                                                |\n\n## Usage with ddev\n\nIf you use [ddev] for local development, the task `dep flow:import` will not work. You have to enable the setting `ddev` to `true` to make it work. Please run this task not inside the container.\n\n## Slack notifications\n\nThe parameter `slack_webhook` accepts an array with strings beside a simple string.  \nWith this, you can post the notifications to multiple channels.\n\nExample:\n\n```yaml\ndomain.tld:\n  slack_webhook:\n    - https://hooks.slack.com/services/__SLACK/WEBHOOK/CHANNEL_ONE__\n    - https://hooks.slack.com/services/__SLACK/WEBHOOK/CHANNEL_TWO__\n    - https://hooks.slack.com/services/__SLACK/WEBHOOK/CHANNEL_N__\n```\n\n## Deployment to multiple stages and/or via GitHub Actions\n\n\u003cdetails\u003e\n  \u003csummary\u003eDeployment of staging and production to the same hosts\u003c/summary\u003e\n\nIf you want to have a staging and production instance on the same host, you should set up at least two branches, e.g., `staging` and `production`. It is recommended that you name the `stage` and the `branch` name the same.\n\n```yaml\n.base: \u0026base\n  hostname: __SERVER__.uberspace.de\n  user: __USER__\n  repository: git@github.com:__OWNER__/__REPOSITORY__.git\n\ndomain.tld:\n  \u003c\u003c: *base\n  branch: production\n  stage: production\n\nstaging.domain.tld:\n  \u003c\u003c: *base\n  branch: staging\n  stage: staging\n  redis_start_db_number: 10\n```\n\n`redis_start_db_number` has to be set because you don't want to share the same Redis database for staging and production. In the [Default parameter](#default-parameter) section, you can read more about this.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eDeployment of staging and production to the multiple hosts\u003c/summary\u003e\n\n```yaml\n.base: \u0026base\n  repository: git@github.com:__OWNER__/__REPOSITORY__.git\n\ndomain.tld:\n  \u003c\u003c: *base\n  hostname: __SERVER_PROD__.uberspace.de\n  user: __USER_PROD__\n  branch: production\n  stage: production\n\nstaging.domain.tld:\n  \u003c\u003c: *base\n  hostname: __SERVER_STAGE__.uberspace.de\n  user: __USER_STAGE__\n  branch: staging\n  stage: staging\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eAutomatic deployment with GitHub actions\u003c/summary\u003e\n\nIn the [example] folder, you'll find a file called `deployment_werkflow.yaml`. To enable automatic deployments via GitHub actions, you have to put a file like this in your repository under `.github/workflows/deploy.yaml`\n\nThis example is just meant as an inspiration; you can (and should) edit this to fit your needs. In this workflows are some GitHub secrets you can set:\n\n| Secret              | Description                                                                                        |\n| ------------------- | -------------------------------------------------------------------------------------------------- |\n| `COMPOSER_AUTH`     | As described [above](#the---composer_auth-input-option-for-the-tasks)                              |\n| `SLACK_WEBHOOK_URL` | It is recommended to let GitHub handle the slack notifications                                     |\n| `SSH_KNOWN_HOSTS`   | Enter here the host from uberspace. You can output these with the command `dep git:ssh:know_hosts` |\n| `SSH_PRIVATE_KEY`   | Enter here the private key. You can output the private key with the command `dep git:ssh:key`       |\n\n\u003c/details\u003e\n\n## Default parameter\n\nThis package sets some default parameters. All of them are defined in [config.php].  \nYou can override them in your `yaml` or directly in your `PHP` file.\n\n\u003cdetails\u003e\n  \u003csummary\u003eNeos \u0026 Flow related\u003c/summary\u003e\n\n#### `flow_context` (string)\n\nSet the context from flow. Defaults to `Production/Live`\n\n#### `shared_dirs` (array)\n\nThese folders get shared over all deployments. Defaults to\n\n```yaml\nshared_dirs:\n  - Data/Persistent\n  - Data/Logs\n  - Configuration\n```\n\n#### `upload_assets_folder` (array)\n\nThese folders (globbing-enabled) will get uploaded from the current installation.  \nPrimarily used for rendered CSS \u0026 JS files, which you don't want in your repository.  \nTo disable the upload you can set this to false: `set('upload_assets_folder', false);` or in the `yaml` file: `upload_assets_folder: false`.  \nDefaults to\n\n```yaml\nupload_assets_folder:\n  - DistributionPackages/*/Resources/Private/Templates/InlineAssets\n  - DistributionPackages/*/Resources/Public/Scripts\n  - DistributionPackages/*/Resources/Public/Styles\n```\n\n#### `db_name` \u0026 `database` (string)\n\nIf Neos is already installed, it will use the flow command `configuration:show` to get the database name. Otherwise, it will check if the value `database` is set and use this as a prefix for the required username from Uberspace. If nothing specific is set it will convert the repository name to camel case, append `_neos`, and also (if specified) the name of the `stage`.\n\n#### `redis_start_db_number` (integer)\n\nDefaults to `2`\n\n#### `redis_defaultLifetime` (integer)\n\nDefaults to `0`\n\n#### `redis_databases` (array)\n\nDefaults to\n\n```yaml\nredis_databases:\n  - Flow_Mvc_Routing_Route\n  - Flow_Mvc_Routing_Resolve\n  - Neos_Fusion_Content\n  - Flow_Session_MetaData\n  - Flow_Session_Storage\n  - Neos_Media_ImageSize\n  - Flow_Security_Cryptography_HashService\n```\n\n#### redis_databases_with_numbers (array)\n\nThis sets the database names (based on `redis_databases`) with the corresponding number (based on `redis_start_db_number`)\n\n```yaml\nredis_databases_with_numbers:\n  Flow_Mvc_Routing_Route: 2\n  Flow_Mvc_Routing_Resolve: 3\n  Neos_Fusion_Content: 4\n  Flow_Session_MetaData: 5\n  Flow_Session_Storage: 6\n  Neos_Media_ImageSize: 7\n  Flow_Security_Cryptography_HashService: 8\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eServer related\u003c/summary\u003e\n\n#### `editor` (string)\n\nDefaults to `nano`\n\n#### `html_path` (string)\n\nDefaults to `/var/www/virtual/{{user}}`\n\n#### `deploy_path` (string)\n\nDefaults to `{{html_path}}/{{deploy_folder}}`\n\n#### `db_backup_folder` (string)\n\nDefaults to `{{deploy_path}}/.dep/databases/dumps`\n\n#### `db_backup_keep_dumps` (integer)\n\nDefaults to `5`\n\n#### `deploy_folder` (string)\n\nDefaults to the repository name. If a `stage` is set, the stage will be placed in a subfolder of this folder. Example: Your repository has the name owner/MyNeosProject with the stage `production`. In that case, the `deploy_folder` will be `MyNeosProject/Production`.\n\n#### `release_name` (string)\n\nThis is set to the current date and time. Example: `2021-01-30__13-40-10`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eGit related\u003c/summary\u003e\n\n#### `git_commit_types` (array)\n\nYou can set the types of commits for the command `git:commit`.  \nPer default, it is based on [commitizen].\n\n```yaml\ngit_commit_types:\n  Fix: A bug fix\n  Update: A backwards-compatible enhancement\n  Breaking: A backwards-incompatible enhancement\n  Docs: Documentation change\n  Build: Build process update\n  New: A new feature implementation\n  Upgrade: Dependency upgrade\n  Chore: 'Other changes (e.g.: refactoring)'\n```\n\n\u003c/details\u003e\n\n[deployer]: https://deployer.org\n[neos cms]: https://www.neos.io\n[example]: example\n[ddev]: https://ddev.com\n[slack webhook]: https://slack.com/oauth/authorize?\u0026client_id=113734341365.225973502034\u0026scope=incoming-webhook\n[let's encrypt]: https://letsencrypt.org\n[uberspace]: https://uberspace.de/\n[uberspace manual]: https://manual.uberspace.de/\n[register your own uberspace]: https://dashboard.uberspace.de/register\n[ssh manual on uberspace]: https://manual.uberspace.de/basics-ssh.html\n[ssh manual on github]: https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent\n[uberspace dashboard]: https://dashboard.uberspace.de/dashboard/datasheet\n[config.php]: config.php\n[commitizen]: https://github.com/commitizen/cz-cli\n[social preview]: https://user-images.githubusercontent.com/4510166/101900466-d099fb80-3baf-11eb-9599-e5c721001736.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonnitto%2Fuberspace.deployer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonnitto%2Fuberspace.deployer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonnitto%2Fuberspace.deployer/lists"}