Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with dongliu master #331

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2915dac
Docker instruction (#91)
dongliu Sep 12, 2021
efb0745
Merge branch 'master' of github.com:AdvancedPhotonSource/traveler int…
dongliu Sep 19, 2021
aaaeab6
Express update 87 (#95)
dongliu Oct 7, 2021
3cfb033
merge APS release 1.5.1 (#96)
dongliu Oct 7, 2021
86ca071
anon holder (#98)
dongliu Nov 9, 2021
35d0035
Form approval 89 (#97)
dongliu Nov 30, 2021
76bd764
101 edit review (#102)
dongliu Dec 18, 2021
1743d03
fix binder share table (#109)
dongliu Apr 22, 2022
0e70a3c
Pdf 88 fix (#110)
dongliu Jul 30, 2022
648d003
Archive 111 (#112)
dongliu Jul 30, 2022
bd5e3aa
json stringify variable in inline js (#113)
dongliu Jul 30, 2022
524e4c3
Path alias (#114)
dongliu Aug 2, 2022
200e7e9
convert to string (#115)
dongliu Aug 2, 2022
df6b884
do not load photo (#117)
dongliu Aug 7, 2022
f63817f
working only when status 0 (#118)
dongliu Aug 24, 2022
d2685d6
Import 119 (#122)
dongliu Sep 11, 2022
50d75cd
Fix form config 104 (#123)
dongliu Nov 7, 2022
c8544be
New datatable 103 (#124)
dongliu Nov 7, 2022
1e72f42
match with exact full name and eslint (#126)
dongliu Nov 13, 2022
5b79219
Reviewer 125 (#127)
dongliu Dec 5, 2022
9743321
Status 129 (#132)
dongliu Jan 31, 2023
c3d07a6
Binder 128 (#131)
dongliu Jan 31, 2023
45e29a4
Binder 130 (#133)
dongliu Jan 31, 2023
590c852
merge from aps 2bb7649 (#137)
dongliu Feb 21, 2023
b72fe1c
Traveler 106 (#134)
dongliu Feb 21, 2023
37f36e1
Revert "Traveler 106 (#134)" (#138)
dongliu Feb 21, 2023
66eae6d
Revert "merge from aps 2bb7649 (#137)" (#139)
dongliu Feb 21, 2023
5c51579
Merge more apis (#140)
dongliu Feb 22, 2023
3ae33d6
Traveler 106 (#141)
dongliu Feb 22, 2023
2f93d75
list transferred form under review, only draft in transferred, allow …
dongliu Mar 29, 2023
7b95de9
clone from correct base (#145)
dongliu Apr 13, 2023
2f9f31c
Template version (#151)
dongliu Apr 30, 2023
f766097
Doc 02 2023 (#152)
dongliu Jun 3, 2023
d81e164
support form and traveler permissions and fix typo (#153)
dongliu Jun 3, 2023
493d251
Binder 147 (#154)
dongliu Jun 3, 2023
42daf5e
Binder 149 (#157)
dongliu Jun 18, 2023
2bc61bc
Binder 148 (#158)
dongliu Jul 1, 2023
71e94fc
Radio 146 (#159)
dongliu Jul 2, 2023
47d87fd
Binder 156 (#160)
dongliu Jul 15, 2023
366410f
Binder 161 (#162)
dongliu Jul 23, 2023
c8bfe36
Readme installation (#163)
dongliu Aug 7, 2023
a73403b
use mht (#164)
dongliu Aug 7, 2023
234f81f
Docs (#165)
dongliu Aug 12, 2023
29de68d
Note 155 (#166)
dongliu Oct 16, 2023
acfd9ad
fix zero note case (#168)
dongliu Oct 17, 2023
9e90dee
unescape string in form binder (#170)
dongliu Nov 6, 2023
17ae5da
update docker to node 20 and doc (#171)
dongliu Dec 9, 2023
cb2ae43
config button for admin and manager (#173)
dongliu Dec 11, 2023
f30cff1
Form 59 checkbox (#174)
dongliu Mar 17, 2024
ad2366f
Binder 176 (#177)
dongliu Apr 9, 2024
6c8f4eb
use uid to identify user (#179)
dongliu Jul 7, 2024
b9c5f7c
Review 180 (#181)
dongliu Aug 16, 2024
cc02980
Admin 36 (#182)
dongliu Sep 14, 2024
ed16f9a
add back the 2 permissions (#183)
dongliu Sep 14, 2024
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
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
etc
sbin
# !public
# public/*
# !public/javascripts
# public/javascripts/*
# !public/javascripts/lib
11 changes: 9 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"parserOptions": {
"ecmaVersion": 2017
},
"extends": ["eslint:recommended", "prettier"],

"extends": ["airbnb-base", "prettier"],
"rules": {
"no-console": 0,
"quotes": [2, "single", "avoid-escape"],
Expand All @@ -21,6 +22,12 @@
"max-params": [2, 10],
"operator-assignment": 0,
"consistent-this": 0,
"no-unused-expressions": 1
"no-unused-expressions": 1,
"no-underscore-dangle": 1,
"no-use-before-define": 1,
"no-unused-vars": 1,
"no-param-reassign": 1,
"no-prototype-builtins": 1,
"no-continue": 1
}
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ node_modules/
*.sublime-workspace
*.idea

# vscode
.vscode

# system related #
.DS_Store

Expand All @@ -42,5 +45,9 @@ config/mongo.json
config/app.json
config/alias.json

docker/server.crt
docker/server.csr
docker/server.key

# npm stuff #
npm-debug.log*
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14
28 changes: 10 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
FROM node:12-alpine
RUN apk update && \
apk add openssl
FROM node:20-alpine
WORKDIR /app
COPY package.json .
COPY package-lock.json .
# RUN apk update && \
# apk add openssl

# Add Tini, see https://github.com/krallin/tini for why
RUN apk add --no-cache tini
# Tini is now available at /sbin/tini
ENTRYPOINT ["/sbin/tini", "--"]
# web port
EXPOSE 3001
# api port
EXPOSE 3443

COPY . /app
# create the certification file for ssl
WORKDIR /app/docker
RUN PASSWORD=$(openssl rand -hex 16) && \
openssl genrsa -des3 -passout "pass:${PASSWORD}" -out server.pass.key 2048 && \
openssl rsa -passin "pass:${PASSWORD}" -in server.pass.key -out server.key && \
rm server.pass.key && \
openssl req -new -key server.key -out server.csr \
-subj "/C=US/ST=WA/L=Seattle/O=Traveler/OU=Dev/CN=example.com" && \
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
WORKDIR /app
# api port if https enabled
# EXPOSE 3443
RUN npm install --only=prod
RUN npm install -g [email protected]
RUN npm install -g nodemon@2
COPY . .
# RUN bower install
CMD ["node", "app.js"]
20 changes: 4 additions & 16 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
The MIT License (MIT)

Copyright (c) 2015 Dong Liu, Dariusz Jarosz
Copyright (c) 2015

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
131 changes: 13 additions & 118 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,130 +1,25 @@
# Traveler
The traveler is a Web application to define work templates, create work instances from released templates, and organize the work.
## Installation

# Instalation
### Manual installation (recommended)

For detailed deployment instructions please see https://confluence.aps.anl.gov/display/APSUCMS/Developer+Guide+for+the+Traveler+Module
Please follow [this instruction](installation-step.md) to install the dependency and traveler application step by step.

**Deployment of the traveler module:**
### With script on one box

# Make a new directory to hold the traveler module and its support
mkdir traveler
cd traveler
git clone https://github.com/AdvancedPhotonSource/traveler.git distribution
cd distribution
# Install all of the support software
make support
# Automate configuration of the application
make default-config
# Navigate to configuration directory
cd ../etc/traveler-config
# End of output from make dev-config has a list of file(s) that need to be edited
nano ad.json
If you want to install the traveler application and its MongoDB dependency in one Linus box, you can follow [this instruction](installation-script.md).

**Starting the traveler module:**
### Local development and test

# Navigate to the distirbution of the traveler module
# When using the support mongodb, start the mongodb part of support
./etc/init.d/traveler-mongodb start
# It is good to start the project using node to make sure everything works properly.
source setup.sh
node app.js
# When everything works, start traveler as daemon
./etc/init.d/traveler-webapp start
# Check progress of traveler-webapp
./etc/init.d/traveler-webapp status

**Installing docker version (not for production use, but good for development and evaluation)**
You can quickly set up a standalone environment for the traveler application [with docker](docker.md). This is the best approach for local development or try out before production deployment.

1. centos docker install (centos) https://docs.docker.com/install/linux/docker-ce/centos/
* uninstall old docker versions
```
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
```
* install docker CE
```
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce
sudo systemctl start docker
```
* test docker install
```
sudo docker run hello-world
```
* configure docker to start on boot
```
sudo systemctl enable docker
```
* install docker-compose https://docs.docker.com/compose/install/
```
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
```
* test docker-compose
```
sudo docker-compose --version
```
2. create docker network for running traveler related apps
```
sudo docker network create -d bridge --subnet 172.18.1.0/24 traveler-dev
```
3. install dependencies
* traveler-mongo https://github.com/dongliu/traveler-mongo
* clone git repo
```
git clone https://github.com/dongliu/traveler-mongo.git (to e.g., ~/git/traveler)
```
* run traveler-mongo
```
sudo docker-compose up
```
* access mongo express at http://localhost:8081. The username is traveler, and password is travelerpass.
* traveler-ldap https://github.com/dongliu/traveler-ldap
* clone git repo
```
git clone https://github.com/dongliu/traveler-ldap.git
```
* run
```
sudo docker-compose up
```
* test
* You can check the state of the openladp service via the php ldap admin web https://localhost:6443. There is a default admin account that you can use to log in user name: cn=admin,dc=example,dc=org password: admin
4. install traveler https://github.com/AdvancedPhotonSource/traveler
* clone git repo
```
git clone https://github.com/AdvancedPhotonSource/traveler.git
```
* to run and test
* must “sudo docker-compose up” traveler-mongo and traveler-ldap as described above first
```
sudo docker-compose up
```
* URL to run traveler is https://localhost:3001
* find a user login in the ldap file traveler-ldap/seed/traveler.ldif


# Style and Lint

[prettier](https://prettier.io/) is configured in `prettier.config.js` and `.prettierignore`, and hooked with git at `package.json`. The prettier will process for js, json, css, and md files when the hooked action is triggered via husky. The prettier can be run mannually as
`./node_modules/prettier/bin-prettier.js --config ./prettier.config.js --write {.,config/**,lib/**,model/**,public/javascripts/**,public/stylesheets/**,routes/**,test/**,utilities/**}/*.{js,json,css,md}` .

Recommend to use [ESLint](http://eslint.org/) to lint the code before committing. The ESLint configuration file is `.eslintrc`.
## Development
### Source style and Lint
We use `eslint` and `prettier` for style and linting.

## User manual
See https://dongliu.github.io/traveler-doc/manual for details.
# License

[MIT](https://github.com/dongliu/traveler/blob/master/LICENSE.md)
Loading