Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / app_settings / default / api.py @ 2522e489

History | View | Annotate | Download (5.1 kB)

1 1277fb19 Vangelis Koukis
# -*- coding: utf-8 -*-
2 1277fb19 Vangelis Koukis
#
3 1277fb19 Vangelis Koukis
# API configuration
4 1277fb19 Vangelis Koukis
#####################
5 1277fb19 Vangelis Koukis
6 de470b1e Kostas Papadimitriou
7 de470b1e Kostas Papadimitriou
DEBUG = False
8 de470b1e Kostas Papadimitriou
9 07d104d8 Kostas Papadimitriou
# Top-level URL for deployment. Numerous other URLs depend on this.
10 22a882a1 Georgios D. Tsoukalas
CYCLADES_BASE_URL = "https://compute.example.synnefo.org/compute/"
11 1277fb19 Vangelis Koukis
12 1277fb19 Vangelis Koukis
# The API will return HTTP Bad Request if the ?changes-since
13 1277fb19 Vangelis Koukis
# parameter refers to a point in time more than POLL_LIMIT seconds ago.
14 1277fb19 Vangelis Koukis
POLL_LIMIT = 3600
15 1277fb19 Vangelis Koukis
16 1277fb19 Vangelis Koukis
#
17 1277fb19 Vangelis Koukis
# Network Configuration
18 1277fb19 Vangelis Koukis
#
19 1277fb19 Vangelis Koukis
20 9446e7e5 Christos Stavrakakis
# List of network IDs. All created instances will get a NIC connected to each
21 9446e7e5 Christos Stavrakakis
# network of this list. If the special network ID "SNF:ANY_PUBLIC" is used,
22 9446e7e5 Christos Stavrakakis
# Cyclades will automatically choose a public network and connect the server to
23 9446e7e5 Christos Stavrakakis
# it.
24 b2791a77 Christos Stavrakakis
DEFAULT_INSTANCE_NETWORKS = ["SNF:ANY_PUBLIC"]
25 9446e7e5 Christos Stavrakakis
26 6eed1ede Christos Stavrakakis
# Maximum allowed network size for private networks.
27 6eed1ede Christos Stavrakakis
MAX_CIDR_BLOCK = 22
28 839e2bd0 Christos Stavrakakis
29 b7d38981 Dimitris Aragiorgis
# Default settings used by network flavors
30 b7d38981 Dimitris Aragiorgis
DEFAULT_MAC_PREFIX = 'aa:00:0'
31 b7d38981 Dimitris Aragiorgis
DEFAULT_BRIDGE = 'br0'
32 839e2bd0 Christos Stavrakakis
33 b7d38981 Dimitris Aragiorgis
# Network flavors that users are allowed to create through API requests
34 b7d38981 Dimitris Aragiorgis
API_ENABLED_NETWORK_FLAVORS = ['MAC_FILTERED']
35 b7d38981 Dimitris Aragiorgis
36 b7d38981 Dimitris Aragiorgis
# Settings for IP_LESS_ROUTED network:
37 b7d38981 Dimitris Aragiorgis
# -----------------------------------
38 b7d38981 Dimitris Aragiorgis
# In this case VMCs act as routers that forward the traffic to/from VMs, based
39 b7d38981 Dimitris Aragiorgis
# on the defined routing table($DEFAULT_ROUTING_TABLE) and ip rules, that
40 b7d38981 Dimitris Aragiorgis
# exist in every node, implenting an IP-less routed and proxy-arp setup.
41 b7d38981 Dimitris Aragiorgis
DEFAULT_ROUTING_TABLE = 'snf_public'
42 b7d38981 Dimitris Aragiorgis
43 b7d38981 Dimitris Aragiorgis
# Settings for MAC_FILTERED network:
44 839e2bd0 Christos Stavrakakis
# ------------------------------------------
45 839e2bd0 Christos Stavrakakis
# All networks of this type are bridged to the same bridge. Isolation between
46 839e2bd0 Christos Stavrakakis
# networks is achieved by assigning a unique MAC-prefix to each network and
47 839e2bd0 Christos Stavrakakis
# filtering packets via ebtables.
48 b7d38981 Dimitris Aragiorgis
DEFAULT_MAC_FILTERED_BRIDGE = 'prv0'
49 839e2bd0 Christos Stavrakakis
50 e6a42a96 Christos Stavrakakis
51 b2791a77 Christos Stavrakakis
# Firewalling. Firewall tags should contain '%d' to be filled with the NIC
52 b2791a77 Christos Stavrakakis
# index.
53 b2791a77 Christos Stavrakakis
GANETI_FIREWALL_ENABLED_TAG = 'synnefo:network:%d:protected'
54 b2791a77 Christos Stavrakakis
GANETI_FIREWALL_DISABLED_TAG = 'synnefo:network:%d:unprotected'
55 b2791a77 Christos Stavrakakis
GANETI_FIREWALL_PROTECTED_TAG = 'synnefo:network:%d:limited'
56 1277fb19 Vangelis Koukis
57 9b5b718a Giorgos Verigakis
# The default firewall profile that will be in effect if no tags are defined
58 9b5b718a Giorgos Verigakis
DEFAULT_FIREWALL_PROFILE = 'DISABLED'
59 9b5b718a Giorgos Verigakis
60 5dd9d123 Christos Stavrakakis
# Fixed mapping of user VMs to a specific backend.
61 68a81d58 Olga Brani
# e.g. BACKEND_PER_USER = {'example@synnefo.org': 2}
62 5dd9d123 Christos Stavrakakis
BACKEND_PER_USER = {}
63 5dd9d123 Christos Stavrakakis
64 776d2a3f Christos Stavrakakis
# List of backend IDs used *only* for archipelago.
65 776d2a3f Christos Stavrakakis
ARCHIPELAGO_BACKENDS = []
66 2e1e6844 Christos Stavrakakis
67 ce55f211 Kostas Papadimitriou
68 5391d6b5 Giorgos Verigakis
# URL templates for the stat graphs.
69 5391d6b5 Giorgos Verigakis
# The API implementation replaces '%s' with the encrypted backend id.
70 5391d6b5 Giorgos Verigakis
# FIXME: For now we do not encrypt the backend id.
71 68a81d58 Olga Brani
CPU_BAR_GRAPH_URL = 'http://stats.synnefo.org/%s/cpu-bar.png'
72 68a81d58 Olga Brani
CPU_TIMESERIES_GRAPH_URL = 'http://stats.synnefo.org/%s/cpu-ts.png'
73 68a81d58 Olga Brani
NET_BAR_GRAPH_URL = 'http://stats.synnefo.org/%s/net-bar.png'
74 68a81d58 Olga Brani
NET_TIMESERIES_GRAPH_URL = 'http://stats.synnefo.org/%s/net-ts.png'
75 c738c935 Giorgos Verigakis
76 c738c935 Giorgos Verigakis
# Recommended refresh period for server stats
77 c738c935 Giorgos Verigakis
STATS_REFRESH_PERIOD = 60
78 fc443bcd Giorgos Verigakis
79 fc443bcd Giorgos Verigakis
# The maximum number of file path/content pairs that can be supplied on server
80 fc443bcd Giorgos Verigakis
# build
81 fc443bcd Giorgos Verigakis
MAX_PERSONALITY = 5
82 fc443bcd Giorgos Verigakis
83 fc443bcd Giorgos Verigakis
# The maximum size, in bytes, for each personality file
84 fc443bcd Giorgos Verigakis
MAX_PERSONALITY_SIZE = 10240
85 c909cbbd Giorgos Verigakis
86 6ef51e9f Giorgos Verigakis
87 e3ff6830 Georgios D. Tsoukalas
# Top-level URL of the astakos instance to be used for user management
88 e3ff6830 Georgios D. Tsoukalas
ASTAKOS_BASE_URL = 'https://accounts.example.synnefo.org/'
89 30e0ed74 Christos Stavrakakis
90 28c41829 Christos Stavrakakis
# Tune the size of the Astakos http client connection pool
91 28c41829 Christos Stavrakakis
# This limit the number of concurrent requests to Astakos.
92 b0c95903 Giorgos Korfiatis
CYCLADES_ASTAKOSCLIENT_POOLSIZE = 50
93 28c41829 Christos Stavrakakis
94 30e0ed74 Christos Stavrakakis
# Key for password encryption-decryption. After changing this setting, synnefo
95 30e0ed74 Christos Stavrakakis
# will be unable to decrypt all existing Backend passwords. You will need to
96 0224049a Christos Stavrakakis
# store again the new password by using 'snf-manage backend-modify'.
97 0224049a Christos Stavrakakis
# SECRET_ENCRYPTION_KEY may up to 32 bytes. Keys bigger than 32 bytes are not
98 0224049a Christos Stavrakakis
# supported.
99 28c41829 Christos Stavrakakis
SECRET_ENCRYPTION_KEY = "Password Encryption Key"
100 a682eaea Kostas Papadimitriou
101 a682eaea Kostas Papadimitriou
# Astakos service token
102 a682eaea Kostas Papadimitriou
# The token used for astakos service api calls (e.g. api to retrieve user email
103 a682eaea Kostas Papadimitriou
# using a user uuid)
104 49c0d427 Kostas Papadimitriou
CYCLADES_SERVICE_TOKEN = ''
105 02f0cf8a Kostas Papadimitriou
106 02f0cf8a Kostas Papadimitriou
# Let cyclades proxy user specific api calls to astakos, via self served
107 02f0cf8a Kostas Papadimitriou
# endpoints. Set this to False if you deploy cyclades-app/astakos-app on the
108 02f0cf8a Kostas Papadimitriou
# same machine.
109 02f0cf8a Kostas Papadimitriou
CYCLADES_PROXY_USER_SERVICES = True
110 d328a525 Christos Stavrakakis
111 d328a525 Christos Stavrakakis
# Template to use to build the FQDN of VMs. The setting will be formated with
112 d328a525 Christos Stavrakakis
# the id of the VM. If set to 'None' the first public IPv4 or IPv6 address
113 d328a525 Christos Stavrakakis
# of the VM will be used.
114 d328a525 Christos Stavrakakis
CYCLADES_SERVERS_FQDN = 'snf-%(id)s.vm.example.synnefo.org'
115 2522e489 Christos Stavrakakis
116 2522e489 Christos Stavrakakis
# Description of applied port forwarding rules (DNAT) for Cyclades VMs. This
117 2522e489 Christos Stavrakakis
# setting contains a mapping from the port of each VM to a tuple contaning the
118 2522e489 Christos Stavrakakis
# destination IP/hostname and the new port: (host, port). Instead of a tuple a
119 2522e489 Christos Stavrakakis
# python callable object may be used which must return such a tuple. The caller
120 2522e489 Christos Stavrakakis
# will pass to the callable the following positional arguments, in the
121 2522e489 Christos Stavrakakis
# following order:
122 2522e489 Christos Stavrakakis
# * server_id: The ID of the VM in the DB
123 2522e489 Christos Stavrakakis
# * ip_address: The IPv4 address of the public VM NIC
124 2522e489 Christos Stavrakakis
# * fqdn: The FQDN of the VM
125 2522e489 Christos Stavrakakis
# * user: The UUID of the owner of the VM
126 2522e489 Christos Stavrakakis
#
127 2522e489 Christos Stavrakakis
# Here is an example describing the mapping of the SSH port of all VMs to
128 2522e489 Christos Stavrakakis
# the external address 'gate.example.synnefo.org' and port 60000+server_id.
129 2522e489 Christos Stavrakakis
# e.g. iptables -t nat -A prerouting -d gate.example.synnefo.org \
130 2522e489 Christos Stavrakakis
# --dport (61000 + $(VM_ID)) -j DNAT --to-destination $(VM_IP):22
131 2522e489 Christos Stavrakakis
#CYCLADES_PORT_FORWARDING = {
132 2522e489 Christos Stavrakakis
#    22: lambda ip_address, server_id, fqdn, user:
133 2522e489 Christos Stavrakakis
#               ("gate.example.synnefo.org", 61000 + server_id),
134 2522e489 Christos Stavrakakis
#}
135 2522e489 Christos Stavrakakis
CYCLADES_PORT_FORWARDING = {}