Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ workflows:
requires:
- test
filters:
branches:
only:
- master
branches:
only:
- master
- build_children:
context: circle-api
requires:
Expand All @@ -24,7 +24,7 @@ jobs:
steps:
- checkout

- setup_remote_docker: # (2)
- setup_remote_docker: # (2)
docker_layer_caching: false # (3)
- run:
name: Install goss
Expand All @@ -51,8 +51,7 @@ jobs:
docker save -o workspace/lancachenet-ubuntu-nginx.tar lancachenet/ubuntu-nginx:goss-test
- persist_to_workspace:
root: workspace
paths:
lancachenet-ubuntu-nginx.tar
paths: lancachenet-ubuntu-nginx.tar
- store_test_results:
path: reports
- store_artifacts:
Expand All @@ -62,7 +61,7 @@ jobs:
docker:
- image: circleci/python:2-jessie
steps:
- setup_remote_docker: # (2)
- setup_remote_docker: # (2)
docker_layer_caching: false # (3)
- attach_workspace:
at: /tmp/workspace
Expand All @@ -80,7 +79,7 @@ jobs:
- run:
name: "Request API to build children"
command: |
for child in "monolithic"; do
echo "Asking API to trigger build for $child"
curl -X POST --header "Content-Type: application/json" -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/lancachenet/$child/build?circle-token=${CIRCLE_API_USER_TOKEN}
done
for child in "monolithic"; do
echo "Asking API to trigger build for $child"
curl -X POST --header "Content-Type: application/json" -d '{"branch":"master"}' https://circleci.com/api/v1.1/project/github/lancachenet/$child/build?circle-token=${CIRCLE_API_USER_TOKEN}
done
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.md]
indent_size = 0

[*.sh]
indent_style = tab
55 changes: 55 additions & 0 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
---
name: MegaLinter

on:
pull_request:
branches:
- master

env:
GITHUB_STATUS_REPORTER: true

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest

permissions:
contents: write
issues: write
pull-requests: write

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: MegaLinter
uses: oxsecurity/megalinter@v8
id: ml
env:
VALIDATE_ALL_CODEBASE: >-
${{
github.event_name == 'push' &&
github.ref == 'refs/heads/master'
}}

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Archive production artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: MegaLinter reports
include-hidden-files: "true"
path: |
megalinter-reports
mega-linter.log
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.iml
megalinter-reports
6 changes: 6 additions & 0 deletions .lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pre-commit:
parallel: true
jobs:
- name: megalinter
run: docker run --rm -e USER=$(id -u) -e GROUP=$(id -g) -v "$PWD:/tmp/lint" oxsecurity/megalinter:beta
stage_fixed: true
28 changes: 28 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Configuration file for MegaLinter
#
# See all available variables at https://megalinter.io/latest/config-file/ and in
# linters documentation

APPLY_FIXES: all
FLAVOR_SUGGESTIONS: false
PRINT_ALPACA: false
SHOW_ELAPSED_TIME: true

ENABLE:
- ACTION
- BASH
- DOCKERFILE
- EDITORCONFIG
- MARKDOWN
- YAML

DISABLE_LINTERS:
- MARKDOWN_MARKDOWNLINT
- YAML_V8R

BASH_SHELLCHECK_ARGUMENTS: "-f gcc"
EDITORCONFIG_EDITORCONFIG_CHECKER_ARGUMENTS: "-f gcc"

POST_COMMANDS:
- command: find . -user root -group root -exec chown ${USER}:${GROUP} {} \;
cwd: workspace
44 changes: 25 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
# hadolint ignore=DL3007
FROM lancachenet/ubuntu:latest
MAINTAINER LanCache.Net Team <[email protected]>

LABEL org.opencontainers.image.authors="LanCache.Net Team <[email protected]>"

ARG DEBIAN_FRONTEND=noninteractive
COPY overlay/ /
RUN apt-get update && \
apt-get install -y nginx-full inotify-tools --no-install-recommends && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
RUN \
chmod 777 /opt/nginx/startnginx.sh && \
rm /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default && \
mkdir -p /etc/nginx/sites-enabled/ && \
mkdir -p /etc/nginx/stream-enabled/ && \
for SITE in /etc/nginx/sites-available/*; do [ -e "$SITE" ] || continue; ln -s $SITE /etc/nginx/sites-enabled/`basename $SITE`; done && \
for SITE in /etc/nginx/stream-available/*; do [ -e "$SITE" ] || continue; ln -s $SITE /etc/nginx/stream-enabled/`basename $SITE`; done && \
mkdir -p /var/www/html && \
chmod 777 /var/www/html /var/lib/nginx && \
chmod -R 777 /var/log/nginx && \
chmod -R 755 /hooks /init && \
chmod 755 /var/www && \
chmod -R 666 /etc/nginx/sites-* /etc/nginx/conf.d/* /etc/nginx/stream.d/* /etc/nginx/stream-*

SHELL ["/bin/bash", "-c"]

# hadolint ignore=DL3008
RUN <<EOF
apt-get update
apt-get install -y nginx-full inotify-tools --no-install-recommends
apt-get -y clean
rm -rf /var/lib/apt/lists/*
EOF

COPY --link overlay/ /

RUN <<EOF
rm /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
mkdir -p /etc/nginx/{sites,stream}-enabled/ /var/lib/nginx /var/www/html
chmod -R 664 /etc/nginx/{conf,stream}.d/*
for file in /etc/nginx/{sites,stream}-available/*; do
ln -s "${file}" "${file/available/enabled}"
done
EOF

EXPOSE 80
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This image provides a basic nginx hosting environment. The intent is for the web

## Updates

Please consult [the official Ubuntu site](https://www.ubuntu.com/info/release-end-of-life) for information on when this version of Ubuntu becomes end of life.
Please consult [the official Ubuntu site](https://ubuntu.com/about/release-cycle) for information on when this version of Ubuntu becomes end of life.

## Usage

Expand Down
1 change: 0 additions & 1 deletion overlay/etc/nginx/conf.d/gzip.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;

97 changes: 29 additions & 68 deletions overlay/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,88 +4,49 @@ pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
worker_connections 768;
}

http {

##
# Basic Settings
##
##
# Basic Settings
##

sendfile on;
client_max_body_size 0;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
sendfile on;
client_max_body_size 0;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;

include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##

##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##

##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Virtual Host Configs
##

##
# Gzip Settings
##

#gzip on;

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}


#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

stream {
include /etc/nginx/stream.d/*.conf;
include /etc/nginx/stream-enabled/*;
include /etc/nginx/stream.d/*.conf;
include /etc/nginx/stream-enabled/*;
}
Loading