Git Product home page Git Product logo

weeklyreport_vditor's Introduction

Weekly Report

wangeditor 为富文本编辑器,不是很好用,建议采用 veditor的版本,源码见github

modified by chopong forked from CodingCrush/WeeklyReport

原仓库里在 docker build 的时候遇到很多未知错误, 我做了部分修改.

原Weekly和Postgres的参数由两个文件分别控制,我build时总是连不上数据库,后来发现是另一个文件,而且方法是写死的,于是改用环境变量传参。

  • Dockerfile: 添加了一部分必要包, 旧代码总报错.
  • checkdb.py: 改用环境变量传参; 启动时检查数据库是否存在, 不存在则创建(可以手动创建).
  • deploy/config: 改用环境变量传参
  • requirements: 固定部分pip package版本号, 原库无版本, 项目代码老旧, 使得启动时各种报错代码.
  • 其他: iteritem --> item 部分命令启用, 小小改动
  • NEW: 放弃富文本编辑器WangEditor,改用Markdown编辑器Vditor

Build

git clone https://github.com/Chopong/WeeklyReport_vditor && \
cd WeeklyReport_editor && \
docker build -t chopong/weeklyreport:vditor .

Run

docker run -d \
        --restart=unless-stopped \
        --name weeklyreport-server \
        -p 5000:5000 \
        --add-host=host.docker.internal:host-gateway
        -v /etc/localtime:/etc/localtime:ro \
        -v $PWD:/opt/weeklyreport \
        -v db_name:weeklyreport \
        -v db_host:host.docker.internal \
        -v db_port:5432 \
        -v db_user:postgres \
        -v db_pass:postgres \
        chopong/weeklyreport:vditor

Or docker compose:

services:
  weekly-db:
    image: postgres:9
    container_name: weeklyreport-db
    restart: unless-stopped
    ports:
      - 5432:5432
    environment:
      - POSTGRES_DB=weeklyreport
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    volumes:
      - $PWD/deploy/postgres:/var/lib/postgresql/data
      
  weekly-server:
    image: chopong/weeklyreport:vditor
    container_name: weeklyreport-server
    restart: unless-stopped
    volumes:
      - $PWD:/opt/weeklyreport
    ports:
      - 5000:5000
    networks:
      - default
    depends_on:
      - weekly-db
    environment:
      - db_name=weeklyreport
      - db_host=host.docker.internal # the docker host ip in case access denied
      - db_port=5432
      - db_user=postgres
      - db_pass=postgres
      # 更多参数,可以通过查看 /deploy/config中的变量表来定义
    extra_hosts:
      - "host.docker.internal:host-gateway" # used with host.docker.internal

# Networks
networks:
  default:
    driver: bridge
    name: weekly

参考: 1. https://wr.mcloud.fun:81/auth/login

  1. https://github.com/wuchaohua/WeeklyReport
  2. https://github.com/CodingCrush/WeeklyReport

后台管理

第一次注册的用户为超级管理员,永远有登录后台的权限, 管理员可以修改其他角色

默认用户角色为EMPLOYEE(或STUDENT),仅具有读写自己的周报的权限;

MANAGER可以读写周报,并查看本部门(学院)所有周报。

HR(或者PROF)可以读写周报,并查看全部门(学院)所有周报。

ADMINISTRATORHR(或PROF)基础上增加了进入后台的功能。

QUIT(或ALUMNI) 用来标识离职后的员工(或毕业的学生),禁止其登录。

weeklyreport_vditor's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.