Compare commits

...

75 Commits

Author SHA1 Message Date
Leopere
42050dc078
Update README.md
updated demo url
2023-10-13 13:49:50 -04:00
Michael Schramm
ffe74eafcd
Merge pull request #182 from ru2saig/master
Updated install link for node-prune
2023-08-25 12:18:35 +02:00
Michael Schramm
10db1541c2 fix node prune location
fixes https://github.com/ohmyform/ohmyform/issues/184
2022-07-28 08:02:14 +02:00
Michael Schramm
2a9ef35ef2
Update CHANGELOG.md 2022-07-04 14:09:47 +02:00
Michael Schramm
405fb04ce6
Merge pull request #185 from joebailey26/patch-1
Fixed typo
2022-07-04 14:08:28 +02:00
Joe Bailey
a7d64bac79
Fixed typo 2022-06-09 09:03:09 +01:00
ru2saig
ee962f9afa Updated install link for node-prune 2022-05-23 00:49:08 +05:30
Michael Schramm
bef2eb7344 release 1.0.3 2022-03-27 20:24:54 +02:00
Michael Schramm
ed3d0e7392 release 1.0.3 2022-03-27 20:24:28 +02:00
Michael Schramm
deb81d2164
Update CHANGELOG.md 2022-03-16 16:32:17 +01:00
Michael Schramm
b6c651e47f
Merge pull request #167 from spencerflagg/master
Added minimal config example for Caddy server
2022-03-16 16:31:39 +01:00
Spencer Flagg
9887d1a898
Added minimal config example for Caddy server 2022-03-16 14:52:57 +01:00
Michael Schramm
701f43c98f release 1.0.2 2022-03-13 23:48:01 +01:00
Michael Schramm
912be0bc38 changed docker restart policy 2022-03-13 23:39:46 +01:00
Michael Schramm
9c58d92aee release 1.0.1 2022-03-01 23:43:45 +01:00
Michael Schramm
2cd3bd0e1d fix docker build 2022-02-28 09:08:10 +01:00
Michael Schramm
13ceb1fe52 add libc6-compat 2022-02-28 08:41:42 +01:00
Michael Schramm
6c34e65c3b upgrade to node 16 2022-02-28 08:37:52 +01:00
Michael Schramm
17ce7328bb update changelog for version 1.0.0 2022-02-28 08:34:29 +01:00
Michael Schramm
30de61172a update submodules 2022-02-13 23:14:24 +01:00
Michael Schramm
d3ec553b33 update submodules 2022-02-13 22:37:48 +01:00
Michael Schramm
4537b35c6b fix combined image 2022-01-13 16:47:35 +01:00
Michael Schramm
3ad5c4e86b update to latest api 2022-01-13 14:50:00 +01:00
Michael Schramm
2e47aaf645 update ui to latest 2022-01-03 20:19:09 +01:00
Michael Schramm
5ac5d3a6be update github actions 2022-01-03 14:36:47 +01:00
Michael Schramm
8de3d59d04 update github actions 2022-01-03 14:34:16 +01:00
Michael Schramm
bf575badb0 test new tags 2022-01-03 13:08:34 +01:00
Michael Schramm
3fcde897b7 update api and ui and fix env 2022-01-03 00:58:36 +01:00
Michael Schramm
52ddbc72f7
Merge pull request #148 from real-or-random/patch-1
don't mkdir /run/nginx if it exists
2022-01-02 16:16:35 +01:00
Tim Ruffing
1866b3054c
don't mkdir /run/nginx if it exists
Fixes #147.
2021-12-07 23:40:15 +01:00
Michael Schramm
4eb162b8e0 fix example env variable names
https://github.com/ohmyform/ohmyform/issues/134
2021-05-07 00:32:49 +02:00
Michael Schramm
feff3056a5 fix problem with node-prune on production build 2021-05-06 20:12:03 +02:00
Michael Schramm
e05c36c26a update ui to include improvements on api connection error and side menu once logged in 2021-05-04 18:31:19 +02:00
Michael Schramm
596999193a update api to apply version fix 2021-05-04 18:06:36 +02:00
Michael Schramm
d71bd22924 upgrade refs to latest version 2021-05-02 18:38:15 +02:00
Michael Schramm
a4454fa6ad update minimal example to not even require db 2021-05-02 18:37:46 +02:00
Michael Schramm
861b6aa951 update texts 2021-05-02 16:26:28 +02:00
Michael Schramm
5414f3b371 - switched to supervisord based combined container
- heroku deployments
2021-05-02 15:53:01 +02:00
Michael Schramm
46760ae135 remove email and password from heroku deploy 2021-05-02 14:07:35 +02:00
Michael Schramm
fa11cb1214 theoretical fix for heroku deployments 2021-05-02 14:04:25 +02:00
Michael Schramm
97441902a6 update ref to release 0.9.9 2021-02-14 14:20:04 +01:00
Michael Schramm
6ef9b8e52c
Merge pull request #120 from patcon/patch-1
Correct opencollective Sponsor link.
2021-01-07 07:19:12 +01:00
Patrick Connolly
27682231b7
Correct opencollective Sponsor link. 2020-11-15 14:04:30 -05:00
Michael Schramm
ca5e5a7714
Update CHANGELOG.md 2020-10-09 08:59:15 +02:00
Michael Schramm
adafe06c11
Merge pull request #118 from kmjayadeep/node-upgrade
upgrade node version to 14
2020-10-09 08:57:36 +02:00
Jayadeep KM
17c09b0853 add vesion 12 and 14 to node engine in package.json 2020-10-09 12:25:50 +05:30
Jayadeep KM
9ee877f3e6 upgrade node version for api and ui 2020-10-09 12:09:20 +05:30
Jayadeep KM
46816290fc upgrade node production and build stage versions to 14 2020-10-09 11:48:37 +05:30
Jayadeep KM
79e25a6d52 upgrade node version to 14 2020-10-09 11:46:09 +05:30
Michael Schramm
e4a9088014 fix dependency 2020-09-18 17:34:14 +02:00
Michael Schramm
7b4b772acc fix dependency 2020-09-18 17:29:42 +02:00
Michael Schramm
04dd4abb77 prepare 0.9.8 release 2020-09-02 11:31:32 +02:00
Michael Schramm
4387f48dc8 prepare 0.9.8 release 2020-09-02 11:26:25 +02:00
Michael Schramm
6e1f2b7edb update changelog for 0.9.6 2020-07-17 10:39:15 +02:00
Leopere
6e7194d64b
Correcting FUNDING.yml 2020-07-08 10:05:17 -04:00
Michael Schramm
59d59eb048 reduce docker layer size 2020-06-16 10:45:52 +02:00
Michael Schramm
034da458be
Merge pull request #98 from jmhbnz/master
Switched to non root user
2020-06-16 09:25:07 +02:00
James Blair
c6360ce3be Corrected ownership of schema file. 2020-06-16 19:18:21 +12:00
James Blair
d67a780185 Reverted "Corrected ownership of schema file."
This reverts commit b36a73afdb8ced00c7f1764de541ebf8f8868806.
2020-06-16 19:15:58 +12:00
James Blair
b36a73afdb Corrected ownership of schema file. 2020-06-16 19:12:18 +12:00
James Blair
97af16862a Applied #97 suggested dockerfile. 2020-06-16 18:52:24 +12:00
James Blair
961ff38eb5 Switched to non root user and alpine. 2020-06-16 18:21:17 +12:00
Michael Schramm
4d27b928d8 update changelog 2020-06-11 18:31:15 +02:00
Michael Schramm
e72dcbda9f add demo links and fix setting.service 2020-06-11 12:15:31 +02:00
Michael Schramm
5be5edcc71 add link to dockerhub 2020-06-11 10:42:01 +02:00
Michael Schramm
17908af385 add changelog for 0.9.4 release 2020-06-09 18:22:09 +02:00
Michael Schramm
0ea7aa9bf3 update to latest ui 2020-06-09 18:07:46 +02:00
Michael Schramm
b3d7f26b41 show current ref in heroku 2020-06-09 17:19:25 +02:00
Michael Schramm
40da6a3c3a use latest settings call 2020-06-09 16:50:07 +02:00
Michael Schramm
558306ed6b update api and ui 2020-06-09 16:41:37 +02:00
Michael Schramm
411c2c2987 update readme with status badges 2020-06-09 11:55:19 +02:00
Michael Schramm
0fe0ea3489 add general changelog 2020-06-04 16:30:30 +02:00
Michael Schramm
8501b26511 update dependencies 2020-06-04 15:57:53 +02:00
Michael Schramm
a9fbe35fae fix mongodb persistence path 2020-06-04 11:59:50 +02:00
Michael Schramm
8616f69ff6 add a few more examples 2020-06-04 11:48:33 +02:00
25 changed files with 718 additions and 97 deletions

