Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker symlink fixes #4747

Merged
merged 1 commit into from Nov 18, 2017
Merged

Docker symlink fixes #4747

merged 1 commit into from Nov 18, 2017

Conversation

gunzy83
Copy link
Contributor

@gunzy83 gunzy83 commented Sep 3, 2017

This pull request addresses an issue I found in the setup script that is run inside the docker container on startup. Due to how trivial it is there is no open issue for this.

What currently happens: On first run, the following symlinks are created:

  • /app/gogs/log -> /data/gogs/log
  • /app/gogs/data -> /data/gogs/data
  • /home/git -> /data/git

On second run (upgrade/restart) the following links are created because the existing target links are followed:

  • /data/gogs/log/log -> /data/gogs/log
  • /data/gogs/data/data -> /data/gogs/data
  • /data/git/git -> /data/git

These are circular links. This pull request uses the -n option (treat LINK_NAME as a normal file if it is a symbolic link to a directory) to prevent this from happening on container restart.

* Prevent circular links (symlinks) from being created:
	* /data/gogs/log/log -> /data/gogs/log
	* /data/gogs/data/data -> /data/gogs/data
	* /data/git/git -> /data/git
@unknwon
Copy link
Member

unknwon commented Nov 18, 2017

Thank you!

@unknwon unknwon merged commit 925c2a2 into gogs:develop Nov 18, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants