User Tools

Site Tools


infra:services:hula

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
infra:services:hula [2025/12/28 18:48] atluxity_idp.hackeriet.noinfra:services:hula [2026/03/29 22:08] (current) atluxity_idp.hackeriet.no
Line 80: Line 80:
  
 See also https://github.com/hackeriet/fiken-hula See also https://github.com/hackeriet/fiken-hula
 +
 +The Fiken API token is stored in the password manager. `hackerpass fiken/api`
 +To avoid storing the token in plaintext in `.env`, pipe it directly into the vault helper: 
  
 <code> <code>
-atluxity@hostname: git$ gh repo clone hackeriet/fiken-hula +atluxity@hostname:~$ gh repo clone hackeriet/fiken-hula 
-atluxity@hostname: git$ cd fiken-hula/ +atluxity@hostname:~$ cd fiken-hula/                                                                                                                                                    
-atluxity@hostname: fiken-hula$ echo FIKEN_API=\"$(hackerpass fiken/api)\" > .env +atluxity@hostname:fiken-hula$ python3 -m venv env                                                                                                                                      
-atluxity@hostname: fiken-hula$ source env/bin/activate +atluxity@hostname:fiken-hula$ source env/bin/activate                                                                                                                                  
-(env) atluxity@hostname: fiken-hula$ pip install -r requirements.txt  +(env) atluxity@hostname:fiken-hula$ pip install -r requirements.txt 
-(env) atluxity@hostname: fiken-hula$ python dump_all_sales.py > $(date +%Y-%d-%m)-all-sales.json+(env) atluxity@hostname:fiken-hula$ hackerpass fiken/api | python env_vault.py encrypt --name FIKEN_API --value-stdin 
 +Encryption password: 
 +Confirm encryption password: 
 +Updated .env with FIKEN_API_VAULT 
 +(env) atluxity@hostname: fiken-hula$ python dump_all_sales.py > $(date +%Y-%m-%d)-all-sales.json
 </code> </code>
  
Line 106: Line 113:
  
 TAKE CARE, the json file has too much PII etc, do not leave it unattended. TAKE CARE, the json file has too much PII etc, do not leave it unattended.
 +
 +=== Reporting on payments stored in Hula ===
 +To sanity check, or whatever, a small stats command was created to be run in the same way as the sync command above.
 +<code>
 +(hackerhula-py3.11) hackerietweb@blade:/srv/webapp-hackerhula/new/hackerhula$ python3 manage.py payments_stats -h
 +usage: manage.py payments_stats [-h] [--from DATE_FROM] [--to DATE_TO] [--last-months LAST_MONTHS] [--last-1-months] [--last-3-months] [--last-6-months] [--last-12-months]
 +                                [--format {text,json}] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color]
 +                                [--skip-checks]
 +
 +Report payment statistics from the database
 +
 +options:
 +  -h, --help            show this help message and exit
 +  --from DATE_FROM      Start date (YYYY-MM-DD)
 +  --to DATE_TO          End date (YYYY-MM-DD)
 +  --last-months LAST_MONTHS
 +                        Last N months (e.g. --last-months 3)
 +  --last-1-months       Preset for last 1 month
 +  --last-3-months       Preset for last 3 months
 +  --last-6-months       Preset for last 6 months
 +  --last-12-months      Preset for last 12 months
 +  --format {text,json}  Output format (default: text)
 +  --version             Show program's version number and exit.
 +  -v {0,1,2,3}, --verbosity {0,1,2,3}
 +                        Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output
 +  --settings SETTINGS   The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used.
 +  --pythonpath PYTHONPATH
 +                        A directory to add to the Python path, e.g. "/home/djangoprojects/myproject".
 +  --traceback           Raise on CommandError exceptions.
 +  --no-color            Don't colorize the command output.
 +  --force-color         Force colorization of the command output.
 +  --skip-checks         Skip system checks.
 +</code>
/srv/hackeriet-wiki/dokuwiki/data/attic/infra/services/hula.1766947728.txt.gz · Last modified: by atluxity_idp.hackeriet.no