Browse Source

Merge branch 'dev' into 6_restrict_opens

pull/10/head
Kim Grytøyr 2 years ago
parent
commit
8c4475601c
  1. 16
      cli-script/npaste
  2. 8
      src/routes/index.js
  3. 4
      src/views/index.jade

16
cli-script/npaste

@ -8,15 +8,15 @@ usage() {
echo "npaste [OPTIONS] file"
printf "\t-h --help\n"
printf "\t-p --plaintext No syntax highlighting.\n"
printf "\t--get PASTE_ID Downloads a paste and (optionally decrypts it and) saves it to the current folder."
printf "\t--age When to delete this item. Syntax: n[m|h|d|y], where n is an integer. minutes, hours, days, years. Example: 1h. Default: 0, ie. never deleted.\n"
printf "\t--max-opens Restrict how many times this paste can be opened"
printf "\t--encrypt The paste will be encrypted using a secret key not known to the server.\n"
printf "\t--vault If using --encrypt, this will also encrypt it with a password that is not in the URL.\n"
printf "\t--archive The paste will be restorable for the submitter with the archive flag.\n"
printf "\t--no-archive The paste will NOT be archived, regardless of default defined in config file.\n"
printf "\t--get PASTE_ID Downloads a paste and (optionally decrypts it and) saves it to the current folder.\n"
printf "\t--age When to delete this item. Syntax: n[m|h|d|y], where n is an integer. minutes, hours, days, years. Example: 1h. Default: 0, ie. never deleted.\n"
printf "\t--max-opens Restrict how many times this paste can be opened.\n"
printf "\t--encrypt The paste will be encrypted using a secret key not known to the server.\n"
printf "\t--vault If using --encrypt, this will also encrypt it with a password that is not in the URL.\n"
printf "\t--archive The paste will be restorable for the submitter with the archive flag.\n"
printf "\t--no-archive The paste will NOT be archived, regardless of default defined in config file.\n"
printf "\t--no-auto-pipe Don't use auto pipe command as defined in config file\n"
printf "\t--config Default: $HOME/.config/npaste/cli.conf\n"
printf "\t--config Default: $HOME/.config/npaste/cli.conf\n"
echo ""
echo "The supplied file may be a file with or without suffix or simply '-' for STDIN. Default if omitted is STDIN."
}

8
src/routes/index.js

@ -3,7 +3,7 @@
// npm modules
const express = require('express');
const router = express.Router({ strict: true });
const multer = require('multer');
const multer = require('multer');
const config = require('../lib/config').getConfig(); // local
const upload = multer({ dest: config.path })
@ -13,7 +13,11 @@ const paste = require('../lib/paste');
/* GET home page. */
router.get('/', (req, res, next) => {
res.render('index', { title: 'npaste' });
res.render('index', {
title: 'npaste',
generatedTimestamp: new Date().toISOString(),
version: config.version
});
});
/* GET paste */

4
src/views/index.jade

@ -3,4 +3,6 @@ extends layout
block content
h1= title
p Simple personal pastebin server.
a(href="https://git.grytoyr.io/npaste/") https://git.grytoyr.io/npaste/
a(href="https://src.grytoyr.io/kim/npaste/") https://src.grytoyr.io/kim/npaste/
include footer.jade
Loading…
Cancel
Save