Skip to content

Commit 2b3a881

Browse files
authored
Merge pull request #46 from htdguide/testing
Shift to 0.2.4
2 parents 4297d42 + 1e2fb0d commit 2b3a881

File tree

185 files changed

+19848
-4262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+19848
-4262
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# .env
2+
VITE_APP_WEBOS_VERSION="0.2.4"

.github/workflows/testing.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# File: .github/workflows/testing.yml
2+
3+
name: Build and Push Docker Image to Docker Hub (Testing)
4+
5+
on:
6+
push:
7+
branches:
8+
- testing
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
steps:
14+
# 1) Check out the repo
15+
- name: Check out repository
16+
uses: actions/checkout@v2
17+
18+
# 2) Set up Node.js
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
24+
# 3) Install dependencies
25+
- name: Install Dependencies
26+
run: npm install --legacy-peer-deps
27+
28+
# 4) Run tests (optional)
29+
- name: Run Tests
30+
run: npm run test
31+
32+
# 5) Build production artifacts
33+
- name: Build
34+
run: npm run build
35+
36+
# 6) Log in to Docker Hub
37+
- name: Login to Docker Hub
38+
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
39+
40+
# 7) Build Docker image
41+
- name: Build Docker Image
42+
run: |
43+
docker build --no-cache \
44+
-t ${{ secrets.DOCKER_USERNAME }}/webportfoliotesting:latest \
45+
-f Dockerfile \
46+
.
47+
48+
# 8) Push Docker image
49+
- name: Push Docker Image
50+
run: docker push ${{ secrets.DOCKER_USERNAME }}/webportfoliotesting:latest

Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1+
# Use the official Nginx image
12
FROM nginx:stable-alpine
23

3-
# Remove the default Nginx HTML
4+
# Remove default HTML
45
RUN rm -rf /usr/share/nginx/html/*
56

6-
# Copy the production build – contents of 'dist' only
7+
# Copy your production build
78
COPY dist/ /usr/share/nginx/html/
89

9-
# Copy your custom HTTPS-only (or redirection) nginx.conf
10-
COPY nginx.conf /etc/nginx/conf.d/default.conf
10+
# Copy both HTTP- and HTTPS-ready nginx configs
11+
COPY nginx.http.conf /etc/nginx/conf.d/default-http.conf
12+
COPY nginx.ssl.conf /etc/nginx/conf.d/default-ssl.conf
1113

12-
# Expose port 443 (and 80 if you want HTTP open/redirect)
14+
# Copy the entrypoint script that picks the right config
15+
COPY entrypoint.sh /entrypoint.sh
16+
RUN chmod +x /entrypoint.sh
17+
18+
# Expose both ports (so Docker can map whichever one runs)
1319
EXPOSE 80
1420
EXPOSE 443
1521

22+
# Entrypoint will choose config, then run nginx
23+
ENTRYPOINT ["/entrypoint.sh"]
1624
CMD ["nginx", "-g", "daemon off;"]

LICENCE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Nikita Mogilevskii
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the “Software”), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

entrypoint.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Detect whether both cert and key actually exist
5+
if [ -f /etc/ssl/certs/ssl.crt ] && [ -f /etc/ssl/private/ssl.key ]; then
6+
echo "✅ SSL certs found, enabling HTTPS"
7+
cp /etc/nginx/conf.d/default-ssl.conf /etc/nginx/conf.d/default.conf
8+
else
9+
echo "⚠️ No SSL certs found, falling back to HTTP only"
10+
cp /etc/nginx/conf.d/default-http.conf /etc/nginx/conf.d/default.conf
11+
fi
12+
13+
# Remove everything else in conf.d so nginx only sees default.conf
14+
rm -f /etc/nginx/conf.d/default-http.conf \
15+
/etc/nginx/conf.d/default-ssl.conf
16+
17+
# Launch nginx
18+
exec "$@"

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
88
<meta name="theme-color" content="#000000" />
9-
<meta name="description" content="htdguide's portfolio website" />
9+
<meta name="description" content="htdguide's webOS" />
1010
<link rel="icon" href="favicon.png" />
1111
<link rel="apple-touch-icon" href="/logo192.png" />
1212
<title>webOS</title>
1313
</head>
1414
<body>
1515
<div id="root"></div>
16-
<script type="module" src="/src/main.jsx"></script>
17-
<noscript>You need to enable JavaScript to run this app.</noscript>
16+
<script type="module" src="/main/main.jsx"></script>
17+
<noscript>You need to enable JavaScript to run webOS.</noscript>
1818
</body>
1919
</html>

main/index.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* index.css */
2+
3+
/* Global styles */
4+
html, body, #root {
5+
margin: 0;
6+
padding: 0;
7+
width: 100%;
8+
height: 100%;
9+
background-color: black; /* Outside the monitor: black */
10+
overflow: hidden !important; /* Disable scrolling */
11+
overscroll-behavior: none !important; /* Prevent scroll chaining */
12+
-webkit-user-select: none !important; /* Disable text selection in WebKit */
13+
-moz-user-select: none !important; /* Disable text selection in Firefox */
14+
-ms-user-select: none !important; /* Disable text selection in IE10+ */
15+
user-select: none !important; /* Standard property */
16+
-webkit-tap-highlight-color: transparent !important; /* Remove tap highlight flash */
17+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
18+
}
19+
20+
21+
/* Hide React error overlay */
22+
#react-error-overlay {
23+
display: none !important;
24+
}
25+
26+
/* Hide any iframes that might be embedded inadvertently */
27+
body > iframe {
28+
display: none;
29+
}
30+
31+
/* Apply to all elements, to be sure no child can be selected */
32+
* {
33+
-webkit-user-select: none !important;
34+
-moz-user-select: none !important;
35+
-ms-user-select: none !important;
36+
user-select: none !important;
37+
overscroll-behavior: none !important;
38+
}

main/main.jsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// main.jsx
2+
3+
import React, { StrictMode, useEffect } from 'react';
4+
import { createRoot } from 'react-dom/client';
5+
import './index.css';
6+
import BIOS from '../src/BIOS/BIOS';
7+
8+
const Main = () => {
9+
useEffect(() => {
10+
// Prevent all scrolling
11+
const preventDefault = (e) => {
12+
e.preventDefault();
13+
};
14+
15+
// Block wheel, touchmove, text selection start, and context menu (long-press)
16+
document.addEventListener('wheel', preventDefault, { passive: false });
17+
document.addEventListener('selectstart', preventDefault);
18+
document.addEventListener('contextmenu', preventDefault);
19+
20+
return () => {
21+
document.removeEventListener('wheel', preventDefault);
22+
document.removeEventListener('touchmove', preventDefault);
23+
document.removeEventListener('selectstart', preventDefault);
24+
document.removeEventListener('contextmenu', preventDefault);
25+
};
26+
}, []);
27+
28+
return (
29+
<StrictMode>
30+
<BIOS />
31+
</StrictMode>
32+
);
33+
};
34+
35+
createRoot(document.getElementById('root')).render(<Main />);

nginx.http.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# HTTP-only server
2+
server {
3+
listen 80;
4+
server_name _;
5+
6+
root /usr/share/nginx/html;
7+
index index.html;
8+
9+
# SPA fallback
10+
location / {
11+
try_files $uri $uri/ /index.html;
12+
}
13+
}

0 commit comments

Comments
 (0)