diff --git a/cdn.dockerfile b/cdn.dockerfile new file mode 100644 index 0000000..d6d8c9f --- /dev/null +++ b/cdn.dockerfile @@ -0,0 +1,25 @@ +FROM baiyuetribe/kamifaka:v1.3 +LABEL 维护者="佰阅 2894049053@qq.com" +LABEL stable="v1.3" +# 备选数据库Sqlite \Mysql \ PostgreSQL +ENV DB_TYPE='Sqlite' +ENV DB_HOST='127.0.0.1' +ENV DB_PORT='3306' +ENV DB_USER='KAMIFKA' +ENV DB_PASSWORD='PASSWORD' +ENV DB_DATABASE='KAMIFKA' + +WORKDIR /usr/src/app + +RUN echo "
" > /usr/src/app/dist/index.html + +# 用于替换logo +COPY logo.png /usr/src/app/service/system/logo.png + +EXPOSE 8000 + +ENTRYPOINT [ "/usr/src/app/docker-entrypoint.sh" ] + +# ENTRYPOINT ["gunicorn","-k", "gevent", "--bind", "0.0.0.0:8000", "--workers", "8", "app:app"] + + diff --git a/service/config/config.py b/service/config/config.py index 64596a2..088851f 100644 --- a/service/config/config.py +++ b/service/config/config.py @@ -65,6 +65,10 @@ def init_db(update=False): db.session.add(Order('演示订单4455','普通商品演示','虎皮椒微信','458721@qq.com','非常感谢',9.99,3,1.97,None)) #卡密为None或‘’空都可以 db.session.add(Order('演示订单4456','普通商品演示','虎皮椒支付宝','demo@gmail.com','不错',9.99,1,0.9,'')) db.session.add(Order('演示订单4457','普通商品演示','虎皮椒支付宝','demo2@gmail.com','不错',9.99,1,1.9,'')) - # + + # 插件配置信息 + db.session.add(Plugin('TG发卡',"{'TG_TOKEN':'xxxxxxxxxxxx'}",False)) + db.session.add(Plugin('微信公众号',"{'PID':'xxxxxxxxxxxx'}",False)) + db.session.commit() diff --git a/service/database/models.py b/service/database/models.py index a3f7d01..4a03c63 100644 --- a/service/database/models.py +++ b/service/database/models.py @@ -306,23 +306,22 @@ def to_json(self): } -class Message(db.Model): - __tablename__ = 'message' # 通知或文章存档 +class Plugin(db.Model): + __tablename__ = 'plugin' # 通知或文章存档 id = Column(Integer, primary_key=True,autoincrement=True) - option = Column(Boolean, nullable=False) #开关0/1;true,false - info = Column(Text, nullable=False,default=False) #消息 - classfiy = Column(String(50), nullable=False,default=False) #类似,顶部公告或弹窗公告 - updatetime = Column(Text, nullable=True,default=datetime.now()) # + name = Column(String(50), nullable=False,unique=True) #微信公众号+Tg发卡 + config = Column(Text,nullable=False) #配置参数{}json + switch = Column(Boolean, nullable=False) #开关0/1;true,false - def __init__(self, option, info, classfiy): - self.option = option - self.info = info - self.classfiy = classfiy + def __init__(self, name, config, switch): + self.name = name + self.config = config + self.switch = switch def to_json(self): return { - 'classfiy': self.classfiy, - 'info': self.info, - 'option': self.option, + 'name': self.name, + 'config': self.config, + 'switch': self.switch, } class Notice(db.Model):