View File

@ -5,6 +5,7 @@ data
docker
node_modules
selenium
examples
.all-contributorsrc
.csslintrc
.editorconfig
@ -18,3 +19,11 @@ docker-compose.yml
Dockerfile
Procfile
protractor.conf.js
pg_data
ui/.next
ui/node_modules
api/node_modules
api/pg_data
api/data
api/maria_data
api/dist

20
.github/FUNDING.yml vendored
View File

@ -1,12 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: ohmyform
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: Leopere
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://patron.ohmyform.com
# github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
# patreon: # Replace with a single Patreon username
open_collective: ohmyform-sustainability
# ko_fi: # Replace with a single Ko-fi username
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
# liberapay: Leopere
# issuehunt: # Replace with a single IssueHunt username
# otechie: # Replace with a single Otechie username
# custom: https://patron.ohmyform.com

45
.github/workflows/docker-image.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: Docker Image CI
on:
push:
branches:
- master
release:
types:
- published
jobs:
build:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
submodules: true
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ohmyform/ohmyform
tags: |
type=raw,value=latest
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

3
.gitignore vendored
View File

@ -61,6 +61,9 @@ local.properties
.c9/
data/
mongod
pg_data
maria
*.sqlite
# General
# =======

228
CHANGELOG.md Normal file
View File

