Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 16 additions & 91 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,97 +1,22 @@
## The overall settings for all servers, not all keys correspond one on one with the seperate servers, see the config.js file if you want to run a server independently
AUTH_FIRST_CLIENT_LOGIN_CODE=CREATEACODE

# MYSQL settings, host should be set to mysql not localhost (corresponding to name in compose file)
MYSQL_HOST=localhost
MYSQL_USER=
MYSQL_PASSWORD=
# depends on mysql version, see docs
MYSQL_ST_GEO_MODE=on
# this is probably unnecessary
#for dev turn off secure sessions, should be on in prod!
COOKIE_SECURE_OFF=yes
BASE_DOMAIN=openstad.local

#set unique
SESSION_SECRET=xyxyxyxy
DB_HOST=localhost
DB_USERNAME=USERNAME
DB_PASSWORD=PASSWORD
DB_BASE_NAME=openstad

#mail
MAIL_TRANSPORT_SMTP_HOST=smtp.gmail.com
MAIL_TRANSPORT_SMTP_HOST=true
MAIL_TRANSPORT_SMTP_AUTH_PASS=1234
MAIL_TRANSPORT_SMTP_AUTH_USER=openstad@openstad.org
MAIL_TRANSPORT_SMTP_PORT=587
MAIL_TRANSPORT_SMTP_REQUIRESSL=true
MONGO_HOST=database-server

#api
API_PORT=8111
API_URL=http://localhost:8111
API_HOSTNAME=localhost
API_DATABASE=api
API_EMAILADDRESS=admin@openstad.org
API_MAIL_FROM=`Openstad Dev`
API_NOTIFICATIONS_ADMIN_EMAILADDRESS=admin@openstad.org
API_SECURITY_SESSIONS_COOKIENAME=cookies
API_SECURITY_SESSIONS_ONLYSECURE=false
API_AUTHORIZATION_JWTSECRET=123456
#this seem a bit weird. A user is created in the DB for the CMS to query the api. The token is necessary for identification
#token here has to correspond with FRONTEND_SITE_API_KEY
API_AUTHORIZATION_FIXEDAUTHTOKENS=[{"token": "xxxxxxx", "userId": "2"}]
BASIC_AUTH_USER=openstad
BASIC_AUTH_PASSWORD=openstad

#images
IMAGE_DB_NAME=image
IMAGE_APP_URL=http://localhost:3333
IMAGE_API_ACCESS_TOKEN=xxxxxx
IMAGE_PORT_API=3333
IMAGE_PORT_STEAM=7777
FIRST_IMAGE_API_ACCESS_TOKEN=xxxx
FROM_EMAIL_ADDRESS=user@example.xx
SMTP_PORT=465
SMTP_HOST=smtp.example.xx
SMTP_USERNAME=USERNAME
SMTP_PASSWORD=PASSWORD

#auth
AUTH_DB_NAME=auth
AUTH_PORT=4000
AUTH_APP_URL=http://localhost:4000
AUTH_MAIL_FROM_NAME=`Authenticatie Openstad`
AUTH_MAIL_FROM_MAIL=`auth@openstad.org`
AUTH_INTERNAL_SERVER_URL=http://localhost:4000

# this wont work for images if it's a localhost of course,
# when practically necessary I normally just take staging url
# would be better to embed images would render this unnecessary
AUTH_EMAIL_ASSETS_URL=http://localhost:4000

#frontend
FRONTED_PORT=4444
#makes a database for the first site
FRONTED_DEFAULT_MONGO_DB=default_db

#allows to connect to API as admin user
#FRONTEND_SITE_API_KEY=123456
FRONTEND_URL=http://localhost:4444
FRONTEND_APOS_WORKFLOW=ON
#this is for the /login route but not used anymore in new verions
FRONTEND_LOGIN_CSM_BASIC_AUTH_USER=me
FRONTEND_LOGIN_CSM_BASIC_AUTH_PASSWORD=password

#the api calls are made over internal network, for docker or live systems this can be over the internal network to reduce network latency
FRONTEND_INTERNAL_API_URL=http://localhost:8111
#redirects are done through browser that need to go over public network
FRONTEND_API_URL=http://localhost:8111
FRONTEND_MONGO_SCHEME=mongodb://localhost
FRONTEND_MONGO_DB_HOST=localhost
FRONTEND_MONGO_PORT=27017
FRONTEND_MINIFY_JS=OFF
FRONTEND_SITE_API_KEY=xxxxxxx

#GENERATION VALUES, these are used for generating values in migration
#this will set these values to the first client if you run the auth seed, AUTH_FIRST_CLIENT_LOGIN_CODE will be the first login code
AUTH_FIRST_CLIENT_ID=cccccc
AUTH_FIRST_CLIENT_SECRET=xxxxxxxx
AUTH_FIRST_CLIENT_URL=xxxxxxxx
AUTH_FIRST_CLIENT_LOGIN_CODE=test_openstad

