1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

Updated cert configs

This commit is contained in:
Eldad Fux 2020-02-25 12:04:12 +02:00
parent 41b0076623
commit 333ec49ee9
3 changed files with 16 additions and 7 deletions

View file

@ -29,6 +29,7 @@ const APP_VERSION_STABLE = '0.5.0';
const APP_STORAGE_UPLOADS = '/storage/uploads';
const APP_STORAGE_CACHE = '/storage/cache';
const APP_STORAGE_CERTIFICATES = '/storage/certificates';
const APP_STORAGE_CONFIG = '/storage/config';
const APP_SOCIAL_TWITTER = 'https://twitter.com/appwrite_io';
const APP_SOCIAL_TWITTER_HANDLE = 'appwrite_io';
const APP_SOCIAL_FACEBOOK = 'https://www.facebook.com/appwrite.io';

View file

@ -146,6 +146,16 @@ class CertificatesV1
if(!$document) {
throw new Exception('Failed saving domain to DB');
}
$config =
"tls:
certificates:
- certFile: /storage/certificates/{$domain->get()}/fullchain.pem
keyFile: /storage/certificates/{$domain->get()}/privkey.pem";
if(!file_put_contents(APP_STORAGE_CONFIG.'/'.$domain->get().'.yml', $config)) {
throw new Exception('Failed to save SSL configuration');
}
Authorization::reset();
}

View file

@ -6,7 +6,7 @@ services:
command:
- --log.level=DEBUG
- --api.insecure=true
- --providers.file.directory=/etc/traefik/dynamic_conf
- --providers.file.directory=/storage/config
- --providers.file.watch=true
- --providers.docker=true
- --entrypoints.web.address=:80
@ -18,11 +18,8 @@ services:
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/etc/traefik/dynamic_conf/conf.yml:ro
- ./docker/ssl/cert.pem:/certs/default.crt:ro
- ./docker/ssl/key.pem:/certs/default.key:ro
- appwrite-traefik:/traefik
- appwrite-certificates:/storage/certificates:rw
- appwrite-config:/storage/config:ro
- appwrite-certificates:/storage/certificates:ro
depends_on:
- appwrite
networks:
@ -46,6 +43,7 @@ services:
volumes:
- appwrite-uploads:/storage/uploads:rw
- appwrite-cache:/storage/cache:rw
- appwrite-config:/storage/config:rw
- appwrite-certificates:/storage/certificates:rw
- ./phpunit.xml:/usr/share/nginx/html/phpunit.xml
- ./tests:/usr/share/nginx/html/tests
@ -166,4 +164,4 @@ volumes:
appwrite-uploads:
appwrite-certificates:
appwrite-influxdb:
appwrite-traefik:
appwrite-config: