A lot of small errors fixed on deployment, some things work different with mysql and MariaDB
This commit is contained in:
parent
3f211919af
commit
d2c84f8d68
@ -1,5 +1,7 @@
|
|||||||
CREATE DATABASE `bremen_calling` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
|
CREATE DATABASE `bremen_calling` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
|
||||||
|
|
||||||
|
USE `bremen_calling`
|
||||||
|
|
||||||
CREATE TABLE `participant` (
|
CREATE TABLE `participant` (
|
||||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(128) DEFAULT NULL,
|
`name` varchar(128) DEFAULT NULL,
|
||||||
|
|||||||
@ -18,9 +18,11 @@
|
|||||||
-- Dumping data for table `berth`
|
-- Dumping data for table `berth`
|
||||||
--
|
--
|
||||||
|
|
||||||
|
USE `bremen_calling`;
|
||||||
|
|
||||||
LOCK TABLES `berth` WRITE;
|
LOCK TABLES `berth` WRITE;
|
||||||
/*!40000 ALTER TABLE `berth` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `berth` DISABLE KEYS */;
|
||||||
INSERT INTO `berth` (`id`, `name`) VALUES (1,'Roland Mühle'),(1,'Stahlwerk'),(2,'Kellogs');
|
INSERT INTO `berth` (`id`, `name`) VALUES (1,'Roland Mühle'),(2,'Stahlwerk'),(3,'Kellogs');
|
||||||
/*!40000 ALTER TABLE `berth` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `berth` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
|||||||
@ -5,11 +5,13 @@ import json
|
|||||||
|
|
||||||
bp = Blueprint('ships', __name__)
|
bp = Blueprint('ships', __name__)
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/ships', methods=['get'])
|
@bp.route('/ships', methods=['get'])
|
||||||
@auth_guard() # no restriction by role
|
@auth_guard() # no restriction by role
|
||||||
def GetShips():
|
def GetShips():
|
||||||
if 'Authentication' in request.headers:
|
|
||||||
token = request.headers.get('Authentication')
|
if 'Authorization' in request.headers:
|
||||||
|
token = request.headers.get('Authorization')
|
||||||
return impl.ships.GetShips(token)
|
return impl.ships.GetShips(token)
|
||||||
else:
|
else:
|
||||||
return json.dumps("not authenticated"), 403
|
return json.dumps("not authenticated"), 403
|
||||||
|
|||||||
@ -5,5 +5,6 @@
|
|||||||
"password" : "HalloWach23",
|
"password" : "HalloWach23",
|
||||||
"pool_name" : "brecal_pool",
|
"pool_name" : "brecal_pool",
|
||||||
"pool_size" : 20,
|
"pool_size" : 20,
|
||||||
"database" : "bremen_calling"
|
"database" : "bremen_calling",
|
||||||
|
"autocommit" : true
|
||||||
}
|
}
|
||||||
@ -28,5 +28,5 @@ def initPool():
|
|||||||
except mysql.connector.PoolError as e:
|
except mysql.connector.PoolError as e:
|
||||||
logging.error(f"Failed to create connection pool: {e}")
|
logging.error(f"Failed to create connection pool: {e}")
|
||||||
print(e)
|
print(e)
|
||||||
except e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
@ -144,7 +144,7 @@ class Times:
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class User:
|
class User:
|
||||||
|
|
||||||
id: int
|
id: int
|
||||||
participant_id: int
|
participant_id: int
|
||||||
first_name: str
|
first_name: str
|
||||||
@ -161,6 +161,7 @@ class Ship(Schema):
|
|||||||
name: str
|
name: str
|
||||||
imo: int
|
imo: int
|
||||||
callsign: str
|
callsign: str
|
||||||
|
participant_id: int
|
||||||
length: float
|
length: float
|
||||||
width: float
|
width: float
|
||||||
created: datetime
|
created: datetime
|
||||||
|
|||||||
12
src/server/flaskapp.wsgi
Normal file
12
src/server/flaskapp.wsgi
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import sys
|
||||||
|
import logging
|
||||||
|
|
||||||
|
sys.path.insert(0, '/var/www/brecal/server')
|
||||||
|
sys.path.insert(0, '/var/www/brecal/venv/lib/python3.10/site-packages/')
|
||||||
|
|
||||||
|
# Set up logging
|
||||||
|
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
|
||||||
|
|
||||||
|
# Import and run the Flask app
|
||||||
|
from BreCal import create_app
|
||||||
|
application = create_app()
|
||||||
Loading…
Reference in New Issue
Block a user