-
Notifications
You must be signed in to change notification settings - Fork 4
2. Configuration
Now that TemPIC is reachable at tempic.example.com
, we need to configure it,
as you may have probably found out by now.
First, we go to the /web
directory:
cd /home/tempic/TemPIC/web
Then we copy the configuration template:
cp config.default.php config.php
After that, edit config.php
. It contains an explanation for all the available options,
so just follow those. Continue with this guide when you're done.
At this point, you should be able to upload files to TemPIC without a problem.
However, our files aren't being deleted yet after the specified times,
neither are album ZIP files or thumbnails (as configured) generated.
Time to fix that!
Go into the /scripts
directory:
cd /home/tempic/TemPIC/scripts
Once again, copy the configuration template:
cp config.default.php config.php
Now open config.php
in a text editor:
$PATH_TEMPIC = "/var/www/tempic";
Set this to the path where your TemPIC/web directory is located.
In our example, you can set this to either /home/tempic/TemPIC/web
or /var/www/tempic
, where we symlinked it to.
You should now test if the cleanup works:
./postprocess.sh
It should print something like this:
* scanning basedir: /var/www/tempic/upload/30m
- found: /var/www/tempic/upload/30m/b1292bf4e282/demonstration.gif (remaining: 10 minutes 37 seconds)
- found: /var/www/tempic/upload/30m/5cd2470fbc87/demo2.mkv (deleted)
* scanning basedir: /var/www/tempic/upload/1h
* scanning basedir: /var/www/tempic/upload/2h
* scanning basedir: /var/www/tempic/upload/4h
* scanning basedir: /var/www/tempic/upload/10h
* scanning basedir: /var/www/tempic/upload/1d
* scanning basedir: /var/www/tempic/upload/3d
Try uploading some files and wait until they time out.
If you see (deleted)
, run it again and see if they appear again.
They're gone? Everything's great!
They aren't gone? You see permission errors?
Check if the permissions of the web/uploads
are correct, this might help.
Try to manually remove a file from web/uploads
.
If that works, don't hesitate to create an issue ticket.
Now all that's left is making sure that the script is called periodically. This can be done for example using a cronjob or a systemd-timer.
An example cronjob setting is provided in scripts/cronjob.txt
.