update readme and create default config

This commit is contained in:
Izalia Mae 2020-01-18 11:55:07 -05:00
parent 4aa385f8af
commit e04dd99dc1
4 changed files with 38 additions and 4 deletions

View file

@ -26,11 +26,13 @@ MASTOPATH=/home/mastodon/glitch-soc
PAWS_HOST=127.0.0.1
PAWS_PORT=3001
# These will be phased out
PAWS_USER=admin
PAWS_PASS=password
# Domain to list in the actor. Only needed if you plan on using the whitelist
PAWS_DOMAIN=bappypaws.example.com
```
Extra environment variables (cannot be put in production.env):
- LOGDATE: boolean (default: yes). Set to no to remove access times from the console log
### Caddy
Append this to caddy's mastodon config:

13
paws.example.service Normal file
View file

@ -0,0 +1,13 @@
[Unit]
Description = PAWS
After = network.target
[Service]
User = [user]
Group = [user]
WorkingDirectory = /home/[user]/paws
Environment = LOGDATE=no
ExecStart = /usr/bin/python3 ./server.py
Restart = always
RestartSec = 3
[Install]
WantedBy = multi-user.target

View file

@ -46,6 +46,19 @@ logging.addHandler(console)
if not isfile(f'{stor_path}/production.env'):
logging.error(f'PAWS environment file doesn\'t exist: {stor_path}/production.env')
logging.error('Creating a new config file. Be sure to edit it and restart PAWS')
new_config = '''
PAWS_HOST=127.0.0.1
PAWS_PORT=3001
PAWS_DOMAIN=bappypaws.example.com
MASTOPATH=/home/mastodon/glitch-soc
'''
with open(f'{stor_path}/production.env', 'w') as pawsconf:
pawsconf.write(new_config)
else:
load_envbash(f'{stor_path}/production.env')
@ -54,7 +67,7 @@ PAWSCONFIG = {
'host': env.get('PAWS_HOST', '127.0.0.1'),
'port': int(env.get('PAWS_PORT', 3001)),
'mastopath': env.get('MASTOPATH', os.getcwd()),
'domain': env.get('PAWS_DOMAIN', 'pleroma.barkshark.xyz')
'domain': env.get('PAWS_DOMAIN', 'bappypaws.example.com')
}

6
production.example.env Normal file
View file

@ -0,0 +1,6 @@
PAWS_HOST=127.0.0.1
PAWS_PORT=3001
PAWS_DOMAIN=bappypaws.example.com
MASTOPATH=/home/mastodon/glitch-soc