Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
622efa7
added a database in a separate docker container and connected it to t…
I-vac Feb 28, 2025
3f1dc07
Refactor code structure for improved readability and maintainability
jlang62 May 27, 2025
0ac77ff
Update README.md to reflect project details and structure
jlang62 May 27, 2025
c83da8b
Add sections for System, Process, and Reflection Perspectives in READ…
jlang62 May 27, 2025
151f157
Enhance README.md with detailed GitHub Actions CI/CD analysis and ali…
jlang62 May 27, 2025
0a78f14
Add comprehensive report outline and detailed CI/CD documentation for…
jlang62 May 28, 2025
9476947
Enhance CI/CD documentation in report.md with detailed pipeline overv…
jlang62 May 28, 2025
2071392
added csrf protection,sql-xss injections prevention,session security
I-vac May 28, 2025
9b40664
Enhance report.md with detailed architecture overview, technology dep…
jlang62 May 28, 2025
f67789f
Refactor technology dependencies section in report.md to include addi…
jlang62 May 28, 2025
cef3f6d
Create report.yml
jlang62 May 29, 2025
a4a4101
Update report.yml
jlang62 May 29, 2025
6c93a23
Update report.yml
jlang62 May 29, 2025
18b0a29
Update report.yml
jlang62 May 29, 2025
c97e9c6
Update report.yml
jlang62 May 29, 2025
0085f4f
Implement code changes to enhance functionality and improve performance
jlang62 May 29, 2025
78d6a3a
Enhance CI/CD documentation with GitHub Actions comparison and securi…
jlang62 May 29, 2025
d12c0e9
chore: update code structure for improved readability and maintainabi…
jlang62 May 29, 2025
01b90ee
docs: update authorship details and enhance CI/CD pipeline documentat…
jlang62 May 29, 2025
4ad2334
fix: adjust PDF generation settings for improved layout and margins
jlang62 May 29, 2025
8d2fb49
fix: update static analysis checks in CI/CD pipeline for improved cod…
jlang62 May 29, 2025
6b0f630
Merge pull request #7 from I-vac/feat/availability
jlang62 May 29, 2025
a257f08
chore: refactor report generation workflow to streamline PDF commit a…
jlang62 May 29, 2025
b996069
Merge pull request #8 from I-vac/report
jlang62 May 29, 2025
c36515f
fix: update CI/CD workflows to use 'main' branch for triggers
jlang62 May 29, 2025
a085ec6
chore: update ITU-MiniTwit-Report.pdf [skip ci]
github-actions[bot] May 29, 2025
8551a55
integrated the docker database and fixed all merge issues, other mino…
I-vac May 29, 2025
89f0d44
testing new db on droplet
I-vac May 29, 2025
32c2925
merged and modified the security enhancements with the db code, addit…
I-vac May 29, 2025
66556b8
added aliases to conflicting db tables
I-vac May 30, 2025
a004294
more robust template and docker volume transitions
I-vac May 30, 2025
b76aea4
quick fix db not using aliases
I-vac May 30, 2025
5e44222
added aliases to missing queries
I-vac May 30, 2025
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
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ target/
.git
.gitignore
*.iml
.idea/
.idea/
.vagrant
4 changes: 2 additions & 2 deletions .github/workflows/cicd_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
workflow_dispatch:
push:
branches:
- main
- feat/availability
- separate-db
# - feat/availability

jobs:
test-java:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build Report

permissions:
contents: write

on:
push:
branches: [ main ]

jobs:
build-docs:
name: Build Documentation PDF
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: true # allow pushes
fetch-depth: 0 # get full history

- name: Install Pandoc & XeLaTeX
run: |
sudo apt-get update
sudo apt-get install -y pandoc texlive-xetex

- name: Build report PDF
run: |
pandoc report/report.md \
--from=gfm+yaml_metadata_block+pipe_tables \
--resource-path=report:report/diagrams/pdf \
-V geometry:margin=0.7in,landscape \
--pdf-engine=xelatex \
--output report/ITU-MiniTwit-Report.pdf

