Compare commits

...

22 Commits

Author SHA1 Message Date
Timothée Floure 15d962bdf8
Rebase CI environment on alpine linux
continuous-integration/drone/push Build is passing Details
2022-05-22 12:05:15 +02:00
Timothée Floure f7fa25c2e5
Update bamboo and minor mix deps; fix synthax error in user module
continuous-integration/drone/push Build is passing Details
2022-05-21 18:47:56 +02:00
Timothée Floure 190b0827a2
Replace sr.ht builds by internal drone CI
continuous-integration/drone/push Build is failing Details
2022-05-21 18:38:33 +02:00
Timothée Floure 3f3c835598
VirtualMachineHosting* -> VirtualMachine* 2021-04-12 15:53:49 +02:00
Timothée Floure 11270fc7b1
VM dashboard - do not crash on missing configuration 2021-04-12 15:48:49 +02:00
Timothée Floure 82c12bd234
Rename from RecycledCloud / management to Meta 2021-04-12 15:44:12 +02:00
Timothée Floure 8e5ba0269f
Release 0.4.0 2021-04-09 11:38:38 +02:00
Timothée Floure 4a370a9952
Cleanup VM dashboard 2021-04-09 11:36:33 +02:00
Timothée Floure 65c9c07297
Wrap Odoo auth in try block 2021-04-07 17:24:21 +02:00
Timothée Floure 7e6439be67
Wire initial VM management frontend 2021-04-07 17:23:48 +02:00
Timothée Floure 053d5a3320
Fix mapping of lists in ONE Records, import both VM and VM_POOL
subrecords
2021-03-05 16:09:04 +01:00
Timothée Floure ae52442bd6
Add initial OpenNebula XML-RPC Api Integration 2021-02-11 14:34:40 +01:00
Timothée Floure 6938d7083c
Add credo linter 2021-02-08 15:26:00 +01:00
Timothée Floure 42d44160b5
Fix minor typo in captcha description, release v0.3.1 2021-02-03 13:56:00 +01:00
Timothée Floure 2250c87c6f
CI: fetch LDAP environment container before running tests 2021-02-03 13:18:18 +01:00
Timothée Floure 9612ee8bfc
Set LICENSE to AGPLv3 (fixes #17) 2021-02-03 11:59:59 +01:00
Timothée Floure 11fb1b4a5c
Release v0.3.0 2021-02-03 11:54:44 +01:00
Timothée Floure 00394a3559
Blacklist misleading usernames (fixes #10) 2021-02-03 11:53:26 +01:00
Timothée Floure c5b02fe5be
Populate CHANGELOG with latest changes 2021-02-03 10:14:17 +01:00
Timothée Floure 3dfc9115a1
Add captcha to registrations (fixes #9) 2021-02-03 10:12:23 +01:00
Timothée Floure a1dcc36dab
Add captcha to support requests 2021-02-03 09:37:00 +01:00
Timothée Floure a9a65adb8c
Add minimal contact form 2021-02-02 18:49:11 +01:00
167 changed files with 8531 additions and 296 deletions

View File

@ -1,33 +0,0 @@
image: alpine/edge
packages:
- elixir
- postgresql
- postgresql-contrib
- docker
artifacts:
- management/_build/prod/rel/recycledcloud.tar.gz
sources:
- https://code.recycled.cloud/e-Durable/management.git
tasks:
- setup: |
sudo service postgresql setup
sudo service postgresql start
sudo service docker start
cd management
mix local.hex --force
mix local.rebar --force
mix deps.get
- build: |
cd management
MIX_ENV=test mix deps.compile
MIX_ENV=test mix compile
- test: |
cd management
CALL_CONTAINER_RUNTIME_AS_ROOT=1 LDAP_WAIT_LOOPS=100 MIX_ENV=test mix test
- release: |
cd management
MIX_ENV=prod mix compile
MIX_ENV=prod mix phx.digest
MIX_ENV=prod mix release
cd _build/prod/rel
tar cvzf recycledcloud.tar.gz recycledcloud/

35
.drone.yml Normal file
View File

@ -0,0 +1,35 @@
---
kind: pipeline
name: default
steps:
- name: build-release
image: alpine:3.15
environment:
MIX_ENV: prod
commands:
- apk add elixir git make gcc libc-dev
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix compile
- mix phx.digest
- mix release
- cd _build/prod/rel
- tar czf "meta-$(git describe --exact-match --tags $(git log -n1 --pretty='%h') || git rev-parse HEAD).tar.gz" meta/
- name: publish-release-archive
image: alpine:3.15
environment:
LFTP_PASSWORD:
from_secret: ssh_password
commands:
- apk add lftp openssh-client git
- cd _build/prod/rel
- mkdir ~/.ssh
- ssh-keyscan static.recycled.cloud > ~/.ssh/known_hosts
- lftp "sftp://artifacts:$LFTP_PASSWORD@static.recycled.cloud" -e "cd htdocs; put meta-$(git describe --exact-match --tags $(git log -n1 --pretty='%h') || git rev-parse HEAD).tar.gz; bye"
---
kind: secret
name: ssh_password
data: qdcw1yGdz1iDaGmovTD7Afj1piyjcZ/H4NXNKPpmUWgagBvA

View File

@ -1,3 +1,24 @@
# meta 0.5.0, not yet release
* Rename app from Recycled Cloud / management to Meta
# management 0.4.0, 2021-04-09
* Initial VM dashboard
* Various typo fixes and error catching.
# management 0.3.1, 2021-02-03
* Allow forgery on the support request form
* Fix minor typo in captcha description
# management 0.3.0, 2021-02-03
* Add minimal captcha module
* Add minimal support/contact form
* Add captcha to registrations
* Blacklist misleading username for new accounts
# management 0.2.0, 2021-01-19
* Initial Odoo/Billing integration

661
LICENSE.txt Normal file
View File

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View File

@ -1,6 +1,6 @@
# Recycled Cloud Management Interface
# Recycled Cloud Management Interface (Meta)
[![builds.sr.ht status](https://builds.sr.ht/~fnux.svg?search=recycledcloud-management)](https://builds.sr.ht/~fnux?search=recycledcloud-management)
[![builds.sr.ht status](https://builds.sr.ht/~fnux.svg?search=recycledcloud-meta)](https://builds.sr.ht/~fnux?search=recycledcloud-meta)
This repository tracks the initial work for a web interface atop the recycled
cloud. It is written in [Elixir](https://elixir-lang.org/), making use of the
@ -18,6 +18,7 @@ cloud. It is written in [Elixir](https://elixir-lang.org/), making use of the
* Authentication is based on José Valim and Aaron Renner's
[Phx.Gen.Auth](https://hex.pm/packages/phx_gen_auth), adapted for LDAP-backed
authentication.
* You can run the linter with `mix credo`.
## Getting Started

View File

@ -7,17 +7,17 @@
# General application configuration
use Mix.Config
config :recycledcloud,
namespace: RecycledCloud,
ecto_repos: [RecycledCloud.Repo],
config :meta,
namespace: Meta,
ecto_repos: [Meta.Repo],
enable_registration: true
# Configures the endpoint
config :recycledcloud, RecycledCloudWeb.Endpoint,
config :meta, MetaWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "bm4MGjSLcEbL3HEDg2H0LlcJ5d3nIkogyd/PpGW1iXdEbKbtM0N8Ct4Jh/PbsnoS",
render_errors: [view: RecycledCloudWeb.ErrorView, accepts: ~w(html json), layout: false],
pubsub_server: RecycledCloud.PubSub,
render_errors: [view: MetaWeb.ErrorView, accepts: ~w(html json), layout: false],
pubsub_server: Meta.PubSub,
live_view: [signing_salt: "kTyyWZd5"]
# Configures Elixir's Logger

View File

@ -1,10 +1,10 @@
use Mix.Config
# Configure your database
config :recycledcloud, RecycledCloud.Repo,
config :meta, Meta.Repo,
username: "postgres",
password: "postgres",
database: "recycledcloud_dev",
database: "meta_dev",
hostname: "localhost",
show_sensitive_data_on_connection_error: true,
pool_size: 10
@ -15,7 +15,7 @@ config :recycledcloud, RecycledCloud.Repo,
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with webpack to recompile .js and .css sources.
config :recycledcloud, RecycledCloudWeb.Endpoint,
config :meta, MetaWeb.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true,
@ -47,13 +47,13 @@ config :recycledcloud, RecycledCloudWeb.Endpoint,
# different ports.
# Watch static and templates for browser reloading.
config :recycledcloud, RecycledCloudWeb.Endpoint,
config :meta, MetaWeb.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/recycledcloud_web/(live|views)/.*(ex)$",
~r"lib/recycledcloud_web/templates/.*(eex)$"
~r"lib/meta_web/(live|views)/.*(ex)$",
~r"lib/meta_web/templates/.*(eex)$"
]
]
@ -68,11 +68,11 @@ config :phoenix, :stacktrace_depth, 20
config :phoenix, :plug_init_mode, :runtime
# Send emails to local memory for development.
config :recycledcloud, RecycledCloud.Mailer,
config :meta, Meta.Mailer,
adapter: Bamboo.LocalAdapter
# LDAP configuration
config :recycledcloud, :ldap,
config :meta, :ldap,
server: "127.0.0.1",
port: 3089,
ssl: false,
@ -82,7 +82,7 @@ config :recycledcloud, :ldap,
default_group_gid: 1000
## Odoo API credentials
config :recycledcloud, :odoo,
config :meta, :odoo,
server: "https://odoo.staging.e-durable.ch",
database: "e-Durable",
user: "user",

View File

@ -9,7 +9,7 @@ use Mix.Config
# manifest is generated by the `mix phx.digest` task,
# which you should run after static files are built and
# before starting your production server.
config :recycledcloud, RecycledCloudWeb.Endpoint,
config :meta, MetaWeb.Endpoint,
url: [host: "example.com", port: 80],
cache_static_manifest: "priv/static/cache_manifest.json"
@ -21,7 +21,7 @@ config :logger, level: :info
# To get SSL working, you will need to add the `https` key
# to the previous section and set your `:url` port to 443:
#
# config :recycledcloud, RecycledCloudWeb.Endpoint,
# config :meta, MetaWeb.Endpoint,
# ...
# url: [host: "example.com", port: 443],
# https: [
@ -45,7 +45,7 @@ config :logger, level: :info
# We also recommend setting `force_ssl` in your endpoint, ensuring
# no data is ever sent via http, always redirecting to https:
#
# config :recycledcloud, RecycledCloudWeb.Endpoint,
# config :meta, MetaWeb.Endpoint,
# force_ssl: [hsts: true]
#
# Check `Plug.SSL` for all available options in `force_ssl`.

View File

@ -10,7 +10,7 @@ database_url =
For example: ecto://USER:PASS@HOST/DATABASE
"""
config :recycledcloud, RecycledCloud.Repo,
config :meta, Meta.Repo,
# ssl: true,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")
@ -22,7 +22,7 @@ secret_key_base =
You can generate one by calling: mix phx.gen.secret
"""
config :recycledcloud, RecycledCloudWeb.Endpoint,
config :meta, MetaWeb.Endpoint,
http: [
port: String.to_integer(System.get_env("PORT") || "4000"),
transport_options: [socket_opts: [:inet6]]
@ -34,7 +34,7 @@ config :recycledcloud, RecycledCloudWeb.Endpoint,
# If you are doing OTP releases, you need to instruct Phoenix
# to start each relevant endpoint:
#
config :recycledcloud, RecycledCloudWeb.Endpoint, server: true
config :meta, MetaWeb.Endpoint, server: true
#
# Then you can assemble a release by calling `mix release`.
# See `mix help release` for more information.

View File

@ -8,16 +8,16 @@ config :bcrypt_elixir, :log_rounds, 1
# The MIX_TEST_PARTITION environment variable can be used
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :recycledcloud, RecycledCloud.Repo,
config :meta, Meta.Repo,
username: "postgres",
password: "postgres",
database: "recycledcloud_test#{System.get_env("MIX_TEST_PARTITION")}",
database: "meta_test#{System.get_env("MIX_TEST_PARTITION")}",
hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :recycledcloud, RecycledCloudWeb.Endpoint,
config :meta, MetaWeb.Endpoint,
http: [port: 4002],
server: false
@ -25,7 +25,7 @@ config :recycledcloud, RecycledCloudWeb.Endpoint,
config :logger, level: :warn
# LDAP configuration
config :recycledcloud, :ldap,
config :meta, :ldap,
server: "127.0.0.1",
port: 3089,
ssl: false,
@ -34,5 +34,5 @@ config :recycledcloud, :ldap,
bind_pw: "admin"
# Send emails to local memory for testing.
config :recycledcloud, RecycledCloud.Mailer,
config :meta, Meta.Mailer,
adapter: Bamboo.LocalAdapter

View File

@ -1,6 +1,6 @@
defmodule RecycledCloud do
defmodule Meta do
@moduledoc """
RecycledCloud keeps the contexts that define your domain
Meta keeps the contexts that define your domain
and business logic.
Contexts are also responsible for managing your data, regardless

View File

@ -1,11 +1,11 @@
defmodule RecycledCloud.Accounts do
defmodule Meta.Accounts do
@moduledoc """
The Accounts context.
"""
import Ecto.Query, warn: false
alias RecycledCloud.Repo
alias RecycledCloud.Accounts.{User, Key, UserToken, UserNotifier}
alias Meta.Repo
alias Meta.Accounts.{User, Key, UserToken, UserNotifier}
## Database getters

View File

@ -1,4 +1,4 @@
defmodule RecycledCloud.Accounts.Key do
defmodule Meta.Accounts.Key do
use Ecto.Schema
import Ecto.Changeset
@ -6,7 +6,7 @@ defmodule RecycledCloud.Accounts.Key do
field :comment, :string
field :value, :string
field :fingerprint, :string
belongs_to :user, RecycledCloud.Accounts.User
belongs_to :user, Meta.Accounts.User
timestamps()
end

View File

@ -1,10 +1,10 @@
defmodule RecycledCloud.Accounts.User do
defmodule Meta.Accounts.User do
use Ecto.Schema
import Ecto.Changeset
require Logger
alias RecycledCloud.{LDAP,Accounts}
alias RecycledCloud.Accounts.User
alias RecycledCloud.Repo
alias Meta.{LDAP,Accounts}
alias Meta.Accounts.User
alias Meta.Repo
@min_password_lenght 6
@max_password_lenght 80
@ -17,6 +17,7 @@ defmodule RecycledCloud.Accounts.User do
field :email, :string, virtual: true
field :confirmed_at, :naive_datetime
field :partner_id, :integer
field :captcha, :integer, virtual: :true
has_many :keys, Accounts.Key
@ -73,7 +74,7 @@ defmodule RecycledCloud.Accounts.User do
defp create_ldap_user(%User{} = user) do
# TODO: read dn template from conf, gid_number
conf = Application.get_env(:recycledcloud, :ldap)
conf = Application.get_env(:meta, :ldap)
basetree = conf |> Keyword.get(:base_dn)
default_group_gid = conf |> Keyword.get(:default_group_gid, 1000)
@ -151,8 +152,13 @@ defmodule RecycledCloud.Accounts.User do
also be very expensive to hash for certain algorithms.
"""
def registration_changeset(user, attrs) do
expected_captcha_result = attrs |> Map.get("expected_captcha")
user
|> insertion_changeset(attrs)
|> cast(attrs, [:username, :password, :email, :dn, :captcha])
|> Meta.Captcha.validate(expected_captcha_result)
|> validate_username()
|> validate_email()
|> validate_password()
end
@ -160,6 +166,7 @@ defmodule RecycledCloud.Accounts.User do
user
|> cast(attrs, [:username, :password, :email, :dn])
|> validate_email()
|> validate_username()
end
defp validate_email(changeset) do
@ -178,6 +185,21 @@ defmodule RecycledCloud.Accounts.User do
#|> validate_format(:password, ~r/[!?@#$%^&*_0-9]/, message: "at least one digit or punctuation character")
end
defp validate_username(changeset) do
check_blacklist = fn changeset ->
username = get_field(changeset, :username)
if TheBigUsernameBlacklist.valid?(username) do
changeset
else
add_error(changeset, :username, "This username is blacklisted, you cannot use it.")
end
end
changeset
|> validate_required([:username])
|> check_blacklist.()
end
@doc """
A user changeset for changing the email.
@ -244,7 +266,7 @@ defmodule RecycledCloud.Accounts.User do
def set_password(%User{dn: nil} = _user, _), do: {:error, "User DN must be set"}
def set_password(_, nil), do: {:error, "Password cannot be nil"}
def set_password(%User{dn: dn} = _user, new_password) when
byte_size(new_password) > 0do
byte_size(new_password) do
query = fn ldap_conn ->
:eldap.modify_password(
ldap_conn,

View File

@ -1,5 +1,5 @@
defmodule RecycledCloud.Accounts.UserNotifier do
alias RecycledCloud.Mailer
defmodule Meta.Accounts.UserNotifier do
alias Meta.Mailer
import Bamboo.Email
defp deliver(to, body) do

View File

@ -1,4 +1,4 @@
defmodule RecycledCloud.Accounts.UserToken do
defmodule Meta.Accounts.UserToken do
use Ecto.Schema
import Ecto.Query
@ -16,7 +16,7 @@ defmodule RecycledCloud.Accounts.UserToken do
field :token, :binary
field :context, :string
field :sent_to, :string
belongs_to :user, RecycledCloud.Accounts.User
belongs_to :user, Meta.Accounts.User
timestamps(updated_at: false)
end
@ -28,7 +28,7 @@ defmodule RecycledCloud.Accounts.UserToken do
"""
def build_session_token(user) do
token = :crypto.strong_rand_bytes(@rand_size)
{token, %RecycledCloud.Accounts.UserToken{token: token, context: "session", user_id: user.id}}
{token, %Meta.Accounts.UserToken{token: token, context: "session", user_id: user.id}}
end
@doc """
@ -63,7 +63,7 @@ defmodule RecycledCloud.Accounts.UserToken do
hashed_token = :crypto.hash(@hash_algorithm, token)
{Base.url_encode64(token, padding: false),
%RecycledCloud.Accounts.UserToken{
%Meta.Accounts.UserToken{
token: hashed_token,
context: context,
sent_to: sent_to,
@ -123,17 +123,17 @@ defmodule RecycledCloud.Accounts.UserToken do
Returns the given token with the given context.
"""
def token_and_context_query(token, context) do
from RecycledCloud.Accounts.UserToken, where: [token: ^token, context: ^context]
from Meta.Accounts.UserToken, where: [token: ^token, context: ^context]
end
@doc """
Gets all tokens for the given user for the given contexts.
"""
def user_and_contexts_query(user, :all) do
from t in RecycledCloud.Accounts.UserToken, where: t.user_id == ^user.id
from t in Meta.Accounts.UserToken, where: t.user_id == ^user.id
end
def user_and_contexts_query(user, [_ | _] = contexts) do
from t in RecycledCloud.Accounts.UserToken, where: t.user_id == ^user.id and t.context in ^contexts
from t in Meta.Accounts.UserToken, where: t.user_id == ^user.id and t.context in ^contexts
end
end

View File

@ -1,4 +1,4 @@
defmodule RecycledCloud.Application do
defmodule Meta.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
@ -8,31 +8,31 @@ defmodule RecycledCloud.Application do
def start(_type, _args) do
children = [
# Start the Ecto repository
RecycledCloud.Repo,
Meta.Repo,
# Start the Telemetry supervisor
RecycledCloudWeb.Telemetry,
MetaWeb.Telemetry,
# Start the PubSub system
{Phoenix.PubSub, name: RecycledCloud.PubSub},
{Phoenix.PubSub, name: Meta.PubSub},
# Start the Endpoint (http/https)
RecycledCloudWeb.Endpoint,
MetaWeb.Endpoint,
# Starts LDAP connection pool
RecycledCloud.LDAP,
Meta.LDAP,
# Starts Odoo client
RecycledCloud.Odoo
# Start a worker by calling: RecycledCloud.Worker.start_link(arg)
# {RecycledCloud.Worker, arg}
Meta.Odoo
# Start a worker by calling: Meta.Worker.start_link(arg)
# {Meta.Worker, arg}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: RecycledCloud.Supervisor]
opts = [strategy: :one_for_one, name: Meta.Supervisor]
Supervisor.start_link(children, opts)
end
# Tell Phoenix to update the endpoint configuration
# whenever the application is updated.
def config_change(changed, _new, removed) do
RecycledCloudWeb.Endpoint.config_change(changed, removed)
MetaWeb.Endpoint.config_change(changed, removed)
:ok
end
end

View File

@ -1,6 +1,6 @@
defmodule RecycledCloud.Billing.Invoice do
alias RecycledCloud.Billing.{Partner, Invoice}
alias RecycledCloud.Odoo
defmodule Meta.Billing.Invoice do
alias Meta.Billing.{Partner, Invoice}
alias Meta.Odoo
use Ecto.Schema

View File

@ -1,8 +1,8 @@
defmodule RecycledCloud.Billing.Partner do
alias RecycledCloud.Accounts.User
alias RecycledCloud.Billing.Partner
alias RecycledCloud.Odoo
alias RecycledCloud.Repo
defmodule Meta.Billing.Partner do
alias Meta.Accounts.User
alias Meta.Billing.Partner
alias Meta.Odoo
alias Meta.Repo
import Ecto.Changeset
use Ecto.Schema

33
lib/meta/captcha.ex Normal file
View File

@ -0,0 +1,33 @@
defmodule Meta.Captcha do
# We can't use a graphical-only captcha library such as
# https://hex.pm/packages/captcha since it would break accessibility for
# blind people. Let's make it simple maths instead!
# Captcha expression tuning:
@terms 1..6
@operands ["+", "-", "*"]
def validate(changeset, expected_result) do
result = Ecto.Changeset.get_field(changeset, :captcha)
if result == expected_result do
changeset
else
Ecto.Changeset.add_error(changeset, :captcha, "does not match")
end
end
def generate do
left = @terms |> Enum.random
right = @terms |> Enum.random
operation = @operands |> Enum.random
text = "#{left} #{operation} #{right}"
value = case operation do
"+" -> left + right
"-" -> left - right
"*" -> left * right
end
{text, value}
end
end

View File

@ -1,4 +1,4 @@
defmodule RecycledCloud.LDAP do
defmodule Meta.LDAP do
require Logger
use GenServer
@ -54,7 +54,7 @@ defmodule RecycledCloud.LDAP do
###
def search(ldap_conn, field, value, search_timeout \\ 1000) do
base_dn = Application.get_env(:recycledcloud, :ldap) |> Keyword.get(:base_dn)
base_dn = Application.get_env(:meta, :ldap) |> Keyword.get(:base_dn)
opts = [
{:base, to_charlist(base_dn)},
{:scope, :eldap.wholeSubtree()},
@ -89,7 +89,7 @@ defmodule RecycledCloud.LDAP do
defp internal_execute_query(query, ldap_conn), do: query.(ldap_conn)
defp bind(ldap_conn) do
conf = Application.get_env(:recycledcloud, :ldap, [])
conf = Application.get_env(:meta, :ldap, [])
dn = conf |> Keyword.get(:bind_dn)
pw = conf |> Keyword.get(:bind_pw)
@ -98,7 +98,7 @@ defmodule RecycledCloud.LDAP do
# The method is used by the RC.LDAPTestEnvironment module.
def connect do
conf = Application.get_env(:recycledcloud, :ldap, [])
conf = Application.get_env(:meta, :ldap, [])
host = Keyword.get(conf, :server, "localhost") |> String.to_charlist
opts = [

View File

@ -1,5 +1,5 @@
defmodule RecycledCloud.Mailer do
use Bamboo.Mailer, otp_app: :recycledcloud
defmodule Meta.Mailer do
use Bamboo.Mailer, otp_app: :meta
import Bamboo.Email
@from "no-reply@recycled.cloud"

View File

@ -1,4 +1,4 @@
defmodule RecycledCloud.Odoo do
defmodule Meta.Odoo do
use GenServer
require Logger
@ -8,7 +8,7 @@ defmodule RecycledCloud.Odoo do
# Odoo 14.0 API is documented at https://www.odoo.com/documentation/14.0/webservices/odoo.html
defp get_odoo_config(key) do
Application.get_env(:recycledcloud, :odoo, []) |> Keyword.get(key)
Application.get_env(:meta, :odoo, []) |> Keyword.get(key)
end
defp post!(call, endpoint) do
@ -32,12 +32,15 @@ defmodule RecycledCloud.Odoo do
nil
]
auth_response = %XMLRPC.MethodCall{method_name: "authenticate", params: auth_params}
|> post!(@common_endpoint)
case auth_response do
{:ok, false} -> {:error, "Could not authenticate against Odoo."}
{:ok, uid} -> {:ok, uid}
{:error, err} -> {:error, err}
try do
auth_response = %XMLRPC.MethodCall{method_name: "authenticate", params: auth_params}
|> post!(@common_endpoint)
case auth_response do
{:ok, false} -> {:error, "Could not authenticate against Odoo."}
{:ok, uid} -> {:ok, uid}
{:error, err} -> {:error, err}
end
rescue e -> {:error, e}
end
end

91
lib/meta/opennebula.ex Normal file
View File

@ -0,0 +1,91 @@
defmodule Meta.OpenNebula do
@moduledoc """
The OpenNebula context and XML-RPC Interface.
See http://docs.opennebula.io/5.12/integration/system_interfaces/api.html for details.
"""
alias Meta.OpenNebula.{VM, VMPool}
require Logger
# OpenNebula daemon.
@endpoint "/RPC2"
defp get_opennebula_config(key, default \\ nil) do
Application.get_env(:meta, :opennebula, []) |> Keyword.get(key, default)
end
def get_locations() do
get_opennebula_config(:locations, [])
|> Enum.map(fn m -> Map.get(m, :name) end)
end
def get_location_config(name) do
get_opennebula_config(:locations)
|> Enum.find(fn m -> Map.get(m, :name) == name end)
end
##
# Related to XML-RPC calls
defp post(url, request) do
opts = []
headers = []
body = request |> XMLRPC.encode!
query = HTTPoison.post(url, body, headers, opts)
case query do
{:ok, response} ->
case response.body |> XMLRPC.decode! do
%{fault_code: _, fault_string: err} -> {:error, err}
%{param: [false, err | _]} -> {:error, err}
%{param: [true, result | _]} -> {:ok, result}
end
{:error, %HTTPoison.Error{id: nil, reason: reason}} ->
Logger.warn("Error querying OpenNebula: #{inspect(reason)}")
{:error, reason}
end
end
def query(location, method, params) do
user = Map.get(get_location_config(location), :user)
password = Map.get(get_location_config(location), :password)
auth_string = "#{user}:#{password}"
request = %XMLRPC.MethodCall{
method_name: method,
params: [auth_string | params]
}
address = get_location_config(location) |> Map.get(:xmlrpc_address)
post(address <> @endpoint, request)
end
##
# Public / external calls.
def get_vm(location, id), do: VM.get(id).(location)
def get_vms_for_user(location, username) do
call = VMPool.get(%{
filter_flag: :all,
range_start: :infinite,
range_end: :infinite,
state_filter: VM.state_for(:any_except_done),
kv_filter: ""
})
case call.(location) do
{:ok, %{VM: vms}} ->
Enum.filter(vms,
fn vm -> List.to_string(Map.get(vm, :UNAME)) == username end)
{:error, _err} -> %{}
end
end
def get_vms_for_user(username) do
get_locations()
|> Enum.map(fn l -> %{l => get_vms_for_user(l, username)} end)
|> Enum.reduce(%{}, &Map.merge/2)
end
end

View File

@ -0,0 +1,99 @@
defmodule Meta.OpenNebula.Schema do
@moduledoc """
Helpers used to process OpenNebula's XSD schema.
,.
/,,;';;. ,;;;.. ,,;. '
.','' `::;:' ``;;;;' `..'
` ,,/' ,,//
Here be dragons! We import the records from Erlang header files (.hrl)
generated by erlsom as macros in the Records module. The only way I found to
programatically call a macro (apply/3 only works with functions) is by
playing around with the AST to template said call...
I'm not fond of this as it makes things more complex than I would like them
to be, but likely the easiest way to user erlsom's data binder from elixir
(and it's not *that* bad). The ideal would be to generate elixir structs from
source XSD files, but it would take much more work.
Heavily inspired from Gary Poster's:
http://codesinger.blogspot.com/2015/12/elixir-erlang-records-and-erlsom-xml.html
I stole the dragon art from ASCII.co.uk.
"""
require Logger
alias Meta.OpenNebula.Schema
alias Meta.OpenNebula.Schema.Records
@opennebula_release "5.12"
##
# Data-binding: access and extract XSD models.
defp get_raw(type, object) do
priv_dir = :code.priv_dir(:meta) |> to_string
{data_dir, extension} = case type do
:xsd -> {"xsd-src", ".xsd"}
:hrl -> {"xsd-records", ".hrl"}
end
raw_path = [priv_dir, "opennebula", @opennebula_release, data_dir, object <> extension]
raw_path |> Path.join()
end
def get_xsd_for(object), do: get_raw(:xsd, object)
def get_hrl_for(object), do: get_raw(:hrl, object)
def generate_model_for(object) do
{:ok, model} = object
|> get_xsd_for()
|> :erlsom.compile_xsd_file()
model
end
##
# Data-binding: transform erlsom records to Elixir maps.
def scan(raw, object_type) do
{:ok, data, _rest} = :erlsom.scan(raw, Records.get_model_for(object_type))
data
end
defp transform_value({k, l}) when is_list(l) do
{k, Enum.map(l, fn v -> map_record(v) end)}
end
defp transform_value({k, v}), do: {k, map_record(v)}
# Here be dragons! See moduledoc.
def map_record(data) when is_tuple(data) do
schema = elem(data, 0)
if schema in Keyword.keys(Schema.Records.__info__(:macros)) do
call = quote do
require Meta.OpenNebula.Schema.Records
Meta.OpenNebula.Schema.Records."XSD"(:data)
end
replace = fn
:XSD, {model, data} -> {model, {model, data}}
:data, {model, data} -> {data, {model, data}}
node, stubs -> {node, stubs}
end
{{inserted, _raw}, []} = call
|> Macro.prewalk({schema, Macro.escape(data)}, replace)
|> Code.eval_quoted()
Enum.into(inserted, Map.new, &transform_value/1)
else
Logger.debug("Ignoring unknown OpenNebula Model #{schema}.")
data
end
end
def map_record(data = [first | _rest]) when is_integer(first), do:
List.to_string(data)
def map_record(:undefined), do: nil
def map_record(data), do: data
end

View File

@ -0,0 +1,33 @@
defmodule Meta.OpenNebula.Schema.Records do
@moduledoc """
Here we define XSD template into something we can play with (Records).
Records are not usually used in elixir except for integrating with erlang
code - which is what we're doing right now: the records are defined in .hrl
(erlang headers) by erlsom.
See Meta.OpenNebula.Schema module for details.
"""
require Record
alias Meta.OpenNebula.Schema
@models %{
"vm" => Schema.generate_model_for("vm"),
"vm_pool" => Schema.generate_model_for("vm_pool")
}
def get_model_for(object), do: Map.get(@models, object)
extract = fn name, acc -> Record.extract_all(from: Schema.get_hrl_for(name)) ++ acc end
sources = ["vm", "vm_pool"]
|> Enum.reduce([], extract)
|> Enum.sort_by(fn {name, _} -> name end)
|> Enum.dedup_by(fn {name, _} -> name end)
#IO.inspect sources |> Enum.dedup_by(fn {, _} -> name end)
for {name, record} <- sources do
Record.defrecord name, record
end
end

195
lib/meta/opennebula/vm.ex Normal file
View File

@ -0,0 +1,195 @@
defmodule Meta.OpenNebula.VM do
@moduledoc """
OpenNebula VM: http://docs.opennebula.io/5.12/integration/system_interfaces/api.html#one-vm-info
"""
alias Meta.OpenNebula, as: ONE
alias Meta.OpenNebula.Schema
@states [
{:any, -2},
{:any_except_done, -1},
{:init, 0},
{:pending, 1},
{:hold, 2},
{:active, 3},
{:stopped, 4},
{:suspended, 5},
{:done, 6},
{:failure, 7},
{:poweroff, 8},
{:undeployed, 9},
{:cloning, 10},
{:cloning_failure, 11}
]
@lcm_states [
{:LCM_INIT , 0},
{:PROLOG , 1},
{:BOOT , 2},
{:RUNNING , 3},
{:MIGRATE , 4},
{:SAVE_STOP , 5},
{:SAVE_SUSPEND , 6},
{:SAVE_MIGRATE , 7},
{:PROLOG_MIGRATE , 8},
{:PROLOG_RESUME , 9},
{:EPILOG_STOP , 10},
{:EPILOG , 11},
{:SHUTDOWN , 12},
{:CLEANUP_RESUBMIT , 15},
{:UNKNOWN , 16},
{:HOTPLUG , 17},
{:SHUTDOWN_POWEROFF , 18},
{:BOOT_UNKNOWN , 19},
{:BOOT_POWEROFF , 20},
{:BOOT_SUSPENDED , 21},
{:BOOT_STOPPED , 22},
{:CLEANUP_DELETE , 23},
{:HOTPLUG_SNAPSHOT , 24},
{:HOTPLUG_NIC , 25},
{:HOTPLUG_SAVEAS , 26},
{:HOTPLUG_SAVEAS_POWEROFF , 27},
{:HOTPLUG_SAVEAS_SUSPENDED , 28},
{:SHUTDOWN_UNDEPLOY , 29},
{:EPILOG_UNDEPLOY , 30},
{:PROLOG_UNDEPLOY , 31},
{:BOOT_UNDEPLOY , 32},
{:HOTPLUG_PROLOG_POWEROFF , 33},
{:HOTPLUG_EPILOG_POWEROFF , 34},
{:BOOT_MIGRATE , 35},
{:BOOT_FAILURE , 36},
{:BOOT_MIGRATE_FAILURE , 37},
{:PROLOG_MIGRATE_FAILURE , 38},
{:PROLOG_FAILURE , 39},
{:EPILOG_FAILURE , 40},
{:EPILOG_STOP_FAILURE , 41},
{:EPILOG_UNDEPLOY_FAILURE , 42},
{:PROLOG_MIGRATE_POWEROFF , 43},
{:PROLOG_MIGRATE_POWEROFF_FAILURE, 44},
{:PROLOG_MIGRATE_SUSPEND , 45},
{:PROLOG_MIGRATE_SUSPEND_FAILURE , 46},
{:BOOT_UNDEPLOY_FAILURE , 47},
{:BOOT_STOPPED_FAILURE , 48},
{:PROLOG_RESUME_FAILURE , 49},
{:PROLOG_UNDEPLOY_FAILURE , 50},
{:DISK_SNAPSHOT_POWEROFF , 51},
{:DISK_SNAPSHOT_REVERT_POWEROFF , 52},
{:DISK_SNAPSHOT_DELETE_POWEROFF , 53},
{:DISK_SNAPSHOT_SUSPENDED , 54},
{:DISK_SNAPSHOT_REVERT_SUSPENDED , 55},
{:DISK_SNAPSHOT_DELETE_SUSPENDED , 56},
{:DISK_SNAPSHOT , 57},
{:DISK_SNAPSHOT_DELETE , 59},
{:PROLOG_MIGRATE_UNKNOWN , 60},
{:PROLOG_MIGRATE_UNKNOWN_FAILURE , 61},
]
@actions [
"terminate-hard",
"terminate",
"undeploy-hard",
"undeploy",
"poweroff-hard",
"poweroff",
"reboot-hard",
"reboot",
"hold",
"release",
"stop",
"suspend",
"resume",
"resched",
"unresched"
]
@events [
{:NONE_ACTION , 0},
{:MIGRATE_ACTION , 1},
{:LIVE_MIGRATE_ACTION , 2},
{:SHUTDOWN_ACTION , 3},
{:SHUTDOWN_HARD_ACTION , 4},
{:UNDEPLOY_ACTION , 5},
{:UNDEPLOY_HARD_ACTION , 6},
{:HOLD_ACTION , 7},
{:RELEASE_ACTION , 8},
{:STOP_ACTION , 9},
{:SUSPEND_ACTION , 10},
{:RESUME_ACTION , 11},
{:BOOT_ACTION , 12},
{:DELETE_ACTION , 13},
{:DELETE_RECREATE_ACTION , 14},
{:REBOOT_ACTION , 15},
{:REBOOT_HARD_ACTION , 16},
{:RESCHED_ACTION , 17},
{:UNRESCHED_ACTION , 18},
{:POWEROFF_ACTION , 19},
{:POWEROFF_HARD_ACTION , 20},
{:DISK_ATTACH_ACTION , 21},
{:DISK_DETACH_ACTION , 22},
{:NIC_ATTACH_ACTION , 23},
{:NIC_DETACH_ACTION , 24},
{:DISK_SNAPSHOT_CREATE_ACTION , 25},
{:DISK_SNAPSHOT_DELETE_ACTION , 26},
{:TERMINATE_ACTION , 27},
{:TERMINATE_HARD_ACTION , 28},
{:DISK_RESIZE_ACTION , 29},
{:DEPLOY_ACTION , 30},
{:CHOWN_ACTION , 31},
{:CHMOD_ACTION , 32},
{:UPDATECONF_ACTION , 33},
{:RENAME_ACTION , 34},
{:RESIZE_ACTION , 35},
{:UPDATE_ACTION , 36},
{:SNAPSHOT_CREATE_ACTION , 37},
{:SNAPSHOT_DELETE_ACTION , 38},
{:SNAPSHOT_REVERT_ACTION , 39},
{:DISK_SAVEAS_ACTION , 40},
{:DISK_SNAPSHOT_REVERT_ACTION , 41},
{:RECOVER_ACTION , 42},
{:RETRY_ACTION , 43},
{:MONITOR_ACTION , 44},
{:DISK_SNAPSHOT_RENAME_ACTION , 45},
{:ALIAS_ATTACH_ACTION , 46},
{:ALIAS_DETACH_ACTION , 47},
]
defp find(table, state) when is_integer(state) do
case Enum.find(table, fn {_atom, value} -> value == state end) do
{atom, _value} -> atom
nil -> nil
end
end
def state_for(state) when is_atom(state), do: @states |> Keyword.get(state)
def state_for(state) when is_integer(state), do: find(@states, state)
def lcm_state_for(state) when is_integer(state), do: find(@lcm_states, state)
def event_for(event) when is_integer(event) do
case Enum.find(@events, fn {_atom, value} -> value == event end) do
{atom, _value} -> atom
nil -> nil
end
end
def get(id) do
fn location ->
case ONE.query(location, "one.vm.info", [id]) do
{:ok, raw} ->
data = raw
|> Schema.scan("vm")
|> Schema.map_record
{:ok, data}
{:error, err} -> {:error, err}
end
end
end
def execute(vm_id, action) when action in @actions do
fn location ->
case ONE.query(location, "one.vm.action", [action, vm_id]) do
{:ok, _raw} -> :ok
{:error, err} -> {:error, err}
end
end
end
end

View File

@ -0,0 +1,55 @@
defmodule Meta.OpenNebula.VMPool do
@moduledoc """
OpenNebula VM Pool: http://docs.opennebula.io/5.12/integration/system_interfaces/api.html#one-vmpool-info
"""
alias Meta.OpenNebula, as: ONE
alias Meta.OpenNebula.Schema
# Filters ressourses.
# (user) ID >= 0 matches an user's resources.
@filter_flags [
{:user_primary_group, -4},
{:user, -3},
{:all, -2},
{:user_and_groups, -1}
]
def get(%{filter_flag: filter_flag} = params) when is_atom(filter_flag) do
params
|> Map.put(:filter_flag, Keyword.get(@filter_flags, filter_flag))
|> get()
end
def get(%{range_start: :infinite} = params) do
params |> Map.put(:range_start, -1) |> get()
end
def get(%{range_end: :infinite} = params) do
params |> Map.put(:range_end, -1) |> get()
end
def get(%{state_filter: state} = params) when is_atom(state) do
params |> Map.put(:state_filter, ONE.VM.state_for(state)) |> get()
end
def get(%{
filter_flag: filter_flag,
range_start: range_start,
range_end: range_end,
state_filter: state,
kv_filter: kv_filter
}) do
fn location ->
params = [filter_flag, range_start, range_end, state, kv_filter]
case ONE.query(location, "one.vmpool.info", params) do
{:ok, raw} ->
data = raw
|> Schema.scan("vm_pool")
|> Schema.map_record
{:ok, data}
{:error, err} -> {:error, err}
end
end
end
end

View File

@ -1,5 +1,5 @@
defmodule RecycledCloud.Release do
@app :recycledcloud
defmodule Meta.Release do
@app :meta
def migrate do
load_app()

5
lib/meta/repo.ex Normal file
View File

@ -0,0 +1,5 @@
defmodule Meta.Repo do
use Ecto.Repo,
otp_app: :meta,
adapter: Ecto.Adapters.Postgres
end

View File

@ -0,0 +1,50 @@
defmodule Meta.SupportRequest do
use Ecto.Schema
import Ecto.Changeset
import Bamboo.Email
alias Meta.SupportRequest
alias Meta.Mailer
alias Meta.Captcha
embedded_schema do
field :name, :string
field :email, :string
field :message, :string
field :captcha, :integer
timestamps()
end
def changeset(key, attrs) do
expected_captcha_result = attrs |> Map.get("expected_captcha")
key
|> cast(attrs, [:name, :email, :message, :captcha])
|> validate_required([:name, :email, :message, :captcha])
|> Captcha.validate(expected_captcha_result)
end
def send(%SupportRequest{} = request) do
admin_email = Application.get_env(:meta, :admin_email)
host = Application.get_env(:meta, MetaWeb.Endpoint)
|> Keyword.get(:url, [])
|> Keyword.get(:host, "localhost")
body = """
A new request has been received on #{host}:
From: #{request.name} // #{request.email}
~~~
#{request.message}
"""
Mailer.template()
|> to(request.email)
|> bcc(admin_email)
|> put_header("Reply-To", request.email)
|> subject("Recycled Cloud Support Request")
|> text_body(body)
|> Mailer.deliver_now()
end
end

View File

@ -1,12 +1,12 @@
defmodule RecycledCloudWeb do
defmodule MetaWeb do
@moduledoc """
The entrypoint for defining your web interface, such
as controllers, views, channels and so on.
This can be used in your application as:
use RecycledCloudWeb, :controller
use RecycledCloudWeb, :view
use MetaWeb, :controller
use MetaWeb, :view
The definitions below will be executed for every view,
controller, etc, so keep them short and clean, focused
@ -19,19 +19,19 @@ defmodule RecycledCloudWeb do
def controller do
quote do
use Phoenix.Controller, namespace: RecycledCloudWeb
use Phoenix.Controller, namespace: MetaWeb
import Plug.Conn
import RecycledCloudWeb.Gettext
alias RecycledCloudWeb.Router.Helpers, as: Routes
import MetaWeb.Gettext
alias MetaWeb.Router.Helpers, as: Routes
end
end
def view do
quote do
use Phoenix.View,
root: "lib/recycledcloud_web/templates",
namespace: RecycledCloudWeb
root: "lib/meta_web/templates",
namespace: MetaWeb
# Import convenience functions from controllers
import Phoenix.Controller,
@ -54,7 +54,7 @@ defmodule RecycledCloudWeb do
def channel do
quote do
use Phoenix.Channel
import RecycledCloudWeb.Gettext
import MetaWeb.Gettext
end
end
@ -66,9 +66,9 @@ defmodule RecycledCloudWeb do
# Import basic rendering functionality (render, render_layout, etc)
import Phoenix.View
import RecycledCloudWeb.ErrorHelpers
import RecycledCloudWeb.Gettext
alias RecycledCloudWeb.Router.Helpers, as: Routes
import MetaWeb.ErrorHelpers
import MetaWeb.Gettext
alias MetaWeb.Router.Helpers, as: Routes
end
end

View File

@ -1,8 +1,8 @@
defmodule RecycledCloudWeb.UserSocket do
defmodule MetaWeb.UserSocket do
use Phoenix.Socket
## Channels
# channel "room:*", RecycledCloudWeb.RoomChannel
# channel "room:*", MetaWeb.RoomChannel
# Socket params are passed from the client and can
# be used to verify and authenticate a user. After
@ -27,7 +27,7 @@ defmodule RecycledCloudWeb.UserSocket do
# Would allow you to broadcast a "disconnect" event and terminate
# all active sockets and channels for a given user:
#
# RecycledCloudWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{})
# MetaWeb.Endpoint.broadcast("user_socket:#{user.id}", "disconnect", %{})
#
# Returning `nil` makes this socket anonymous.
@impl true

View File

@ -1,8 +1,8 @@
defmodule RecycledCloudWeb.BillingController do
use RecycledCloudWeb, :controller
defmodule MetaWeb.BillingController do
use MetaWeb, :controller
alias RecycledCloud.Billing.{Partner, Invoice}
alias RecycledCloud.Repo
alias Meta.Billing.{Partner, Invoice}
alias Meta.Repo
def current_partner(conn) do
user = conn.assigns.current_user

View File

@ -0,0 +1,7 @@
defmodule MetaWeb.PageController do
use MetaWeb, :controller
def index(conn, _params) do
render(conn, "index.html")
end
end

View File

@ -0,0 +1,41 @@
defmodule MetaWeb.SupportController do
use MetaWeb, :controller
alias Meta.SupportRequest
alias Meta.Captcha
def new(conn, _params) do
{captcha_text, captcha_result} = Captcha.generate()
conn
|> assign(:request_changeset, SupportRequest.changeset(%SupportRequest{}, %{}))
|> assign(:captcha, captcha_text)
|> put_session(:captcha, captcha_result)
|> render("new.html")
end
def create(conn, %{"support_request" => raw} = params) do
attrs = raw |> Map.put("expected_captcha", get_session(conn, :captcha))
action = SupportRequest.changeset(%SupportRequest{}, attrs)
|> Ecto.Changeset.apply_action(:update)
case action do
{:ok, request} ->
# FIXME: check for error?
SupportRequest.send(request)
conn
|> put_flash(:info, "Request has been sent. We'll come back to you.")
|> redirect(to: Routes.page_path(conn, :index))
{:error, changeset} ->
{captcha_text, captcha_result} = Captcha.generate()
conn
|> assign(:request_changeset, changeset)
|> assign(:captcha, captcha_text)
|> put_session(:captcha, captcha_result)
|> render("new.html")
end
end
end

View File

@ -1,9 +1,9 @@
defmodule RecycledCloudWeb.UserAuth do
defmodule MetaWeb.UserAuth do
import Plug.Conn
import Phoenix.Controller
alias RecycledCloud.Accounts
alias RecycledCloudWeb.Router.Helpers, as: Routes
alias Meta.Accounts
alias MetaWeb.Router.Helpers, as: Routes
# Make the remember me cookie valid for 60 days.
# If you want bump or reduce this value, also change
@ -75,7 +75,7 @@ defmodule RecycledCloudWeb.UserAuth do
user_token && Accounts.delete_session_token(user_token)
if live_socket_id = get_session(conn, :live_socket_id) do
RecycledCloudWeb.Endpoint.broadcast(live_socket_id, "disconnect", %{})
MetaWeb.Endpoint.broadcast(live_socket_id, "disconnect", %{})
end
conn

View File

@ -1,7 +1,7 @@
defmodule RecycledCloudWeb.UserConfirmationController do
use RecycledCloudWeb, :controller
defmodule MetaWeb.UserConfirmationController do
use MetaWeb, :controller
alias RecycledCloud.Accounts
alias Meta.Accounts
def new(conn, _params) do
render(conn, "new.html")

View File

@ -1,7 +1,7 @@
defmodule RecycledCloudWeb.UserKeysController do
use RecycledCloudWeb, :controller
defmodule MetaWeb.UserKeysController do
use MetaWeb, :controller
alias RecycledCloud.Accounts
alias Meta.Accounts
def index(conn, %{"username" => username}) do
case Accounts.get_user_by_username(username) do

View File

@ -1,16 +1,18 @@
defmodule RecycledCloudWeb.UserRegistrationController do
use RecycledCloudWeb, :controller
defmodule MetaWeb.UserRegistrationController do
use MetaWeb, :controller
alias RecycledCloud.Accounts
alias RecycledCloud.Accounts.User
alias RecycledCloudWeb.UserAuth
alias Meta.Captcha
alias Meta.Accounts
alias Meta.Accounts.User
alias MetaWeb.UserAuth
defp is_registration_enabled?() do
Application.get_env(:recycledcloud, :enable_registration)
Application.get_env(:meta, :enable_registration)
end
def new(conn, _params) do
changeset = Accounts.change_user_registration(%User{})
{captcha_text, captcha_result} = Captcha.generate()
with_notice = unless is_registration_enabled?() do
conn
@ -20,17 +22,20 @@ defmodule RecycledCloudWeb.UserRegistrationController do
end
with_notice
|> assign(:captcha, captcha_text)
|> put_session(:captcha, captcha_result)
|> render("new.html", changeset: changeset)
end
def create(conn, %{"user" => user_params}) do
changeset = Accounts.change_user_registration(%User{})
unless is_registration_enabled?() do
conn
|> redirect(to: Routes.user_registration_path(conn, :new))
else
case Accounts.register_user(user_params) do
attrs = user_params
|> Map.put("expected_captcha", get_session(conn, :captcha))
case Accounts.register_user(attrs) do
{:ok, user} ->
{:ok, _} =
Accounts.deliver_user_confirmation_instructions(
@ -43,7 +48,12 @@ defmodule RecycledCloudWeb.UserRegistrationController do
|> UserAuth.log_in_user(user)
{:error, %Ecto.Changeset{} = changeset} ->
render(conn, "new.html", changeset: changeset)
{captcha_text, captcha_result} = Captcha.generate()
conn
|> assign(:captcha, captcha_text)
|> put_session(:captcha, captcha_result)
|> render("new.html", changeset: changeset)
end
end
end

View File

@ -1,7 +1,7 @@
defmodule RecycledCloudWeb.UserResetPasswordController do
use RecycledCloudWeb, :controller
defmodule MetaWeb.UserResetPasswordController do
use MetaWeb, :controller
alias RecycledCloud.Accounts
alias Meta.Accounts
plug :get_user_by_reset_password_token when action in [:edit, :update]

View File

@ -1,8 +1,8 @@
defmodule RecycledCloudWeb.UserSessionController do
use RecycledCloudWeb, :controller
defmodule MetaWeb.UserSessionController do
use MetaWeb, :controller
alias RecycledCloud.Accounts
alias RecycledCloudWeb.UserAuth
alias Meta.Accounts
alias MetaWeb.UserAuth
def new(conn, _params) do
render(conn, "new.html", error_message: nil)

View File

@ -1,8 +1,8 @@
defmodule RecycledCloudWeb.UserSettingsController do
use RecycledCloudWeb, :controller
defmodule MetaWeb.UserSettingsController do
use MetaWeb, :controller
alias RecycledCloud.Accounts
alias RecycledCloudWeb.UserAuth
alias Meta.Accounts
alias MetaWeb.UserAuth
plug :assign_email_and_password_changesets

View File

@ -0,0 +1,59 @@
defmodule MetaWeb.VirtualMachineController do
use MetaWeb, :controller
alias Meta.OpenNebula, as: ONE
def index(conn, _params) do
username = conn.assigns.current_user.username
vms = ONE.get_vms_for_user(username)
render(conn, "index.html", vms: vms)
end
# def start(conn, %{"id" => id}) do
# case VM.execute(String.to_integer(id), "resume") do
# :ok ->
# conn
# |> put_flash(:info, "Start request sent to VMM.")
# |> redirect(to: Routes.virtual_machine_hosting_path(conn, :index))
# {:error, err} ->
# conn
# |> put_flash(:error, "Something went wrong: #{inspect(err)}")
# |> redirect(to: Routes.virtual_machine_hosting_path(conn, :index))
# end
# end
#
# def stop(conn, %{"id" => id}) do
# case VM.execute(String.to_integer(id), "poweroff") do
# :ok ->
# conn
# |> put_flash(:stop, "Stop request sent to VMM.")
# |> redirect(to: Routes.virtual_machine_hosting_path(conn, :index))
# {:error, err} ->
# conn
# |> put_flash(:error, "Something went wrong: #{inspect(err)}")
# |> redirect(to: Routes.virtual_machine_hosting_path(conn, :index))
# end
# end
def show(conn, %{"location" => location, "id" => id}) do
case ONE.get_vm(location, String.to_integer(id)) do
{:error, err} ->
conn
|> put_flash(:error, "Could not fetch VM details: #{inspect(err)}")
|> redirect(to: Routes.virtual_machine_hosting_path(conn, :index))
{:ok, vm} ->
owner = vm |> Map.get(:UNAME) |> List.to_string
if owner == conn.assigns.current_user.username do
conn
|> assign(:location, location)
|> assign(:vm, vm)
|> render("show.html")
else
conn
|> put_flash(:error, "You are not the owner of this machine.")
|> redirect(to: Routes.virtual_machine_hosting_path(conn, :index))
end
end
end
end

View File

@ -1,16 +1,16 @@
defmodule RecycledCloudWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :recycledcloud
defmodule MetaWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :meta
# The session will be stored in the cookie and signed,
# this means its contents can be read but not tampered with.
# Set :encryption_salt if you would also like to encrypt it.
@session_options [
store: :cookie,
key: "_recycledcloud_key",
key: "_meta_key",
signing_salt: "6k95bz+m"
]
socket "/socket", RecycledCloudWeb.UserSocket,
socket "/socket", MetaWeb.UserSocket,
websocket: true,
longpoll: false
@ -20,7 +20,7 @@ defmodule RecycledCloudWeb.Endpoint do
# when deploying your static files in production.
plug Plug.Static,
at: "/",
from: :recycledcloud,
from: :meta,
gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)
@ -30,7 +30,7 @@ defmodule RecycledCloudWeb.Endpoint do
socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
plug Phoenix.LiveReloader
plug Phoenix.CodeReloader
plug Phoenix.Ecto.CheckRepoStatus, otp_app: :recycledcloud
plug Phoenix.Ecto.CheckRepoStatus, otp_app: :meta
end
plug Plug.RequestId
@ -44,5 +44,5 @@ defmodule RecycledCloudWeb.Endpoint do
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
plug RecycledCloudWeb.Router
plug MetaWeb.Router
end

View File

@ -1,11 +1,11 @@
defmodule RecycledCloudWeb.Gettext do
defmodule MetaWeb.Gettext do
@moduledoc """
A module providing Internationalization with a gettext-based API.
By using [Gettext](https://hexdocs.pm/gettext),
your module gains a set of macros for translations, for example:
import RecycledCloudWeb.Gettext
import MetaWeb.Gettext
# Simple translation
gettext("Here is the string to translate")
@ -20,5 +20,5 @@ defmodule RecycledCloudWeb.Gettext do
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
"""
use Gettext, otp_app: :recycledcloud
use Gettext, otp_app: :meta
end

View File

@ -1,7 +1,7 @@
defmodule RecycledCloudWeb.Router do
use RecycledCloudWeb, :router
defmodule MetaWeb.Router do
use MetaWeb, :router
import RecycledCloudWeb.UserAuth
import MetaWeb.UserAuth
pipeline :browser do
plug :accepts, ["html"]
@ -12,6 +12,14 @@ defmodule RecycledCloudWeb.Router do
plug :fetch_current_user
end
pipeline :browser_with_forgery do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :put_secure_browser_headers
plug :fetch_current_user
end
pipeline :api do
plug :accepts, ["json"]
end
@ -20,13 +28,22 @@ defmodule RecycledCloudWeb.Router do
plug :accepts, ["text"]
end
scope "/", RecycledCloudWeb do
scope "/", MetaWeb do
pipe_through :browser
get "/", PageController, :index
get "/support/new", SupportController, :new
end
scope "/", RecycledCloudWeb do
scope "/", MetaWeb do
pipe_through :browser_with_forgery
# The static recycled.cloud website POST this endpoint, which basically is
# Cross-Site Request Forgery (hence browser_with_forgery pipeline).
post "/support/new", SupportController, :create
end
scope "/", MetaWeb do
pipe_through :plain
get "/keys/:username", UserKeysController, :index
@ -34,7 +51,7 @@ defmodule RecycledCloudWeb.Router do
## Authentication routes
scope "/", RecycledCloudWeb do
scope "/", MetaWeb do
pipe_through [:browser, :redirect_if_user_is_authenticated]
get "/users/register", UserRegistrationController, :new
@ -47,7 +64,7 @@ defmodule RecycledCloudWeb.Router do
put "/users/reset_password/:token", UserResetPasswordController, :update
end
scope "/", RecycledCloudWeb do
scope "/", MetaWeb do
pipe_through [:browser, :require_authenticated_user]
get "/users/settings", UserSettingsController, :edit
@ -57,9 +74,12 @@ defmodule RecycledCloudWeb.Router do
get "/users/settings/keys/:key_id/delete", UserKeysController, :delete
get "/billing", BillingController, :index
post "/billing/partner/update", BillingController, :update
get "/hosting/vm", VirtualMachineController, :index
get "/hosting/vm/:location/:id", VirtualMachineController, :show
end
scope "/", RecycledCloudWeb do
scope "/", MetaWeb do
pipe_through [:browser]
get "/users/log_out", UserSessionController, :delete
@ -71,7 +91,7 @@ defmodule RecycledCloudWeb.Router do
# In-memory mailer for development purposes only.
# See https://hexdocs.pm/bamboo/Bamboo.SentEmailViewerPlug.html for details.
if RecycledCloud.env() == :dev do
if Meta.env() == :dev do
forward "/outbox", Bamboo.SentEmailViewerPlug
end
end

View File

@ -1,4 +1,4 @@
defmodule RecycledCloudWeb.Telemetry do
defmodule MetaWeb.Telemetry do
use Supervisor
import Telemetry.Metrics
@ -31,11 +31,11 @@ defmodule RecycledCloudWeb.Telemetry do
),
# Database Metrics
summary("recycledcloud.repo.query.total_time", unit: {:native, :millisecond}),
summary("recycledcloud.repo.query.decode_time", unit: {:native, :millisecond}),
summary("recycledcloud.repo.query.query_time", unit: {:native, :millisecond}),
summary("recycledcloud.repo.query.queue_time", unit: {:native, :millisecond}),
summary("recycledcloud.repo.query.idle_time", unit: {:native, :millisecond}),
summary("meta.repo.query.total_time", unit: {:native, :millisecond}),
summary("meta.repo.query.decode_time", unit: {:native, :millisecond}),
summary("meta.repo.query.query_time", unit: {:native, :millisecond}),
summary("meta.repo.query.queue_time", unit: {:native, :millisecond}),
summary("meta.repo.query.idle_time", unit: {:native, :millisecond}),
# VM Metrics
summary("vm.memory.total", unit: {:byte, :kilobyte}),
@ -49,7 +49,7 @@ defmodule RecycledCloudWeb.Telemetry do
[
# A module, function and arguments to be invoked periodically.
# This function must call :telemetry.execute/3 and a metric must be added above.
# {RecycledCloudWeb, :count_users, []}
# {MetaWeb, :count_users, []}
]
end
end

View File

@ -6,13 +6,25 @@
<li><%= link "Settings", to: Routes.user_settings_path(@conn, :edit) %></li>
<li><%= link "Billing", to: Routes.billing_path(@conn, :index) %></li>
<li><%= link "Log out", to: Routes.user_session_path(@conn, :delete), method: :delete %></li>
<hr />
<!--
<li><%= link "Web Hosting", to: Routes.page_path(@conn, :index) %></li>
<li><%= link "Name Service", to: Routes.page_path(@conn, :index) %></li>
<li><%= link "Storage Services", to: Routes.page_path(@conn, :index) %></li>
-->
<li><%= link "Virtual Machines", to: Routes.virtual_machine_path(@conn, :index) %></li>
<% else %>
<li><%= link "Log in", to: Routes.user_session_path(@conn, :new) %></li>
<li><%= link "Register", to: Routes.user_registration_path(@conn, :new) %></li>
<% end %>
<hr />
<li>
<a href="https://status.recycled.cloud">
Infrastructure status
</a>
</li>
<a href="https://recycled.cloud">
Back to recycled.cloud &crarr;
</a>
</li>
</ul>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>RecycledCloud · Management</title>
<title>Meta · Management</title>
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
</head>
<body>
@ -15,7 +15,7 @@
<img id="nav-logo" src="<%= Routes.static_path(@conn, "/images/cloud.svg") %>"></img>
<p class="nav-notice">
<small>
management v<%= RecycledCloud.version() %> | <%= RecycledCloud.env() %> | <a href="https://code.recycled.cloud/e-Durable/management">sources</a>
meta v<%= Meta.version() %> | <%= Meta.env() %> | <a href="https://code.recycled.cloud/e-Durable/management">sources</a>
</small>
</p>
</div>

View File

@ -0,0 +1,42 @@
<h1>New support request</h1>
<%= form_for @request_changeset, Routes.support_path(@conn, :new), fn f -> %>
<%= if @request_changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<%= text_input f, :name, placeholder: "Name" %>
<%= error_tag f, :name %>
<br />
<%= email_input f, :email, placeholder: "Email" %>
<%= error_tag f, :email %>
<br />
<%= textarea f, :message, placeholder: "Your message" %>
<%= error_tag f, :message %>
<br />
<p>
Can you answer the following expression to confirm you are
not a basic robot?
<br />
<b><%= @captcha %> = </b>
<%= text_input f, :captcha, placeholder: "Captcha" %>
<%= error_tag f, :captcha %>
</p>
<div>
<%= submit "Send" %>
</div>
<% end %>

View File

@ -22,6 +22,18 @@
<br />
<p>
Can you answer the following expression to confirm you are not a basic robot?
<br />
<b><%= @captcha %> = </b>
<%= text_input f, :captcha, placeholder: "Captcha" %>
<%= error_tag f, :captcha %>
</p>
<div>
<%= submit "Register" %>
</div>

View File

@ -0,0 +1,40 @@
<h1>Virtual Machines</h1>
<p>This page list all the Virtual Machines linked to your account. Note that
SSH keys are not (yet) synced with OpenNebula: you'll have to add your key in
<i><%= @current_user.username %> (top-right) > Settings > Add SSH Key</i> in
OpenNebula for every location you want to use.</p>
<%= for location <- Map.keys(@vms) do %>
<h2>Location: <%= location %></h2>
<p>
You can access the OpenNebula dashboard with your LDAP credentials at:
<a href="<%= Map.get(ONE.get_location_config(location), :public_address) %>">
<%= Map.get(ONE.get_location_config(location), :public_address) %>
</a>
</p>
<table>
<thead>
<tr>
<th style="width: 15%;">ID</th>
<th style="width: 40%;">Name</th>
<th style="width: 30%;">State</th>
<th style="width: 15%">Actions</th>
</tr>
</thead>
<tbody>
<%= for vm <- Map.get(@vms, location) do %>
<tr>
<td><%= location %>#<%= Map.get(vm, :ID) %></td>
<td><%= Map.get(vm, :NAME) %></td>
<td><%= render_state(vm) %></td>
<td>
<%= link "Show history »", to: Routes.virtual_machine_path(@conn, :show, location, Map.get(vm, :ID)) %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>

View File

@ -0,0 +1,30 @@
<h1>VM <%= @location %>#<%= Map.get(@vm, :ID) %> - <%= Map.get(@vm, :NAME) %></h1>
<p>
This VM is located in the <%= @location %> location, its state is <%=
render_state(@vm) %>. The OpenNebula dashboard can be accessed at
<a href="<%= Map.get(ONE.get_location_config(@location), :public_address) %>">
<%= Map.get(ONE.get_location_config(@location), :public_address) %>
</a>.
</p>
<h2>History</h2>
<table>
<thead>
<tr>
<th>Time</th>
<th>Action</th>
<th>Host</th>
</tr>
</thead>
<tbody>
<%= for entry <- @vm |> Map.get(:HISTORY_RECORDS) |> Map.get(:HISTORY) do %>
<tr>
<td><%= DateTime.from_unix!(Map.get(entry, :STIME)) %></td>
<td><%= VM.event_for(Map.get(entry, :ACTION)) %></td>
<td><%= Map.get(entry, :HOSTNAME) %></td>
</tr>
<% end %>
</tbody>
</table>

View File

@ -0,0 +1,3 @@
defmodule MetaWeb.BillingView do
use MetaWeb, :view
end

View File

@ -1,4 +1,4 @@
defmodule RecycledCloudWeb.ErrorHelpers do
defmodule MetaWeb.ErrorHelpers do
@moduledoc """
Conveniences for translating and building error messages.
"""
@ -39,9 +39,9 @@ defmodule RecycledCloudWeb.ErrorHelpers do
# should be written to the errors.po file. The :count option is
# set by Ecto and indicates we should also apply plural rules.
if count = opts[:count] do
Gettext.dngettext(RecycledCloudWeb.Gettext, "errors", msg, msg, count, opts)
Gettext.dngettext(MetaWeb.Gettext, "errors", msg, msg, count, opts)
else
Gettext.dgettext(RecycledCloudWeb.Gettext, "errors", msg, opts)
Gettext.dgettext(MetaWeb.Gettext, "errors", msg, opts)
end
end
end

View File

@ -1,5 +1,5 @@
defmodule RecycledCloudWeb.ErrorView do
use RecycledCloudWeb, :view
defmodule MetaWeb.ErrorView do
use MetaWeb, :view
# If you want to customize a particular status code
# for a certain format, you may uncomment below.

View File

@ -0,0 +1,3 @@
defmodule MetaWeb.LayoutView do
use MetaWeb, :view
end

View File

@ -0,0 +1,3 @@
defmodule MetaWeb.PageView do
use MetaWeb, :view
end

View File

@ -0,0 +1,3 @@
defmodule MetaWeb.SupportView do
use MetaWeb, :view
end

View File

@ -0,0 +1,3 @@
defmodule MetaWeb.UserConfirmationView do
use MetaWeb, :view
end

View File

@ -0,0 +1,3 @@
defmodule MetaWeb.UserRegistrationView do
use MetaWeb, :view
end

View File

@ -0,0 +1,3 @@
defmodule MetaWeb.UserResetPasswordView do
use MetaWeb, :view
end

View File

@ -0,0 +1,3 @@
defmodule MetaWeb.UserSessionView do
use MetaWeb, :view
end

View File

@ -0,0 +1,3 @@
defmodule MetaWeb.UserSettingsView do
use MetaWeb, :view
end

View File

@ -0,0 +1,16 @@
defmodule MetaWeb.VirtualMachineView do
use MetaWeb, :view
alias Meta.OpenNebula, as: ONE
alias Meta.OpenNebula.VM
def render_state(vm) do
state = Map.get(vm, :STATE) |> VM.state_for
if state == :active do
lcm_state = Map.get(vm, :LCM_STATE) |> VM.lcm_state_for
raw("#{state} (<b>#{lcm_state}</b>)")
else
raw("#{state}")
end
end
end

View File

@ -0,0 +1,43 @@
defmodule Mix.Tasks.GenerateOpenNebulaRecords do
use Mix.Task
@moduledoc """
Generate erlang records from OpenNebula's XSD templates. Inspired from
http://codesinger.blogspot.com/2015/12/elixir-erlang-records-and-erlsom-xml.html
"""
@opennebula_release "5.12"
@shortdoc "Generate erlang records from OpenNebula's XSD templates"
def run(_) do
priv_dir = to_string(:code.priv_dir(:meta))
xsd_dir = Path.join([priv_dir, "opennebula", @opennebula_release, "xsd-src"])
hrl_dir = Path.join([priv_dir, "opennebula", @opennebula_release, "xsd-records"])
files = xsd_dir
|> File.ls!()
|> Enum.filter(fn filename -> String.ends_with?(filename, ".xsd") end)
|> Enum.sort()
# Delete existing hrl headers.
if File.exists?(hrl_dir) do
File.rm_rf!(hrl_dir)
end
File.mkdir_p(hrl_dir)
for xsd_filename <- files do
hrl_filename = String.replace_trailing(xsd_filename, ".xsd", ".hrl")
xsd_file = Path.join([xsd_dir, xsd_filename]) |> String.to_charlist
hrl_file = Path.join([hrl_dir, hrl_filename]) |> String.to_charlist
IO.write "> Processing #{xsd_filename}... "
try do
:erlsom.write_xsd_hrl_file(xsd_file, hrl_file, [])
IO.puts "OK"
catch
e -> IO.puts "Error: #{inspect(e)}"
end
end
end
end

0
lib/opennebula.ex Normal file
View File

View File

@ -1,5 +0,0 @@
defmodule RecycledCloud.Repo do
use Ecto.Repo,
otp_app: :recycledcloud,
adapter: Ecto.Adapters.Postgres
end

View File

@ -1,7 +0,0 @@
defmodule RecycledCloudWeb.PageController do
use RecycledCloudWeb, :controller
def index(conn, _params) do
render(conn, "index.html")
end
end

View File

@ -1,3 +0,0 @@
defmodule RecycledCloudWeb.BillingView do
use RecycledCloudWeb, :view
end

View File

@ -1,3 +0,0 @@
defmodule RecycledCloudWeb.LayoutView do
use RecycledCloudWeb, :view
end

View File

@ -1,3 +0,0 @@
defmodule RecycledCloudWeb.PageView do
use RecycledCloudWeb, :view
end

View File

@ -1,3 +0,0 @@
defmodule RecycledCloudWeb.UserConfirmationView do
use RecycledCloudWeb, :view
end

View File

@ -1,3 +0,0 @@
defmodule RecycledCloudWeb.UserRegistrationView do
use RecycledCloudWeb, :view
end

View File

@ -1,3 +0,0 @@
defmodule RecycledCloudWeb.UserResetPasswordView do
use RecycledCloudWeb, :view
end

View File

@ -1,3 +0,0 @@
defmodule RecycledCloudWeb.UserSessionView do
use RecycledCloudWeb, :view
end

View File

@ -1,3 +0,0 @@
defmodule RecycledCloudWeb.UserSettingsView do
use RecycledCloudWeb, :view
end

21
mix.exs
View File

@ -1,10 +1,10 @@
defmodule RecycledCloud.MixProject do
defmodule Meta.MixProject do
use Mix.Project
def project do
[
app: :recycledcloud,
version: "0.2.0",
app: :meta,
version: "0.4.0",
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
@ -12,7 +12,7 @@ defmodule RecycledCloud.MixProject do
aliases: aliases(),
deps: deps(),
releases: [
recycledcloud: [
meta: [
include_executables_for: [:unix],
applications: [runtime_tools: :permanent],
include_erts: true,
@ -27,7 +27,7 @@ defmodule RecycledCloud.MixProject do
# Type `mix help compile.app` for more information.
def application do
[
mod: {RecycledCloud.Application, []},
mod: {Meta.Application, []},
extra_applications: [:logger, :runtime_tools, :eldap]
]
end
@ -54,13 +54,14 @@ defmodule RecycledCloud.MixProject do
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
{:phx_gen_auth, "~> 0.6", only: [:dev], runtime: false},
{:bamboo, "~> 1.6"},
# FIXME: See https://github.com/fewlinesco/bamboo_smtp/issues/143
{:bamboo_smtp, git: "https://github.com/Fnux/bamboo_smtp.git"},
# FIXME: See https://github.com/gen-smtp/gen_smtp/issues/234
{:bamboo, "~> 2.2"},
{:bamboo_smtp, "~> 4.1"},
{:ranch, "~> 1.7.1", override: true},
{:xmlrpc, "~> 1.4"},
{:httpoison, "~> 1.8"}
{:httpoison, "~> 1.8"},
{:the_big_username_blacklist, "~> 0.1"},
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:erlsom, "~> 1.5"}
]
end

View File

@ -1,46 +1,49 @@
%{
"bamboo": {:hex, :bamboo, "1.6.0", "adfb583bef028923aae6f22deaea6667290561da1246058556ecaeb0fec5a175", [:mix], [{:hackney, ">= 1.13.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "454e67feacbc9b6e00553ce1d2fba003c861e0035600d59b09d6159985b17f9b"},
"bamboo_smtp": {:git, "https://github.com/Fnux/bamboo_smtp.git", "bdc911bb82963e548f7189ad10670107b24bb28b", []},
"bcrypt_elixir": {:hex, :bcrypt_elixir, "2.3.0", "6cb662d5c1b0a8858801cf20997bd006e7016aa8c52959c9ef80e0f34fb60b7a", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "2c81d61d4f6ed0e5cf7bf27a9109b791ff216a1034b3d541327484f46dd43769"},
"certifi": {:hex, :certifi, "2.5.3", "70bdd7e7188c804f3a30ee0e7c99655bc35d8ac41c23e12325f36ab449b70651", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "ed516acb3929b101208a9d700062d520f3953da3b6b918d866106ffa980e1c10"},
"comeonin": {:hex, :comeonin, "5.3.2", "5c2f893d05c56ae3f5e24c1b983c2d5dfb88c6d979c9287a76a7feb1e1d8d646", [:mix], [], "hexpm", "d0993402844c49539aeadb3fe46a3c9bd190f1ecf86b6f9ebd71957534c95f04"},
"bamboo": {:hex, :bamboo, "2.2.0", "f10a406d2b7f5123eb1f02edfa043c259db04b47ab956041f279eaac776ef5ce", [:mix], [{:hackney, ">= 1.15.2", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.4", [hex: :mime, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "8c3b14ba7d2f40cb4be04128ed1e2aff06d91d9413d38bafb4afccffa3ade4fc"},
"bamboo_smtp": {:hex, :bamboo_smtp, "4.1.0", "ba547be4146ae592f63af05c6c7b7b5195b2b6ca57eeea9d80070b38eacd528b", [:mix], [{:bamboo, "~> 2.2.0", [hex: :bamboo, repo: "hexpm", optional: false]}, {:gen_smtp, "~> 1.1.1", [hex: :gen_smtp, repo: "hexpm", optional: false]}], "hexpm", "cb1a2856ab0507d10df609428314aa5e18231e8b1801a5bc6e42f319eeb50ad9"},
"bcrypt_elixir": {:hex, :bcrypt_elixir, "2.3.1", "5114d780459a04f2b4aeef52307de23de961b69e13a5cd98a911e39fda13f420", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "42182d5f46764def15bf9af83739e3bf4ad22661b1c34fc3e88558efced07279"},
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
"comeonin": {:hex, :comeonin, "5.3.3", "2c564dac95a35650e9b6acfe6d2952083d8a08e4a89b93a481acb552b325892e", [:mix], [], "hexpm", "3e38c9c2cb080828116597ca8807bb482618a315bfafd98c90bc22a821cc84df"},
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
"cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"},
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"},
"cowlib": {:hex, :cowlib, "2.9.1", "61a6c7c50cf07fdd24b2f45b89500bb93b6686579b069a89f88cb211e1125c78", [:rebar3], [], "hexpm", "e4175dc240a70d996156160891e1c62238ede1729e45740bdd38064dad476170"},
"db_connection": {:hex, :db_connection, "2.3.1", "4c9f3ed1ef37471cbdd2762d6655be11e38193904d9c5c1c9389f1b891a3088e", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm", "abaab61780dde30301d840417890bd9f74131041afd02174cf4e10635b3a63f5"},
"cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
"credo": {:hex, :credo, "1.6.4", "ddd474afb6e8c240313f3a7b0d025cc3213f0d171879429bf8535d7021d9ad78", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "c28f910b61e1ff829bffa056ef7293a8db50e87f2c57a9b5c3f57eee124536b7"},
"db_connection": {:hex, :db_connection, "2.4.2", "f92e79aff2375299a16bcb069a14ee8615c3414863a6fef93156aee8e86c2ff3", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4fe53ca91b99f55ea249693a0229356a08f4d1a7931d8ffa79289b145fe83668"},
"decimal": {:hex, :decimal, "1.9.0", "83e8daf59631d632b171faabafb4a9f4242c514b0a06ba3df493951c08f64d07", [:mix], [], "hexpm", "b1f2343568eed6928f3e751cf2dffde95bfaa19dd95d09e8a9ea92ccfd6f7d85"},
"ecto": {:hex, :ecto, "3.5.5", "48219a991bb86daba6e38a1e64f8cea540cded58950ff38fbc8163e062281a07", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "98dd0e5e1de7f45beca6130d13116eae675db59adfa055fb79612406acf6f6f1"},
"ecto_sql": {:hex, :ecto_sql, "3.5.3", "1964df0305538364b97cc4661a2bd2b6c89d803e66e5655e4e55ff1571943efd", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.5.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2f53592432ce17d3978feb8f43e8dc0705e288b0890caf06d449785f018061c"},
"elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"},
"ecto": {:hex, :ecto, "3.8.3", "5e681d35bc2cbb46dcca1e2675837c7d666316e5ada14eca6c9c609b6232817c", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "af92dd7815967bcaea0daaaccf31c3b23165432b1c7a475d84144efbc703d105"},
"ecto_sql": {:hex, :ecto_sql, "3.8.2", "d7d44bc8d45ba9c85485952710c80408632a7336eb811b045e791718d11ddb5b", [:mix], [{:db_connection, "~> 2.5 or ~> 2.4.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.8.1", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0 or ~> 0.16.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7b9b03d64360d6cc05dc263500a43c11740b5fd4552244c27efad358e98c75b3"},
"elixir_make": {:hex, :elixir_make, "0.6.3", "bc07d53221216838d79e03a8019d0839786703129599e9619f4ab74c8c096eac", [:mix], [], "hexpm", "f5cbd651c5678bcaabdbb7857658ee106b12509cd976c2c2fca99688e1daf716"},
"erlsom": {:hex, :erlsom, "1.5.0", "c5a5cdd0ee0e8dca62bcc4b13ff08da24fdefc16ccd8b25282a2fda2ba1be24a", [:rebar3], [], "hexpm", "55a9dbf9cfa77fcfc108bd8e2c4f9f784dea228a8f4b06ea10b684944946955a"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"gen_smtp": {:hex, :gen_smtp, "1.0.1", "cc3de2898d9136ff02dc78fc8193d4fc997824fc793f5bbbada79ccde94581be", [:rebar3], [{:hut, "1.3.0", [hex: :hut, repo: "hexpm", optional: false]}, {:ranch, "1.6.2", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "341a98dc4dafad9cc1e4426e4988e45b31d3f235fa637408f7579a9b598c0ab6"},
"gettext": {:hex, :gettext, "0.18.2", "7df3ea191bb56c0309c00a783334b288d08a879f53a7014341284635850a6e55", [:mix], [], "hexpm", "f9f537b13d4fdd30f3039d33cb80144c3aa1f8d9698e47d7bcbcc8df93b1f5c5"},
"hackney": {:hex, :hackney, "1.17.0", "717ea195fd2f898d9fe9f1ce0afcc2621a41ecfe137fae57e7fe6e9484b9aa99", [:rebar3], [{:certifi, "~>2.5", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "64c22225f1ea8855f584720c0e5b3cd14095703af1c9fbc845ba042811dc671c"},
"httpoison": {:hex, :httpoison, "1.8.0", "6b85dea15820b7804ef607ff78406ab449dd78bed923a49c7160e1886e987a3d", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "28089eaa98cf90c66265b6b5ad87c59a3729bea2e74e9d08f9b51eb9729b3c3a"},
"gen_smtp": {:hex, :gen_smtp, "1.1.1", "bf9303c31735100631b1d708d629e4c65944319d1143b5c9952054f4a1311d85", [:rebar3], [{:hut, "1.3.0", [hex: :hut, repo: "hexpm", optional: false]}, {:ranch, ">= 1.7.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "51bc50cc017efd4a4248cbc39ea30fb60efa7d4a49688986fafad84434ff9ab7"},
"gettext": {:hex, :gettext, "0.19.1", "564953fd21f29358e68b91634799d9d26989f8d039d7512622efb3c3b1c97892", [:mix], [], "hexpm", "10c656c0912b8299adba9b061c06947511e3f109ab0d18b44a866a4498e77222"},
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
"httpoison": {:hex, :httpoison, "1.8.1", "df030d96de89dad2e9983f92b0c506a642d4b1f4a819c96ff77d12796189c63e", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "35156a6d678d6d516b9229e208942c405cf21232edd632327ecfaf4fd03e79e0"},
"hut": {:hex, :hut, "1.3.0", "71f2f054e657c03f959cf1acc43f436ea87580696528ca2a55c8afb1b06c85e7", [:"erlang.mk", :rebar, :rebar3], [], "hexpm", "7e15d28555d8a1f2b5a3a931ec120af0753e4853a4c66053db354f35bf9ab563"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
"jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "1.5.0", "203ef35ef3389aae6d361918bf3f952fa17a09e8e43b5aa592b93eba05d0fb8d", [:mix], [], "hexpm", "55a94c0f552249fc1a3dd9cd2d3ab9de9d3c89b559c2bd01121f824834f24746"},
"mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"phoenix": {:hex, :phoenix, "1.5.7", "2923bb3af924f184459fe4fa4b100bd25fa6468e69b2803dfae82698269aa5e0", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "774cd64417c5a3788414fdbb2be2eb9bcd0c048d9e6ad11a0c1fd67b7c0d0978"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.2.1", "13f124cf0a3ce0f1948cf24654c7b9f2347169ff75c1123f44674afee6af3b03", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 2.15", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "478a1bae899cac0a6e02be1deec7e2944b7754c04e7d4107fc5a517f877743c0"},
"phoenix": {:hex, :phoenix, "1.5.13", "d4e0805ec0973bed80d67302631130fb47d75b1a0b7335a0b23c4432b6ce55ee", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1a7c4f1900e6e60bb60ae6680e48418e3f7c360d58bcb9f812487b6d0d281a0f"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"},
"phoenix_html": {:hex, :phoenix_html, "2.14.3", "51f720d0d543e4e157ff06b65de38e13303d5778a7919bcc696599e5934271b8", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "efd697a7fff35a13eeeb6b43db884705cba353a1a41d127d118fda5f90c8e80f"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.0", "f35f61c3f959c9a01b36defaa1f0624edd55b87e236b606664a556d6f72fd2e7", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "02c1007ae393f2b76ec61c1a869b1e617179877984678babde131d716f95b582"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"},
"phx_gen_auth": {:hex, :phx_gen_auth, "0.6.0", "4ffbfa5b34ad8178c3dfcb996fed776df425903595cbc8d56a9ae5bc53136810", [:mix], [{:phoenix, "~> 1.5.2", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9a801c0f0bc251d8d91d62cecba0ebb6a90b8580fa8843029d931d15164e6ad9"},
"plug": {:hex, :plug, "1.11.0", "f17217525597628298998bc3baed9f8ea1fa3f1160aa9871aee6df47a6e4d38e", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2d9c633f0499f9dc5c2fd069161af4e2e7756890b81adcbb2ceaa074e8308876"},
"plug_cowboy": {:hex, :plug_cowboy, "2.4.1", "779ba386c0915027f22e14a48919a9545714f849505fa15af2631a0d298abf0f", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d72113b6dff7b37a7d9b2a5b68892808e3a9a752f2bf7e503240945385b70507"},
"plug_crypto": {:hex, :plug_crypto, "1.2.0", "1cb20793aa63a6c619dd18bb33d7a3aa94818e5fd39ad357051a67f26dfa2df6", [:mix], [], "hexpm", "a48b538ae8bf381ffac344520755f3007cc10bd8e90b240af98ea29b69683fc2"},
"postgrex": {:hex, :postgrex, "0.15.8", "f5e782bbe5e8fa178d5e3cd1999c857dc48eda95f0a4d7f7bd92a50e84a0d491", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "698fbfacea34c4cf22c8281abeb5cf68d99628d541874f085520ab3b53d356fe"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"},
"phx_gen_auth": {:hex, :phx_gen_auth, "0.7.0", "2e10e9527b6b71abbfbb4601c7dc4aa4fb9f2db6f9a6be457c468b7f2b0f6319", [:mix], [{:phoenix, "~> 1.5.2", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "b9dc3e3b866e67c5db8f00f4a2adb28fc8636e794f78600e35aba0e55bdac209"},
"plug": {:hex, :plug, "1.13.6", "187beb6b67c6cec50503e940f0434ea4692b19384d47e5fdfd701e93cadb4cc2", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "02b9c6b9955bce92c829f31d6284bf53c591ca63c4fb9ff81dfd0418667a34ff"},
"plug_cowboy": {:hex, :plug_cowboy, "2.5.2", "62894ccd601cf9597e2c23911ff12798a8a18d237e9739f58a6b04e4988899fe", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ea6e87f774c8608d60c8d34022a7d073bd7680a0a013f049fc62bf35efea1044"},
"plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"},
"postgrex": {:hex, :postgrex, "0.16.3", "fac79a81a9a234b11c44235a4494d8565303fa4b9147acf57e48978a074971db", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "aeaae1d2d1322da4e5fe90d241b0a564ce03a3add09d7270fb85362166194590"},
"ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"},
"telemetry_metrics": {:hex, :telemetry_metrics, "0.6.0", "da9d49ee7e6bb1c259d36ce6539cd45ae14d81247a2b0c90edf55e2b50507f7b", [:mix], [{:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5cfe67ad464b243835512aa44321cee91faed6ea868d7fb761d7016e02915c3d"},
"telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"},
"telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"},
"telemetry_poller": {:hex, :telemetry_poller, "0.5.1", "21071cc2e536810bac5628b935521ff3e28f0303e770951158c73eaaa01e962a", [:rebar3], [{:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4cab72069210bc6e7a080cec9afffad1b33370149ed5d379b81c7c5f0c663fd4"},
"the_big_username_blacklist": {:hex, :the_big_username_blacklist, "0.1.2", "a2622f06a26279c9cd5216ada872c2dceb63bc2ade5c8714df0de65a24aa985c", [:mix], [], "hexpm", "9f411601209758d4a5ef9e247a1e7b908c0cd05e78171f51f07e68b7afb038fe"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
"xmlrpc": {:hex, :xmlrpc, "1.4.1", "e69711f5a15b297c6c27dd833726a6a0cf06bab9130ac6039b8031510a3af497", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:erlsom, "~> 1.4", [hex: :erlsom, repo: "hexpm", optional: false]}], "hexpm", "4680ce0e452f80ce69f405429fa35ecfbd5a385fe882a7f2666702da3cd173a7"},
"xmlrpc": {:hex, :xmlrpc, "1.4.2", "e38c3666e3d2e1a93ed830e3dc56a3faf86680b2ac36d9979aa61234b4116db6", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:erlsom, "~> 1.4", [hex: :erlsom, repo: "hexpm", optional: false]}], "hexpm", "8145f2d285c45b68ae2bbdaebfa021f6f6a7abe8e2dbe07e0708ca13ea26133a"},
}

View File

@ -0,0 +1,127 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('HISTORY', {anyAttribs :: anyAttribs(),
'OID' :: integer(),
'SEQ' :: integer(),
'HOSTNAME' :: string(),
'HID' :: integer(),
'CID' :: integer(),
'STIME' :: integer(),
'ETIME' :: integer(),
'VM_MAD' :: string(),
'TM_MAD' :: string(),
'DS_ID' :: integer(),
'PSTIME' :: integer(),
'PETIME' :: integer(),
'RSTIME' :: integer(),
'RETIME' :: integer(),
'ESTIME' :: integer(),
'EETIME' :: integer(),
'ACTION' :: integer(),
'UID' :: integer(),
'GID' :: integer(),
'REQUEST_ID' :: string(),
'VM' :: 'HISTORY/VM'()}).
-type 'HISTORY'() :: #'HISTORY'{}.
-record('HISTORY/VM', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'UID' :: integer(),
'GID' :: integer(),
'UNAME' :: string(),
'GNAME' :: string(),
'NAME' :: string(),
'PERMISSIONS' :: 'HISTORY/VM/PERMISSIONS'() | undefined,
'LAST_POLL' :: integer(),
'STATE' :: integer(),
'LCM_STATE' :: integer(),
'PREV_STATE' :: integer(),
'PREV_LCM_STATE' :: integer(),
'RESCHED' :: integer(),
'STIME' :: integer(),
'ETIME' :: integer(),
'DEPLOY_ID' :: string(),
'MONITORING' :: string(),
'TEMPLATE' :: string(),
'USER_TEMPLATE' :: string(),
'HISTORY_RECORDS' :: string(),
'SNAPSHOTS' :: ['HISTORY/VM/SNAPSHOTS'()] | undefined}).
-type 'HISTORY/VM'() :: #'HISTORY/VM'{}.
-record('HISTORY/VM/SNAPSHOTS', {anyAttribs :: anyAttribs(),
'ALLOW_ORPHANS' :: string(),
'CURRENT_BASE' :: integer(),
'DISK_ID' :: integer(),
'NEXT_SNAPSHOT' :: integer(),
'SNAPSHOT' :: ['HISTORY/VM/SNAPSHOTS/SNAPSHOT'()] | undefined}).
-type 'HISTORY/VM/SNAPSHOTS'() :: #'HISTORY/VM/SNAPSHOTS'{}.
-record('HISTORY/VM/SNAPSHOTS/SNAPSHOT', {anyAttribs :: anyAttribs(),
'ACTIVE' :: string() | undefined,
'CHILDREN' :: string() | undefined,
'DATE' :: integer(),
'ID' :: integer(),
'NAME' :: string() | undefined,
'PARENT' :: integer(),
'SIZE' :: integer()}).
-type 'HISTORY/VM/SNAPSHOTS/SNAPSHOT'() :: #'HISTORY/VM/SNAPSHOTS/SNAPSHOT'{}.
-record('HISTORY/VM/PERMISSIONS', {anyAttribs :: anyAttribs(),
'OWNER_U' :: integer(),
'OWNER_M' :: integer(),
'OWNER_A' :: integer(),
'GROUP_U' :: integer(),
'GROUP_M' :: integer(),
'GROUP_A' :: integer(),
'OTHER_U' :: integer(),
'OTHER_M' :: integer(),
'OTHER_A' :: integer()}).
-type 'HISTORY/VM/PERMISSIONS'() :: #'HISTORY/VM/PERMISSIONS'{}.
-record('HISTORY_RECORDS', {anyAttribs :: anyAttribs(),
'HISTORY_RECORDS/SEQ1' :: 'HISTORY_RECORDS/SEQ1'() | undefined}).
-type 'HISTORY_RECORDS'() :: #'HISTORY_RECORDS'{}.
-record('HISTORY_RECORDS/SEQ1', {anyAttribs :: anyAttribs(),
'HISTORY' :: ['HISTORY'()] | undefined}).
-type 'HISTORY_RECORDS/SEQ1'() :: #'HISTORY_RECORDS/SEQ1'{}.

View File

@ -0,0 +1,50 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('ACL_POOL', {anyAttribs :: anyAttribs(),
'ACL_POOL/SEQ1' :: 'ACL_POOL/SEQ1'() | undefined}).
-type 'ACL_POOL'() :: #'ACL_POOL'{}.
-record('ACL_POOL/SEQ1', {anyAttribs :: anyAttribs(),
'ACL' :: ['ACL_POOL/SEQ1/ACL'()] | undefined}).
-type 'ACL_POOL/SEQ1'() :: #'ACL_POOL/SEQ1'{}.
-record('ACL_POOL/SEQ1/ACL', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'USER' :: string(),
'RESOURCE' :: string(),
'RIGHTS' :: string(),
'ZONE' :: string(),
'STRING' :: string()}).
-type 'ACL_POOL/SEQ1/ACL'() :: #'ACL_POOL/SEQ1/ACL'{}.

View File

@ -0,0 +1,56 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('CLUSTER', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'NAME' :: string(),
'HOSTS' :: 'CLUSTER/HOSTS'(),
'DATASTORES' :: 'CLUSTER/DATASTORES'(),
'VNETS' :: 'CLUSTER/VNETS'(),
'TEMPLATE' :: string()}).
-type 'CLUSTER'() :: #'CLUSTER'{}.
-record('CLUSTER/VNETS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'CLUSTER/VNETS'() :: #'CLUSTER/VNETS'{}.
-record('CLUSTER/DATASTORES', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'CLUSTER/DATASTORES'() :: #'CLUSTER/DATASTORES'{}.
-record('CLUSTER/HOSTS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'CLUSTER/HOSTS'() :: #'CLUSTER/HOSTS'{}.

View File

@ -0,0 +1,89 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('DATASTORE', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'UID' :: integer(),
'GID' :: integer(),
'UNAME' :: string(),
'GNAME' :: string(),
'NAME' :: string(),
'PERMISSIONS' :: 'DATASTORE/PERMISSIONS'() | undefined,
'DS_MAD' :: string(),
'TM_MAD' :: string(),
'BASE_PATH' :: string(),
'TYPE' :: integer(),
'DISK_TYPE' :: integer(),
'STATE' :: integer(),
'CLUSTERS' :: 'DATASTORE/CLUSTERS'(),
'TOTAL_MB' :: integer(),
'FREE_MB' :: integer(),
'USED_MB' :: integer(),
'IMAGES' :: 'DATASTORE/IMAGES'(),
'TEMPLATE' :: 'DATASTORE/TEMPLATE'()}).
-type 'DATASTORE'() :: #'DATASTORE'{}.
-record('DATASTORE/TEMPLATE', {anyAttribs :: anyAttribs(),
'VCENTER_DC_NAME' :: string() | undefined,
'VCENTER_DC_REF' :: string() | undefined,
'VCENTER_DS_NAME' :: string() | undefined,
'VCENTER_DS_REF' :: string() | undefined,
'VCENTER_HOST' :: string() | undefined,
'VCENTER_INSTANCE_ID' :: string() | undefined,
'#any' :: any()}).
-type 'DATASTORE/TEMPLATE'() :: #'DATASTORE/TEMPLATE'{}.
-record('DATASTORE/IMAGES', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'DATASTORE/IMAGES'() :: #'DATASTORE/IMAGES'{}.
-record('DATASTORE/CLUSTERS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'DATASTORE/CLUSTERS'() :: #'DATASTORE/CLUSTERS'{}.
-record('DATASTORE/PERMISSIONS', {anyAttribs :: anyAttribs(),
'OWNER_U' :: integer(),
'OWNER_M' :: integer(),
'OWNER_A' :: integer(),
'GROUP_U' :: integer(),
'GROUP_M' :: integer(),
'GROUP_A' :: integer(),
'OTHER_U' :: integer(),
'OTHER_M' :: integer(),
'OTHER_A' :: integer()}).
-type 'DATASTORE/PERMISSIONS'() :: #'DATASTORE/PERMISSIONS'{}.

View File

@ -0,0 +1,65 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('DOCUMENT', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'UID' :: integer(),
'GID' :: integer(),
'UNAME' :: string(),
'GNAME' :: string(),
'NAME' :: string(),
'TYPE' :: string(),
'PERMISSIONS' :: 'DOCUMENT/PERMISSIONS'() | undefined,
'LOCK' :: 'DOCUMENT/LOCK'() | undefined,
'TEMPLATE' :: string()}).
-type 'DOCUMENT'() :: #'DOCUMENT'{}.
-record('DOCUMENT/LOCK', {anyAttribs :: anyAttribs(),
'LOCKED' :: integer(),
'OWNER' :: integer(),
'TIME' :: integer(),
'REQ_ID' :: integer()}).
-type 'DOCUMENT/LOCK'() :: #'DOCUMENT/LOCK'{}.
-record('DOCUMENT/PERMISSIONS', {anyAttribs :: anyAttribs(),
'OWNER_U' :: integer(),
'OWNER_M' :: integer(),
'OWNER_A' :: integer(),
'GROUP_U' :: integer(),
'GROUP_M' :: integer(),
'GROUP_A' :: integer(),
'OTHER_U' :: integer(),
'OTHER_M' :: integer(),
'OTHER_A' :: integer()}).
-type 'DOCUMENT/PERMISSIONS'() :: #'DOCUMENT/PERMISSIONS'{}.

View File

@ -0,0 +1,201 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('GROUP', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'NAME' :: string(),
'TEMPLATE' :: string(),
'USERS' :: 'GROUP/USERS'(),
'ADMINS' :: 'GROUP/ADMINS'(),
'DATASTORE_QUOTA' :: 'GROUP/DATASTORE_QUOTA'() | undefined,
'NETWORK_QUOTA' :: 'GROUP/NETWORK_QUOTA'() | undefined,
'VM_QUOTA' :: 'GROUP/VM_QUOTA'() | undefined,
'IMAGE_QUOTA' :: 'GROUP/IMAGE_QUOTA'() | undefined,
'DEFAULT_GROUP_QUOTAS' :: 'GROUP/DEFAULT_GROUP_QUOTAS'()}).
-type 'GROUP'() :: #'GROUP'{}.
-record('GROUP/DEFAULT_GROUP_QUOTAS', {anyAttribs :: anyAttribs(),
'DATASTORE_QUOTA' :: 'GROUP/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA'() | undefined,
'NETWORK_QUOTA' :: 'GROUP/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA'() | undefined,
'VM_QUOTA' :: 'GROUP/DEFAULT_GROUP_QUOTAS/VM_QUOTA'() | undefined,
'IMAGE_QUOTA' :: 'GROUP/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA'() | undefined}).
-type 'GROUP/DEFAULT_GROUP_QUOTAS'() :: #'GROUP/DEFAULT_GROUP_QUOTAS'{}.
-record('GROUP/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA', {anyAttribs :: anyAttribs(),
'IMAGE' :: ['GROUP/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA/IMAGE'()] | undefined}).
-type 'GROUP/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA'() :: #'GROUP/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA'{}.
-record('GROUP/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA/IMAGE', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'RVMS' :: string(),
'RVMS_USED' :: string()}).
-type 'GROUP/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA/IMAGE'() :: #'GROUP/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA/IMAGE'{}.
-record('GROUP/DEFAULT_GROUP_QUOTAS/VM_QUOTA', {anyAttribs :: anyAttribs(),
'VM' :: 'GROUP/DEFAULT_GROUP_QUOTAS/VM_QUOTA/VM'() | undefined}).
-type 'GROUP/DEFAULT_GROUP_QUOTAS/VM_QUOTA'() :: #'GROUP/DEFAULT_GROUP_QUOTAS/VM_QUOTA'{}.
-record('GROUP/DEFAULT_GROUP_QUOTAS/VM_QUOTA/VM', {anyAttribs :: anyAttribs(),
'CPU' :: string(),
'CPU_USED' :: string(),
'MEMORY' :: integer(),
'MEMORY_USED' :: integer(),
'RUNNING_CPU' :: string(),
'RUNNING_CPU_USED' :: string(),
'RUNNING_MEMORY' :: integer(),
'RUNNING_MEMORY_USED' :: integer(),
'RUNNING_VMS' :: integer(),
'RUNNING_VMS_USED' :: integer(),
'SYSTEM_DISK_SIZE' :: string(),
'SYSTEM_DISK_SIZE_USED' :: string(),
'VMS' :: integer(),
'VMS_USED' :: integer()}).
-type 'GROUP/DEFAULT_GROUP_QUOTAS/VM_QUOTA/VM'() :: #'GROUP/DEFAULT_GROUP_QUOTAS/VM_QUOTA/VM'{}.
-record('GROUP/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA', {anyAttribs :: anyAttribs(),
'NETWORK' :: ['GROUP/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA/NETWORK'()] | undefined}).
-type 'GROUP/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA'() :: #'GROUP/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA'{}.
-record('GROUP/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA/NETWORK', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'LEASES' :: string(),
'LEASES_USED' :: string()}).
-type 'GROUP/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA/NETWORK'() :: #'GROUP/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA/NETWORK'{}.
-record('GROUP/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA', {anyAttribs :: anyAttribs(),
'DATASTORE' :: ['GROUP/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA/DATASTORE'()] | undefined}).
-type 'GROUP/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA'() :: #'GROUP/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA'{}.
-record('GROUP/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA/DATASTORE', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'IMAGES' :: string(),
'IMAGES_USED' :: string(),
'SIZE' :: string(),
'SIZE_USED' :: string()}).
-type 'GROUP/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA/DATASTORE'() :: #'GROUP/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA/DATASTORE'{}.
-record('GROUP/IMAGE_QUOTA', {anyAttribs :: anyAttribs(),
'IMAGE' :: ['GROUP/IMAGE_QUOTA/IMAGE'()] | undefined}).
-type 'GROUP/IMAGE_QUOTA'() :: #'GROUP/IMAGE_QUOTA'{}.
-record('GROUP/IMAGE_QUOTA/IMAGE', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'RVMS' :: string(),
'RVMS_USED' :: string()}).
-type 'GROUP/IMAGE_QUOTA/IMAGE'() :: #'GROUP/IMAGE_QUOTA/IMAGE'{}.
-record('GROUP/VM_QUOTA', {anyAttribs :: anyAttribs(),
'VM' :: 'GROUP/VM_QUOTA/VM'() | undefined}).
-type 'GROUP/VM_QUOTA'() :: #'GROUP/VM_QUOTA'{}.
-record('GROUP/VM_QUOTA/VM', {anyAttribs :: anyAttribs(),
'CPU' :: string(),
'CPU_USED' :: string(),
'MEMORY' :: integer(),
'MEMORY_USED' :: integer(),
'RUNNING_CPU' :: string(),
'RUNNING_CPU_USED' :: string(),
'RUNNING_MEMORY' :: integer(),
'RUNNING_MEMORY_USED' :: integer(),
'RUNNING_VMS' :: integer(),
'RUNNING_VMS_USED' :: integer(),
'SYSTEM_DISK_SIZE' :: string(),
'SYSTEM_DISK_SIZE_USED' :: string(),
'VMS' :: integer(),
'VMS_USED' :: integer()}).
-type 'GROUP/VM_QUOTA/VM'() :: #'GROUP/VM_QUOTA/VM'{}.
-record('GROUP/NETWORK_QUOTA', {anyAttribs :: anyAttribs(),
'NETWORK' :: ['GROUP/NETWORK_QUOTA/NETWORK'()] | undefined}).
-type 'GROUP/NETWORK_QUOTA'() :: #'GROUP/NETWORK_QUOTA'{}.
-record('GROUP/NETWORK_QUOTA/NETWORK', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'LEASES' :: string(),
'LEASES_USED' :: string()}).
-type 'GROUP/NETWORK_QUOTA/NETWORK'() :: #'GROUP/NETWORK_QUOTA/NETWORK'{}.
-record('GROUP/DATASTORE_QUOTA', {anyAttribs :: anyAttribs(),
'DATASTORE' :: ['GROUP/DATASTORE_QUOTA/DATASTORE'()] | undefined}).
-type 'GROUP/DATASTORE_QUOTA'() :: #'GROUP/DATASTORE_QUOTA'{}.
-record('GROUP/DATASTORE_QUOTA/DATASTORE', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'IMAGES' :: string(),
'IMAGES_USED' :: string(),
'SIZE' :: string(),
'SIZE_USED' :: string()}).
-type 'GROUP/DATASTORE_QUOTA/DATASTORE'() :: #'GROUP/DATASTORE_QUOTA/DATASTORE'{}.
-record('GROUP/ADMINS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'GROUP/ADMINS'() :: #'GROUP/ADMINS'{}.
-record('GROUP/USERS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'GROUP/USERS'() :: #'GROUP/USERS'{}.

View File

@ -0,0 +1,219 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('GROUP_POOL', {anyAttribs :: anyAttribs(),
choice :: 'GROUP_POOL/SEQ1'() | 'GROUP_POOL/SEQ1'() | 'GROUP_POOL/SEQ1'()}).
-type 'GROUP_POOL'() :: #'GROUP_POOL'{}.
-record('GROUP_POOL/SEQ1', {anyAttribs :: anyAttribs(),
choice :: [['GROUP_POOL/SEQ1/QUOTAS'()] | ['GROUP_POOL/SEQ1/GROUP'()]] | undefined,
'DEFAULT_GROUP_QUOTAS' :: 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS'()}).
-type 'GROUP_POOL/SEQ1'() :: #'GROUP_POOL/SEQ1'{}.
-record('GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS', {anyAttribs :: anyAttribs(),
'DATASTORE_QUOTA' :: 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA'() | undefined,
'NETWORK_QUOTA' :: 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA'() | undefined,
'VM_QUOTA' :: 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/VM_QUOTA'() | undefined,
'IMAGE_QUOTA' :: 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA'() | undefined}).
-type 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS'() :: #'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS'{}.
-record('GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA', {anyAttribs :: anyAttribs(),
'IMAGE' :: ['GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA/IMAGE'()] | undefined}).
-type 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA'() :: #'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA'{}.
-record('GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA/IMAGE', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'RVMS' :: string(),
'RVMS_USED' :: string()}).
-type 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA/IMAGE'() :: #'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/IMAGE_QUOTA/IMAGE'{}.
-record('GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/VM_QUOTA', {anyAttribs :: anyAttribs(),
'VM' :: 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/VM_QUOTA/VM'() | undefined}).
-type 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/VM_QUOTA'() :: #'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/VM_QUOTA'{}.
-record('GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/VM_QUOTA/VM', {anyAttribs :: anyAttribs(),
'CPU' :: string(),
'CPU_USED' :: string(),
'MEMORY' :: string(),
'MEMORY_USED' :: string(),
'RUNNING_CPU' :: string(),
'RUNNING_CPU_USED' :: string(),
'RUNNING_MEMORY' :: string(),
'RUNNING_MEMORY_USED' :: string(),
'RUNNING_VMS' :: string(),
'RUNNING_VMS_USED' :: string(),
'SYSTEM_DISK_SIZE' :: string(),
'SYSTEM_DISK_SIZE_USED' :: string(),
'VMS' :: string(),
'VMS_USED' :: string()}).
-type 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/VM_QUOTA/VM'() :: #'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/VM_QUOTA/VM'{}.
-record('GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA', {anyAttribs :: anyAttribs(),
'NETWORK' :: ['GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA/NETWORK'()] | undefined}).
-type 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA'() :: #'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA'{}.
-record('GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA/NETWORK', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'LEASES' :: string(),
'LEASES_USED' :: string()}).
-type 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA/NETWORK'() :: #'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/NETWORK_QUOTA/NETWORK'{}.
-record('GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA', {anyAttribs :: anyAttribs(),
'DATASTORE' :: ['GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA/DATASTORE'()] | undefined}).
-type 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA'() :: #'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA'{}.
-record('GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA/DATASTORE', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'IMAGES' :: string(),
'IMAGES_USED' :: string(),
'SIZE' :: string(),
'SIZE_USED' :: string()}).
-type 'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA/DATASTORE'() :: #'GROUP_POOL/SEQ1/DEFAULT_GROUP_QUOTAS/DATASTORE_QUOTA/DATASTORE'{}.
-record('GROUP_POOL/SEQ1/QUOTAS', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'DATASTORE_QUOTA' :: 'GROUP_POOL/SEQ1/QUOTAS/DATASTORE_QUOTA'() | undefined,
'NETWORK_QUOTA' :: 'GROUP_POOL/SEQ1/QUOTAS/NETWORK_QUOTA'() | undefined,
'VM_QUOTA' :: 'GROUP_POOL/SEQ1/QUOTAS/VM_QUOTA'() | undefined,
'IMAGE_QUOTA' :: 'GROUP_POOL/SEQ1/QUOTAS/IMAGE_QUOTA'() | undefined}).
-type 'GROUP_POOL/SEQ1/QUOTAS'() :: #'GROUP_POOL/SEQ1/QUOTAS'{}.
-record('GROUP_POOL/SEQ1/QUOTAS/IMAGE_QUOTA', {anyAttribs :: anyAttribs(),
'IMAGE' :: ['GROUP_POOL/SEQ1/QUOTAS/IMAGE_QUOTA/IMAGE'()] | undefined}).
-type 'GROUP_POOL/SEQ1/QUOTAS/IMAGE_QUOTA'() :: #'GROUP_POOL/SEQ1/QUOTAS/IMAGE_QUOTA'{}.
-record('GROUP_POOL/SEQ1/QUOTAS/IMAGE_QUOTA/IMAGE', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'RVMS' :: string(),
'RVMS_USED' :: string()}).
-type 'GROUP_POOL/SEQ1/QUOTAS/IMAGE_QUOTA/IMAGE'() :: #'GROUP_POOL/SEQ1/QUOTAS/IMAGE_QUOTA/IMAGE'{}.
-record('GROUP_POOL/SEQ1/QUOTAS/VM_QUOTA', {anyAttribs :: anyAttribs(),
'VM' :: 'GROUP_POOL/SEQ1/QUOTAS/VM_QUOTA/VM'() | undefined}).
-type 'GROUP_POOL/SEQ1/QUOTAS/VM_QUOTA'() :: #'GROUP_POOL/SEQ1/QUOTAS/VM_QUOTA'{}.
-record('GROUP_POOL/SEQ1/QUOTAS/VM_QUOTA/VM', {anyAttribs :: anyAttribs(),
'CPU' :: string(),
'CPU_USED' :: string(),
'MEMORY' :: string(),
'MEMORY_USED' :: string(),
'RUNNING_CPU' :: string(),
'RUNNING_CPU_USED' :: string(),
'RUNNING_MEMORY' :: string(),
'RUNNING_MEMORY_USED' :: string(),
'RUNNING_VMS' :: string(),
'RUNNING_VMS_USED' :: string(),
'SYSTEM_DISK_SIZE' :: string(),
'SYSTEM_DISK_SIZE_USED' :: string(),
'VMS' :: string(),
'VMS_USED' :: string()}).
-type 'GROUP_POOL/SEQ1/QUOTAS/VM_QUOTA/VM'() :: #'GROUP_POOL/SEQ1/QUOTAS/VM_QUOTA/VM'{}.
-record('GROUP_POOL/SEQ1/QUOTAS/NETWORK_QUOTA', {anyAttribs :: anyAttribs(),
'NETWORK' :: ['GROUP_POOL/SEQ1/QUOTAS/NETWORK_QUOTA/NETWORK'()] | undefined}).
-type 'GROUP_POOL/SEQ1/QUOTAS/NETWORK_QUOTA'() :: #'GROUP_POOL/SEQ1/QUOTAS/NETWORK_QUOTA'{}.
-record('GROUP_POOL/SEQ1/QUOTAS/NETWORK_QUOTA/NETWORK', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'LEASES' :: string(),
'LEASES_USED' :: string()}).
-type 'GROUP_POOL/SEQ1/QUOTAS/NETWORK_QUOTA/NETWORK'() :: #'GROUP_POOL/SEQ1/QUOTAS/NETWORK_QUOTA/NETWORK'{}.
-record('GROUP_POOL/SEQ1/QUOTAS/DATASTORE_QUOTA', {anyAttribs :: anyAttribs(),
'DATASTORE' :: ['GROUP_POOL/SEQ1/QUOTAS/DATASTORE_QUOTA/DATASTORE'()] | undefined}).
-type 'GROUP_POOL/SEQ1/QUOTAS/DATASTORE_QUOTA'() :: #'GROUP_POOL/SEQ1/QUOTAS/DATASTORE_QUOTA'{}.
-record('GROUP_POOL/SEQ1/QUOTAS/DATASTORE_QUOTA/DATASTORE', {anyAttribs :: anyAttribs(),
'ID' :: string(),
'IMAGES' :: string(),
'IMAGES_USED' :: string(),
'SIZE' :: string(),
'SIZE_USED' :: string()}).
-type 'GROUP_POOL/SEQ1/QUOTAS/DATASTORE_QUOTA/DATASTORE'() :: #'GROUP_POOL/SEQ1/QUOTAS/DATASTORE_QUOTA/DATASTORE'{}.
-record('GROUP_POOL/SEQ1/GROUP', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'NAME' :: string(),
'TEMPLATE' :: string(),
'USERS' :: 'GROUP_POOL/SEQ1/GROUP/USERS'(),
'ADMINS' :: 'GROUP_POOL/SEQ1/GROUP/ADMINS'()}).
-type 'GROUP_POOL/SEQ1/GROUP'() :: #'GROUP_POOL/SEQ1/GROUP'{}.
-record('GROUP_POOL/SEQ1/GROUP/ADMINS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'GROUP_POOL/SEQ1/GROUP/ADMINS'() :: #'GROUP_POOL/SEQ1/GROUP/ADMINS'{}.
-record('GROUP_POOL/SEQ1/GROUP/USERS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'GROUP_POOL/SEQ1/GROUP/USERS'() :: #'GROUP_POOL/SEQ1/GROUP/USERS'{}.

View File

@ -0,0 +1,81 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('HOOK', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'NAME' :: string(),
'TYPE' :: string(),
'TEMPLATE' :: 'HOOK/TEMPLATE'(),
'HOOKLOG' :: 'HOOK/HOOKLOG'() | undefined}).
-type 'HOOK'() :: #'HOOK'{}.
-record('HOOK/HOOKLOG', {anyAttribs :: anyAttribs(),
'HOOK_EXECUTION_RECORD' :: ['HOOK/HOOKLOG/HOOK_EXECUTION_RECORD'()] | undefined}).
-type 'HOOK/HOOKLOG'() :: #'HOOK/HOOKLOG'{}.
-record('HOOK/HOOKLOG/HOOK_EXECUTION_RECORD', {anyAttribs :: anyAttribs(),
choice :: [any()] | undefined,
'HOOK_ID' :: integer(),
'EXECUTION_ID' :: integer(),
'TIMESTAMP' :: integer(),
'ARGUMENTS' :: string(),
'EXECUTION_RESULT' :: 'HOOK/HOOKLOG/HOOK_EXECUTION_RECORD/EXECUTION_RESULT'(),
'REMOTE_HOST' :: string() | undefined,
'RETRY' :: string() | undefined,
choice1 :: [any()] | undefined}).
-type 'HOOK/HOOKLOG/HOOK_EXECUTION_RECORD'() :: #'HOOK/HOOKLOG/HOOK_EXECUTION_RECORD'{}.
-record('HOOK/HOOKLOG/HOOK_EXECUTION_RECORD/EXECUTION_RESULT', {anyAttribs :: anyAttribs(),
'COMMAND' :: string(),
'STDOUT' :: string(),
'STDERR' :: string(),
'CODE' :: string()}).
-type 'HOOK/HOOKLOG/HOOK_EXECUTION_RECORD/EXECUTION_RESULT'() :: #'HOOK/HOOKLOG/HOOK_EXECUTION_RECORD/EXECUTION_RESULT'{}.
-record('HOOK/TEMPLATE', {anyAttribs :: anyAttribs(),
choice :: [any()] | undefined,
'ARGUMENTS' :: string() | undefined,
'ARGUMENTS_STDIN' :: string() | undefined,
'CALL' :: string() | undefined,
'COMMAND' :: string(),
'REMOTE' :: string() | undefined,
'RESOURCE' :: string() | undefined,
'STATE' :: string() | undefined,
'LCM_STATE' :: string() | undefined,
choice1 :: [any()] | undefined}).
-type 'HOOK/TEMPLATE'() :: #'HOOK/TEMPLATE'{}.

View File

@ -0,0 +1,35 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('HOOK_MESSAGE', {anyAttribs :: anyAttribs(),
'HOOK_TYPE' :: string(),
'CALL' :: string(),
'CALL_INFO' :: ['CALL_INFO'()] | undefined}).
-type 'HOOK_MESSAGE'() :: #'HOOK_MESSAGE'{}.

View File

@ -0,0 +1,34 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('HOOK_MESSAGE', {anyAttribs :: anyAttribs(),
'ARGUMENTS' :: string(),
'HOOK_ID' :: integer()}).
-type 'HOOK_MESSAGE'() :: #'HOOK_MESSAGE'{}.

View File

@ -0,0 +1,165 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('HOST', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'NAME' :: string(),
'STATE' :: integer(),
'PREV_STATE' :: integer(),
'IM_MAD' :: string(),
'VM_MAD' :: string(),
'CLUSTER_ID' :: integer(),
'CLUSTER' :: string(),
'HOST_SHARE' :: 'HOST/HOST_SHARE'(),
'VMS' :: 'HOST/VMS'(),
'TEMPLATE' :: 'HOST/TEMPLATE'(),
'MONITORING' :: 'HOST/MONITORING'()}).
-type 'HOST'() :: #'HOST'{}.
-record('HOST/MONITORING', {anyAttribs :: anyAttribs(),
'TIMESTAMP' :: integer() | undefined,
'ID' :: integer() | undefined,
'CAPACITY' :: 'HOST/MONITORING/CAPACITY'() | undefined,
'SYSTEM' :: 'HOST/MONITORING/SYSTEM'() | undefined}).
-type 'HOST/MONITORING'() :: #'HOST/MONITORING'{}.
-record('HOST/MONITORING/SYSTEM', {anyAttribs :: anyAttribs(),
'NETRX' :: integer() | undefined,
'NETTX' :: integer() | undefined}).
-type 'HOST/MONITORING/SYSTEM'() :: #'HOST/MONITORING/SYSTEM'{}.
-record('HOST/MONITORING/CAPACITY', {anyAttribs :: anyAttribs(),
'FREE_CPU' :: integer(),
'FREE_MEMORY' :: integer(),
'USED_CPU' :: integer(),
'USED_MEMORY' :: integer()}).
-type 'HOST/MONITORING/CAPACITY'() :: #'HOST/MONITORING/CAPACITY'{}.
-record('HOST/TEMPLATE', {anyAttribs :: anyAttribs(),
choice :: [any()] | undefined,
'VCENTER_CCR_REF' :: string() | undefined,
'VCENTER_DS_REF' :: [string()] | undefined,
'VCENTER_HOST' :: string() | undefined,
'VCENTER_INSTANCE_ID' :: string() | undefined,
'VCENTER_NAME' :: string() | undefined,
'VCENTER_PASSWORD' :: string() | undefined,
'VCENTER_RESOURCE_POOL_INFO' :: [string()] | undefined,
'VCENTER_USER' :: string() | undefined,
'VCENTER_VERSION' :: string() | undefined,
choice1 :: [any()] | undefined}).
-type 'HOST/TEMPLATE'() :: #'HOST/TEMPLATE'{}.
-record('HOST/VMS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'HOST/VMS'() :: #'HOST/VMS'{}.
-record('HOST/HOST_SHARE', {anyAttribs :: anyAttribs(),
'MEM_USAGE' :: integer(),
'CPU_USAGE' :: integer(),
'TOTAL_MEM' :: integer(),
'TOTAL_CPU' :: integer(),
'MAX_MEM' :: integer(),
'MAX_CPU' :: integer(),
'RUNNING_VMS' :: integer(),
'VMS_THREAD' :: integer(),
'DATASTORES' :: 'HOST/HOST_SHARE/DATASTORES'(),
'PCI_DEVICES' :: 'HOST/HOST_SHARE/PCI_DEVICES'(),
'NUMA_NODES' :: 'HOST/HOST_SHARE/NUMA_NODES'()}).
-type 'HOST/HOST_SHARE'() :: #'HOST/HOST_SHARE'{}.
-record('HOST/HOST_SHARE/NUMA_NODES', {anyAttribs :: anyAttribs(),
'NODE' :: ['HOST/HOST_SHARE/NUMA_NODES/NODE'()] | undefined}).
-type 'HOST/HOST_SHARE/NUMA_NODES'() :: #'HOST/HOST_SHARE/NUMA_NODES'{}.
-record('HOST/HOST_SHARE/NUMA_NODES/NODE', {anyAttribs :: anyAttribs(),
'CORE' :: ['HOST/HOST_SHARE/NUMA_NODES/NODE/CORE'()] | undefined,
'HUGEPAGE' :: ['HOST/HOST_SHARE/NUMA_NODES/NODE/HUGEPAGE'()] | undefined,
'MEMORY' :: 'HOST/HOST_SHARE/NUMA_NODES/NODE/MEMORY'(),
'NODE_ID' :: integer()}).
-type 'HOST/HOST_SHARE/NUMA_NODES/NODE'() :: #'HOST/HOST_SHARE/NUMA_NODES/NODE'{}.
-record('HOST/HOST_SHARE/NUMA_NODES/NODE/MEMORY', {anyAttribs :: anyAttribs(),
'DISTANCE' :: string(),
'FREE' :: integer(),
'TOTAL' :: integer(),
'USAGE' :: integer(),
'USED' :: integer()}).
-type 'HOST/HOST_SHARE/NUMA_NODES/NODE/MEMORY'() :: #'HOST/HOST_SHARE/NUMA_NODES/NODE/MEMORY'{}.
-record('HOST/HOST_SHARE/NUMA_NODES/NODE/HUGEPAGE', {anyAttribs :: anyAttribs(),
'FREE' :: integer(),
'PAGES' :: integer(),
'SIZE' :: integer(),
'USAGE' :: integer()}).
-type 'HOST/HOST_SHARE/NUMA_NODES/NODE/HUGEPAGE'() :: #'HOST/HOST_SHARE/NUMA_NODES/NODE/HUGEPAGE'{}.
-record('HOST/HOST_SHARE/NUMA_NODES/NODE/CORE', {anyAttribs :: anyAttribs(),
'CPUS' :: string(),
'DEDICATED' :: string(),
'FREE' :: integer(),
'ID' :: integer()}).
-type 'HOST/HOST_SHARE/NUMA_NODES/NODE/CORE'() :: #'HOST/HOST_SHARE/NUMA_NODES/NODE/CORE'{}.
-record('HOST/HOST_SHARE/PCI_DEVICES', {anyAttribs :: anyAttribs(),
'PCI' :: [string()] | undefined}).
-type 'HOST/HOST_SHARE/PCI_DEVICES'() :: #'HOST/HOST_SHARE/PCI_DEVICES'{}.
-record('HOST/HOST_SHARE/DATASTORES', {anyAttribs :: anyAttribs(),
'DISK_USAGE' :: integer(),
'FREE_DISK' :: integer(),
'MAX_DISK' :: integer(),
'USED_DISK' :: integer()}).
-type 'HOST/HOST_SHARE/DATASTORES'() :: #'HOST/HOST_SHARE/DATASTORES'{}.

View File

@ -0,0 +1,131 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('IMAGE', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'UID' :: integer(),
'GID' :: integer(),
'UNAME' :: string(),
'GNAME' :: string(),
'NAME' :: string(),
'LOCK' :: 'IMAGE/LOCK'() | undefined,
'PERMISSIONS' :: 'IMAGE/PERMISSIONS'() | undefined,
'TYPE' :: integer(),
'DISK_TYPE' :: integer(),
'PERSISTENT' :: integer(),
'REGTIME' :: integer(),
'SOURCE' :: string(),
'PATH' :: string(),
'FORMAT' :: string(),
'FS' :: string(),
'SIZE' :: integer(),
'STATE' :: integer(),
'RUNNING_VMS' :: integer(),
'CLONING_OPS' :: integer(),
'CLONING_ID' :: integer(),
'TARGET_SNAPSHOT' :: integer(),
'DATASTORE_ID' :: integer(),
'DATASTORE' :: string(),
'VMS' :: 'IMAGE/VMS'(),
'CLONES' :: 'IMAGE/CLONES'(),
'APP_CLONES' :: 'IMAGE/APP_CLONES'(),
'TEMPLATE' :: 'IMAGE/TEMPLATE'(),
'SNAPSHOTS' :: 'IMAGE/SNAPSHOTS'()}).
-type 'IMAGE'() :: #'IMAGE'{}.
-record('IMAGE/SNAPSHOTS', {anyAttribs :: anyAttribs(),
'ALLOW_ORPHANS' :: string(),
'CURRENT_BASE' :: integer(),
'NEXT_SNAPSHOT' :: string(),
'SNAPSHOT' :: ['IMAGE/SNAPSHOTS/SNAPSHOT'()] | undefined}).
-type 'IMAGE/SNAPSHOTS'() :: #'IMAGE/SNAPSHOTS'{}.
-record('IMAGE/SNAPSHOTS/SNAPSHOT', {anyAttribs :: anyAttribs(),
'CHILDREN' :: string() | undefined,
'ACTIVE' :: string() | undefined,
'DATE' :: integer(),
'ID' :: integer(),
'NAME' :: string() | undefined,
'PARENT' :: integer(),
'SIZE' :: integer()}).
-type 'IMAGE/SNAPSHOTS/SNAPSHOT'() :: #'IMAGE/SNAPSHOTS/SNAPSHOT'{}.
-record('IMAGE/TEMPLATE', {anyAttribs :: anyAttribs(),
choice :: [any()] | undefined,
'VCENTER_IMPORTED' :: string() | undefined,
choice1 :: [any()] | undefined}).
-type 'IMAGE/TEMPLATE'() :: #'IMAGE/TEMPLATE'{}.
-record('IMAGE/APP_CLONES', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'IMAGE/APP_CLONES'() :: #'IMAGE/APP_CLONES'{}.
-record('IMAGE/CLONES', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'IMAGE/CLONES'() :: #'IMAGE/CLONES'{}.
-record('IMAGE/VMS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'IMAGE/VMS'() :: #'IMAGE/VMS'{}.
-record('IMAGE/PERMISSIONS', {anyAttribs :: anyAttribs(),
'OWNER_U' :: integer(),
'OWNER_M' :: integer(),
'OWNER_A' :: integer(),
'GROUP_U' :: integer(),
'GROUP_M' :: integer(),
'GROUP_A' :: integer(),
'OTHER_U' :: integer(),
'OTHER_M' :: integer(),
'OTHER_A' :: integer()}).
-type 'IMAGE/PERMISSIONS'() :: #'IMAGE/PERMISSIONS'{}.
-record('IMAGE/LOCK', {anyAttribs :: anyAttribs(),
'LOCKED' :: integer(),
'OWNER' :: integer(),
'TIME' :: integer(),
'REQ_ID' :: integer()}).
-type 'IMAGE/LOCK'() :: #'IMAGE/LOCK'{}.

View File

@ -0,0 +1,66 @@
%% HRL file generated by ERLSOM
%%
%% It is possible (and in some cases necessary) to change the name of
%% the record fields.
%%
%% It is possible to add default values, but be aware that these will
%% only be used when *writing* an xml document.
-ifndef(ERLSOM_ANY_ATTRIB_TYPES).
-define(ERLSOM_ANY_ATTRIB_TYPES, true).
-type anyAttrib() :: {{string(), %% name of the attribute
string()}, %% namespace
string()}. %% value
-type anyAttribs() :: [anyAttrib()] | undefined.
-endif.
-ifndef(ERLSOM_QNAME_TYPES).
-define(ERLSOM_QNAME_TYPES, true).
%% xsd:QName values are translated to #qname{} records.
-record(qname, {uri :: string(),
localPart :: string(),
prefix :: string(),
mappedPrefix :: string()}).
-endif.
-record('MARKETPLACE', {anyAttribs :: anyAttribs(),
'ID' :: integer(),
'UID' :: integer(),
'GID' :: integer(),
'UNAME' :: string(),
'GNAME' :: string(),
'NAME' :: string(),
'MARKET_MAD' :: string(),
'ZONE_ID' :: string(),
'TOTAL_MB' :: integer(),
'FREE_MB' :: integer(),
'USED_MB' :: integer(),
'MARKETPLACEAPPS' :: 'MARKETPLACE/MARKETPLACEAPPS'(),
'PERMISSIONS' :: 'MARKETPLACE/PERMISSIONS'() | undefined,
'TEMPLATE' :: string()}).
-type 'MARKETPLACE'() :: #'MARKETPLACE'{}.
-record('MARKETPLACE/PERMISSIONS', {anyAttribs :: anyAttribs(),
'OWNER_U' :: integer(),
'OWNER_M' :: integer(),
'OWNER_A' :: integer(),
'GROUP_U' :: integer(),
'GROUP_M' :: integer(),
'GROUP_A' :: integer(),
'OTHER_U' :: integer(),
'OTHER_M' :: integer(),
'OTHER_A' :: integer()}).
-type 'MARKETPLACE/PERMISSIONS'() :: #'MARKETPLACE/PERMISSIONS'{}.
-record('MARKETPLACE/MARKETPLACEAPPS', {anyAttribs :: anyAttribs(),
'ID' :: [integer()] | undefined}).
-type 'MARKETPLACE/MARKETPLACEAPPS'() :: #'MARKETPLACE/MARKETPLACEAPPS'{}.

Some files were not shown because too many files have changed in this diff Show More