vesta-web 1.1.3__py3-none-any.whl → 1.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
vesta/scripts/cli.py CHANGED
@@ -203,9 +203,9 @@ def main():
203
203
  installer.createDB()
204
204
  installer.createUniauth()
205
205
  installer.initDB()
206
- elif args.nginx_command == 'init':
206
+ elif args.db_command == 'init':
207
207
  installer.initDB()
208
- elif args.nginx_command == 'reset':
208
+ elif args.db_command == 'reset':
209
209
  installer.resetDB()
210
210
  else:
211
211
  parser_db.print_help()
vesta/scripts/utils.py CHANGED
@@ -89,7 +89,7 @@ class Installer:
89
89
 
90
90
  # -----------------__DB METHODS__----------------- #
91
91
  def initDB(self):
92
- initializer = DBInitializer(path=self.PATH, configFile=self.PATH + "/server.ini", noStart=True)
92
+ initializer = DBInitializer(path=self.PATH, configFile="/server.ini", noStart=True)
93
93
  if self.uniauth:
94
94
  initializer.initUniauth()
95
95
  initializer.initDB()
@@ -127,27 +127,29 @@ class DBInitializer(Server):
127
127
 
128
128
  def referenceUniauth(self):
129
129
  self.db.cur.execute("CREATE EXTENSION if not exists postgres_fdw;")
130
+ # using sql.SQL because we cant use %s inside OPTIONS
130
131
  self.db.cur.execute(
131
132
  sql.SQL("""
132
- CREATE SERVER if not exists uniauth
133
- FOREIGN DATA WRAPPER postgres_fdw
134
- OPTIONS (host %s, port %s, dbname %s);
135
- """),
136
- (
137
- self.config.get('UNIAUTH', 'DB_HOST'),
138
- self.config.get('UNIAUTH', 'DB_PORT'),
139
- self.config.get('UNIAUTH', 'DB_NAME')
140
- ))
133
+ CREATE SERVER IF NOT EXISTS uniauth
134
+ FOREIGN DATA WRAPPER postgres_fdw
135
+ OPTIONS (host {host}, port {port}, dbname {dbname});
136
+ """).format(
137
+ host=sql.Literal(self.config.get('UNIAUTH', 'DB_HOST')),
138
+ port=sql.Literal(self.config.get('UNIAUTH', 'DB_PORT')),
139
+ dbname=sql.Literal(self.config.get('UNIAUTH', 'DB_NAME'))
140
+ )
141
+ )
141
142
 
142
143
  self.db.cur.execute(
143
144
  sql.SQL("""
144
- CREATE USER MAPPING if not exists FOR CURRENT_USER SERVER uniauth
145
- OPTIONS (user %s, password %s);
146
- """),
147
- (
148
- self.config.get('DB', 'DB_USER'),
149
- self.config.get('DB', 'DB_PASSWORD')
150
- ))
145
+ CREATE USER MAPPING IF NOT EXISTS FOR CURRENT_USER
146
+ SERVER uniauth
147
+ OPTIONS (user {user}, password {password});
148
+ """).format(
149
+ user=sql.Literal(self.config.get('DB', 'DB_USER')),
150
+ password=sql.Literal(self.config.get('DB', 'DB_PASSWORD'))
151
+ )
152
+ )
151
153
  self.db.cur.execute(
152
154
  """
153
155
  CREATE FOREIGN TABLE if not exists account (id bigserial NOT NULL)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vesta-web
3
- Version: 1.1.3
3
+ Version: 1.1.4
4
4
  Summary: An extensive web framework adding every feature needed for Carbonlab
5
5
  Project-URL: Homepage, https://gitlab.com/Louciole/vesta
6
6
  Project-URL: Issues, https://gitlab.com/Louciole/vesta/-/issues
@@ -50,13 +50,13 @@ vesta/http/error.py,sha256=fWdp-oI2ObJD2mHHuxs1yVJvhON5oHYgYFRLAcUMs-I,180
50
50
  vesta/http/redirect.py,sha256=OiDeOmU-X5Mos8a0BQIeOIJqvgWjDEtaYrM4-x4MXl0,177
51
51
  vesta/http/response.py,sha256=G7cmbrXFNbIbQoqNxNkR06I5VymIwjFSAe3LtVa56Ok,3760
52
52
  vesta/mailing/mailing_service.py,sha256=GBO5Hnspm9Pqwd5kGB0iekZaMoIrfQvrhMUf8tVma7g,5386
53
- vesta/scripts/cli.py,sha256=3vKp-imzaAxLHkOwFcNznQ8t9j3St9m0G6RJMpErJIc,8230
53
+ vesta/scripts/cli.py,sha256=AtC7hxB3sMH984e65msO2-R0s4nkrzP09Aqd3OPwCes,8224
54
54
  vesta/scripts/initDB.py,sha256=TKaK4RZM6CycBEsHeGb9Q9PdphkQgaJDnEWhvRnGC9k,1659
55
55
  vesta/scripts/install.py,sha256=GvH_HHx5aU5_54RQ1_2vz4DaLCh42AHfUKy-m0q21vY,2125
56
56
  vesta/scripts/testsRun.py,sha256=bXJImdexKQUDW8CR8F9VIKTrgkd7QfnvHQPENEV4x38,2463
57
- vesta/scripts/utils.py,sha256=g5QKt1Xeezqf56m4ETLvYBhbZ82eg3qHRPKdjE6mjAQ,5860
58
- vesta_web-1.1.3.dist-info/METADATA,sha256=7EY_IDwbSTQEmK2TXoIcm6A5sCt9Bojo_dhDR6s_mcc,1584
59
- vesta_web-1.1.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
60
- vesta_web-1.1.3.dist-info/entry_points.txt,sha256=MHMrWJwtkb4FmNz0CTpxZzwQ3LTqndXBh8YBPDfXlW4,49
61
- vesta_web-1.1.3.dist-info/licenses/LICENSE.md,sha256=zoPFEFUUoSgosmDBK5fGTWGRHHBaSVuuJT2ZQIYXuIk,177
62
- vesta_web-1.1.3.dist-info/RECORD,,
57
+ vesta/scripts/utils.py,sha256=DbsmHJOmW7rwh0K20Jq1b7fRp7UMjb2ioOPPfGBYaQ0,5985
58
+ vesta_web-1.1.4.dist-info/METADATA,sha256=ZWYGzSG77dzNs2wvMNxiB0RUwDim7J8VkzOuT31uZfI,1584
59
+ vesta_web-1.1.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
60
+ vesta_web-1.1.4.dist-info/entry_points.txt,sha256=MHMrWJwtkb4FmNz0CTpxZzwQ3LTqndXBh8YBPDfXlW4,49
61
+ vesta_web-1.1.4.dist-info/licenses/LICENSE.md,sha256=zoPFEFUUoSgosmDBK5fGTWGRHHBaSVuuJT2ZQIYXuIk,177
62
+ vesta_web-1.1.4.dist-info/RECORD,,