Fixes and improvements

This commit is contained in:
2025-04-10 19:10:57 +01:00
parent 9f715ac17a
commit 660fb0c642
5 changed files with 28 additions and 36 deletions
-2
View File
@@ -49,5 +49,3 @@ jobs:
ssh-keyscan -H hazemkrimi.tech >> ~/.ssh/known_hosts ssh-keyscan -H hazemkrimi.tech >> ~/.ssh/known_hosts
rsync -avz --delete client/build/* deploy@hazemkrimi.tech:/var/www/touch-programming.hazemkrimi.tech/public rsync -avz --delete client/build/* deploy@hazemkrimi.tech:/var/www/touch-programming.hazemkrimi.tech/public
rsync -avz --delete server/executable deploy@hazemkrimi.tech:/var/www/touch-programming.hazemkrimi.tech/api rsync -avz --delete server/executable deploy@hazemkrimi.tech:/var/www/touch-programming.hazemkrimi.tech/api
# scp -r client/build deploy@hazemkrimi.tech:/var/www/touch-programming.hazemkrimi.tech/public
# scp server/executable deploy@hazemkrimi.tech:/var/www/touch-programming.hazemkrimi.tech/api
-1
View File
@@ -1,7 +1,6 @@
export const KEYS_TO_DISABLE = [ export const KEYS_TO_DISABLE = [
'Backspace', 'Backspace',
'Shift', 'Shift',
'Alt',
'Control', 'Control',
'F1', 'F1',
'F2', 'F2',
+23 -30
View File
@@ -1,37 +1,30 @@
events {} server {
server_name touch-programming.hazemkrimi.tech;
http { access_log /var/log/nginx/access.log;
include /etc/nginx/mime.types; root /var/www/touch-programming.hazemkrimi.tech/public;
default_type application/octet-stream;
server { location / {
listen 80; try_files $uri $uri/ /index.html;
server_name touch-programming.hazemkrimi.tech; }
access_log /var/log/nginx/access.log;
root /usr/share/nginx/html;
location / { location /assets/ {
try_files $uri $uri/ /index.html; try_files $uri =404;
} }
location /assets/ { location ~* \.(?:css|js|ico|ttf|png|svg|webm) {
try_files $uri =404; expires 1M;
} access_log off;
add_header Cache-Control "public";
}
location ~* \.(?:css|js|ico|ttf|png|svg|webm) { location /api/ {
expires 1M; proxy_pass http://127.0.0.1:5000/;
access_log off; proxy_set_header Host $host;
add_header Cache-Control "public"; proxy_set_header X-Real-IP $remote_addr;
} proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
location /api/ { proxy_cache_bypass $http_upgrade;
proxy_pass http://127.0.0.1:5000/; proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_cache_bypass $http_upgrade;
proxy_http_version 1.1;
}
} }
} }
+2 -2
View File
@@ -2,8 +2,8 @@
Description=Touch Programming API Service Description=Touch Programming API Service
[Service] [Service]
ExecStart=/usr/local/bin/touch-programming-api ExecStart=/var/www/touch-programming.hazemkrimi.tech/api/executable
WorkingDirectory=/usr/local/bin WorkingDirectory=/var/www/touch-programming.hazemkrimi.tech/api
User=hazem User=hazem
Group=hazem Group=hazem
LimitNOFILE=65536 LimitNOFILE=65536
+3 -1
View File
@@ -26,7 +26,9 @@ func main() {
ech := echo.New() ech := echo.New()
ech.Use(middleware.CORS()) ech.Use(middleware.CORSWithConfig(middleware.CORSConfig{
AllowOrigins: []string{"https://touch-programming.hazemkrimi.tech"},
}))
ech.GET("/generate", handlers.Generate) ech.GET("/generate", handlers.Generate)