last fixes before production

root 2021-05-30 10:48:35 +02:00
parent 29fd770f6d
commit 876e56f581
2 changed files with 24 additions and 2 deletions

View File

@ -1,5 +1,9 @@
#!/bin/sh #!/bin/sh
ssh-keygen -A ssh-keygen -A
## Only in development
cd /admin/admin
yarn install
## End Only in development
cd /admin cd /admin
python3 start.py & python3 start.py &
/usr/sbin/sshd -D -e -f /etc/ssh/sshd_config /usr/sbin/sshd -D -e -f /etc/ssh/sshd_config

View File

@ -40,6 +40,15 @@ class Admin():
sleep(2) sleep(2)
log.warning('Moodle connected.') log.warning('Moodle connected.')
ready=False
while not ready:
try:
with open(os.path.join(app.root_path, "../moodledata/saml2/moodle."+app.config['DOMAIN']+".pem"),"r") as pem:
ready=True
except IOError:
log.warning('Could not get moodle SAML2 pem certificate. Retrying...')
sleep(2)
ready=False ready=False
while not ready: while not ready:
try: try:
@ -51,9 +60,18 @@ class Admin():
log.warning('Nextcloud connected.') log.warning('Nextcloud connected.')
self.default_setup() self.default_setup()
self.internal={} self.internal={}
self.resync_data() # self.resync_data()
ready=False
while not ready:
try:
self.resync_data()
ready=True
except:
log.error('Could not connect to moodle, waiting to be online...')
sleep(2)
self.external={'users':[], self.external={'users':[],
'groups':[], 'groups':[],
'roles':[]} 'roles':[]}