- name: Commit & push PDF
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add report/ITU-MiniTwit-Report.pdf
# only commit if the PDF actually changed
git diff --cached --exit-code || git commit -m "chore: update ITU-MiniTwit-Report.pdf [skip ci]"
git push
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Makefile
flag_tool.c
minitwit.py
minitwit.pyc
.vagrant/
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RUN mvn clean package
# Runtime
FROM eclipse-temurin:21-jdk
WORKDIR /app
RUN apt-get update && apt-get install -y sqlite3 && rm -rf /var/lib/apt/lists/*

# JMX exporter
# copy the JMX exporter and config so the script can pick them up
Expand All @@ -18,10 +17,7 @@ EXPOSE 9404

# App
COPY --from=build /app/target/minitwit-java-app.jar app.jar
COPY src/main/resources/schema.sql /app/schema.sql
COPY db_init.sh /app/db_init.sh
RUN chmod +x /app/db_init.sh

# Ports
EXPOSE 5000
CMD ["/app/db_init.sh"]
CMD ["java", "-jar", "app.jar"]
5 changes: 1 addition & 4 deletions Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ EXPOSE 9404

# App
COPY --from=build /app/target/minitwit-java-simulator-api.jar app.jar
COPY src/main/resources/schema.sql /app/schema.sql
COPY db_init.sh /app/db_init.sh
RUN chmod +x /app/db_init.sh

# Ports
EXPOSE 5001
CMD ["/app/db_init.sh"]
CMD ["java", "-javaagent:/app/jmx_prometheus_javaagent-0.18.0.jar=9404:/app/jmx_config.yml", "-jar", "app.jar"]
14 changes: 0 additions & 14 deletions db_init.sh

This file was deleted.

8 changes: 8 additions & 0 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
Expand Down
61 changes: 45 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
name: minitwit

services:
# BLUE VERSION
mysql:
image: mysql:latest
volumes:
- mysql-data:/var/lib/mysql
- ./src/main/resources/schema.sql:/docker-entrypoint-initdb.d/schema.sql
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- "${MYSQL_PORT}:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-p$MYSQL_ROOT_PASSWORD"]
interval: 30s
timeout: 10s
retries: 10
restart: always

# BLUE VERSION (MySQL-based)
minitwit-blue:
build:
context: .
dockerfile: Dockerfile
container_name: minitwit-blue
ports:
- "5004:5000" # exposed for NGINX
- "5004:5000"
- "9404:9404"
- "9094:9091"
volumes:
- minitwit-data:/data
#old sqlite data
# - minitwit-data:/data
- minitwit-logs:/data/logs
environment:
- DATABASE_URL=jdbc:sqlite:/data/minitwit.db
- DATABASE_URL=jdbc:mysql://mysql:3306/${MYSQL_DATABASE}?user=root&password=${MYSQL_ROOT_PASSWORD}
- METRICS_PORT=9091
depends_on:
mysql:
condition: service_healthy
restart: always

# GREEN VERSION
# GREEN VERSION (MySQL-based)
minitwit-green:
build:
context: .
Expand All @@ -30,11 +52,15 @@ services:
- "9406:9404"
- "9095:9091"
volumes:
- minitwit-data:/data
#old sqlite data
# - minitwit-data:/data
- minitwit-logs:/data/logs
environment:
- DATABASE_URL=jdbc:sqlite:/data/minitwit.db
- DATABASE_URL=jdbc:mysql://mysql:3306/${MYSQL_DATABASE}?user=root&password=${MYSQL_ROOT_PASSWORD}
- METRICS_PORT=9091
depends_on:
mysql:
condition: service_healthy
restart: always

simulator-api:
Expand All @@ -43,14 +69,17 @@ services:
dockerfile: Dockerfile.api
ports:
- "5001:5001"
- "9405:9404" # host 9405 → container 9404
- "9092:9091" # HTTP /metrics (host 9092 → container 9091)
- "9405:9404"
- "9092:9091"
volumes:
- minitwit-data:/data
#old sqlite data
# - minitwit-data:/data
- minitwit-logs:/data/logs
environment:
- DATABASE_URL=jdbc:sqlite:/data/minitwit.db
- "9092:9091" # HTTP /metrics (host 9092 → container 9091)
- DATABASE_URL=jdbc:mysql://mysql:3306/${MYSQL_DATABASE}?user=root&password=${MYSQL_ROOT_PASSWORD}
depends_on:
mysql:
condition: service_healthy
restart: always

node-exporter-app:
Expand All @@ -59,7 +88,7 @@ services:
volumes:
- /:/host:ro
ports:
- "9101:9100" # host 9101 → container 9100
- "9101:9100"
restart: unless-stopped

cadvisor-app:
Expand All @@ -70,12 +99,11 @@ services:
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
ports:
- "8081:8080" # host 8081 → container 8080
- "8081:8080"
restart: unless-stopped

filebeat:
image: docker.elastic.co/beats/filebeat:8.8.2
# network_mode: "host"
user: root
volumes:
- type: bind
Expand All @@ -87,10 +115,11 @@ services:
- default

volumes:
mysql-data:
name: minitwit_mysql-data
minitwit-data:
external: true
name: minitwit_minitwit-data
minitwit-logs:
external: true
name: minitwit_minitwit-logs

6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
<version>3.47.0.0</version>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand Down
Binary file added report/ITU-MiniTwit-Report.pdf
Binary file not shown.
Binary file added report/img/c4-container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added report/img/cicd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added report/img/comp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added report/img/enduser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added report/img/simu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions report/outline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## What to include in the report?

### System's Perspective

A description and illustration of the:

- Design and architecture of your _ITU-MiniTwit_ systems
- All dependencies of your _ITU-MiniTwit_ systems on all levels of abstraction and development stages. That is, list and briefly describe all technologies and tools you applied and depend on.
- Important interactions of subsystems.
- For example, via an illustrative UML Sequence diagram that shows the flow of information through your system from user request in the browser, over all subsystems, hitting the database, and a response that is returned to the user.
- Similarly, another illustrative sequence diagram that shows how requests from the simulator traverse your system.
- Describe the current state of your systems, for example using results of static analysis and quality assessments.

MSc students should argue for the choice of technologies and decisions for at least all cases for which we asked you to do so in the tasks at the end of each session.


### Process' perspective

This perspective should clarify how code or other artifacts come from idea into the running system and everything that happens on the way.

In particular, the following descriptions should be included:

- A complete description of stages and tools included in the CI/CD chains, including deployment and release of your systems.
- How do you monitor your systems and what precisely do you monitor?
- What do you log in your systems and how do you aggregate logs?
- Brief results of the security assessment and brief description of how did you harden the security of your system based on the analysis.
- Applied strategy for scaling and upgrades.

In case you have used AI-assistants during your project briefly explain which system(s) you used during the project and reflect how it supported or hindered your process.



### Reflection Perspective

Describe the biggest issues, how you solved them, and which are major lessons learned with regards to:

- evolution and refactoring
- operation, and
- maintenance

of your _ITU-MiniTwit_ systems. Link back to respective commit messages, issues, tickets, etc. to illustrate these.


Also reflect and describe what was the "DevOps" style of your work.
For example, what did you do differently to previous development projects and how did it work?
Loading
Loading