Skip to content

Commit cc1171b

Browse files
fix: appserver public ip
1 parent f62a410 commit cc1171b

5 files changed

Lines changed: 8 additions & 3 deletions

File tree

app-server/appserver_linux_amd64

200 Bytes
Binary file not shown.

app-server/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type Config struct {
1313
FSROOT string `ini:"FSROOT"`
1414
SECURE bool `ini:"SECURE"`
1515
DRI bool `ini:"DRI"`
16+
PUBLICADDR string `ini:"PUBLICADDR"`
1617
} `ini:"Configuration"`
1718
}
1819

app-server/config.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ REPOSITORY = localhost:5000
44
SECRET = q@4iMlcS!AnMC74ZfxB0GNh623VN!Qo*Jf$6wuKBFZ*f0doBJ1
55
FSROOT = /tmp/appvirt/
66
SECURE = true
7-
DRI = true
7+
DRI = true
8+
PUBLICADDR = 127.0.0.1

app-server/jwt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func ProcessToken(access_token string) (string, bool) {
4545

4646
//Comprova que el servidor de destí sigui el que toca
4747
if servidor, ok := claims["server"].(string); ok {
48-
if servidor != ip {
49-
log.Println("S'ha intentat accedir a ",ip," amb un token per ",servidor)
48+
if servidor != ip && servidor != GLOBAL.Configuration.PUBLICADDR {
49+
log.Println("S'ha intentat accedir a ",ip,"/",GLOBAL.Configuration.PUBLICADDR," amb un token per ",servidor)
5050
return "", false
5151
}
5252

install/install_appserver.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ cd appserver
99

1010

1111
#Demana per la configuració
12+
read -p "Escriu l'adreça pública del servei [Per defecte: localhost]: " pubaddr
13+
pubaddr=${pubaddr:-"localhost"}
1214
read -p "Escriu l'URL del servidor de control [Per defecte: https://localhost:3000]: " url
1315
url=${url:-"https://localhost:3000"}
1416
read -p "Escriu el secret generat pel servidor: " secret
@@ -57,6 +59,7 @@ SECRET = $secret
5759
FSROOT = $path
5860
SECURE = $https
5961
DRI = $dri
62+
PUBLICADDR = $pubaddr
6063
EOF
6164

6265
#Permetre registres inseguurs

0 commit comments

Comments
 (0)