Compare commits
15 Commits
9b0f7daa2c
...
debian12
| Author | SHA1 | Date | |
|---|---|---|---|
| ab6ccdcc48 | |||
| 1b83ed51cb | |||
| 2e6ea96fbb | |||
| 6f839a67f4 | |||
| bdb8f9bb64 | |||
| df3802ff50 | |||
| 388cff9368 | |||
| 3d6c9bfecd | |||
| 77111958a2 | |||
| 04c82dd9d4 | |||
| 20bee1018c | |||
| f32ddd837b | |||
| 38ef97b553 | |||
| ff77629a01 | |||
| 4c42bd94ea |
@@ -112,3 +112,5 @@ backend/public/uploads/
|
|||||||
config/
|
config/
|
||||||
secrets/
|
secrets/
|
||||||
keys/
|
keys/
|
||||||
|
|
||||||
|
icon/
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
## Release Notes
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
- Changed **web panel** backend, so you don't need to set the API key anymore. [Web Panel](https://weather.the1s.de)
|
||||||
|
- You can now see the **last updated** time in the web panel.
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
- Changed Website Icons to lucide react icons
|
||||||
|
- Changed overall handling of the panel
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
cd /pfad/zu/deinem/repo
|
|
||||||
while true; do
|
|
||||||
git pull || echo "git pull failed"
|
|
||||||
sleep 10
|
|
||||||
done
|
|
||||||
+2
-11
@@ -2,26 +2,17 @@ services:
|
|||||||
frontend:
|
frontend:
|
||||||
container_name: weather-frontend
|
container_name: weather-frontend
|
||||||
build: ./frontend
|
build: ./frontend
|
||||||
ports:
|
|
||||||
- "7002:7002"
|
|
||||||
networks:
|
networks:
|
||||||
- proxynet
|
- proxynet
|
||||||
environment:
|
|
||||||
- CHOKIDAR_USEPOLLING=true
|
|
||||||
volumes:
|
|
||||||
- ./frontend:/app
|
|
||||||
- /app/node_modules
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
container_name: weather-backend
|
container_name: weather-backend
|
||||||
build: ./backend
|
build: ./backend
|
||||||
networks:
|
networks:
|
||||||
- proxynet
|
- proxynet
|
||||||
ports:
|
|
||||||
- "7001:7001"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./backend:/app
|
- ./backend:/bikelane-backend
|
||||||
- /app/node_modules
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
+12
-5
@@ -1,12 +1,19 @@
|
|||||||
FROM node:20-alpine
|
FROM node:22-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm install
|
RUN npm ci
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
EXPOSE 7002
|
FROM nginx:alpine AS runner
|
||||||
|
|
||||||
CMD ["npm", "run", "dev"]
|
WORKDIR /usr/share/nginx/html
|
||||||
|
COPY --from=builder /app/dist .
|
||||||
|
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
+2
-6
@@ -1,12 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link
|
<link rel="icon" type="image/png" href="/icon_weather-app_dark.png" />
|
||||||
rel="icon"
|
|
||||||
type="image/svg+xml"
|
|
||||||
href="./src/assets/cloud-sun-fill.png"
|
|
||||||
/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Weather App</title>
|
<title>Weather App</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /backend {
|
||||||
|
return 301 /backend/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /backend/ {
|
||||||
|
proxy_pass http://weather-backend:7001/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* \.(?:js|mjs|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
|
||||||
|
expires 1y;
|
||||||
|
access_log off;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
@@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -53,7 +53,7 @@ const ChangeAPI: React.FC<Props> = ({ currentAPIKey, onClose }) => {
|
|||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="bg-gradient-to-r from-blue-600 to-blue-400 text-white font-bold px-6 py-3 rounded-xl shadow-lg hover:from-blue-700 hover:to-blue-500 transition-all"
|
className="cursor-pointer bg-gradient-to-r from-blue-600 to-blue-400 text-white font-bold px-6 py-3 rounded-xl shadow-lg hover:from-blue-700 hover:to-blue-500 transition-all"
|
||||||
onClick={handleUpdate}
|
onClick={handleUpdate}
|
||||||
>
|
>
|
||||||
Update API Key
|
Update API Key
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import ChangePreferences from "./ChangePreferences";
|
|||||||
import { myToast } from "../utils/toastify";
|
import { myToast } from "../utils/toastify";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import logo from "../assets/cloud-sun-fill.png";
|
import logo from "/icon_weather-app_default.png";
|
||||||
import { Github, KeyRound, Settings2 } from "lucide-react";
|
import { Github, KeyRound, Settings2 } from "lucide-react";
|
||||||
|
|
||||||
const Header: React.FC = () => {
|
const Header: React.FC = () => {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ const WeatherCard: React.FC = () => {
|
|||||||
toast
|
toast
|
||||||
.promise(fetchWeather(city, getUnit()), {
|
.promise(fetchWeather(city, getUnit()), {
|
||||||
pending: "Fetching weather data...",
|
pending: "Fetching weather data...",
|
||||||
|
success: "Weather data loaded successfully!",
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (localStorage.getItem("weather")) {
|
if (localStorage.getItem("weather")) {
|
||||||
@@ -49,7 +50,7 @@ const WeatherCard: React.FC = () => {
|
|||||||
Current weather will be displayed here.
|
Current weather will be displayed here.
|
||||||
</p>
|
</p>
|
||||||
<p className="mb-2 text-gray-600">
|
<p className="mb-2 text-gray-600">
|
||||||
<strong>You don't need an API Key!</strong>
|
<strong>Make sure to set your API key in the header section.</strong>
|
||||||
</p>
|
</p>
|
||||||
<form onSubmit={handleSubmit} className="flex flex-col gap-4 mt-4">
|
<form onSubmit={handleSubmit} className="flex flex-col gap-4 mt-4">
|
||||||
<label htmlFor="city" className="font-medium text-gray-700">
|
<label htmlFor="city" className="font-medium text-gray-700">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { myToast } from "./toastify";
|
|||||||
export const fetchWeather = async (city: string, units: string) => {
|
export const fetchWeather = async (city: string, units: string) => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`https://backend.weather.the1s.de/api/fetchWeather?city=${encodeURIComponent(
|
`https://weather.the1s.de/backend/api/fetchWeather?city=${encodeURIComponent(
|
||||||
city
|
city
|
||||||
)}&units=${encodeURIComponent(units)}`,
|
)}&units=${encodeURIComponent(units)}`,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user