diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..0f7d235 Binary files /dev/null and b/.DS_Store differ diff --git a/client/.gitignore b/client/.gitignore index f7fb300..0cb66b4 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -23,4 +23,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -bun.lockb \ No newline at end of file +bun.lockb +.env \ No newline at end of file diff --git a/client/Dockerfile b/client/Dockerfile index d98802f..a59674c 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -17,5 +17,6 @@ FROM nginx:alpine AS production COPY --from=build /app/build /usr/share/nginx/html # Optional: If you have a custom nginx.conf, you can copy it to the container # COPY nginx.conf /etc/nginx/nginx.conf -EXPOSE 80 +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 42069 CMD ["nginx", "-g", "daemon off;"] diff --git a/client/nginx.conf b/client/nginx.conf new file mode 100644 index 0000000..b4de8a9 --- /dev/null +++ b/client/nginx.conf @@ -0,0 +1,7 @@ +server { + listen 42069; + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file diff --git a/client/src/components/Settings.tsx b/client/src/components/Settings.tsx index 8a430de..0f5b86b 100644 --- a/client/src/components/Settings.tsx +++ b/client/src/components/Settings.tsx @@ -10,7 +10,7 @@ const Settings = () => { const [filterDifficulty, setFilterDifficulty] = useState(localStorage.getItem('filterDifficulty') || 20); const [difficulty, setDifficulty] = useState(localStorage.getItem('difficulty') || 21); const [showAdvancedSettings, setShowAdvancedSettings] = useState(false); - const [powServer, setPowServer] = useState(localStorage.getItem('powserver') || ''); + const [powServer, setPowServer] = useState(process.env.REACT_APP_POWSERVER || localStorage.getItem('powserver') || ''); const [testDiff, setTestDiff] = useState('21') const [testResult, setTestResult] = useState() @@ -28,7 +28,6 @@ const Settings = () => { const event = new CustomEvent('settingsChanged', { detail: eventData }); window.dispatchEvent(event); }; - console.log(powServer) const handleTest = () => { setTestResult({ timeTaken: '...', hashrate: '...' }); @@ -152,7 +151,6 @@ const Settings = () => {
Found a bug? dm me: doot or smolgrrr@protonmail.com -
diff --git a/pow_server/Dockerfile b/pow_server/Dockerfile index 946e8a2..69cba5c 100644 --- a/pow_server/Dockerfile +++ b/pow_server/Dockerfile @@ -17,7 +17,7 @@ COPY . . RUN go build -o main . # Expose port 8080 to the outside world -EXPOSE 8080 +EXPOSE 42068 # Command to run the executable CMD ["./main"] \ No newline at end of file diff --git a/pow_server/main.go b/pow_server/main.go index 2ef0b69..729fbb7 100644 --- a/pow_server/main.go +++ b/pow_server/main.go @@ -133,5 +133,5 @@ func main() { http.Handle("/powgen", corsMiddleware(http.HandlerFunc(handlePOW))) http.Handle("/test", corsMiddleware(http.HandlerFunc(handleTest))) - log.Fatal(http.ListenAndServe("0.0.0.0:8080", nil)) + log.Fatal(http.ListenAndServe("0.0.0.0:42068", nil)) }