Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gnu-social
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
192
Issues
192
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gnu.io
gnu-social
Commits
ec98fd0c
Commit
ec98fd0c
authored
Dec 17, 2017
by
mmn
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'gnuio/master' into nightly
parents
ec504ec4
67a9c041
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
21 deletions
+27
-21
CONFIGURE
CONFIGURE
+7
-0
INSTALL
INSTALL
+4
-14
installer.php
lib/installer.php
+11
-6
util.php
lib/util.php
+4
-0
install_cli.php
scripts/install_cli.php
+1
-1
No files found.
CONFIGURE
View file @
ec98fd0c
...
...
@@ -774,6 +774,13 @@ high: if you need high performance, or if you're seeing bad
performance, set this to true. It will turn off some high-intensity code from
the site.
cache
-----
dir: A string path to a writable directory that will be used as temporary cache
for some functions (currently just the HtmlSanitizer).
If it is not set, the GNU social installation directory will be used.
oldschool
---------
...
...
INSTALL
View file @
ec98fd0c
...
...
@@ -124,17 +124,7 @@ especially if you've previously installed PHP/MariaDB packages.
that user's default group instead. As a last resort, you can create
a new group like "gnusocial" and add the Web server's user to the group.
4. You should also take this moment to make your 'avatar' and 'file' sub-
directories writeable by the Web server. The _insecure_ way to do
this is:
chmod a+w /var/www/gnusocial/avatar
chmod a+w /var/www/gnusocial/file
You can also make the avatar, and file directories just writable by
the Web server group, as noted above.
5. Create a database to hold your site data. Something like this
4. Create a database to hold your site data. Something like this
should work (you will be prompted for your database password):
mysqladmin -u "root" -p create social
...
...
@@ -147,7 +137,7 @@ especially if you've previously installed PHP/MariaDB packages.
a tool like phpMyAdmin to create a database. Check your hosting
service's documentation for how to create a new MariaDB database.)
6
. Create a new database account that GNU Social will use to access the
5
. Create a new database account that GNU Social will use to access the
database. If you have shell access, this will probably work from the
MariaDB shell:
...
...
@@ -159,7 +149,7 @@ especially if you've previously installed PHP/MariaDB packages.
to your preferred new database username and password. You may want to
test logging in to MariaDB as this new user.
7
. In a browser, navigate to the GNU Social install script; something like:
6
. In a browser, navigate to the GNU Social install script; something like:
https://social.example.net/install.php
...
...
@@ -167,7 +157,7 @@ especially if you've previously installed PHP/MariaDB packages.
install program will configure your site and install the initial,
almost-empty database.
8
. You should now be able to navigate to your social site's main directory
7
. You should now be able to navigate to your social site's main directory
and see the "Public Timeline", which will probably be empty. You can
now register new user, post some notices, edit your profile, etc.
...
...
lib/installer.php
View file @
ec98fd0c
...
...
@@ -85,7 +85,7 @@ abstract class Installer
$pass
=
true
;
$config
=
INSTALLDIR
.
'/config.php'
;
if
(
file_exists
(
$config
))
{
if
(
!
$this
->
skipConfig
&&
file_exists
(
$config
))
{
if
(
!
is_writable
(
$config
)
||
filesize
(
$config
)
>
0
)
{
if
(
filesize
(
$config
)
==
0
)
{
$this
->
warning
(
'Config file "config.php" already exists and is empty, but is not writable.'
);
...
...
@@ -126,14 +126,16 @@ abstract class Installer
}
// @fixme this check seems to be insufficient with Windows ACLs
if
(
!
is_writable
(
INSTALLDIR
))
{
if
(
!
$this
->
skipConfig
&&
!
is_writable
(
INSTALLDIR
))
{
$this
->
warning
(
sprintf
(
'Cannot write config file to: <code>%s</code></p>'
,
INSTALLDIR
),
sprintf
(
'On your server, try this command: <code>chmod a+w %s</code>'
,
INSTALLDIR
));
$pass
=
false
;
}
// Check the subdirs used for file uploads
$fileSubdirs
=
array
(
'avatar'
,
'file'
);
// TODO get another flag for this --skipFileSubdirCreation
if
(
!
$this
->
skipConfig
)
{
$fileSubdirs
=
array
(
$this
->
avatarDir
,
$this
->
fileDir
);
foreach
(
$fileSubdirs
as
$fileSubdir
)
{
$fileFullPath
=
INSTALLDIR
.
"/
$fileSubdir
"
;
if
(
!
file_exists
(
$fileFullPath
))
{
...
...
@@ -148,7 +150,7 @@ abstract class Installer
$pass
=
false
;
}
}
}
return
$pass
;
}
...
...
@@ -515,6 +517,9 @@ abstract class Installer
*/
function
registerInitialUser
()
{
// initalize hostname from install arguments, so it can be used to find
// the /etc config file from the commandline installer
$server
=
$this
->
server
;
require_once
INSTALLDIR
.
'/lib/common.php'
;
$data
=
array
(
'nickname'
=>
$this
->
adminNick
,
...
...
@@ -580,10 +585,10 @@ abstract class Installer
return
false
;
}
if
(
!
$this
->
skipConfig
)
{
// Make sure we can write to the file twice
$oldUmask
=
umask
(
000
);
if
(
!
$this
->
skipConfig
)
{
$this
->
updateStatus
(
"Writing config file..."
);
$res
=
$this
->
writeConf
();
...
...
@@ -616,12 +621,12 @@ abstract class Installer
$this
->
updateStatus
(
"Can't write to config file."
,
true
);
return
false
;
}
}
// Restore original umask
umask
(
$oldUmask
);
// Set permissions back to something decent
chmod
(
INSTALLDIR
.
'/config.php'
,
0644
);
}
$scheme
=
$this
->
ssl
===
'always'
?
'https'
:
'http'
;
$link
=
"
{
$scheme
}
://
{
$this
->
server
}
/
{
$this
->
path
}
"
;
...
...
lib/util.php
View file @
ec98fd0c
...
...
@@ -610,6 +610,10 @@ function common_purify($html, array $args=array())
$cfg
->
set
(
'URI.Base'
,
$args
[
'URI.Base'
]);
// if null this is like unsetting it I presume
$cfg
->
set
(
'URI.MakeAbsolute'
,
!
is_null
(
$args
[
'URI.Base'
]));
// if we have a URI base, convert relative URLs to absolute ones.
}
if
(
common_config
(
'cache'
,
'dir'
))
{
$cfg
->
set
(
'Cache.SerializerPath'
,
common_config
(
'cache'
,
'dir'
));
}
// if you don't want to use the default cache dir for htmlpurifier, set it specifically as $config['htmlpurifier']['Cache.SerializerPath'] = '/tmp'; or something.
foreach
(
common_config
(
'htmlpurifier'
)
as
$key
=>
$val
)
{
$cfg
->
set
(
$key
,
$val
);
}
...
...
scripts/install_cli.php
View file @
ec98fd0c
...
...
@@ -47,10 +47,10 @@ class CliInstaller extends Installer
*/
function
main
()
{
if
(
$this
->
prepare
())
{
if
(
!
$this
->
checkPrereqs
())
{
return
false
;
}
if
(
$this
->
prepare
())
{
return
$this
->
handle
();
}
else
{
$this
->
showHelp
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment