{"id":21574895,"url":"https://github.com/jonathanlb/signed-s3-links","last_synced_at":"2025-03-18T06:44:24.455Z","repository":{"id":61993226,"uuid":"527654326","full_name":"jonathanlb/signed-s3-links","owner":"jonathanlb","description":"Display signed S3 links for files under S3 keys.","archived":false,"fork":false,"pushed_at":"2024-05-01T19:08:42.000Z","size":171,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T13:28:20.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathanlb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2022-08-22T16:54:26.000Z","updated_at":"2024-05-01T19:08:40.000Z","dependencies_parsed_at":"2024-05-01T20:45:09.594Z","dependency_job_id":null,"html_url":"https://github.com/jonathanlb/signed-s3-links","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanlb%2Fsigned-s3-links","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanlb%2Fsigned-s3-links/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanlb%2Fsigned-s3-links/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanlb%2Fsigned-s3-links/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanlb","download_url":"https://codeload.github.com/jonathanlb/signed-s3-links/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244173502,"owners_count":20410295,"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":[],"created_at":"2024-11-24T12:11:35.328Z","updated_at":"2025-03-18T06:44:24.436Z","avatar_url":"https://github.com/jonathanlb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# signed-s3-links\nThe signed-s3-links (SS3L) WordPress plugin allows post authors to publish signed links to otherwise inaccessible S3 content.\n\n## Installation\n\n- SS3L should work with PHP 8.0 and WordPress 6.0.  The [unit-test framework](https://phpunit.de/) bundled here, however, [only runs with PHP 7.4.30.](https://github.com/jonathanlb/signed-s3-links/issues/4)\n- [Install AWS PHP SDK.](https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/getting-started_installation.html)  Running `composer update` using [composer.json](composer.json) should work if you have [composer installed.](https://getcomposer.org)\n- [Check your AWS credentials.](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)  SS3L will use server-local credentials to authenticate with S3 services. \n  - By default, SS3L will look for credentials profiles in the `$HOME/.aws/credentials` file.  You can specify an alternate directory under the settings menu with \"Path to credentials file\" using either an absolute path begining with /, or one relative to the SS3L plugin directory.\n\n## Usage\n\n### Settings\n\nIn your WordPress installation under the plugin settings, go to the \nsigned-s3-links settings and make sure your region and credentials profile\nmatches what you expect.\n\n### Displaying a link\n\nYou can insert a signed hyperlink to a object stored under S3 with the markup in your post text\n```\n[ss3_ref my-s3-bucket-name/some/key/file.txt title=\"read this\" region=us-west-2]\n```\nThe title and region parameters are optional.\nIn the absence of title, the plugin will use the object filename as the href text.\nOmitting region will create a link using the region stored in the plugin settings.\n\n#### Optional named parameters:\n\n- `class` provides styling classes for the link.\n- `div_class` provides class style for an enclosing div.  If no value is provide, the hyperlink appears naked without an enclosing div.\n- `div_style` provides style for the enclosing div. If no class or style value is provided, the hyperlink appears naked without an enclosing div.\n- `id` provides a reference to the hyperlink.\n- `style` provides css style overrides to the hyperlink.\n\n### Displaying a directory listing\n\nYou can display a directory listing using\n```\n[ss3_dir my-s3-bucket-name/some/key titles=\"index.json\"]\n```\nwhich will render an HTML list of signed links titled by the corresponding object file names.\n\n#### Optional named parameters:\n\n- `div_class` provides class for an enclosing div. If no class or style value is provided, the list appears naked without an enclosing div.\n- `div_style` provides style for the enclosing div. If no class or style value is provided, the list appears naked without an enclosing div.\n- `a_class`, `li_class`, `ul_class` style the links using a class, list elements, and unordered list and reference the list, respectively.\n- `id` provide. a reference to the unordered list.\n- `region` overrides the global default AWS region.\n- `style` provides css style overrides to the hyperlink.\n- `titles` specifies a JSON file containing a dictionary mapping names (without the key prefix) to titles to print.  In the absence of a title entry or title dictionary, objects will list as their name under the key.\n\nHere is an example titles dictionary:\n```\n{\n\t\"2022_09_08_notes.pdf\": \"Emergency meeting minutes\",\n\t\"2022_09_01_agenda.html\": \"Emergency meeting agenda\"\n}\n```\n\nThe titles dictionary object will not be printed, nor will objects nested in keys beneath the key specified.\n\n### Using the media player\n\nYou can embed a signed link into a HTML5 media player\n```\n[ss3_audio my-s3-bucket/tunebook/song.mp3 style=\"width: 100%;\" class=\"wp-audio-shortcode\" title=\"Some Song to Play\"]\n```\n\n#### Optional named parameters:\n\n- `class` provide styling classes for the audio player.\n- `id` provide a reference to the audio player.\n- `title` enclose the player in a caption with the given title.\n- `style` provides css style overrides to the audio player, e.g. `\"width: 100%;\"`.\n\n## Troubleshooting\n\n### Using a Visual Editor\nIf you're using a visual editor, like [Divi](https://www.elegantthemes.com/gallery/divi/), either\n\n- use the \"text\" editing mode, as opposed to the \"visual\" mode option in the upper-right side of the panel,\n- embed the shortcode inside a Code module container.\n\nDivi will wrap certain tokens, like \"class\", in span elements, preventing WordPress from interpretting shortcode arguments.\nAlso, the visual editor can be slow to apply CSS class styling to\nthe shortcodes.\nBe patient.\nTest outside of the editor.\nCheck the `post_content` column in the `wp_posts` table using MySQL.\n\n### AWS Credentials\nIf you get an error reading the AWS credentials file from the home directory,\ncopy your credentials file into the signed-s3-links plugin directory and \nreference it with `./credentials` from the Signed-S3-Links settings menu.\n\n## Testing\n\n- Set up unit tests with `./bin/install-wp-tests.sh wordpress_test your-user 'your-password' localhost 6.0`\n- Run the unit tests with `composer exec phpunit`\n\n## Linting\n\n```\nphpcs --standard=WordPress tests/test*php\nphpcbf --standard=WordPress *.php tests/test*php\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanlb%2Fsigned-s3-links","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanlb%2Fsigned-s3-links","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanlb%2Fsigned-s3-links/lists"}