Skip to content

Commit

Permalink
add v1.3cdn版本
Browse files Browse the repository at this point in the history
  • Loading branch information
Baiyuetribe committed Nov 26, 2020
1 parent 8fde9fd commit ccd9e27
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 14 deletions.
25 changes: 25 additions & 0 deletions cdn.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM baiyuetribe/kamifaka:v1.3
LABEL 维护者="佰阅 [email protected]"
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 "<!DOCTYPE html><html lang=\"zh-cn\"><head><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><link rel=\"icon\" href=\"images/favicon.ico\"><link href=\"https://cdn.jsdelivr.net/gh/Baiyuetribe/[email protected]/vendor.0784d59c.css\" rel=\"stylesheet\"><link href=\"https://cdn.jsdelivr.net/gh/Baiyuetribe/[email protected]/styles.da19693f.css\" rel=\"stylesheet\"></head><body><noscript><strong>We're sorry but kamifaka doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=\"app\"></div><script src=\"https://cdn.jsdelivr.net/gh/Baiyuetribe/[email protected]/vendor.aa000dcd.js\"></script><script src=\"https://cdn.jsdelivr.net/gh/Baiyuetribe/[email protected]/styles.61405570.js\"></script><script src=\"https://cdn.jsdelivr.net/gh/Baiyuetribe/[email protected]/app.383e05ff.js\"></script></body></html>" > /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"]


6 changes: 5 additions & 1 deletion service/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def init_db(update=False):
db.session.add(Order('演示订单4455','普通商品演示','虎皮椒微信','[email protected]','非常感谢',9.99,3,1.97,None)) #卡密为None或‘’空都可以
db.session.add(Order('演示订单4456','普通商品演示','虎皮椒支付宝','[email protected]','不错',9.99,1,0.9,''))
db.session.add(Order('演示订单4457','普通商品演示','虎皮椒支付宝','[email protected]','不错',9.99,1,1.9,''))
#

# 插件配置信息
db.session.add(Plugin('TG发卡',"{'TG_TOKEN':'xxxxxxxxxxxx'}",False))
db.session.add(Plugin('微信公众号',"{'PID':'xxxxxxxxxxxx'}",False))

db.session.commit()

25 changes: 12 additions & 13 deletions service/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ccd9e27

Please sign in to comment.