Skip to content

Insert a INSTALL_PREFIX to set where to put the mirror#5

Open
Stef-33560 wants to merge 2 commits intopeter279k:masterfrom
Stef-33560:master
Open

Insert a INSTALL_PREFIX to set where to put the mirror#5
Stef-33560 wants to merge 2 commits intopeter279k:masterfrom
Stef-33560:master

Conversation

@Stef-33560
Copy link
Copy Markdown

@Stef-33560 Stef-33560 commented Jun 8, 2021

Hi,

To allow the mirror to be installed in another folder than /var/www/html, I've introduced an INSTALL_PREFIX variable.

I took the opportunity to

  • add two controls on the content of mirror.config.php and nginx-default.conf
  • ask if INSTALL_PREFIX must be emptied
  • delete reference to old and deprecated ondrej's PPA

Is it usefull for you ?

Comment thread .env
@@ -0,0 +1 @@
INSTALL_PREFIX="/var/repos/mirror-kickstarter" No newline at end of file
Copy link
Copy Markdown
Owner

@peter279k peter279k Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.env I think it should be the optional file.

I think it should create the .env.example file and let the .env file be under the .gitignore file.

And add some .env setting descriptions in the README.md.

Comment thread mirror-kickstarter.sh
${sudo_prefix}chmod 0600 /var/spool/cron/crontabs/root
${sudo_prefix}systemctl restart cron

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The space is additional and it should be removed.

Comment thread nginx-default.conf
listen [::]:80 default_server;

root /var/www/html/mirror/public;
root /var/repos/mirror/public;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If using the install prefix setting, it should modify the Nginx config file programmatically.

Please refer following steps:

  • Revert the nginx-default.conf file.
  • After running the command, using the sed command to replace the /var/www/html/mirror/public setting with the INSTALL_PREFIX variable in the /etc/nginx/sites-available/default.

Comment thread mirror-kickstarter.sh
echo -e "${green_color}Import key for remote Nginx mirror...${rest_color}"
echo "deb http://ppa.launchpad.net/ondrej/nginx/ubuntu $(lsb_release -sc) main" | ${sudo_prefix}tee -a /etc/apt/sources.list.d/ondrej.list
echo "deb-src http://ppa.launchpad.net/ondrej/nginx/ubuntu $(lsb_release -sc) main" | ${sudo_prefix}tee -a /etc/apt/sources.list.d/ondrej.list

Copy link
Copy Markdown
Owner

@peter279k peter279k Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why deprecating the ondrej/php?

This repository always updates the latest PHP versions and it's not old. The repository is available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants