修复超级签权限问题

修复docker下超级签名zip unzip命令不存在
修复应用专属域名删除失败问题
dependabot/npm_and_yarn/fir_admin/decode-uri-component-0.2.2
isummer 2 years ago
parent 646162593e
commit 42451f2cb0
  1. 2
      fir_ser/Dockerfile
  2. 15
      fir_ser/api/management/commands/services/services/base.py
  3. 2
      fir_ser/api/views/domain.py
  4. 2
      fir_ser/xsign/views/receiveudids.py

@ -5,7 +5,7 @@ FROM python:3.9.14-slim
RUN sed -i 's/deb.debian.org/mirrors.163.com/g' /etc/apt/sources.list \
&& sed -i 's/security.debian.org/mirrors.163.com/g' /etc/apt/sources.list \
&& apt update \
&& apt-get install g++ wget -y \
&& apt-get install g++ wget zip unzip -y \
&& apt-get install libssl-dev openssl libmariadb-dev -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

@ -20,6 +20,15 @@ def get_user_id(uid):
...
def chown_dir_file(directory, u_gid, recursive=False):
if recursive:
for (dir_path, dir_names, filenames) in os.walk(directory):
for filename in filenames + dir_names:
os.chown(uid=u_gid, gid=u_gid, path=os.path.join(dir_path, filename))
else:
os.chown(uid=u_gid, gid=u_gid, path=directory)
class BaseService(object):
def __init__(self, **kwargs):
@ -144,12 +153,10 @@ class BaseService(object):
if u_gid is None:
u_gid = os.getuid()
if u_gid is not None:
for (dir_path, dir_names, filenames) in os.walk(LOG_DIR):
for filename in filenames + dir_names:
os.chown(uid=u_gid, gid=u_gid, path=os.path.join(dir_path, filename))
chown_dir_file(LOG_DIR, u_gid, recursive=True)
if self.name == 'uwsgi':
for dirs in ['files', 'supersign']:
os.chown(uid=u_gid, gid=u_gid, path=os.path.join(BASE_DIR, dirs))
chown_dir_file(os.path.join(BASE_DIR, dirs), u_gid, recursive=True)
else:
logging.error(f'uid: {self.uid} gid:{self.gid} is not exists')

@ -41,7 +41,7 @@ def get_domain_filter(request):
def auto_clean_download_cache(user_obj, user_domain_obj, app_obj, delete=False):
if user_domain_obj:
base_domain_queryset = UserDomainInfo.objects.filter(user_id=user_obj, is_enable=True).all()
if user_domain_obj.domain_type in [0, 1]:
if user_domain_obj.domain_type in [0, 1, 2]:
if delete:
user_domain_obj.delete()
if base_domain_queryset.filter(domain_type__in=[0, 1]).count() == 0:

@ -64,8 +64,8 @@ class IosUDIDView(APIView):
if app_obj:
user_obj = app_obj.user_id
short = get_preview_short_config(user_obj, short)
server_domain = get_app_download_uri(request, user_obj, app_obj, preview=False)
if p_token and verify_token(p_token, app_obj.app_id, True):
server_domain = get_app_download_uri(request, user_obj, app_obj, preview=False)
if app_obj.issupersign and app_obj.user_id.supersign_active:
res = check_app_permission(app_obj, BaseResponse())
if res.code != 1000:

Loading…
Cancel
Save