You are browsing as a guest. Sign up (or log in) to start making projects!

lawrenceshi

@lawrenceshi

Joined June 1st, 2026

  • 5Devlogs
  • 1Projects
  • 0Ships
  • 0Votes
Open comments for this post

9h 35m 36s logged

Devlog #5

I have finished working on the .sh script, and now there are more customization options that can be passed in through the ARGs.
I added SHA-256 verification for the packages downloaded from GitHub releases.
I added support for some other modules, including Fancy Index, and geoip2.
Also, I worked on NJS and found out that the official image already comes with the njs module. Repetitive work was done. :––––––––––––––––––––––––––––––––––––––––––––––––––:

I’m running out of time and energy because I need to focus on “Back to School” stuff, so I plan to wrap up the project.
I didn’t finish the Alpine-based image.

To-Do:

  • Fix one error
  • Write the default nginx.conf file
  • Test that everything works well
  • Deal with copyright stuff, i.e. include the license in the image
  • Write a CI/CD to push to Docker Hub
  • Write a README file
0
0
4
Open comments for this post

8h 25m 26s logged

Devlog #4

Hello!

I am now working on a big refactor (again).

I am planning to write a .sh script that can be used in either alpine or debian based image.

A rough description of what I am making from my previous Devlog:
I am making an OCI Image, basically a Docker image, that includes Nginx and a bunch of third-party modules and runs out of the box.

Leanred

I was almost new to .sh scripts. I knew it is similar to the command used in Terminal, but I didn’t know there are actually some huge difference.

  • case and if
    • I learned how to use the case command.
    • I learned more about the if command.
    • A quick example:
      # /bin/sh
      
      # Example for Case
      case ${YOUR_ENV} in 
      "Apple")
      echo "The ENV is Apple"
      # Ending symble
      ;;
      "Orange"|"Banana")
      echo "The ENV is either Orange or Banana"
      ;;
      # Ending symble
      esac
      
      # Example for if:
      
      # Conditions can be:
      
      [ -z ${YOUR_ENV} ] # If the ENV is empty
      [ ${YOUR_ENV} == "Hi" ] # If the ENV matches the string Hi
      
      # The space after the "[" and before the "]" is super important. It cannot be forgotten. 
      
      # Read more about the space:
      # https://www.shellcheck.net/wiki/SC1020
      
      if [ condition ]; then
           echo "The condition is True!"
      else
          echo "The condition is not True!"
      
      # Ending symble
      fi
      

More information will be provided in the next Devlog (Devlog #5 ).

So many ARGs in the photo!

0
0
9
Open comments for this post

11h 23m 38s logged

Devlog #3

This is a shortened version due to the character limit. I posted the full version on GitHub.

Hi!

It has been a long time since I posted my last devlog, whether you count the days or the coding hours. I took a break surfing the internet and listening to the radio. After I came back, I ended up spending more than 10 hours coding. Anyway, there are some big changes.

If you missed the previous devlogs, I am making an OCI Image, basically a Docker image, that includes Nginx and a bunch of third-party modules and runs out of the box.

Changes:

  • I first tried to make a Containerfile generator. Just like most complicated C/C++ projects use ./configure to generate the Makefile, I planned to write a python program that can generate the Containerfile for different combination of Nginx plugins. However, I think this may be too complicated for my project right now, so I moved the unfinished code to the experiment/containerfile-generator branch. I may come back to it later.
    82 additions & 0 deletions
    #(WIP) Commit 2884ed1

  • Also, I did a big refactor with 134 additions and 89 deletions. Now the user can customize the versions of software and the installation path when building the image! I replaced a lot of fixed commands with build ARGs. The replacement tool really helped a lot!
    #Commit c9a2643

  • I changed the project name from slim-lua-nginx to ModsNGX. Does it feel better? Old GitHub links should automatically redirect. If you run into any issue, try replacing the repository name in the link with ModsNGX, and feel free to contact me.

It is kinda weird, but I committed my latest changes first, and then commit my early generator code. It’s somehow out of order. Some code I commit now is written two weeks ago.

Plan:

Ship it when I feel it is ready!!

I regret making the gap between the two devlogs this long. It literally took me an hour to separate the mixed code and stage the changes, and I also spent almost my whole day on this devlog. Even worse, I hit the 4000-character limit.

0
0
18
Open comments for this post

7h 31m 33s logged

Devlog #2

Hello!

I am working on a prepared docker (or podman) image with Nginx, lua and other plugins.

Changes:

The major change since the last devlog is that I added support for the crowdsec-nginx-bouncer. Furthermore, I standardized some comments, installing path, stage names. These changes don’t really affect building the image, but will make maintenance easier.

Challenges:

I kept running into many kinds of errors. Mostly about missing or incorrect path to the dependency of the modules. The second most common errors are configuration problem or syntax issues.

Learned:

It might be surprising, but I feel like I learned how to use git the most. I didn’t use git a lot before, especially in a standard way.
I learned the git add /path/to/file \-p method, so I could stage changes by chunks instead of files.

Also, I learned more about docker (or podman). I learned the dns resolver in docker is fixed as 127.0.0.11, whereas it is dynamic in podman (can be shown by podman network inspect \<network name\> | grep “gateway” )

Plan:

I plan to ship this before 2026-06-30T23:59-04:00 to earn the stickers Nevermind. I spent my weekend cooking. Let’s see how it goes.

P.S.: I also found a bug of the stardance shop system too. See more on GitHub: https://github.com/hackclub/stardance/issues/700

0
0
5
Open comments for this post

1h 58m 17s logged

Devlog #1

Hello!

I’m building a docker (or podman) image that can make deploying nginx easier.
The current version can compile and install the coraza-nginx, lua, and ngx_headers_more module as dynamic modules.
It is closer to the original nginx, and it also includes other modules. I also believe the image size will be smaller than openresty when I switch the base to alpine Linux. Furthermore, I plan to include a default nginx configuration, not only a basic hello page, but basic ip rate limits, waf rules, and blocking secured files like “.env”, etc.

I started writing the Containerfile (almost the same as Dockerfile) when I was working on my website (not working). I quickly found out this could help someone, and I decided to make it a single project, so some git history may be missing. Also, I am coding on the dev branch for those who are confused.

0
0
5

Followers

Loading…