@ -0,0 +1,228 @@
# Change Log
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
<!--
Template for next version
## [Unreleased]
### Added
### Changed
### Fixed
### Security
-->
## [Unreleased]
### Added
### Changed
### Fixed
* Fixed typo https://github.com/ohmyform/ohmyform/pull/185
* node prune location (https://github.com/ohmyform/ohmyform/issues/184)
### Security
## [1.0.3] - 2022-03-27
### Updates
* https://github.com/ohmyform/api/releases/tag/1.0.3
* https://github.com/ohmyform/ui/releases/tag/1.0.3
### Added
* minimal configuration example for caddy server (https://github.com/ohmyform/ohmyform/pull/167)
## [1.0.2] - 2022-03-13
### Updates
* https://github.com/ohmyform/api/releases/tag/1.0.2
* https://github.com/ohmyform/ui/releases/tag/1.0.2
### Changed
- docker restart policy (https://github.com/ohmyform/ohmyform/issues/164)
## [1.0.1] - 2022-03-01
### Updates
* https://github.com/ohmyform/api/releases/tag/1.0.1
* https://github.com/ohmyform/ui/releases/tag/1.0.1
## [1.0.0] - 2022-02-28
### Updates
* https://github.com/ohmyform/api/releases/tag/1.0.0
* https://github.com/ohmyform/ui/releases/tag/1.0.0
### Changed
- switched to supervisord based combined container
- upgrade to node 16
### Fixed
- heroku deployments
- fix problem with node-prune on production build
- variable names in examples (https://github.com/ohmyform/ohmyform/issues/134)
- error if /run/nginx already exists (https://github.com/ohmyform/ohmyform/pull/148)
- fix combine images
## [0.9.9] - 2021-02-14
### Added
- Submission export
- Lokalize reference
- more languages
### Changed
- updated french translations by @Vercety87
- upgrade to node 14 (https://github.com/ohmyform/ohmyform/issues/99)
### Fixed
- missing dependency to @apollo/client
- footer rendering during authentication check
### Security
- authentication check for profile page
## [0.9.8] - 2020-09-02
### Changed
- improved german translation (https://github.com/ohmyform/ui/pull/28)
### Fixed
- colors for landing page buttons
- menu selection type
### Security
- upgraded dependencies
## [0.9.6] - 2020-07-17
### Added
- slug for fields to be able to set value by url parameter
- form submission hokks
- default index.html for api without bundled ui
- slug for form fields can now be saved
- submission webhooks with ability to customize json payload
```
{
form: ID
submission: ID
created: DateTime
lastModified: DateTime
fields: [
{
field: ID
slug: String
value: any
}
]
}
```
### Changed
- minify containers to reduce layer size
### Fixed
- bug in settings resolver with nullable fields
- bug if user was deleted and form still exists
- do not show login note if it is not set
- typo in dropdown options https://github.com/ohmyform/ohmyform/issues/96
- query parms are not parsed https://github.com/ohmyform/ui/pull/27 https://github.com/ohmyform/ohmyform/issues/100
- errors because of missing user reference (https://github.com/ohmyform/ohmyform/issues/102)
### Security
- container now runs as non root user
## [0.9.5] - 2020-06-10
### Added
- `DEFAULT_ROLE` -> `admin` | `superuser` | `user` - with `user` being the default, making it possible that new users can create their own forms after creating
- `LOGIN_NOTE` -> markdown for Login Page, to show info text on login page
- `HIDE_CONTRIB` -> ability to hide contribution banner
- mobile improvements for lists and home page
- markdown support for page paragraphs and field description
- hideable omf badge
- login notes
- username in admin toolbar
- github stars in multiple places
### Changed
- verified spanish translations https://github.com/ohmyform/ui/pull/23
### Fixed
- di on setting resolver, prevented signup settings to be visible in ui
- return admin of form also for admins
- yes / no field fixed on admin and user view
- prev property error on div
- rating field default on admin
- number field defaults
- translations for field validation
- number validation
- side menu only shows accessible entries
## [0.9.4] - 2020-06-09
### Added
- Fetch Server Settings to determine if signup is available
- `SPA` env variable to have static page with loading spinner before redirect
- `de`, `fr`, `es`, `it`, `cn` base folders for translations
- finish translating `de` and `en`
- add `yarn translation:sort` to order translations (to ensure the same order
when we add / change translations)
- add `yarn translation:missing <lang>` to print a list of missing translations
for the given language (this takes `en` as a baseline)
- travis for tests
- eslint with prettier
- `SIGNUP_DISABLED=true` to prevent users from signing up
### Changed
- `export` uses now spa mode for initial loading screen
### Fixed
- [OMF#93](https://github.com/ohmyform/ohmyform/issues/93) dropdown options are not saved
- redirect attempts on static export
- startup error with invalid create admin config
## [0.9.3] - 2020-06-04
### Added
- nginx example
- load balanced example
- minimal example
### Fixed
- docker-compose mongo data dir to persist data

View File

@ -13,6 +13,10 @@
<!-- /TOC -->
## Translating
You can help us [translate](https://app.lokalise.com/public/379418475ede5d5c6937b0.31012044/) ever part of OhMyForm, when you want to add a new language please write either in discord or create a new issue.
## Report issues
You can [create issues](https://github.com/ohmyform/ohmyform/issues/new) to report bug or request feature.

View File

@ -1,30 +1,73 @@
FROM node:12 as builder
## Build UI
FROM node:16-alpine as ui
WORKDIR /usr/src/app
WORKDIR /usr/src/ui
RUN apk --update --no-cache add curl bash g++ make libpng-dev
# install node-prune (https://github.com/tj/node-prune)
RUN curl -sf https://gobinaries.com/tj/node-prune | sh
COPY ui/ .
RUN yarn install --frozen-lockfile
RUN yarn export
RUN yarn build
FROM node:12
# remove development dependencies
RUN npm prune --production
# run node prune
# there is some problem running node prune that then prevents the frontend to load (just start with /form/1 and it will crash)
#RUN /usr/local/bin/node-prune
## Build API
FROM node:16-alpine as api
LABEL maintainer="OhMyForm <admin@ohmyform.com>"
WORKDIR /usr/src/app
WORKDIR /usr/src/api
RUN apk --update --no-cache add curl bash g++ make libpng-dev
# install node-prune (https://github.com/tj/node-prune)
RUN curl -sf https://gobinaries.com/tj/node-prune | sh
COPY api/ .
COPY --from=builder /usr/src/app/out /usr/src/app/public
RUN touch /usr/src/api/src/schema.gql && chown 9999:9999 /usr/src/api/src/schema.gql
RUN yarn install --frozen-lockfile
RUN yarn build
ENV PORT=3000 \
SECRET_KEY=ChangeMe \
# remove development dependencies
RUN npm prune --production
# run node prune
RUN /usr/local/bin/node-prune
## Production Image.
FROM node:16-alpine
RUN apk --update add supervisor nginx && rm -rf /var/cache/apk/*
WORKDIR /usr/src
COPY --from=api /usr/src/api /usr/src/api
COPY --from=ui /usr/src/ui /usr/src/ui
RUN addgroup --gid 9999 ohmyform && adduser -D --uid 9999 -G ohmyform ohmyform
ENV SECRET_KEY=ChangeMe \
CREATE_ADMIN=FALSE \
ADMIN_EMAIL=admin@ohmyform.com \
ADMIN_USERNAME=root \
ADMIN_PASSWORD=root
ADMIN_PASSWORD=root \
NODE_ENV=production
EXPOSE 3000
CMD [ "yarn", "start:prod" ]
RUN mkdir -p /run/nginx/
RUN touch /usr/src/supervisord.log && chmod 777 /usr/src/supervisord.log
COPY supervisord.conf /etc/supervisord.conf
COPY nginx.conf /etc/nginx/nginx.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
# CMD [ "yarn", "start:prod" ]

View File

@ -1,34 +1,30 @@
![OhMyForm](public/logo.png)
# OhMyForm 0.9.1
# OhMyForm
<!-- TODO: Code Shelter maybe. -->
<!-- [![Code Shelter](https://www.codeshelter.co/static/badges/badge-flat.svg)](https://www.codeshelter.co/) -->
<!-- TODO: Travis CI maybe. -->
<!-- [![Build Status](https://travis-ci.org/ohmyform/ohmyform.svg?branch=master)](https://travis-ci.org/ohmyform/ohmyform) -->
[![Financial Contributors on Open Collective](https://opencollective.com/ohmyform-sustainability/all/badge.svg?label=financial+contributors)](https://opencollective.com/ohmyform-sustainability)
![Project Status](https://img.shields.io/badge/status-0.9.1-green.svg)
<!-- TODO: Codeacy maybe. -->
<!-- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3491e86eb7194308b8fc80711d736ede)](https://www.codacy.com/app/david-baldwin/ohmyform?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ohmyform/ohmyform&amp;utm_campaign=Badge_Grade) -->
<!--
Moving over to Discord so that I can manage things without hassle.
[![Gitter](https://badges.gitter.im/ohmyform/Lobby.svg)](https://gitter.im/ohmyform/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
-->
<!-- TODO: Get ohmyform.com/examples to have some. -->
[![Discord](https://img.shields.io/discord/595773457862492190.svg?label=Discord%20Chat)](https://discord.gg/nWbrjtz)
> An *open source alternative to TypeForm* that can create stunning mobile-ready forms, surveys and questionnaires.
![Project Status](https://badgen.net/github/checks/ohmyform/ohmyform)
![Latest Release](https://badgen.net/github/tag/ohmyform/ohmyform)
[![Docker Pulls](https://badgen.net/docker/pulls/ohmyform/ohmyform)](https://hub.docker.com/r/ohmyform/ohmyform)
[![Lokalise](https://badgen.net/badge/Lokalise/EN/green?icon=libraries)](https://app.lokalise.com/public/379418475ede5d5c6937b0.31012044/)
![Last Commit](https://badgen.net/github/last-commit/ohmyform/ohmyform)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/ohmyform/ohmyform/tree/master)
[Demo](https://demo.ohmyform.org/) Username and password are just `demo`. We will reset the demo instance at least once for every new release and possibly more often so don't rely on it for sending actual forms expect no notice for resets.
> An *open source alternative to TypeForm* that can create stunning mobile-ready forms, surveys and questionnaires.
[![Discord](https://img.shields.io/discord/595773457862492190.svg?label=Discord%20Chat)](https://discord.gg/MJqAuAZ)
[![Financial Contributors on Open Collective](https://opencollective.com/ohmyform-sustainability/all/badge.svg?label=financial+contributors)](https://opencollective.com/ohmyform-sustainability)
## Table of Contents
<!-- TOC depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
- [OhMyForm 0.9.1](#ohmyform-091)
- [OhMyForm](#ohmyform-091)
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Currently following features are implemented:](#currently-following-features-are-implemented)
- [On the Roadmap for v1.0.0](#on-the-roadmap-for-v100)
- [On the Roadmap](#on-the-roadmap)
- [How to Contribute](#how-to-contribute)
- [Quickstart](#quickstart)
- [Where to get help](#where-to-get-help)
@ -37,29 +33,30 @@ Moving over to Discord so that I can manage things without hassle.
## Features
### Currently following features are implemented:
- Multi-Language Support (Semi implemented)
- Multi-Language Support
- 11 possible question types
- Editable start and end pages
- Export Submissions to XLS, JSON or CSV
- Native Analytics and Google Analytics Support
- Custom Subdomains for each User
- Embeddable Forms
- Forms as a Service API
- Customizable Notifications on Form Submission
- Web Hooks on Form Submission
- Deployable with Heroku and DockerHub
- PostgreSQL and sqlite
<!-- TODO: Determine roadmap for OhMyForm if it is to be different from OhMyForm's roadmap. -->
<!-- ### On the Roadmap (Tentative pending [refactor](https://github.com/ohmyform/ohmyform/pull/1)) -->
### On the Roadmap for v1.0.0
### On the Roadmap
- Custom Subdomains for each User
- Implement encryption for all form data
- Add Typeform API integration
- Add plugin/3rd party integration support (ala Slack)
- Add plugin/3rd party integration support (aka Slack)
- Create wiki for easy installation and setup
- Add Stripe/Payment Form field
- Add Custom Background and Dropdown Field Images
- Add File Upload Form Field
- Deployable with Heroku and DockerHub
- Ditch MongoDB for a drop in replacement with better licensing.
@ -72,7 +69,13 @@ Please checkout our [contributing guide](CONTRIBUTING.md) on ways to contribute
Follow documentation hosted on [OhMyForm.com](http://ohmyform.com/docs/install/) it will be the main and hopefully only location to obtain the up to date documentation.
if you pull the repository do not forget to execute: `git submodule update --init`
If you pull the repository do not forget to execute: `git submodule update --init`
### Some technical Insights
[API](https://github.com/ohmyform/api/tree/master/doc)
[UI](https://github.com/ohmyform/ui/tree/master/doc)
## Where to get help
@ -95,7 +98,7 @@ Become a financial contributor and help us sustain our community. [[Contribute](
#### Individuals
[![Individuals](https://opencollective.com/static/images/opencollective-og-default.png?width=890)](https://opencollective.com/ohmyform-sustainability)
[![Individuals](https://opencollective.com/static/images/opencollective-og-default.png)](https://opencollective.com/ohmyform-sustainability)
#### Organizations
@ -104,4 +107,7 @@ Support this project with your organization. Your logo will show up here with a
[![](https://opencollective.com/ohmyform-sustainability/organization/0/avatar.svg)](https://opencollective.com/ohmyform-sustainability/organization/0/website)
[![](https://opencollective.com/ohmyform-sustainability/organization/1/avatar.svg)](https://opencollective.com/ohmyform-sustainability/organization/1/website)
[![](https://opencollective.com/ohmyform-sustainability/organization/2/avatar.svg)](https://opencollective.com/ohmyform-sustainability/organization/2/website)
[![](https://opencollective.com/ohmyform-sustainability/organization/3/avatar.svg)](https://opencollective.com/ohmyform-sustainability/organization/2/website)
[![](https://opencollective.com/ohmyform-sustainability/organization/4/avatar.svg)](https://opencollective.com/ohmyform-sustainability/organization/2/website)
[![](https://opencollective.com/ohmyform-sustainability/organization/5/avatar.svg)](https://opencollective.com/ohmyform-sustainability/organization/2/website)

2
api

@ -1 +1 @@
Subproject commit c4e4d6d6959e20a7da38003c648d6d199c8a3ad3
Subproject commit c2c421baa6f41e4e6fb812fa2978956aaf7aa0dd

View File

@ -32,6 +32,10 @@
"description": "Username of your default admin account",
"value": "admin"
},
"LOGIN_NOTE": {
"description": "Note next to login form",
"value": "Welcome to your new OhMyForm instance, you can remove this login note in the dyno configuration!"
},
"ADMIN_PASSWORD": {
"description": "Password for your default admin account",
"value": ""
@ -47,10 +51,18 @@
"NPM_CONFIG_PRODUCTION": {
"description": "Allow Dev Dependencies so we can compile typescript",
"value": "false"
},
"DATABASE_DRIVER": {
"description": "Database Driver to use",
"value": "postgres"
},
"DATABASE_SSL": {
"description": "Use SSL Connection for database",
"value": "true"
}
},
"addons": [
"mongolab",
"heroku-postgresql",
"heroku-redis",
"mailtrap"
],

View File

@ -1,63 +1,39 @@
## TODO: add a compose examples directory with various deployment options.
# WARNING!! This is to build from source
# to use a version that is prebuilt copy one of the entries from the examples folder!
version: "3"
services:
redis:
image: redis
mongo:
image: mongo
volumes:
- "./data/mongo:/data"
ohmyform:
build: .
environment:
CREATE_ADMIN: "TRUE"
MONGODB_URI: mongodb://mongo/ohmyform
MAILER_URI: smtp://mail:1025
PORT: 5000
DATABASE_DRIVER: postgres
DATABASE_URL: postgresql://root:root@db:5432/ohmyform
LOGIN_NOTE: "login with root:root!"
SECRET_KEY: 12345
links:
- mongo
- db
- redis
- mail
ports:
- "5000:5000"
- "5200:3000"
depends_on:
- mongo
- db
- redis
# ui:
# image: ohmyform/ui
# environment:
# API_HOST: http://localhost:5100/graphql
# PORT: 5000
# ports:
# - "5000:5000"
# api:
# image: ohmyform/api
# environment:
# CREATE_ADMIN: "true"
# MONGODB_URI: mongodb://mongo/ohmyform
# MAILER_URI: smtp://mail:1025
# REDIS_URL: redis://redis
# PORT: 5000
# links:
# - mongo
# - redis
# - mail
# ports:
# - "5100:5000"
# depends_on:
# - mongo
# - redis
mail:
image: mailhog/mailhog
ports:
- "5050:8025"
mongoexpress:
image: mongo-express
- "5051:8025"
db:
image: postgres:10-alpine
volumes:
- ./pg_data:/var/lib/postgresql/data
environment:
ME_CONFIG_MONGODB_SERVER: mongo
ports:
- "5051:8081"
links:
- mongo
depends_on:
- mongo
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: ohmyform

View File

@ -0,0 +1,3 @@
mywebsite.com {
reverse_proxy ohmyform:3000
}

View File

@ -0,0 +1,41 @@
version: "3.9"
networks:
web:
external: true
internal:
external: false
driver: bridge
services:
caddy:
container_name: caddy
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /data/caddy/Caddyfile:/etc/caddy/Caddyfile
- /data/caddy/data:/data # Optional
- /data/caddy/config:/config # Optional
networks:
- web
- internal
ohmyform:
container_name: ohmyform
image: ohmyform/ohmyform
volumes:
- "./data:/data"
environment:
CREATE_ADMIN: "TRUE"
ADMIN_EMAIL: admin@local.host
ADMIN_USERNAME: admin
ADMIN_PASSWORD: admin
DATABASE_DRIVER: sqlite
DATABASE_URL: "sqlite:///data/data.sqlite"
MAILER_URI: smtp://local.host
LOGIN_NOTE: "Either login with admin:admin or create your own account to test OhMyForm"
restart: unless-stopped
networks:
- internal

View File

@ -0,0 +1,26 @@
# Load Balancing Config
## Required changes
`MAILER_URI` should be set to allow emails to be sent.
Further you have to setup a Load Balancer (more in the Configuration section)
## Configuration
for this setup it is important to have either an
ingress server that does load balancing on paths
or to expose the api on a different host.
If you expose the api on a different host do not forget
to change the API_HOST env variable on the ui
container to route the requests properly.
# AWS Cloudfront Ingress
both ui and api would run behind a load balancer.
the default path should then be routed to the ui container
and the /graphql path to the api container.

View File

@ -0,0 +1,43 @@
version: "3"
services:
redis:
image: redis
db:
image: postgres:10-alpine
volumes:
- ./pg_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: ohmyform
restart: unless-stopped
ui:
image: ohmyform/ui
environment:
ENDPOINT: http://localhost:8090/graphql
SERVER_ENDPOINT: http://api:5000/graphql
PORT: 5000
ports:
- "8080:5000"
restart: unless-stopped
api:
image: ohmyform/api
environment:
CREATE_ADMIN: "true"
ADMIN_EMAIL: admin@local.host
ADMIN_USERNAME: admin
ADMIN_PASSWORD: admin
DATABASE_DRIVER: postgres
DATABASE_URL: postgresql://root:root@db:5432/ohmyform
MAILER_URI: smtp://local.host
REDIS_URL: redis://redis
PORT: 5000
links:
- db
- redis
ports:
- "8090:5000"
depends_on:
- db
- redis
restart: unless-stopped

View File

@ -0,0 +1,10 @@
# Minimal Config
will start one omf container with mongodb, persisting data.
after startup you can access it at *:8080
## Required changes
`MAILER_URI` should be set to allow emails to be sent.

View File

@ -0,0 +1,18 @@
version: "3"
services:
ohmyform:
image: ohmyform/ohmyform
volumes:
- "./data:/data"
environment:
CREATE_ADMIN: "TRUE"
ADMIN_EMAIL: admin@local.host
ADMIN_USERNAME: admin
ADMIN_PASSWORD: admin
DATABASE_DRIVER: sqlite
DATABASE_URL: "sqlite:///data/data.sqlite"
MAILER_URI: smtp://local.host
LOGIN_NOTE: "Either login with admin:admin or create your own account to test OhMyForm"
ports:
- "8080:3000"
restart: unless-stopped

View File

@ -0,0 +1,9 @@
# Nginx Config
ServerSideRendering for the UI with configured Reverse Proxy (Nginx)
after startup you can access your page at *:8080, forms will be persisted between docker runs
## Required changes
`MAILER_URI` should be set to allow emails to be sent.

View File

@ -0,0 +1,16 @@
server {
listen 80;
location / {
proxy_pass http://ui:5000;
proxy_redirect off;
proxy_set_header Host $host;
}
location /graphql {
proxy_pass http://api:5000;
proxy_redirect off;
proxy_set_header Host $host;
}
}

View File

@ -0,0 +1,44 @@
version: "3"
services:
db:
image: postgres:10-alpine
volumes:
- ./pg_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: ohmyform
restart: unless-stopped
nginx:
image: nginx:alpine
volumes:
- "./default.conf:/etc/nginx/conf.d/default.conf"
ports:
- "8080:80"
depends_on:
- ui
- api
restart: unless-stopped
ui:
image: ohmyform/ui
environment:
SERVER_ENDPOINT: http://api:5000/graphql
PORT: 5000
restart: unless-stopped
api:
image: ohmyform/api
environment:
CREATE_ADMIN: "true"
ADMIN_EMAIL: admin@local.host
ADMIN_USERNAME: admin
ADMIN_PASSWORD: admin
DATABASE_DRIVER: postgres
DATABASE_URL: postgresql://root:root@db:5432/ohmyform
MAILER_URI: smtp://local.host
REDIS_URL: redis://redis
PORT: 5000
links:
- db
depends_on:
- db
restart: unless-stopped

54
nginx.conf Normal file
View File

@ -0,0 +1,54 @@
user nginx;
worker_processes 1;
error_log /dev/stderr debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format json_combined escape=json
'{'
'"time_local":"$time_local",'
'"remote_addr":"$remote_addr",'
'"remote_user":"$remote_user",'
'"request":"$request",'
'"status": "$status",'
'"body_bytes_sent":"$body_bytes_sent",'
'"request_time":"$request_time",'
'"http_referrer":"$http_referer",'
'"http_user_agent":"$http_user_agent"'
'}';
access_log /var/log/nginx/access.log json_combined;
server {
listen 3000;
location / {
proxy_pass http://localhost:4000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /graphql {
proxy_pass http://localhost:4100;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
}

View File

@ -1,4 +1,5 @@
{
"version": "1.0.3",
"name": "ohmyform",
"description": "Opensource alternative to TypeForm",
"homepage": "https://github.com/ohmyform/ohmyform",
@ -9,7 +10,7 @@
},
"engines": {
"yarn": "1.x",
"node": "12.x"
"node": "^12 || ^14 || ^16"
},
"scripts": {
"heroku-prebuild": "scripts/heroku/prebuild.sh",

View File

@ -3,6 +3,11 @@ echo "Fetch Submodules"
git clone --depth 1 https://github.com/ohmyform/ui ui
git clone --depth 1 https://github.com/ohmyform/api api
echo "UI ref is"
git --git-dir=ui/.git rev-parse HEAD
echo "API ref is"
git --git-dir=api/.git rev-parse HEAD
echo "Install UI"
yarn --cwd ui install --frozen-lockfile

25
supervisord.conf Normal file
View File

@ -0,0 +1,25 @@
[supervisord]
nodaemon=true
[program:ui]
directory=/usr/src/ui
command=yarn next start -p 4000
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/1
stderr_logfile_maxbytes=0
[program:api]
directory=/usr/src/api
command=yarn start:prod
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/1
stderr_logfile_maxbytes=0
[program:nginx]
command=nginx -g "daemon off;"
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/1
stderr_logfile_maxbytes=0

2
ui

@ -1 +1 @@
Subproject commit 2a34deafa52e2f2deb8009f07407f83a087c1e04
Subproject commit 011a6baef416bb9265f5172707bc21e7823c8086