AUTH_ADMIN_CLIENT_ID=bbbbb
AUTH_ADMIN_CLIENT_SECRET=xcxcxc
ADMIN_BASIC_AUTH_USER=user
ADMIN_BASIC_AUTH_PASSWORD=pass

#admin
ADMIN_PORT=7777
ADMIN_URL=http://localhost:7777
FORCE_HTTP=true
SERVER_IP=IPNUMBER
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ npm-debug.log
node_modules
.jshintrc
.env
.idea/
store.json
tmp
nginx.config.example
25 changes: 15 additions & 10 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
[submodule "frontend"]
path = frontend
url = https://github.com/Amsterdam/openstad-frontend
path = openstad-frontend
url = https://github.com/openstad/openstad-frontend
branch = master
[submodule "api"]
path = api
url = https://github.com/Amsterdam/openstad-api
path = openstad-api
url = https://github.com/openstad/openstad-api
branch = master
[submodule "auth"]
path = auth
url = https://github.com/Amsterdam/openstad-oauth2-server
path = openstad-oauth-server
url = https://github.com/openstad/openstad-oauth2-server
branch = master
[submodule "image"]
path = image
url = https://github.com/Amsterdam/openstad-image-server
path = openstad-image-server
url = https://github.com/openstad/openstad-image-server
branch = master
[submodule "admin"]
path = admin
url = https://github.com/Amsterdam/openstad-management-panel
path = openstad-management-panel
url = https://github.com/openstad/openstad-management-panel
branch = master
20 changes: 20 additions & 0 deletions .gitmodules.nieuw
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[submodule "frontend"]
path = openstad-frontend
url = https://github.com/openstad/openstad-frontend
branch = master
[submodule "api"]
path = openstad-api
url = https://github.com/openstad/openstad-api
branch = master
[submodule "auth"]
path = openstad-oauth-server
url = https://github.com/openstad/openstad-oauth2-server
branch = master
[submodule "image"]
path = openstad-image-server
url = https://github.com/openstad/openstad-image-server
branch = master
[submodule "admin"]
path = openstad-management-panel
url = https://github.com/openstad/openstad-management-panel
branch = master
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
> [!WARNING]
> This project has been migrated to a new **monorepo** and is no longer maintained here.
> Please visit the new repository: [openstad/openstad-headless](https://github.com/openstad/openstad-headless)
>
> More information: [openstad.org](https://openstad.org/)

# Getting started

See Openstad docs for getting started instructions: https://docs.openstad.amsterdam/technical/getting-started.html
See Openstad docs for getting started instructions: https://docs.openstad.org/openstad/technical/getting-started
1 change: 0 additions & 1 deletion admin
Submodule admin deleted from 9a4a4b
1 change: 0 additions & 1 deletion api
Submodule api deleted from 852581
42 changes: 21 additions & 21 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,28 @@ const { objectToAline } = require('./utils.js');

// commands list
const commands = [
{
name: 'Frontend',
command: `cd ./frontend && ${objectToAline(frontendConfig)} npm run dev`
},
{
name: 'Api',
command: `cd ./api && ${objectToAline(apiConfig)} npm run dev`
},
{
name: 'Admin',
command: `cd ./admin && ${objectToAline(adminConfig)} npm run dev`
},
{
name: 'Image',
command: `cd ./image && ${objectToAline(imageConfig)} node server.js`
},
{
name: 'Auth',
command: `cd ./auth && ${objectToAline(authConfig)} npm run dev`
},
// {
// name: 'Frontend',
// command: `cd ./openstad-frontend && ${objectToAline(frontendConfig)} npm run dev`
// },
// {
// name: 'Api',
// command: `cd ./openstad-api && ${objectToAline(apiConfig)} npm run dev`
// },
// {
// name: 'Admin',
// command: `cd ./openstad-management-panel && ${objectToAline(adminConfig)} npm run dev`
// },
// {
// name: 'Image',
// command: `cd ./image-server && ${objectToAline(imageConfig)} node server.js`
// },
{
name: 'Auth',
command: `cd ./openstad-management-panel && ${objectToAline(adminConfig)} npm run dev`
},
];


// run command
function runCommand(command, name, callback) {
child_process.exec(command, function (error, stdout, stderr) {
Expand All @@ -44,6 +43,7 @@ function runCommand(command, name, callback) {

async function execWaitForOutput(command, execOptions = {}) {
return new Promise((resolve, reject) => {
console.log('++++', adminConfig);
const childProcess = exec(command, execOptions);

// stream process output to console
Expand Down
1 change: 0 additions & 1 deletion auth
Submodule auth deleted from b1efe8
6 changes: 3 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
require('dotenv').config();

exports.frontendConfig = {
PORT: process.env.FRONTED_PORT,
PORT: process.env.FRONTEND_PORT,
DB_HOST: process.env.FRONTEND_MONGO_DB_HOST,
DB_PORT: process.env.FRONTEND_MONGO_PORT,
MONGO_DB_HOST: process.env.FRONTEND_MONGO_DB_HOST,
APOS_ALWAYS_COPY_ASSETS: '1',
APOS_WORKFLOW: process.env.FRONTEND_APOS_WORKFLOW,
DEFAULT_DB: process.env.FRONTED_DEFAULT_MONGO_DB,
DEFAULT_DB: process.env.FRONTEND_DEFAULT_MONGO_DB,
IMAGE_API_URL: process.env.IMAGE_APP_URL,
IMAGE_API_ACCESS_TOKEN: process.env.IMAGE_API_ACCESS_TOKEN,
INTERNAL_API_URL: process.env.FRONTEND_INTERNAL_API_URL,
Expand Down Expand Up @@ -81,7 +81,7 @@ exports.authConfig = {
COOKIE_SECURE_OFF: process.env.COOKIE_SECURE_OFF,
AUTH_FIRST_CLIENT_ID: process.env.AUTH_FIRST_CLIENT_ID,
AUTH_FIRST_CLIENT_SECRET: process.env.AUTH_FIRST_CLIENT_SECRET,
AUTH_FIRST_CLIENT_URL: process.env.FRONTED_URL,
AUTH_FIRST_CLIENT_URL: process.env.FRONTEND_URL,
AUTH_FIRST_CLIENT_LOGIN_CODE: process.env.AUTH_FIRST_CLIENT_LOGIN_CODE,
MONGO_DB_HOST: process.env.FRONTEND_MONGO_DB_HOST,
MONGO_DB_PORT: process.env.FRONTEND_MONGO_PORT,
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ services:
COOKIE_SECURE_OFF: "${COOKIE_SECURE_OFF}"
AUTH_FIRST_CLIENT_ID: "${AUTH_FIRST_CLIENT_ID}"
AUTH_FIRST_CLIENT_SECRET: "${AUTH_FIRST_CLIENT_SECRET}"
AUTH_FIRST_CLIENT_URL: "${FRONTED_URL}"
AUTH_FIRST_CLIENT_URL: "${FRONTEND_URL}"
AUTH_FIRST_CLIENT_LOGIN_CODE: "${AUTH_FIRST_CLIENT_LOGIN_CODE}"
MONGO_DB_HOST: "${FRONTEND_MONGO_DB_HOST}"
MONGO_DB_PORT: "${FRONTEND_MONGO_PORT}"
Expand Down Expand Up @@ -176,15 +176,15 @@ services:
command: npm run dev
build: frontend
ports:
- ${FRONTED_PORT}:${FRONTED_PORT}
- ${FRONTEND_PORT}:${FRONTEND_PORT}
environment:
PORT: "${FRONTED_PORT}"
PORT: "${FRONTEND_PORT}"
DB_HOST: "${FRONTEND_MONGO_DB_HOST}"
DB_PORT: "${FRONTEND_MONGO_PORT}"
MONGO_DB_HOST: "${FRONTEND_MONGO_DB_HOST}"
APOS_ALWAYS_COPY_ASSETS: '1'
APOS_WORKFLOW: "${FRONTEND_APOS_WORKFLOW}"
DEFAULT_DB: "${FRONTED_DEFAULT_MONGO_DB}"
DEFAULT_DB: "${FRONTEND_DEFAULT_MONGO_DB}"
IMAGE_API_URL: "${IMAGE_APP_URL}"
IMAGE_API_ACCESS_TOKEN: "${IMAGE_API_ACCESS_TOKEN}"
INTERNAL_API_URL: "${FRONTEND_INTERNAL_API_URL}"
Expand Down
1 change: 0 additions & 1 deletion frontend
Submodule frontend deleted from 833e21
1 change: 0 additions & 1 deletion image
Submodule image deleted from 171bee
1 change: 1 addition & 0 deletions openstad-api
Submodule openstad-api added at a457db
1 change: 1 addition & 0 deletions openstad-frontend
Submodule openstad-frontend added at 9fdab4
1 change: 1 addition & 0 deletions openstad-image-server
Submodule openstad-image-server added at c43175
1 change: 1 addition & 0 deletions openstad-management-panel
1 change: 1 addition & 0 deletions openstad-oauth-server
Submodule openstad-oauth-server added at 5ee398
Loading