Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lholota committed Aug 11, 2023
0 parents commit 37425e2
Show file tree
Hide file tree
Showing 31 changed files with 746 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto
*.sh eol=lf
*.yml eol=lf
**/run eol=lf
**/finish eol=lf
**/services.d/** eol=lf
**/cont-init.d/** eol=lf
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2
updates:
- package-ecosystem: docker
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- dependencies
commit-message:
prefix: fix
include: scope
- package-ecosystem: gradle
directory: "/tests"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- dependencies
commit-message:
prefix: chore
include: scope
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- dependencies
commit-message:
prefix: ci
include: scope
11 changes: 11 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
titleOnly: true
types:
- feat
- fix
- docs
- refactor
- test
- build
- ci
- chore
- revert
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI PR/Branch
on:
push:
branches-ignore:
- master
pull_request:

env:
IMAGE_NAME: "homecentr/$$IMAGE_NAME$$"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@master

- name: Set tag var
id: vars
run: echo ::set-output name=docker_tag::$(echo ${GITHUB_REF} | cut -d'/' -f3)-${GITHUB_SHA}

- name: Verify Dockerfile with Hadolint
uses: brpaz/hadolint-action@master

- name: Build Docker image
run: docker build . -t ${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.docker_tag }}

- name: Test Docker image
run: cd tests && sudo --preserve-env gradle test --info -Ddocker_image_tag=${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.docker_tag }}
env: # To allow downloading packages
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74 changes: 74 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI/CD on master
on:
push:
branches:
- master

env:
IMAGE_NAME: "homecentr/$$IMAGE_NAME$$"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # To add version tags
packages: write # To push docker image
steps:
- uses: actions/checkout@master

- name: "Determine release version"
uses: docker://ghcr.io/codfish/semantic-release-action:v1.9.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Verify Dockerfile with Hadolint
uses: brpaz/hadolint-action@master

- name: "Build Docker image"
if: env.RELEASE_VERSION != ''
run: |
docker build . \
--tag "$IMAGE_NAME:$RELEASE_VERSION" \
--tag "$IMAGE_NAME:latest" \
--tag "ghcr.io/$IMAGE_NAME:$RELEASE_VERSION" \
--tag "ghcr.io/$IMAGE_NAME:latest" \
--label "org.label-schema.schema-version=1.0" \
--label "org.label-schema.vcs-ref=${GITHUB_SHA}" \
--label "org.label-schema.vcs-url=https://github.com/${GITHUB_REPOSITORY}" \
--label "org.label-schema.url=https://github.com/${GITHUB_REPOSITORY}" \
--label "org.label-schema.vendor=Homecentr" \
--label "version=$RELEASE_VERSION" \
--label "org.label-schema.build-date=$(date '+%F %T')"
- name: Test Docker image
if: env.RELEASE_VERSION != ''
run: cd tests && sudo --preserve-env gradle test -Ddocker_image_tag=${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
env: # To allow downloading packages
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Docker Hub
- name: "Log into Docker Hub"
if: env.RELEASE_VERSION != ''
run: "echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin"

- name: "Push to DockerHub"
if: env.RELEASE_VERSION != ''
run: "docker push $IMAGE_NAME:$RELEASE_VERSION && docker push $IMAGE_NAME:latest"

- name: "Update Docker Hub description"
if: env.RELEASE_VERSION != ''
uses: peter-evans/dockerhub-description@v2.4.3
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: ${{ env.IMAGE_NAME }}

# GitHub Packages
- name: "Log into GitHub Packages"
if: env.RELEASE_VERSION != ''
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: "Push to GitHub Packages"
if: env.RELEASE_VERSION != ''
run: "docker push ghcr.io/$IMAGE_NAME:$RELEASE_VERSION && docker push ghcr.io/$IMAGE_NAME:latest"
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.class
*.jar
*.war
*.ear
.gradle
build
.gradletasknamecache

**/.idea/workspace.xml
**/.idea/tasks.xml

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache
8 changes: 8 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
branch: 'master',
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/github',
],
}
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM homecentr/base:3.1.1-alpine
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 homecentr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[![Project status](https://badgen.net/badge/project%20status/stable%20%26%20actively%20maintaned?color=green)](https://github.com/homecentr/docker-$$IMAGE_NAME$$/graphs/commit-activity) [![](https://badgen.net/github/label-issues/homecentr/docker-$$IMAGE_NAME$$/bug?label=open%20bugs&color=green)](https://github.com/homecentr/docker-$$IMAGE_NAME$$/labels/bug) [![](https://badgen.net/github/release/homecentr/docker-$$IMAGE_NAME$$)](https://hub.docker.com/repository/docker/homecentr/$$IMAGE_NAME$$)
[![](https://badgen.net/docker/pulls/homecentr/$$IMAGE_NAME$$)](https://hub.docker.com/repository/docker/homecentr/$$IMAGE_NAME$$)
[![](https://badgen.net/docker/size/homecentr/$$IMAGE_NAME$$)](https://hub.docker.com/repository/docker/homecentr/$$IMAGE_NAME$$)

![CI/CD on master](https://github.com/homecentr/docker-$$IMAGE_NAME$$/workflows/CI/CD%20on%20master/badge.svg)


# Homecentr - $$IMAGE_NAME$$

## Usage

```yml
version: "3.7"
services:
$$IMAGE_NAME$$:
build: .
image: homecentr/$$IMAGE_NAME$$
```

## Environment variables

| Name | Default value | Description |
|------|---------------|-------------|
| PUID | 7077 | UID of the user $$IMAGE_NAME$$ should be running as. |
| PGID | 7077 | GID of the user $$IMAGE_NAME$$ should be running as. |

## Exposed ports

| Port | Protocol | Description |
|------|------|-------------|
| 80 | TCP | Some useful details |

## Volumes

| Container path | Description |
|------------|---------------|
| /config | Some useful details |

## Security
The container is regularly scanned for vulnerabilities and updated. Further info can be found in the [Security tab](https://github.com/homecentr/docker-$$IMAGE_NAME$$/security).

### Container user
The container supports privilege drop. Even though the container starts as root, it will use the permissions only to perform the initial set up. The $$IMAGE_NAME$$ process runs as UID/GID provided in the PUID and PGID environment variables.

:warning: Do not change the container user directly using the `user` Docker compose property or using the `--user` argument. This would break the privilege drop logic.
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security policy

## Disclosure policy

In case you find a security issues with this docker image, please reach out to me at security@homecentr.io and provide 5 business days to release a fixed version.

## Security update policy

Known security issues will be published in GitHub repository's Security / Security advisories.

## Automated processes

The Docker image is regularly scanned for vulnerabilities with [Snyk.io](https://snyk.io/).

The dependencies are automatically scanned using [Dependabot](https://dependabot.com/). Dependencies are regularly updated. You can check for pending dependency updates by listing open Pull requests with the "dependencies" label.
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: "3.7"
services:
$$IMAGE_NAME$$:
build: .
image: homecentr/$$IMAGE_NAME$$
restart: unless-stopped
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "homecentr-$$IMAGE_NAME$$",
"version": "1.0.0",
"description": "",
"repository": {
"type": "git",
"url": "git+https://github.com/homecentr/docker-$$IMAGE_NAME$$.git"
},
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/homecentr/docker-$$IMAGE_NAME$$/issues"
},
"homepage": "https://github.com/homecentr/docker-$$IMAGE_NAME$$#readme"
}
18 changes: 18 additions & 0 deletions tests/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/resources">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
2 changes: 2 additions & 0 deletions tests/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions tests/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions tests/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions tests/.idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

1 comment on commit 37425e2

@mrslim007
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Day,

how are you ? i am a CEH V12 student,and am on a project of sending bulk newsletter messages that would inbox all domain , i would like to know about your smtp, can you please guide me on how to use it please , here is my email... ismailosho007@gmail.com, we can also chat on my Telegram @raskay77 , i don't mind paying for your free time to learn this.
Thanks

Please sign in to comment.