Y
Y
Ytsu Ytsuevich2015-07-26 12:54:23
git
Ytsu Ytsuevich, 2015-07-26 12:54:23

How to hide a file on Github?

Let's say I'm writing a website in PHP (optional).
There is a config.php file, in which the login and password are in the database.
When committing, it is uploaded to the server.
What to do? After all, it can be brazenly stolen?
How do they act in such situations?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey delphinpro, 2015-07-26
@delphinpro

config.php should be de-indexed (added to gitignor) and not included in commits at all.
Instead, include the config-EXAMPLE.php file in the index, which will not contain your actual settings, but only configuration examples.

S
sim3x, 2015-07-26
@sim3x

How do they act in such situations?
all settings go in environment variables
php.net/manual/en/reserved.variables.environment.php
php.net/manual/en/function.getenv.php

S
Sergey, 2015-07-26
Protko @Fesor

do not put such information on githubs.
if you really want to, you can encrypt the file with your key (gnu gpg) and then lay it down, but it's better not to store such information in public places.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question