App-phoebe
view release on metacpan or search on metacpan
script/phoebe view on Meta::CPAN
If you allow uploads of binary files, these are stored separately from the
regular pages; the wiki doesn't keep old revisions of files around. If somebody
overwrites a file, the old revision is gone.
You definitely don't want random people uploading all sorts of images, videos
and binaries to your server. Make sure you set up those L<tokens|/Security>
using C<--wiki_token>!
=head1 NOTES
=head2 Security
The server uses "access tokens" to check whether people are allowed to edit
files. You could also call them "passwords", if you want. They aren't associated
with a username. You set them using the C<--wiki_token> option. By default, the
only password is "hello". That's why the Titan command above contained
"token=hello". ð
If you're going to check up on your wiki often (daily!), you could just tell
people about the token on a page of your wiki. Spammers would at least have to
read the instructions and in my experience the hardly ever do.
You could also create a separate password for every contributor and when they
leave the project, you just remove the token from the options and restart
Phoebe. They will no longer be able to edit the site.
=head2 Privacy
The server only actively logs changes to pages. It calculates a "code" for every
contribution: it is a four digit octal code. The idea is that you could colour
every digit using one of the eight standard terminal colours and thus get little
four-coloured flags.
This allows you to make a pretty good guess about edits made by the same person,
without telling you their IP numbers.
The code is computed as follows: the IP numbers is turned into a 32bit number
using a hash function, converted to octal, and the first four digits are the
code. Thus all possible IP numbers are mapped into 8â´=4096 codes.
If you increase the log level, the server will produce more output, including
information about the connections happening, like C<2020/06/29-15:35:59 CONNECT
SSL Peer: "[::1]:52730" Local: "[::1]:1965"> and the like (in this case C<::1>
is my local address so that isn't too useful but it could also be your visitor's
IP numbers, in which case you will need to tell them about it using in order to
comply with the
L<GDPR|https://en.wikipedia.org/wiki/General_Data_Protection_Regulation>.
=head1 EXAMPLE
Here's an example for how to start Phoebe. It listens on C<localhost> port 1965,
adds the "Welcome" and the "About" page to the main menu, and allows editing
using one of two tokens.
phoebe \
--wiki_token=Elrond \
--wiki_token=Thranduil \
--wiki_page=Welcome \
--wiki_page=About
Here's what my F<phoebe.service> file actually looks like:
[Unit]
Description=Phoebe
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
WorkingDirectory=/home/alex/farm
Restart=always
User=alex
Group=ssl-cert
MemoryMax=100M
MemoryHigh=90M
ExecStart=/home/alex/src/phoebe/script/phoebe \
--port=1965 \
--log_level=debug \
--wiki_dir=/home/alex/phoebe \
--host=transjovian.org \
--cert_file=/var/lib/dehydrated/certs/transjovian.org/fullchain.pem \
--key_file=/var/lib/dehydrated/certs/transjovian.org/privkey.pem \
--host=toki.transjovian.org \
--cert_file=/var/lib/dehydrated/certs/transjovian.org/fullchain.pem \
--key_file=/var/lib/dehydrated/certs/transjovian.org/privkey.pem \
--host=vault.transjovian.org \
--cert_file=/var/lib/dehydrated/certs/transjovian.org/fullchain.pem \
--key_file=/var/lib/dehydrated/certs/transjovian.org/privkey.pem \
--host=communitywiki.org \
--cert_file=/var/lib/dehydrated/certs/communitywiki.org/fullchain.pem \
--key_file=/var/lib/dehydrated/certs/communitywiki.org/privkey.pem \
--host=alexschroeder.ch \
--cert_file=/var/lib/dehydrated/certs/alexschroeder.ch/fullchain.pem \
--key_file=/var/lib/dehydrated/certs/alexschroeder.ch/privkey.pem \
--host=next.oddmuse.org \
--cert_file=/var/lib/dehydrated/certs/oddmuse.org/fullchain.pem \
--key_file=/var/lib/dehydrated/certs/oddmuse.org/privkey.pem \
--host=emacswiki.org \
--cert_file=/var/lib/dehydrated/certs/emacswiki.org/fullchain.pem \
--key_file=/var/lib/dehydrated/certs/emacswiki.org/privkey.pem \
--wiki_main_page=Welcome \
--wiki_page=About \
--wiki_mime_type=image/png \
--wiki_mime_type=image/jpeg \
--wiki_mime_type=audio/mpeg \
--wiki_space=transjovian.org/test \
--wiki_space=transjovian.org/phoebe \
--wiki_space=transjovian.org/anthe \
--wiki_space=transjovian.org/gemini \
--wiki_space=transjovian.org/titan
=head2 Certificates and File Permission
In the example above, I'm using certificates I get from Let's Encrypt. Thus, the
regular website served on port 443 and the Phoebe website on port 1965 use the
same certificates. My problem is that for the regular website, Apache can read
the certificates, but in the setup above Phoebe runs as the user C<alex> and
cannot access the certificates. My solution is to use the group C<ssl-cert>.
This is the group that already has read access to F</etc/ssl/private> on my
system. I granted the following permissions:
( run in 1.211 second using v1.01-cache-2.11-cpan-39bf76dae61 )