staffio
v0.12.1
기업 직원에게 관리형 서비스를 제공하는 OAuth2 서버입니다.
uid
: 사용자 이름, 필수cn
: 성명gn
: 이름sn
: 성, 필수nickname
birthday
: YYYYmmddgender
: 에프,엠email
: 이메일mobile
: 휴대폰 번호avatarPath
: 아바타 URIdescription
:joinDate
: YYYYmmddname
:description
:members
: []uid받기 | 게시/승인
받기 | POST /토큰
받기 | 게시 /정보/{주제}
me
: {me: User}
me+{groupName}
: {me: User, group}
grafana
또는 generic
: {struct for grafana}
URI | 설명 |
---|---|
/login | 자격 증명 요청자/수락자 |
/logout | CAS 세션 삭제(로그아웃) |
/validate | 서비스 티켓 확인 |
/serviceValidate | 서비스 티켓 유효성 검사 [CAS 2.0] |
/proxyValidate 확인 | 서비스/프록시 티켓 검증 [CAS 2.0] |
/proxy TODO | 대리티켓 서비스 [CAS 2.0] |
/p3/serviceValidate 확인 | 서비스 티켓 유효성 검사 [CAS 3.0] |
/p3/proxyValidate 일 확인 | 서비스/프록시 티켓 검증 [CAS 3.0] |
# openldap
docker run --name staffio-ldap -p 389:389 -p 636:636
-e LDAP_ADMIN_PASSWORD=mypassword
-d liut7/staffio-ldap:latest
# postgresql
docker create --name staffio-db-data -v /var/lib/postgresql busybox:1 echo staffio db data
docker run --name staffio-db -p 54322:5432
-e DB_PASS=mypassword
-e TZ=Hongkong
--volumes-from=staffio-db-data
-d liut7/staffio-db:latest
# staffio main server
docker run --name staffio -p 3030:3030
-e STAFFIO_BACKEND_DSN= ' postgres://staffio:mypassword@staffio-db/staffio?sslmode=disable '
-e STAFFIO_LDAP_HOSTS= ' ldap://slapd '
-e STAFFIO_LDAP_BASE= " dc=example,dc=org "
-e STAFFIO_LDAP_BIND_DN= " cn=admin,dc=example,dc=org "
-e STAFFIO_LDAP_PASS= ' mypassword '
--link staffio-db --link staffio-ldap:slapd
-d liut7/staffio:latest web
# create a user as first staff and adminstrator
docker exec staffio staffio addstaff -u eagle -p mysecret -n eagleliut --sn liut
docker exec staffio staffio group -g keeper -a eagle
# now can open http://localhost:3030/ in browser
# add a oauth2 client (optional)
docker exec staffio staffio client --add demo --uri http://localhost:3000
# list clients
docker exec staffio staffio client --list
# # for testing database
echo " CREATE DATABASE staffiotest WITH OWNER = staffio ENCODING = 'UTF8'; " | docker exec -i staffio-db psql -Upostgres
echo " GRANT ALL PRIVILEGES ON DATABASE staffiotest to staffio; " | docker exec -i staffio-db psql -Upostgres
go get -u github.com/liut/staffio
cp -n .env.example .env
cat .env.example
STAFFIO_HTTP_LISTEN=":3000"
STAFFIO_LDAP_HOSTS=slapd.hostname
STAFFIO_LDAP_BASE="dc=example,dc=org"
STAFFIO_LDAP_BIND_DN="cn=admin,dc=example,dc=org"
STAFFIO_LDAP_PASS="mypassword"
STAFFIO_BACKEND_DSN="postgres://staffio:mypassword@localhost:54322/staffio?sslmode=disable"
STAFFIO_PASSWORD_SECRET="mypasswordsecret"
go get -u github.com/ddollar/forego
go get -u github.com/liut/rerun
npm install
forego start
make dist package
scp dist/linux_amd64/staffio remote:/opt/staffio/bin/
make fe-build
rsync -rpt --delete templates htdocs remote:/opt/staffio/
forego run ./staffio addstaff -u eric -p AF1984 -n George --sn Blair