Commit 317abe56 authored by Boxiang Sun's avatar Boxiang Sun

peertube: configuration

parent 295430b2
...@@ -7,9 +7,9 @@ parts = ...@@ -7,9 +7,9 @@ parts =
promise-redis promise-redis
postgresql postgresql
postgresql-extension postgresql-extension
peertube-configuration-1
nginx-service nginx-service
nginx-listen-promise nginx-listen-promise
peertube-configuration-1
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
...@@ -35,13 +35,25 @@ ssl = $${:etc}/ssl ...@@ -35,13 +35,25 @@ ssl = $${:etc}/ssl
recipe = slapos.recipe.build recipe = slapos.recipe.build
production_config_template = ${peertube:location}/config/production.yaml.example production_config_template = ${peertube:location}/config/production.yaml.example
production_config_prod = $${directory:config}/production.yaml production_config_prod = $${directory:config}/production.yaml
default_yaml = ${peertube:location}/config/default.yaml
default_yaml_prod = $${directory:config}/default.yaml
nginx_config = ${peertube:location}/support/nginx/peertube
nginx_config_prod = ${peertube:location}/support/nginx/peertube
install = install =
import shutil import shutil
shutil.copyfile(options['production_config_template'], options['production_config_prod']) shutil.copyfile(options['default_yaml'], options['default_yaml_prod'])
with open(options['production_config_prod'], encoding='UTF-8') as f: shutil.copyfile(options['default_yaml'], options['default_yaml_prod'])
content = f.read() with open(options['production_config_template'], "r", encoding='utf-8') as exmaple_file:
print(content) with open(options['production_config_prod'], "w", encoding='utf-8') as prod_file:
f.close() for line in exmaple_file:
if "hostname: 'example.com'" in line:
line = line.replace("example.com", "https://[$${nginx-configuration:ip}]/$${nginx-configuration:port}")
if "password: 'peertube'" in line:
line = line.replace("peertube", "$${postgresql:password}")
print("Fuck!!!")
print(line)
prod_file.write(line)
# content = content.replace(old_content, new_content) # content = content.replace(old_content, new_content)
...@@ -142,8 +154,9 @@ unixsocket = $${:server-dir}/redis.socket ...@@ -142,8 +154,9 @@ unixsocket = $${:server-dir}/redis.socket
ipv6 = ::1 ipv6 = ::1
port = 0 port = 0
server-bin = {{ redis_binprefix }}/redis-server # server-bin = ${buildout:parts-directory}/redis/bin/redis-server
cli-bin = {{ redis_binprefix }}/redis-cli server-bin = ${redis28:location}/bin/redis-server
cli-bin = ${redis28:location}/bin/redis-cli
depend = depend =
$${logrotate-entry-redis:recipe} $${logrotate-entry-redis:recipe}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment