From 2513160f13d5b317e52fb845451420830a41904e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kol=C3=A1=C5=99?= Date: Thu, 5 Feb 2026 18:39:47 +0100 Subject: [PATCH 1/4] Feature/ddev (#2) * Init commit of ddev --------- Co-authored-by: Lekes Roman --- .ddev/config.yaml | 20 +++ .gitignore | 8 + DDEV_MIGRATION.md | 167 ++++++++++++++++++ DDEV_SETUP.md | 82 +++++++++ README.md | 16 ++ docroot/sites/default/settings.php | 9 + .../sites/default/settings/ddev.settings.php | 92 ++++++++++ .../default/settings/includes.settings.php | 11 ++ private/.htaccess | 27 +++ 9 files changed, 432 insertions(+) create mode 100644 .ddev/config.yaml create mode 100644 DDEV_MIGRATION.md create mode 100644 DDEV_SETUP.md create mode 100644 docroot/sites/default/settings/ddev.settings.php create mode 100644 private/.htaccess diff --git a/.ddev/config.yaml b/.ddev/config.yaml new file mode 100644 index 000000000..c657b31a0 --- /dev/null +++ b/.ddev/config.yaml @@ -0,0 +1,20 @@ +name: drupalcz +type: drupal9 +docroot: docroot +php_version: "8.1" +webserver_type: apache-fpm +router_http_port: "80" +router_https_port: "443" +xdebug_enabled: false +additional_hostnames: [] +additional_fqdns: [] +database: + type: mariadb + version: "10.11" +use_dns_when_possible: true +composer_version: "2" +web_environment: [] + +hooks: + post-start: + - exec: scripts/create-settings.sh diff --git a/.gitignore b/.gitignore index f1497e372..5831ad19b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,14 @@ local.blt.yml .lando.local.yml /docroot/themes/custom/dcz_theme/config_local.json +# DDEV +.ddev/.homeadditions +.ddev/.gitignore +.ddev/import-db +.ddev/db_snapshots +.ddev/.dbirc +.ddev/.bash_history + # Ignore drupal core. docroot/core diff --git a/DDEV_MIGRATION.md b/DDEV_MIGRATION.md new file mode 100644 index 000000000..b7b450c34 --- /dev/null +++ b/DDEV_MIGRATION.md @@ -0,0 +1,167 @@ +# Migrating from Lando to DDEV + +This document explains how to migrate from Lando to DDEV for local development. + +## Prerequisites + +1. Install DDEV: https://ddev.readthedocs.io/en/stable/#installation +2. Stop and remove your Lando environment (optional, but recommended to free resources): + ``` + lando stop + lando destroy + ``` + +## Migration Steps + +### 1. Start DDEV + +```bash +ddev start +``` + +This will: +- Download required Docker images +- Create containers for web server, database, and other services +- Run the `scripts/create-settings.sh` hook to create local settings file + +### 2. Install Drupal + +If you're setting up from scratch: + +```bash +ddev drush si minimal --existing-config +``` + +### 3. Import Content (Optional) + +If you want default content for development: + +```bash +ddev drush dcdi --force update +ddev drush cr +``` + +### 4. Get Login Link + +```bash +ddev drush uli +``` + +### 5. Access Your Site + +Your site will be available at: +- http://drupalcz.ddev.site +- https://drupalcz.ddev.site (if mkcert is installed) + +## Useful DDEV Commands + +| Lando Command | DDEV Equivalent | +|---------------|-----------------| +| `lando start` | `ddev start` | +| `lando stop` | `ddev stop` | +| `lando poweroff` | `ddev poweroff` | +| `lando drush ` | `ddev drush ` | +| `lando composer ` | `ddev composer ` | +| `lando ssh` | `ddev ssh` | +| `lando db-import ` | `ddev import-db --src=` | +| `lando db-export` | `ddev export-db` | +| `lando logs` | `ddev logs` | + +## Database Migration + +If you have an existing database in Lando that you want to migrate: + +1. Export from Lando: + ```bash + lando db-export database.sql.gz + ``` + +2. Stop Lando and start DDEV: + ```bash + lando stop + ddev start + ``` + +3. Import into DDEV: + ```bash + ddev import-db --src=database.sql.gz + ddev drush cr + ``` + +## Files Migration + +If you have user-uploaded files: + +1. Your files in `docroot/sites/default/files/` will remain in place +2. Private files are now expected at `/var/www/html/private` inside the container + +## Frontend Development + +The original Lando setup included Node.js for theme development. For DDEV, you have two options: + +### Option 1: Use DDEV's Node service (Recommended) + +Add to `.ddev/config.yaml`: +```yaml +web_extra_daemons: + - name: "node" + command: "/var/www/html/docroot/themes/custom/dcz_theme && npm install && npm run watch" + directory: /var/www/html/docroot/themes/custom/dcz_theme +``` + +### Option 2: Use Node.js on your host machine + +Install Node.js locally and run: +```bash +cd docroot/themes/custom/dcz_theme +npm install +npm run watch +``` + +## Differences from Lando + +- **Database host**: Changed from `database` to `db` +- **Database credentials**: All are `db` (name, username, password) +- **Project URL**: Changed from `*.lndo.site` to `*.ddev.site` +- **Mailhog**: Available at http://drupalcz.ddev.site:8025 +- **PHP version**: 7.4 (same as Lando) +- **Web server**: Apache (same as Lando) + +## Custom Settings Structure + +This project uses a custom settings file structure instead of DDEV's default `settings.ddev.php`: + +1. **Main settings**: `docroot/sites/default/settings.php` includes `docroot/sites/default/settings/includes.settings.php` +2. **DDEV detection**: `includes.settings.php` detects DDEV via the `IS_DDEV_PROJECT` environment variable +3. **DDEV settings**: When DDEV is detected, it loads `docroot/sites/default/settings/ddev.settings.php` +4. **Local overrides**: Finally, it loads `docroot/sites/default/settings/local.settings.php` if it exists + +This structure allows the same codebase to work with Lando, DDEV, Acquia Cloud, and other environments without modification. + +## Troubleshooting + +### Clear cache if you have issues +```bash +ddev drush cr +``` + +### Restart DDEV +```bash +ddev restart +``` + +### Check DDEV status +```bash +ddev describe +``` + +### View logs +```bash +ddev logs +``` + +## Additional Resources + +- DDEV Documentation: https://ddev.readthedocs.io/ +- DDEV Drupal Quickstart: https://ddev.readthedocs.io/en/stable/users/quickstart/#drupal + diff --git a/DDEV_SETUP.md b/DDEV_SETUP.md new file mode 100644 index 000000000..02c928b6a --- /dev/null +++ b/DDEV_SETUP.md @@ -0,0 +1,82 @@ +# DDEV Migration Summary + +## Files Created + +1. **`.ddev/config.yaml`** - Main DDEV configuration file + - Configures Drupal 9, PHP 7.4, Apache, MariaDB 10.4 + - Disables DDEV's automatic settings management (we use custom structure) + - Includes post-start hook to create local settings file + +2. **`docroot/sites/default/settings/ddev.settings.php`** - DDEV-specific settings + - Database connection configuration (db/db/db on host 'db') + - Development-friendly settings (caching disabled, update access enabled) + - Config split configuration for development + - Private files path and other Drupal settings + +3. **`DDEV_MIGRATION.md`** - Migration guide + - Step-by-step instructions for migrating from Lando to DDEV + - Command reference table + - Database and files migration instructions + - Troubleshooting tips + +## Files Modified + +1. **`docroot/sites/default/settings/includes.settings.php`** + - Added DDEV environment detection using `IS_DDEV_PROJECT` environment variable + - Loads `settings/ddev.settings.php` when running in DDEV + +2. **`.gitignore`** + - Added DDEV-specific ignore patterns + +3. **`README.md`** + - Added DDEV setup instructions + - Added reference to migration guide + +## How It Works + +### Settings Loading Chain: +1. Drupal loads `docroot/sites/default/settings.php` +2. Which includes `docroot/sites/default/settings/includes.settings.php` +3. `includes.settings.php` checks for environment: + - If `IS_DDEV_PROJECT=true` → loads `settings/ddev.settings.php` + - If `LANDO_APP_NAME` exists → loads `settings/lando.settings.php` + - If `AH_SITE_ENVIRONMENT` exists → loads Acquia Cloud settings +4. Finally loads `settings/local.settings.php` for any local overrides + +### Database Configuration: +- **Host**: `db` (DDEV's database container) +- **Database**: `db` +- **Username**: `db` +- **Password**: `db` +- **Port**: `3306` + +This setup ensures that: +- Both Lando and DDEV can work simultaneously (different environment detection) +- No code changes needed when switching between environments +- Settings are organized and maintainable +- DDEV doesn't interfere with the custom settings structure + +## Quick Start + +```bash +# Start DDEV +ddev start + +# Check status +ddev drush status + +# Get login link +ddev drush uli + +# Access site at: +# http://drupalcz.ddev.site +``` + +## Note on settings.ddev.php + +DDEV normally auto-generates a `settings.ddev.php` file in `docroot/sites/default/`. +This project uses a custom settings structure, so we: +- Set `disable_settings_management: true` in `.ddev/config.yaml` +- Use `docroot/sites/default/settings/ddev.settings.php` instead +- This allows better organization and multi-environment support + diff --git a/README.md b/README.md index 4ffc60a28..644d7514b 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,22 @@ Branch | Build status | Dev site | HTTP Basic auth * .travis.yml - Travis CI test suite configuration. ## Requirements +### Pokud používáte DDEV +* Nainstalujte si DDEV, https://ddev.readthedocs.io/en/stable/#installation +* V adresáři projektu spusťte DDEV + + ddev start + +* Po prvním spuštění nainstalujte Drupal: + + ddev drush si minimal --existing-config + +* Přihlaste se: + + ddev drush uli + +* **Pokud migrujete z Lando**, viz [DDEV_MIGRATION.md](DDEV_MIGRATION.md) + ### Pokud používáte Lando * Nainstalujte si Lando, https://docs.devwithlando.io/installation/system-requirements.html * V adresáři projektu spusťte Lando diff --git a/docroot/sites/default/settings.php b/docroot/sites/default/settings.php index 1b1291be9..ae556e64b 100644 --- a/docroot/sites/default/settings.php +++ b/docroot/sites/default/settings.php @@ -6,3 +6,12 @@ */ require_once DRUPAL_ROOT . "/sites/default/settings/includes.settings.php"; + +// Automatically generated include for settings managed by ddev. +$ddev_settings = __DIR__ . '/settings.ddev.php'; +if (getenv('IS_DDEV_PROJECT') == 'true' && is_readable($ddev_settings)) { + require $ddev_settings; +} + +// WTF, without this here it doesnt work.. to be fixed! +$settings['config_sync_directory'] = "../config/default"; diff --git a/docroot/sites/default/settings/ddev.settings.php b/docroot/sites/default/settings/ddev.settings.php new file mode 100644 index 000000000..9c1726384 --- /dev/null +++ b/docroot/sites/default/settings/ddev.settings.php @@ -0,0 +1,92 @@ + + [ + 'default' => + [ + 'database' => $loc_db_name, + 'username' => $loc_db_user, + 'password' => $loc_db_pass, + 'host' => $loc_db_host, + 'port' => $loc_db_port, + 'driver' => 'mysql', + 'prefix' => '', + ], + ], +]; + +/** + * Setup files on local. + */ +$settings['file_public_path'] = "sites/default/files"; +$settings['file_private_path'] = "/var/www/html/private"; +$settings["file_temp_path"] = '/tmp'; + +/** + * Skip file system permissions hardening on local. + */ +$settings['skip_permissions_hardening'] = TRUE; + +/** + * Access control for update.php script. + */ +$settings['update_free_access'] = TRUE; + +/** + * Enable local development services. + */ +$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml'; + +/** + * Disable Drupal caching. + */ +$settings['cache']['bins']['render'] = 'cache.backend.null'; +$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null'; + +/** + * Enable access to rebuild.php. + */ +$settings['rebuild_access'] = TRUE; + +/** + * Salt for one-time login links, cancel links, form tokens, etc. + */ +$settings['hash_salt'] = 'LOCAL_ONLY'; + +/** + * Simulate config we have available on Acquia. + * + * Get your own keys: + * * Slack token: https://api.slack.com/custom-integrations/legacy-tokens . + */ +$config['slack_invite.settings']['token'] = "DUMMY_TOKEN"; + +/** + * Set active config split. + */ +$config['config_split.config_split.default_content']['status'] = TRUE; +$config['config_split.config_split.dev']['status'] = TRUE; +$config['config_split.config_split.test']['status'] = FALSE; +$config['config_split.config_split.cleantalk']['status'] = FALSE; +$config['config_split.config_split.prod']['status'] = FALSE; + +/** + * Trusted host patterns for DDEV. + */ +$settings['trusted_host_patterns'] = [ + '^localhost$', + '^drupalcz\.ddev\.site$', +]; + diff --git a/docroot/sites/default/settings/includes.settings.php b/docroot/sites/default/settings/includes.settings.php index b1c309a47..5beaa3931 100644 --- a/docroot/sites/default/settings/includes.settings.php +++ b/docroot/sites/default/settings/includes.settings.php @@ -139,6 +139,17 @@ } } +/** + * DDEV environment settings. + */ +if (getenv('IS_DDEV_PROJECT') == 'true') { + $path = DRUPAL_ROOT . "/sites/default/settings/ddev.settings.php"; + // Load settings. + if (!empty($path) && file_exists($path)) { + //require $path; + } +} + /** * Allow final local override. */ diff --git a/private/.htaccess b/private/.htaccess new file mode 100644 index 000000000..d43687965 --- /dev/null +++ b/private/.htaccess @@ -0,0 +1,27 @@ +# Deny all requests from Apache 2.4+. + + Require all denied + + +# Deny all requests from Apache 2.0-2.2. + + Deny from all + + +# Turn off all options we don't need. +Options -Indexes -ExecCGI -Includes -MultiViews + +# Set the catch-all handler to prevent scripts from being executed. +SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 + + # Override the handler again if we're run later in the evaluation list. + SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003 + + +# If we know how to do it safely, disable the PHP engine entirely. + + php_flag engine off + + + php_flag engine off + \ No newline at end of file From ca5284af4a8c2857579126a4dd1d5e6d8a6b5295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kol=C3=A1=C5=99?= Date: Thu, 5 Feb 2026 18:44:28 +0100 Subject: [PATCH 2/4] Feature/ddev (#3) * Init commit of ddev. * WIP * use PHP 8.1 --------- Co-authored-by: Lekes Roman From 3201ca561c9a2c5ab4d2a7e026604e39081ea797 Mon Sep 17 00:00:00 2001 From: Martin Kolar Date: Fri, 6 Feb 2026 12:36:27 +0100 Subject: [PATCH 3/4] Moving slack_invite to custom. --- .../modules/custom/slack_invite/LICENSE.txt | 339 ++++++++++++++++++ .../modules/custom/slack_invite/PATCHES.txt | 7 + .../config/install/slack_invite.settings.yml | 6 + .../custom/slack_invite/slack_invite.info.yml | 6 + .../slack_invite/slack_invite.links.menu.yml | 5 + .../custom/slack_invite/slack_invite.module | 42 +++ .../slack_invite/slack_invite.permissions.yml | 7 + .../slack_invite/slack_invite.routing.yml | 15 + .../slack_invite/slack_invite.services.yml | 3 + .../slack_invite/src/Form/SlackInviteForm.php | 68 ++++ .../src/Form/SlackInviteSettingsForm.php | 166 +++++++++ .../Form/SlackInviteTwoStepApproveForm.php | 72 ++++ .../src/Plugin/Block/SlackInviteFormBlock.php | 30 ++ .../custom/slack_invite/src/SlackInvite.php | 172 +++++++++ 14 files changed, 938 insertions(+) create mode 100644 docroot/modules/custom/slack_invite/LICENSE.txt create mode 100644 docroot/modules/custom/slack_invite/PATCHES.txt create mode 100644 docroot/modules/custom/slack_invite/config/install/slack_invite.settings.yml create mode 100644 docroot/modules/custom/slack_invite/slack_invite.info.yml create mode 100644 docroot/modules/custom/slack_invite/slack_invite.links.menu.yml create mode 100644 docroot/modules/custom/slack_invite/slack_invite.module create mode 100644 docroot/modules/custom/slack_invite/slack_invite.permissions.yml create mode 100644 docroot/modules/custom/slack_invite/slack_invite.routing.yml create mode 100644 docroot/modules/custom/slack_invite/slack_invite.services.yml create mode 100644 docroot/modules/custom/slack_invite/src/Form/SlackInviteForm.php create mode 100644 docroot/modules/custom/slack_invite/src/Form/SlackInviteSettingsForm.php create mode 100644 docroot/modules/custom/slack_invite/src/Form/SlackInviteTwoStepApproveForm.php create mode 100644 docroot/modules/custom/slack_invite/src/Plugin/Block/SlackInviteFormBlock.php create mode 100644 docroot/modules/custom/slack_invite/src/SlackInvite.php diff --git a/docroot/modules/custom/slack_invite/LICENSE.txt b/docroot/modules/custom/slack_invite/LICENSE.txt new file mode 100644 index 000000000..d159169d1 --- /dev/null +++ b/docroot/modules/custom/slack_invite/LICENSE.txt @@ -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/docroot/modules/custom/slack_invite/PATCHES.txt b/docroot/modules/custom/slack_invite/PATCHES.txt new file mode 100644 index 000000000..876108baf --- /dev/null +++ b/docroot/modules/custom/slack_invite/PATCHES.txt @@ -0,0 +1,7 @@ +This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches) +Patches applied to this directory: + +3189435 - The URI '' is invalid. +Source: https://git.drupalcode.org/issue/slack_invite-3189435/-/commit/2a10d44bafe2a768dbceceadf6a51e500caae539.patch + + diff --git a/docroot/modules/custom/slack_invite/config/install/slack_invite.settings.yml b/docroot/modules/custom/slack_invite/config/install/slack_invite.settings.yml new file mode 100644 index 000000000..96dfc4883 --- /dev/null +++ b/docroot/modules/custom/slack_invite/config/install/slack_invite.settings.yml @@ -0,0 +1,6 @@ +token: "" +hostname: "" +twostep: + enabled: FALSE + channel: "" + message: "!email has requested an invitation to the Slack team. Click the following link to approve: !url" diff --git a/docroot/modules/custom/slack_invite/slack_invite.info.yml b/docroot/modules/custom/slack_invite/slack_invite.info.yml new file mode 100644 index 000000000..8895a611a --- /dev/null +++ b/docroot/modules/custom/slack_invite/slack_invite.info.yml @@ -0,0 +1,6 @@ +name: Slack Invite +type: module +description: 'Invite your users to your slack team' +package: Custom +core_version_requirement: ^9 || ^10 || ^11 + diff --git a/docroot/modules/custom/slack_invite/slack_invite.links.menu.yml b/docroot/modules/custom/slack_invite/slack_invite.links.menu.yml new file mode 100644 index 000000000..4fde6ca0e --- /dev/null +++ b/docroot/modules/custom/slack_invite/slack_invite.links.menu.yml @@ -0,0 +1,5 @@ +slack_invite.settingss: + title: 'Slack Invite' + parent: system.admin_config_services + description: 'Slack Invite Settings' + route_name: slack_invite.settings diff --git a/docroot/modules/custom/slack_invite/slack_invite.module b/docroot/modules/custom/slack_invite/slack_invite.module new file mode 100644 index 000000000..1b4ee3e2f --- /dev/null +++ b/docroot/modules/custom/slack_invite/slack_invite.module @@ -0,0 +1,42 @@ + 1, + 'email' => $email, + 'set_active' => 'true', + 'token' => variable_get('slack_invite_token', ''), + ]; + + $data['channels'] = variable_get('slack_invite_channels', ''); + if (empty($data['channels'])) { + unset($data['channels']); + } + + $data = drupal_http_build_query($data); + $options = [ + 'method' => 'POST', + 'headers' => ['Content-Type' => 'application/x-www-form-urlencoded'], + 'data' => $data, + ]; + + return drupal_http_request("{$api_url}", $options); +} diff --git a/docroot/modules/custom/slack_invite/slack_invite.permissions.yml b/docroot/modules/custom/slack_invite/slack_invite.permissions.yml new file mode 100644 index 000000000..47869f4a7 --- /dev/null +++ b/docroot/modules/custom/slack_invite/slack_invite.permissions.yml @@ -0,0 +1,7 @@ +administer slack invite: + title: 'Administer Slack Invite Settings.' + description: 'Administer the Slack Invite Settings.' + +approve slack invite: + title: 'Approve Slack Invites.' + description: 'Approve two-step Slack invitations.' diff --git a/docroot/modules/custom/slack_invite/slack_invite.routing.yml b/docroot/modules/custom/slack_invite/slack_invite.routing.yml new file mode 100644 index 000000000..b9e16fe59 --- /dev/null +++ b/docroot/modules/custom/slack_invite/slack_invite.routing.yml @@ -0,0 +1,15 @@ +slack_invite.settings: + path: '/admin/config/services/slack-invite' + defaults: + _form: 'Drupal\slack_invite\Form\SlackInviteSettingsForm' + _title: 'Slack Invite Settings' + requirements: + _permission: 'administer slack invite' + +slack_invite.twostep: + path: '/slack_invite/{email}/{token}' + defaults: + _form: 'Drupal\slack_invite\Form\SlackInviteTwoStepApproveForm' + _title: 'Approve Slack invitation' + requirements: + _custom_access: 'Drupal\slack_invite\Form\SlackInviteTwoStepApproveForm::access' diff --git a/docroot/modules/custom/slack_invite/slack_invite.services.yml b/docroot/modules/custom/slack_invite/slack_invite.services.yml new file mode 100644 index 000000000..389293e56 --- /dev/null +++ b/docroot/modules/custom/slack_invite/slack_invite.services.yml @@ -0,0 +1,3 @@ +services: + slack_invite: + class: Drupal\slack_invite\SlackInvite diff --git a/docroot/modules/custom/slack_invite/src/Form/SlackInviteForm.php b/docroot/modules/custom/slack_invite/src/Form/SlackInviteForm.php new file mode 100644 index 000000000..5fdcc0e8b --- /dev/null +++ b/docroot/modules/custom/slack_invite/src/Form/SlackInviteForm.php @@ -0,0 +1,68 @@ +config('slack_invite.settings'); + + $form['#action'] = Url::fromRoute('', ['query' => $this->getDestinationArray(), 'external' => FALSE])->toString(); + $form['slack_email'] = [ + '#type' => 'textfield', + '#title' => $this->t('Email'), + '#description' => $this->t('Enter email address for slack invite'), + '#required' => TRUE, + ]; + + $form['actions'] = [ + '#type' => 'actions', + ]; + $form['actions']['submit'] = [ + '#type' => 'submit', + '#value' => $this->t('Send') + ]; + return $form; + } + + /** + * {@inheritdoc} + */ + public function validateForm(array &$form, FormStateInterface $form_state) { + $email = $form_state->getValue('slack_email'); + if (!\Drupal::service('email.validator')->isValid($email)) { + $form_state->setErrorByName('slack_email', $this->t('Enter email address in valid format (ex. example@example.com)')); + } + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $slack_invite = \Drupal::service('slack_invite'); + $slack_invite->send($form_state->getValue('slack_email')); + } +} diff --git a/docroot/modules/custom/slack_invite/src/Form/SlackInviteSettingsForm.php b/docroot/modules/custom/slack_invite/src/Form/SlackInviteSettingsForm.php new file mode 100644 index 000000000..d9801ec63 --- /dev/null +++ b/docroot/modules/custom/slack_invite/src/Form/SlackInviteSettingsForm.php @@ -0,0 +1,166 @@ +config('slack_invite.settings'); + + $form['slack_invite_token'] = [ + '#type' => 'textfield', + '#title' => $this->t('Slack Web API Token'), + '#description' => $this->t("Enter the Web API token you get from your team domain. Please ensure that the token has the required 'admin' scope to send out email invites."), + '#default_value' => $config->get('token'), + '#required' => TRUE, + ]; + + $form['slack_invite_hostname'] = [ + '#type' => 'textfield', + '#title' => $this->t('Slack Domain Hostname'), + '#description' => $this->t('Enter your slack team domain (ex. if your domain is https://drupal.slack.com, you would enter "drupal" minus the quotations).'), + '#default_value' => $config->get('hostname'), + '#required' => TRUE, + ]; + + $form['slack_bypass_check'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Bypass credential check'), + '#description' => $this->t('Bypass checking that token and hostname combination are valid'), + ]; + + $form['slack_twostep'] = [ + '#type' => 'details', + '#title' => $this->t('Two-step approval'), + '#open' => TRUE, + '#tree' => TRUE, + ]; + + $twostep = $config->get('twostep'); + $form['slack_twostep']['enabled'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Enable two-step approval'), + '#default_value' => $twostep['enabled'], + ]; + + $form['slack_twostep']['channel'] = [ + '#type' => 'textfield', + '#title' => $this->t('Channel'), + '#description' => $this->t('A slack channel name or id in which the invitation approval request will be sent'), + '#default_value' => $twostep['channel'], + '#states' => [ + 'invisible' => [ + ':input[name="slack_twostep[enabled]"]' => ['checked' => FALSE], + ], + ], + ]; + + $form['slack_twostep']['message'] = [ + '#type' => 'textfield', + '#title' => $this->t('Message'), + '#description' => $this->t('A message to sent to the above channel'), + '#default_value' => $twostep['message'], + '#states' => [ + 'invisible' => [ + ':input[name="slack_twostep[enabled]"]' => ['checked' => FALSE], + ], + ], + ]; + + return parent::buildForm($form, $form_state); + } + + /** + * {@inheritdoc} + */ + public function validateForm(array &$form, FormStateInterface $form_state) { + if ($form_state->getValue('slack_twostep')['enabled']) { + // Validate channel. + if (empty($form_state->getValue('slack_twostep')['channel'])) { + $form_state->setError($form['slack_twostep']['channel'], $this->t('Channel field is required when two-step approval is enabled.')); + } + + // Validate message. + if (empty($form_state->getValue('slack_twostep')['message'])) { + $form_state->setError($form['slack_twostep']['message'], $this->t('Message field is required when two-step approval is enabled.')); + } + } + + if ($form_state->getValue('slack_bypass_check')) { + return; + } + $team_hostname = $form_state->getValue('slack_invite_hostname'); + $token = $form_state->getValue('slack_invite_token'); + $api_url = "https://{$team_hostname}.slack.com/api/api.test"; + + $data = [ + 'form_params' => [ + '_attempts' => 1, + 'token' => $token, + ], + ]; + + try { + $client = \Drupal::httpClient(); + $response = $client->request('POST', $api_url, $data); + // Expected result. + $response_data = json_decode('' . $response->getBody()); + if ($response_data->ok !== TRUE) { + throw new Exception($this->t('Please check the token and hostname; unable to test request')); + } + // Ensure the correct scope is set. + if ($response->hasHeader('x-oauth-scopes')) { + $scopes = explode(',', $response->getHeader('x-oauth-scopes')[0]); + if (!in_array('admin', $scopes)) { + throw new Exception($this->t('The supplied token is missing the required scope: admin')); + } + } + } + catch (Exception $e) { + $form_state->setErrorByName('slack_invite_token', $e->getMessage()); + } + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $values = $form_state->getValues(); + + $config = $this->config('slack_invite.settings'); + $config->set('token', $values['slack_invite_token']) + ->set('hostname', $values['slack_invite_hostname']) + ->set('twostep', $values['slack_twostep']) + ->save(); + parent::submitForm($form, $form_state); + } + +} diff --git a/docroot/modules/custom/slack_invite/src/Form/SlackInviteTwoStepApproveForm.php b/docroot/modules/custom/slack_invite/src/Form/SlackInviteTwoStepApproveForm.php new file mode 100644 index 000000000..fb05c6323 --- /dev/null +++ b/docroot/modules/custom/slack_invite/src/Form/SlackInviteTwoStepApproveForm.php @@ -0,0 +1,72 @@ +email = \Drupal::routeMatch()->getParameter('email'); + $this->token = \Drupal::routeMatch()->getParameter('token'); + } + + /** + * Access check for form route. + */ + public function access(AccountInterface $account) { + $permission = $account->hasPermission('approve slack invite'); + + $slack_invite = \Drupal::service('slack_invite'); + $token = $this->token == $slack_invite->getEmailToken($this->email); + + return AccessResult::allowedIf($permission && $token); + } + + /** + * {@inheritdoc} + */ + public function getFormID() { + return 'slack_invite_twostep_approve_form'; + } + + /** + * @inheritdoc + */ + public function getCancelUrl() { + return Url::fromRoute(''); + } + + /** + * @inheritdoc + */ + public function getQuestion() { + return $this->t('Are you sure you want to invite %email to the Slack team?', ['%email' => $this->email]); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $slack_invite = \Drupal::service('slack_invite'); + $slack_invite->send(\Drupal::routeMatch()->getParameter('email'), TRUE); + $form_state->setRedirectUrl($this->getCancelUrl()); + } +} diff --git a/docroot/modules/custom/slack_invite/src/Plugin/Block/SlackInviteFormBlock.php b/docroot/modules/custom/slack_invite/src/Plugin/Block/SlackInviteFormBlock.php new file mode 100644 index 000000000..f186920eb --- /dev/null +++ b/docroot/modules/custom/slack_invite/src/Plugin/Block/SlackInviteFormBlock.php @@ -0,0 +1,30 @@ +getForm('Drupal\slack_invite\Form\SlackInviteForm'); + } + +} diff --git a/docroot/modules/custom/slack_invite/src/SlackInvite.php b/docroot/modules/custom/slack_invite/src/SlackInvite.php new file mode 100644 index 000000000..8c5018bba --- /dev/null +++ b/docroot/modules/custom/slack_invite/src/SlackInvite.php @@ -0,0 +1,172 @@ +email = $email; + $this->config = \Drupal::config('slack_invite.settings'); + $method = !$this->config->get('twostep')['enabled'] ? 'sendDirect' : 'sendTwoStep'; + if ($direct == TRUE) { + $method = 'sendDirect'; + } + call_user_func([$this, $method]); + } + + /** + * Send the invite directly to the user. + */ + protected function sendDirect() { + $team_hostname = $this->config->get('hostname'); + $api_url = "https://{$team_hostname}.slack.com/api/users.admin.invite?t=" . time(); + + $data = [ + 'form_params' => [ + '_attempts' => 1, + 'email' => $this->email, + 'set_active' => 'true', + 'token' => $this->config->get('token'), + ], + ]; + + try { + $client = \Drupal::httpClient(); + $response = $client->request('POST', $api_url, $data); + + $response_data = json_decode('' . $response->getBody()); + if ($response_data->ok == TRUE) { + \Drupal::messenger()->addStatus(t('You will receive an email notification inviting you to join the slack team shortly.')); + } + else { + $message = ''; + switch ($response_data->error) { + case SLACK_INVITE_ALREADY_IN_TEAM: + $message = $this->t('The user is already a member of the team'); + break; + + case SLACK_INVITE_SENT_RECENTLY: + $message = $this->t('The user was recently sent an invitation.'); + break; + + case SLACK_INVITE_ALREADY_INVITED: + $message = $this->t('The user is already invited.'); + break; + + default: + $message = $data['error']; + break; + } + \Drupal::messenger()->addStatus($this->t('There was an error sending your invite. Please contact the administrator with the following error details. The error message from slack was: @message', ['@message' => $message])); + } + } + catch (Exception $e) { + \Drupal::messenger()->addError($this->t('Something went wrong with the request. Please contact site administrator.')); + } + } + + /** + * Send a two-step request for invitation to the designated Slack channel. + */ + protected function sendTwoStep() { + $token = $this->getEmailToken($this->email); + $url = Url::fromRoute('slack_invite.twostep', [ + 'email' => $this->email, + 'token' => $token, + ], ['absolute' => TRUE]); + $url = $url->toString(); + + $team_hostname = $this->config->get('hostname'); + $api_url = "https://{$team_hostname}.slack.com/api/chat.postMessage?t=" . time(); + + $message = $this->t($this->config->get('twostep')['message'], [ + '!email' => $this->email, + '!url' => $url, + ]); + + $data = [ + 'form_params' => [ + '_attempts' => 1, + 'token' => $this->config->get('token'), + 'channel' => $this->config->get('twostep')['channel'], + 'text' => $message->render(), + ], + ]; + + try { + $client = \Drupal::httpClient(); + $response = $client->request('POST', $api_url, $data); + + $response_data = json_decode('' . $response->getBody()); + if ($response_data->ok == TRUE) { + \Drupal::messenger()->addStatus($this->t('Your slack invitation request has been made and you will receive an email notification inviting you to join the slack team pending approval.')); + } + else { + $message = ''; + switch ($response_data->error) { + default: + $message = $data['error']; + break; + } + \Drupal::messenger()->addStatus($this->t('There was an error sending your invitation request. Please contact the administrator with the following error details. The error message from slack was: @message', ['@message' => $message])); + } + } + catch (Exception $e) { + \Drupal::messenger()->addError($this->t('Something went wrong with the request. Please contact site administrator.')); + } + } + + /** + * @param $email + * @return string + */ + public function getEmailToken($email) { + // Return the first 8 characters. + return substr(Crypt::hmacBase64($email, $this->getPrivateKey() . $this->getHashSalt()), 0, 8); + } + + /** + * Gets the Drupal private key. + * + * @return string + * The Drupal private key. + */ + protected function getPrivateKey() { + return \Drupal::service('private_key')->get(); + } + + /** + * Gets a salt useful for hardening against SQL injection. + * + * @return string + * A salt based on information in settings.php, not in the database. + * + * @throws \RuntimeException + */ + protected function getHashSalt() { + return Settings::getHashSalt(); + } +} From 2b61d543c3de19d714b9a86b1843bd2223d8937b Mon Sep 17 00:00:00 2001 From: Martin Kolar Date: Fri, 6 Feb 2026 12:37:32 +0100 Subject: [PATCH 4/4] Remove licence.txt and patches.txt --- .../modules/custom/slack_invite/LICENSE.txt | 339 ------------------ .../modules/custom/slack_invite/PATCHES.txt | 7 - 2 files changed, 346 deletions(-) delete mode 100644 docroot/modules/custom/slack_invite/LICENSE.txt delete mode 100644 docroot/modules/custom/slack_invite/PATCHES.txt diff --git a/docroot/modules/custom/slack_invite/LICENSE.txt b/docroot/modules/custom/slack_invite/LICENSE.txt deleted file mode 100644 index d159169d1..000000000 --- a/docroot/modules/custom/slack_invite/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - 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/docroot/modules/custom/slack_invite/PATCHES.txt b/docroot/modules/custom/slack_invite/PATCHES.txt deleted file mode 100644 index 876108baf..000000000 --- a/docroot/modules/custom/slack_invite/PATCHES.txt +++ /dev/null @@ -1,7 +0,0 @@ -This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches) -Patches applied to this directory: - -3189435 - The URI '' is invalid. -Source: https://git.drupalcode.org/issue/slack_invite-3189435/-/commit/2a10d44bafe2a768dbceceadf6a51e500caae539.patch - -