Giter Site home page Giter Site logo

gatblau / onix Goto Github PK

View Code? Open in Web Editor NEW
92.0 15.0 33.0 306.54 MB

A reactive configuration manager designed to support Infrastructure as a Code provisioning, and bi-directional configuration management providing a single source of truth across multi-cloud environments.

License: Apache License 2.0

Java 14.39% Gherkin 0.84% Shell 2.48% Python 1.32% Makefile 0.79% Go 55.32% HCL 0.17% Dockerfile 0.52% JavaScript 0.08% HTML 0.22% TypeScript 0.71% CSS 23.11% Ruby 0.01% SCSS 0.01% Procfile 0.04%
cmdb ansible terraform openshift kubernetes configuration-management onix infrastructure multi-cloud reactive

onix's People

Contributors

cdmitri avatar danielfroehlich avatar dcgsteve avatar dependabot[bot] avatar egevorkyan avatar k-p-ani avatar phillipchan avatar rawipfel avatar sushilhpal avatar sw-alpha-romeo avatar swskipper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onix's Issues

art spec push bug

Hi Gatblau!

Was using your Artisan CLI in a project but came across a bug that seems to have been introduced sometime after the 22nd February(as far as I can tell!)

art spec push -c myname:mypassword s3s://my3scloud.com/abc/1.0.0 -t docker.my.stack -i

In previous versions this worked, but in the latest versions I get this as it starts to process the first docker image:

2022/03/04 06:41:03.388065 ART ERROR: cannot push spec - exec: "tag": executable file not found in $PATH

GET /item doesn't work with default query parameters

GET http://localhost:8080/item?top=100 returns

{
  "values": []
}

given:

onix=# select * from item;
 id |   key    |   name   |   description   |             meta             | tag | attribute | status | item_type_id |
 version |            created            | updated |    changed_by    | partition_id
----+----------+----------+-----------------+------------------------------+-----+-----------+--------+--------------+
---------+-------------------------------+---------+------------------+--------------
  1 | siteName | siteName | siteDescription | {"location": "siteLocation"} | {}  |           |      1 |            1 |
       1 | 2019-08-22 23:58:27.512487+00 |         | admin,ROLE_ADMIN |            1
(1 row)

Testing ox_find_items():

onix=# SELECT
onix-#     i.id,
onix-#     i.key,
onix-#     i.name,
onix-#     i.description,
onix-#     i.status,
onix-#     it.key as item_type_key,
onix-#     i.meta,
onix-#     i.tag,
onix-#     i.attribute,
onix-#     i.version,
onix-#     i.created,
onix-#     i.updated,
onix-#     i.changed_by,
onix-#     m.key as model_key,
onix-#     p.key as partition_key
onix-#   FROM item i
onix-#   INNER JOIN item_type it ON i.item_type_id = it.id
onix-#   INNER JOIN model m ON m.id = it.model_id
onix-#   INNER JOIN partition p on i.partition_id = p.id
onix-#   INNER JOIN privilege pr on p.id = pr.partition_id
onix-#   INNER JOIN role r on pr.role_id = r.id;
 id |   key    |   name   |   description   | status | item_type_key |             meta             | tag | attribute
| version |            created            | updated |    changed_by    | model_key  | partition_key
----+----------+----------+-----------------+--------+---------------+------------------------------+-----+-----------
+---------+-------------------------------+---------+------------------+------------+---------------
  1 | siteName | siteName | siteDescription |      1 | YBSITE        | {"location": "siteLocation"} | {}  |
|       1 | 2019-08-23 01:38:23.895909+00 |         | admin,ROLE_ADMIN | YBCS_MODEL | INS
  1 | siteName | siteName | siteDescription |      1 | YBSITE        | {"location": "siteLocation"} | {}  |
|       1 | 2019-08-23 01:38:23.895909+00 |         | admin,ROLE_ADMIN | YBCS_MODEL | INS
  1 | siteName | siteName | siteDescription |      1 | YBSITE        | {"location": "siteLocation"} | {}  |
|       1 | 2019-08-23 01:38:23.895909+00 |         | admin,ROLE_ADMIN | YBCS_MODEL | INS
(3 rows)

Issue related to .env file filtering

Found core function who is responsible to read .env file and prepare mapping. Original function is splitting line to string slice base on = sign separator, which means:

example:
if I have in .env file values below:
HOST=test
SECRETKEY=YWRtaW50ZXN0Cg==

SECRETKEY will be invalid, because it contains = signs more than one time, what if end user want to have complex secrets containing = signs or want to encode in base64 which 99% cases contains = sign than all such values will be invalid:

My solution is replace

Original function:

func NewEnVarFromFile(envFile string) (*Envar, error) {
var outMap = make(map[string]string)
file := ToAbs(envFile)
data, err := ioutil.ReadFile(file)
// if it managed to find the env file load it
// otherwise skip it
content := strings.Split(string(data), "\n")
if err == nil {
for ix, line := range content {
// skips comments
if strings.HasPrefix(strings.Trim(line, " "), "#") ||
len(strings.Trim(line, " ")) == 0 ||
strings.HasPrefix(strings.Trim(line, " "), "\r") ||
strings.HasPrefix(strings.Trim(line, " "), "\n") {
continue
}
keyValue := strings.Split(line, "=")
if len(keyValue) != 2 {
return nil, fmt.Errorf("invalid env file format in line %d: '%s'\n", ix, line)
}
outMap[keyValue[0]] = removeTrail(keyValue[1])
}
} else {
Debug("cannot load env file: %s", err.Error())
}
return &Envar{
Vars: outMap,
}, nil
}

with modification below, which fixes that issues:

func NewEnVarFromFile(envFile string) (*Envar, error) {
var outMap = make(map[string]string)
file := ToAbs(envFile)
data, err := ioutil.ReadFile(file)
// if it managed to find the env file load it
// otherwise skip it
content := strings.Split(string(data), "\n")
if err == nil {
for ix, line := range content {
// skips comments
if strings.HasPrefix(strings.Trim(line, " "), "#") ||
len(strings.Trim(line, " ")) == 0 ||
strings.HasPrefix(strings.Trim(line, " "), "\r") ||
strings.HasPrefix(strings.Trim(line, " "), "\n") {
continue
}
//here ensuring that keyValue will be split on 2 strings
//example: Key=Keyvalue or Key=Keyvalue= or other case
//this is required because base64 values very often contains = signs, example: YWRtaW50ZXN0Cg==
keyValue := strings.SplitN(line, "=", 2)
//Checking if value doesn't have spaces, for example: Key=value123 val
//if contains such value is invalid
if strings.Contains(keyValue[1], " ") {
return nil, fmt.Errorf("invalid env file format in line %d: '%s'\n", ix, line)
}
outMap[keyValue[0]] = removeTrail(keyValue[1])
}
} else {
Debug("cannot load env file: %s", err.Error())
}
return &Envar{
Vars: outMap,
}, nil
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.