mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-19 15:25:51 +00:00
* make nginx run as root within the container (#268) * move file to videos path with fallback to regular copy with no metadata copying (#268) * use `copy_function=shutil.copy` everywhere with `shutil.move`
This commit is contained in:
parent
1479516689
commit
79996f6838
@ -54,12 +54,11 @@ RUN if [ "$INSTALL_DEBUG" ] ; then \
|
||||
; fi
|
||||
|
||||
# make folders
|
||||
RUN mkdir /cache
|
||||
RUN mkdir /youtube
|
||||
RUN mkdir /app
|
||||
RUN mkdir /cache /youtube /app
|
||||
|
||||
# copy config files
|
||||
COPY docker_assets/nginx.conf /etc/nginx/sites-available/default
|
||||
RUN sed -i 's/^user www\-data\;$/user root\;/' /etc/nginx/nginx.conf
|
||||
|
||||
# copy application into container
|
||||
COPY ./tubearchivist /app
|
||||
|
@ -398,7 +398,7 @@ class VideoDownloader:
|
||||
old_file_path = os.path.join(cache_dir, "download", old_file)
|
||||
new_file_path = os.path.join(videos, vid_dict["media_url"])
|
||||
# move media file and fix permission
|
||||
shutil.move(old_file_path, new_file_path)
|
||||
shutil.move(old_file_path, new_file_path, copy_function=shutil.copy)
|
||||
if host_uid and host_gid:
|
||||
os.chown(new_file_path, host_uid, host_gid)
|
||||
|
||||
|
@ -266,7 +266,7 @@ class ManualImport:
|
||||
if ext == ".mp4":
|
||||
new_file = video_file + ext
|
||||
dest_path = os.path.join(self.CACHE_DIR, "download", new_file)
|
||||
shutil.move(video_path, dest_path)
|
||||
shutil.move(video_path, dest_path, copy_function=shutil.copy)
|
||||
else:
|
||||
print(f"processing with ffmpeg: {video_file}")
|
||||
new_file = video_file + ".mp4"
|
||||
|
@ -304,6 +304,6 @@ class ChannelUrlFixer:
|
||||
new_file_path = os.path.join(
|
||||
cache_dir, "download", self.youtube_id + ".mp4"
|
||||
)
|
||||
shutil.move(video_path_is, new_file_path)
|
||||
shutil.move(video_path_is, new_file_path, copy_function=shutil.copy)
|
||||
VideoDownloader().move_to_archive(self.video.json_data)
|
||||
self.video.update_media_url()
|
||||
|
Loading…
Reference in New Issue
Block a user