Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6da2f6f
v2 wip
laftho Jan 30, 2019
8dd41a9
remove typescript output
laftho Jan 30, 2019
44040c8
db console prompts
laftho Jan 31, 2019
d1bafff
remove garbage
laftho Jan 31, 2019
ae663de
manager auto migrate on startup
laftho Jan 31, 2019
3a7929c
cluster vpn admin + cleanup
laftho Feb 1, 2019
0b4a1f6
1.0.1
laftho Feb 1, 2019
25ef8da
2.0.0
laftho Feb 1, 2019
ee1dcef
admin convience script
laftho Feb 1, 2019
d5e39e2
dev instructions
laftho Feb 1, 2019
5426d12
improved dev readme
laftho Feb 1, 2019
25bbcf0
remove unused secrets + fix cert
laftho Feb 2, 2019
abba8fc
update package metainfo + CI versioning
laftho Apr 12, 2019
79c6be0
fix circle syntax
laftho Apr 12, 2019
d29f2a1
trigger circle for enabled pipelines
laftho Apr 12, 2019
5bca199
explicit CI build image version
laftho Apr 12, 2019
c2e35ea
setup_remote_docker for CI
laftho Apr 12, 2019
a145ad0
add all components to CI
laftho Apr 12, 2019
a9e298f
fix syntax
laftho Apr 12, 2019
c0d6607
fix dupe name
laftho Apr 12, 2019
b75508d
refactored reserved parameter to
laftho Apr 12, 2019
547834e
deploy via v2 for now
laftho Apr 12, 2019
f5c5301
targettable version for deploy + fix webhooker conf
laftho Aug 26, 2019
1a26ff0
fix gitignores
laftho Aug 27, 2019
aa3323e
database replication
laftho Aug 27, 2019
31b128a
properly configurable proxy hostname
laftho Sep 16, 2019
f76b8be
optional proxy move app to gateway
laftho Oct 1, 2019
8358630
add gateway to circle
laftho Oct 1, 2019
4a28f84
point webhooker to gateway
laftho Oct 1, 2019
aada640
explicit secrets version
laftho Oct 1, 2019
ea16ee1
Merge branch 'master' into v2
laftho Oct 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
664 changes: 578 additions & 86 deletions .circleci/config.yml

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ local.properties

[Dd]ebug/
x64/
build/
[Bb]in/
[Oo]bj/

Expand Down Expand Up @@ -201,7 +200,6 @@ $RECYCLE.BIN/
# Packages
*.egg
*.egg-info
build/
eggs/
parts/
var/
Expand Down Expand Up @@ -235,3 +233,4 @@ docker/nomos.env
#Coverage
coverage.xml
coverage/.
node_modules
34 changes: 0 additions & 34 deletions Dockerfile

This file was deleted.

34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,43 @@ _In greek mythology, Nomos is the personified spirit of law._

This system in a way acts as the rule set for how things are governed, via membership levels and privileges.

## Configure


For a development configuration:

`sudo npm run build`
`sudo npm run configure`
`sudo npm run deploy:dev`

`sudo bash -c "echo '127.0.0.1 nomos.local.dev.vanhack.ca' >> /etc/hosts"`

`https://nomos.local.dev.vanhack.ca/`

## Cleanup

```
docker stack rm nomos_proxy
docker stack rm nomos

docker system prune
```

Optional:
```
# delete all stopped containers !! not just nomos, although stack rm should clean these all up anyway
docker rm $(docker ps -aq)

#delete all images !! not just nomos images, deletes everything
docker rmi $(docker images -q)

rm -rf /srv/nomos/
```

## Development

See here for complete setup, API, and philosophy:
https://github.com/vhs/membership-manager-pro/wiki

First steps should be installing your test environment:
https://github.com/vhs/membership-manager-pro/wiki/Contributing
https://github.com/vhs/membership-manager-pro/wiki/Contributing
11 changes: 11 additions & 0 deletions adminvpn/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu

RUN apt update && apt install -y openssh-server sudo net-tools iputils-ping
RUN mkdir /var/run/sshd

RUN useradd -m -s $(which bash) -G sudo nomos

COPY run.sh .

EXPOSE 22
CMD ["bash", "run.sh"]
22 changes: 22 additions & 0 deletions adminvpn/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "nomos.adminvpn",
"version": "1.0.0",
"description": "",
"author": "Thomas LaFreniere <thomas@lafreniere.co>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/vhs/nomos.git",
"directory": "adminvpn"
},
"config": {
"build": ".0-dev"
},
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test:ci": "docker run vanhack/$npm_package_name:$npm_package_version$npm_package_config_build echo",
"build": "docker build -t vanhack/$npm_package_name:$npm_package_version$npm_package_config_build .",
"push": "docker push vanhack/$npm_package_name:$npm_package_version$npm_package_config_build"
}
}
5 changes: 5 additions & 0 deletions adminvpn/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo nomos:`cat /run/secrets/adminvpn_password` | chpasswd

/usr/sbin/sshd -D
38 changes: 38 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

cd core
npm run build
cd ..

cd proxy
npm run build
cd ..

cd gateway
npm run build
cd ..

cd web
npm run build
cd ..

cd adminvpn
npm run build
cd ..

cd database
cd manager
npm run build
cd ..

cd master
npm run build
cd ..

cd replica
npm run build
cd ..
cd ..

cd webhooker
npm run build
cd ..
8 changes: 8 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM docker:18.09

RUN apk add --no-cache \
git \
openssh-client \
nodejs \
npm \
sed
24 changes: 24 additions & 0 deletions build/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "nomos.build",
"version": "1.0.0",
"description": "Build image for building nomos images in CI",
"author": "Thomas LaFreniere <thomas@lafreniere.co>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/vhs/nomos.git",
"directory": "build"
},
"config": {
"build": ".0-dev"
},
"main": "index.js",
"directories": {
"test": "tests"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "docker build -t vanhack/$npm_package_name:$npm_package_version$npm_package_config_build .",
"push": "docker push vanhack/$npm_package_name:$npm_package_version$npm_package_config_build"
}
}
1 change: 1 addition & 0 deletions buildnum.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.1-dev
10 changes: 0 additions & 10 deletions circle.yml

This file was deleted.

23 changes: 23 additions & 0 deletions configure-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
docker swarm init

NODE_HOST=$(docker node inspect self | grep Hostname | grep -oEi '[a-z]+' | tail -n 1)

STORAGE_NODE_MASTER=$NODE_HOST
STORAGE_NODE_REPLICA=$NODE_HOST

docker node ls

# specify master storage node, this is the node which will have master database affinity
docker node update --label-add nomos.persistence.master=storage $STORAGE_NODE_MASTER
# this path is required on the master node
mkdir -p /srv/nomos/storage/master

# specify replica storage node, this is the node which will have replica database affinity
docker node update --label-add nomos.persistence.replica=storage $STORAGE_NODE_REPLICA
# this path is required on the replica node
mkdir -p /srv/nomos/storage/replica

docker network inspect proxy || docker network create --driver overlay proxy
docker network inspect admin || docker network create --driver overlay admin

echo "add to /etc/hosts: 127.0.0.1 nomos.local.dev.vanhack.ca"
9 changes: 9 additions & 0 deletions core/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM php:fpm

ADD . .

RUN apt update && apt install -y zip
RUN docker-php-ext-install bcmath
RUN docker-php-ext-install mysqli
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=.
RUN php composer.phar install
3 changes: 3 additions & 0 deletions app/app.php → core/app/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
if (DEBUG) {
error_reporting(E_ALL);
ini_set("display_errors", 1);
} else {
error_reporting(0);
ini_set("display_errors", 0);
}

require_once("include.php");
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function DeleteTemplate($id)
*/
public function ListTemplates($page, $size, $columns, $order, $filters)
{
return EmailTemplate::page($page, $size, $columns, $order, $filters);
return EmailTemplate::page($page, $size, $columns, $order, $filters, []);
}

/**
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading