{"id":22394414,"url":"https://github.com/akamai/esi-test-server-docker","last_synced_at":"2025-04-13T06:13:28.667Z","repository":{"id":137716304,"uuid":"99165238","full_name":"akamai/esi-test-server-docker","owner":"akamai","description":"A dockerized version of Akamai's Edge Side Includes Test Server (ETS).","archived":false,"fork":false,"pushed_at":"2018-08-07T19:18:03.000Z","size":333782,"stargazers_count":33,"open_issues_count":14,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-13T06:13:19.496Z","etag":null,"topics":["akamai","edge-side-include","esi"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akamai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"licenses/Akamai.md","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":"2017-08-02T22:13:04.000Z","updated_at":"2025-03-21T15:47:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"173a18c5-7948-4580-b26b-b740b90f4600","html_url":"https://github.com/akamai/esi-test-server-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2Fesi-test-server-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2Fesi-test-server-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2Fesi-test-server-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2Fesi-test-server-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akamai","download_url":"https://codeload.github.com/akamai/esi-test-server-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670436,"owners_count":21142904,"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":["akamai","edge-side-include","esi"],"created_at":"2024-12-05T05:10:05.747Z","updated_at":"2025-04-13T06:13:28.632Z","avatar_url":"https://github.com/akamai.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Akamai ETS Docker Image\n\n## About\nThis container runs the Akamai Edge Side Includes (ESI) Test Server.\n\n![ETS diagram](https://raw.githubusercontent.com/akamai/esi-test-server-docker/master/ets-diagram.png)\n\nThe container OS is Ubuntu 14.04 Trusty Tahr. Configuration is set via command-line arguments passed via the `docker run` command.\n\nFor more information on ESI, please visit https://www.akamai.com/us/en/support/esi.jsp. For code samples, see http://esi-examples.akamai.com/.\n\n## Glossary\n* **ETS port** - port on the Docker host/machine to access processed ESI pages.\n* **Sandbox origin** (or sandbox) - an Apache server running within the container that hosts ESI examples by default, but can also be used to mount a local directory of ESI files for quick and easy testing.\n* **Remote origin** - an upstream server for ETS to forward requests to. ESI code fetched from this origin will be processed by the ESI Test Server.\n* **Playground** - real-time, test-as-you-type ESI testing tool.\n* **Edgescape** - geographical information about end users. The `--geo` flag can be used to enable or disable this for a given host (it's enabled by default). ETS uses static mocked data for these values with the following defaults:\n```\ngeoregion    = 246\ncountry_code = US\nregion_code  = CA\ncity         = SANJOSE\ndma          = 807\npmsa         = 7400\nareacode     = 408\ncounty       = SANTACLARA\nfips         = 06085\nlat          = 37.3353\nlong         = -121.8938\ntimezone     = PST\nnetwork_type = dialup\n```\n\nIn order to access the ETS server, port 80 on the container must be exposed to the host. The host port which is bound to port 80 on the container is referred to as the **ETS port**. Documentation and ESI code samples can be accessed at `http://localhost:\u003cETS port\u003e/`. The playground can be accessed at `http://localhost:\u003cETS port\u003e/playground`. Settings for the sandbox origin can be set using the hostname `localhost`. Source code versions of ESI pages hosted on the sandbox origin can be accessed at `http://localhost:\u003cETS port\u003e/sandbox`.\n\n## Basic usage\n`docker run -ti -p 8080:80 akamaiesi/ets-docker:latest`\n* Runs the ESI server, sandbox origin, and playground.\n* `-p 8080:80` - explicitly map/publish port 8080 (**ETS port**) on your local machine to port 80 on the Docker container. So, ETS server will be accessible by `http://localhost:8080/`, ESI playground by `http://localhost:8080/playground`, and the sandbox origin by `http://localhost:8080/sandbox`.\n* ESI Debugging is disabled by default.\n* Edgescape is enabled with the defaults documented above.\n\n### Enable ESI Debugging for localhost\n`docker run -ti -p 8080:80 akamaiesi/ets-docker:latest --debug localhost`\n* This will enable ESI debugging for the sandbox origin (defaults to `localhost`).\n\n### Disable Edgescape for localhost\n`docker run -ti -p 8080:80 akamaiesi/ets-docker:latest --geo localhost:off`\n* This will disable Edgescape for the sandbox origin (defaults to `localhost`).\n\n### Remote origin with ESI Debugging enabled\n`docker run -ti -p 8080:80 akamaiesi/ets-docker:latest --remote_origin yoursite.example.com:443 --debug yoursite.example.com`\n* This will enable ESI debugging for a remote origin on `yoursite.example.com`. To get a processed ESI page from yoursite.example.com, add \"Host: yoursite.example.com\" header to request for `http://localhost:8080/my_page.html`\n\n### Remote origin with GEO setting\n`docker run -ti -p 8080:80 akamaiesi/ets-docker:latest \\\n--remote_origin yoursite.example.com:443 \\ --geo\nyoursite.example.com:yoursite.example.com:georegion=246,country_code=US,region_code=CA, \\\ncity=SANJOSE,dma=807,pmsa=7400,areacode=408,county=SANTACLARA,fips=06085, \\\nlat=37.3353,long=-121.8938,timezone=PST,network_type=dialup akamaiesi/ets-docker:latest`\n* This will enable Edgescape for `yoursite.example.com` with the values specified in the corresponding `geo` argument.\n\n### Multiple remote origins\n`docker run -ti -p 8080:80 akamaiesi/ets-docker:latest --remote_origin yoursite1.example.com:443 --remote_origin yoursite2.example.com --debug yoursite1.example.com --geo yoursite2.example.com:off --geo yoursite2.example.com:country_code=CA`\n* This enables ETS to serve two different origins, each of which can have separate `--geo` and `--debug` settings.\n\n## Usage Notes\n\n### Viewing usage information from the command line\nTo view built-in documentation of all of the command-line arguments, run:\n\n`docker run akamaiesi/ets-docker:latest -h`.\n\n### Short flags\nFor brevity and convenience, each argument has both a long and a short flag. e.g. `--remote_origin` and `-r` are equivalent. Run `docker run akamaiesi/ets-docker:latest -h` for more information.\n\n### Argument formatting notes\nThe `--geo` and `--debug` flags are keyed on `hostname` only, not `hostname:port`, even though `--remote_origin` allows both. The following command will result in an error:\n\n`docker run -ti 8080:80 akamaiesi/ets-docker:latest --remote_origin yoursite.example.com:8888 --debug yoursite.example.com:8888`\n\nThe correct form is:\n\n`docker run -ti 8080:80 akamaiesi/ets-docker:latest --remote_origin yoursite.example.com:8888 --debug yoursite.example.com`\n\n## Caveats\n* ETS does not currently return `gzip`ed responses, but it does support `gzip` at the origin.\n* ETS strips `Content-Security-Policy` headers to enable support for proxying HTTPS origins via HTTP.\n\n## Advanced usage\n\n### Daemonizing to run in background\nUsing `docker run`'s `-d` argument (and removing `-t` or `-i`), you can run the ETS container in the background, e.g:\n\n`docker run -d -p 8080:80 akamaiesi/ets-docker:latest`\n\nTo stop the container, use `docker ps` to obtain the container ID and `docker stop` or `docker kill` to make it exit. \n\n## Networking\nWe suggest explicit port publishing and mapping due to its compatibility and simplicity. See [this article](https://www.ctl.io/developers/blog/post/docker-networking-rules/) for more information on Docker networking options.\n\n## Configuration settings\n### Primary\n* `--remote_origin \u003chostname:port\u003e` - hostname and port to use for an additional\n  remote/upstream origin\n* `--debug \u003chostname\u003e` - enable ESI debugging for that hostname\n* `--geo \u003chostname:settings\u003e` - enable Edgescape for a hostname via mock data\n    - Sample GEO flag:\n    \n      `--geo yoursite.example.com:georegion=246,country_code=US,region_code=CA,city=SANJOSE,\n      dma=807,pmsa=7400,areacode=408,county=SANTACLARA,fips=06085,lat=37.3353,\n      long=-121.8938,timezone=PST,network_type=dialup`\n\n## Support for HTTPS\nThe ESI test server doesn't support HTTPS for incoming connections, but remote origins using it are supported. Add them with port 443, e.g. `--remote_origin yoursite.example.com:443`. ETS will unset the `Content-Security-Policy` response header to ensure that browsers will not upgrade ETS requests to a secure/HTTPS schema.\n\n## Container as origin\nIn some cases you may want to specify a server running in another container as an origin. There are [many ways to network containers](https://docs.docker.com/engine/userguide/networking/). In this example, a combination of Docker's `--add-host` parameter and the port in ETS' `--remote_origin` parameter are used to configure an origin hosted by another container:\n* `docker run -d -p 9080:8080 -v \u003cdirectory of ESI files\u003e:/public redsadic/docker-http-server`\n* `docker run -d -p 8080:80 --add-host test.box:\u003cDocker host IP\u003e akamaiesi/ets-docker:latest --remote_origin test.box:9080 `\n\nYou can then access ESI pages on that server using `curl -H 'Host: test.box' http://localhost:8080`.\n\n## Docker Compose\nAn example of how to use ETS with [Docker Compose](https://docs.docker.com/compose/) can be found [here](https://github.com/akamai/esi-test-server-docker/tree/master/dockerimage-tests/test/gzip). You can pass command arguments via the `ETS_CLI_ARGS` environment variable.\n\n## Viewing logs and modifying files\nYou can shell into the container using `docker exec -ti \u003ccontainer ID\u003e bash`. Logs can be found in `/opt/akamai-ets/logs`.\n\n## Mounting a directory of ESI pages\nYou can trivially mount HTML files containing ESI tags in the sandbox server as follows:\n\n`docker run -ti -p 8080:80 -v $(pwd)/my_esi_pages:/opt/akamai-ets/virtual/localhost/docs akamaiesi/ets-docker:latest`\n\nIf you issue requests via the **ETS port**, the ESI tags will be processed. If you want to enable ESI debugging, pass the `--debug localhost` argument. If you'd like to still be able to access default ETS server content (main page and ESI examples), mount your local folder as a subfolder:\n\n`-v $(pwd)/my_esi_pages:/opt/akamai-ets/virtual/localhost/docs/my_esi_pages` \n\nYour pages will be available at `http://localhost:\u003cETS port\u003e/my_esi_pages/`\n\n## Disabling sandbox and/or playground\nIf the sandbox or playground interfere with your code, i.e. you'd like to mount your own directory of ESI pages that have `sandbox`, `server-status` folders (used by the sandbox), or `playground`, `assets`, `process` folders (used by the playground), then you can disable the sandbox with `--no_sandbox` option, and the playground with `--no_playground`. For example:\n\n`docker run -ti -p 8080:80 -v $(pwd)/my_esi_pages:/opt/akamai-ets/virtual/localhost/docs akamaiesi/ets-docker:latest --no_playground`\n\nYour pages at `/my_esi_pages/playground` will be accessible at `http://localhost:\u003cETS port\u003e/playground`\n\n## Status page\nA basic status page implemented using Apache's `mod_status` module is available at `http://localhost:\u003cETS port\u003e/server-status`.\n\n## ESI playground\nESI playground is a real-time, test-as-you-type ESI testing tool, it's available at `http://localhost:\u003cETS port\u003e/playground`.\n\n## ESI code examples\nA set of ESI examples can be accessed at `http://localhost:\u003cETS port\u003e/esi-examples/index.html`.\n\n## Other ports used by container\nThe ETS services run on the following Docker container ports: 81 (sandbox), 82 (ESI playground), 83 (ESI processing for sandbox), with a hostname of `localhost`.\n\n## ETS Docker test automation examples\nAn example of how to use the ETS Docker image as part of test automation can be found in Git [here](https://github.com/akamai/esi-test-server-docker/tree/master/dockerimage-tests).\n\n## Security\nThis software should only be used in restricted environments for testing and development. For security on public or untrusted networks, ensure that your Docker network configuration does not expose ports except to the local machine.\n\n## Support\nFor support with Edge Side Includes or the ESI Test Server, please reach out through [standard support channels](https://www.akamai.com/us/en/support/).\n\nTo report a bug, please [create a GitHub issue](https://github.com/akamai/esi-test-server-docker/issues/new) or email [esi-test-server@akamai.com](mailto:esi-test-server@akamai.com).\n\nTo report a security vulnerability, please email [security@akamai.com](mailto:security@akamai.com). ([GPG key](https://www.akamai.com/us/en/multimedia/documents/infosec/akamai-security-general.pub))\n\n## License\nThe Dockerfile and associated code samples and scripts are licensed under the Apache License 2.0.\n\nLicenses for the products installed within the image:\n* Apache HTTP Server: [Apache License 2.0](https://github.com/akamai/esi-test-server-docker/blob/master/licenses/Apache.md)\n* Akamai ESI Test Server: Copyright 2018 Akamai Technologies, Inc. [Akamai License Agreement](https://github.com/akamai/esi-test-server-docker/blob/master/licenses/Akamai.md)\n* libcurl: Copyright (c) 1996 - 2017, Daniel Stenberg, daniel@haxx.se, and many contributors, see the THANKS file. [MIT License](https://github.com/akamai/esi-test-server-docker/blob/master/licenses/Curl.md)\n* ESI Playground: Copyright (c) 2017 News Corp Australia [MIT License](https://github.com/akamai/esi-test-server-docker/blob/master/licenses/NewsCorpAustralia.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakamai%2Fesi-test-server-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakamai%2Fesi-test-server-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakamai%2Fesi-test-server-docker/lists"}