Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 76f6180
Showing
97 changed files
with
12,981 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
*.pyc | ||
fm.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM beget/fmcore-python | ||
|
||
RUN apt-get install --no-install-recommends -qq -y \ | ||
unzip zip | ||
|
||
COPY requirements.txt / | ||
RUN pip install -r /requirements.txt | ||
|
||
COPY run-rpc.sh /etc/services.d/rpc/run | ||
COPY run-sendfile.sh /etc/services.d/sendfile/run | ||
|
||
COPY init-db.sh /etc/cont-init.d/10-init-db.sh | ||
COPY init-tmp.sh /etc/cont-init.d/20-init-tmp.sh | ||
COPY init-passwd.sh /etc/cont-init.d/30-init-passwd.sh | ||
|
||
COPY ./ /rpc/ | ||
|
||
WORKDIR /rpc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
RPC |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Error(Exception): | ||
def __init__(self, message, code=None): | ||
self.message = message | ||
self.code = code | ||
|
||
def __str__(self): | ||
return "error_message(%s), error_code(%s)" % (self.message, self.code) | ||
|
||
|
||
class AccessError(Exception): | ||
pass |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import os | ||
|
||
# Default logger | ||
DEFAULT_LOGGER = "fm-rpc" | ||
|
||
APP_PATH = os.path.dirname(os.path.dirname(__file__)) | ||
DB_FILE = os.getenv("FM_RPC_SETTINGS_DB_PATH", os.path.join(APP_PATH, 'fm.db')) | ||
ROOT_MOUNT = os.getenv("FM_RPC_ROOT_MOUNT_POINT", '/') | ||
TMP_DIR = os.getenv("FM_RPC_TMP_DIR", '/tmp/fm') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
TYPE_FCGI = 'fcgi' | ||
TYPE_MSGPACK = 'msgpack' | ||
|
||
MSGPACK_CONTROLLERS = 'controllers' | ||
|
||
servers = dict( | ||
# используется по умолнчаению | ||
default=dict( | ||
type=TYPE_MSGPACK, | ||
host="127.0.0.1", | ||
port=8500 | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import os | ||
|
||
# Redis settings | ||
REDIS_DEFAULT_HOST = os.getenv("FM_REDIS_HOST", 'localhost') | ||
REDIS_DEFAULT_PORT = os.getenv("FM_REDIS_PORT", 6379) | ||
REDIS_DEFAULT_EXPIRE = os.getenv("FM_REDIS_EXPIRE", 86400) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import os | ||
import glob | ||
__all__ = [os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")] |
Oops, something went wrong.