vesta-web 1.1.3__py3-none-any.whl → 1.1.5__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,8 @@ 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
+ self.uniauth = True
93
94
  if self.uniauth:
94
95
  initializer.initUniauth()
95
96
  initializer.initDB()
@@ -127,27 +128,29 @@ class DBInitializer(Server):
127
128
 
128
129
  def referenceUniauth(self):
129
130
  self.db.cur.execute("CREATE EXTENSION if not exists postgres_fdw;")
131
+ # using sql.SQL because we cant use %s inside OPTIONS
130
132
  self.db.cur.execute(
131
133
  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
- ))
134
+ CREATE SERVER IF NOT EXISTS uniauth
135
+ FOREIGN DATA WRAPPER postgres_fdw
136
+ OPTIONS (host {host}, port {port}, dbname {dbname});
137
+ """).format(
138
+ host=sql.Literal(self.config.get('UNIAUTH', 'DB_HOST')),
139
+ port=sql.Literal(self.config.get('UNIAUTH', 'DB_PORT')),
140
+ dbname=sql.Literal(self.config.get('UNIAUTH', 'DB_NAME'))
141
+ )
142
+ )
141
143
 
142
144
  self.db.cur.execute(
143
145
  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
- ))
146
+ CREATE USER MAPPING IF NOT EXISTS FOR CURRENT_USER
147
+ SERVER uniauth
148
+ OPTIONS (user {user}, password {password});
149
+ """).format(
150
+ user=sql.Literal(self.config.get('DB', 'DB_USER')),
151
+ password=sql.Literal(self.config.get('DB', 'DB_PASSWORD'))
152
+ )
153
+ )
151
154
  self.db.cur.execute(
152
155
  """
153
156
  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.5
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=PR2XPonaoZEbegzV3QX1EHfyq67sU-cbDEUexCuJp9Q,6013
58
+ vesta_web-1.1.5.dist-info/METADATA,sha256=FITHu0FmVWzp5CLDqXmzPgnQA02nUQ5twObyHu39m8w,1584
59
+ vesta_web-1.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
60
+ vesta_web-1.1.5.dist-info/entry_points.txt,sha256=MHMrWJwtkb4FmNz0CTpxZzwQ3LTqndXBh8YBPDfXlW4,49
61
+ vesta_web-1.1.5.dist-info/licenses/LICENSE.md,sha256=zoPFEFUUoSgosmDBK5fGTWGRHHBaSVuuJT2ZQIYXuIk,177
62
+ vesta_web-1.1.5.dist-info/RECORD,,