npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pressless

v0.9.7

Published

A tool that migrates an existing Wordpress site into a fully functioning Serverless site, powered by AWS (Cloudfront, API Gateway, Lambda, S3).

Downloads

32

Readme

Pressless

serverless language language license

This project is no longer maintained. Bref is recommended as a replacement.

A tool that migrates an existing Wordpress site into a fully functioning Serverless site, powered by AWS (Cloudfront, API Gateway, Lambda, S3).

Pressless will:

  • Create an AWS API Gateway custom domain and assign the specified AWS ACM certificate (via the domain command)
  • Create a CNAME record in Route53 for the Cloudfront distribution of the new API Gateway custom domain
  • Provide you with any other DNS records that need to be created/modified manually
  • Copy your existing Wordpress database into a new database (via the copydb command)
  • Package your existing Wordpress site into an AWS Lambda function and setup an AWS API Gateway Lambda Proxy (via the deploy command)
  • Create an AWS S3 website and logging bucket
  • Automatically store any Wordpress uploads to your AWS S3 website bucket
  • Attempt to automatically cache all non-admin GET requests to S3

Requirements

Pressless requires nodejs-6.x or higher to run.

Pressless also requires AWS API credentials that have the following policy grant (least privilege):

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "acm:ListCertificates",
                "cloudformation:CreateStack",
                "cloudformation:DescribeStacks",
                "cloudformation:DescribeStackEvents",
                "cloudformation:DescribeStackResources",
                "cloudformation:ValidateTemplate",
                "cloudfront:GetDistribution",
                "cloudfront:UpdateDistribution",
                "logs:DescribeLogGroups",
                "logs:CreateLogGroup",
                "route53:ListHostedZones",
                "route53:ChangeResourceRecordSets",
                "s3:CreateBucket"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": "iam:*",
            "Resource": "arn:aws:iam::*:role/pl-*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "apigateway:GET",
                "apigateway:POST",
                "apigateway:PUT",
                "apigateway:DELETE"
            ],
            "Resource": [
                "arn:aws:apigateway:*::/domainnames",
                "arn:aws:apigateway:*::/domainnames/*",
                "arn:aws:apigateway:*::/domainnames/*/*",
                "arn:aws:apigateway:*::/restapis",
                "arn:aws:apigateway:*::/restapis/*",
                "arn:aws:apigateway:*::/restapis/*/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "lambda:Get*",
                "lambda:List*",
                "lambda:CreateFunction"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "lambda:AddPermission",
                "lambda:CreateAlias",
                "lambda:DeleteFunction",
                "lambda:InvokeFunction",
                "lambda:PublishVersion",
                "lambda:RemovePermission",
                "lambda:Update*"
            ],
            "Resource": "arn:aws:lambda:*:*:function:pl-*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetBucketLocation",
                "s3:ListBucket",
                "s3:GetObject",
                "s3:PutObject"
            ],
            "Resource": "arn:aws:s3:::pressless-deploys-*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "cloudformation:UpdateStack",
                "cloudformation:DeleteStack"
            ],
            "Resource": "arn:aws:cloudformation:*:*:stack/pl-*"
        }
    ]
}

If you wish to utilize RDS IAM Authentication so that you don't have to hard code your database password into wp-config.php, you will also need to create an IAM authenticatable user on the RDS instance (CREATE USER [USERNAME] IDENTIFIED WITH AWSAuthenticationPlugin as 'RDS';) along with the necessary grants. Then just specify an SSL connection to MySQL using the newly created user when you run pressless setup. For example:

pressless setup -c [AWS_ACM_CERTIFICATE] -d 'mysql+ssl://[USERNAME]@[RDS_HOST]/[DATABASE]' [DOMAIN] [S3_WEBSITE_BUCKET]

Usage

Install this project:

npm install -g pressless

Running Pressless

pressless
                                         ___
                                        /\_ \
 _____    _ __     __     ____    ____  \//\ \       __     ____    ____
/\ '__`\ /\`'__\ /'__`\  /',__\  /',__\   \ \ \    /'__`\  /',__\  /',__\
\ \ \L\ \\ \ \/ /\  __/ /\__, `\/\__, `\   \_\ \_ /\  __/ /\__, `\/\__, `\
 \ \ ,__/ \ \_\ \ \____\\/\____/\/\____/   /\____\\ \____\\/\____/\/\____/
  \ \ \/   \/_/  \/____/ \/___/  \/___/    \/____/ \/____/ \/___/  \/___/
   \ \_\                ---helping wordpress cost less---
    \/_/


  Usage:  [options] [command]


  Commands:

    setup [options] <domain> <website_bucket>  Setup pressless configuration and install dependencies
    domain                                     Create AWS ApiGateway custom domain
    copydb <dsn>                               Copy database
    exportdb <db_username>                     Export the Pressless database
    deploy [options]                           Deploy Wordpress via Serverless
    copyuploads [options]                      Copy "wp-content/uploads" to S3
    logs [options]                             Watch lambda logs
    test <stage> <request_path>                Test the Serverless function
    warm                                       Warm the S3 website bucket cache by crawling all pages
    invalidate                                 Invalidate the S3 website bucket cache (except `wp-content/uploads`)

  Options:

    -h, --help  output usage information

Thanks

  • Andy Raines for the inspiration and base for this project