From e3ba832b7e4887149a9cb9e04b12c44bfda9a5f8 Mon Sep 17 00:00:00 2001 From: fatchan Date: Wed, 4 Mar 2020 09:37:42 +0100 Subject: [PATCH] make custompages an example file and update readme to let ppl know to move them, also add max file size to faq and gulpfile with a new local --- .gitignore | 1 + README.md | 5 + gulpfile.js | 4 +- views/custompages/faq.pug | 30 ++++ views/custompages/faq.pug.example | 267 ++++++++++++++++++++++++++++ views/custompages/rules.pug | 11 +- views/custompages/rules.pug.example | 13 ++ 7 files changed, 325 insertions(+), 6 deletions(-) create mode 100644 views/custompages/faq.pug.example create mode 100644 views/custompages/rules.pug.example diff --git a/.gitignore b/.gitignore index cdccfdbb..dad31212 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ configs/*.json configs/*.js static/* gulp/res/js/socket.io.js +views/custompages/*.pug /gulp/res/css/codethemes gulp/res/js/timezone.js tmp/ diff --git a/README.md b/README.md index 70e9fb02..0ae0c65b 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,10 @@ geoip_city /usr/share/GeoIP/GeoIPCity.dat; # copy example config file and edit it $ cp configs/main.js.example configs/main.js && editor configs/main.js +# copy example custompages for rules and faq and edit +$ cp views/custompages/faq.pug.example views/custompages/faq.pug +$ cp views/custompages/rules.pug.example views/custompages/rules.pug + # install dependencies and run build tasks $ npm install $ npm run-script setup @@ -98,5 +102,6 @@ $ pm2 logs #see logs $ pm2 reload all #reload all backend processes # gulp is used for various jobs like minifying and compiling scripts $ gulp --tasks #list available gulp tasks +$ gulp migrate #check for and run db migrations $ gulp #run default gulp task ``` diff --git a/gulpfile.js b/gulpfile.js index 3756efde..5289a7a5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,6 +2,7 @@ const gulp = require('gulp') , fs = require('fs-extra') + , formatSize = require(__dirname+'/helpers/files/formatsize.js') , uploadDirectory = require(__dirname+'/helpers/files/uploadDirectory.js') , configs = require(__dirname+'/configs/main.js') , { themes, codeThemes } = require(__dirname+'/helpers/themes.js') @@ -164,7 +165,8 @@ function custompages() { locals: { codeLanguages: configs.highlightOptions.languageSubset, defaultTheme: configs.boardDefaults.theme, - defaultCodeTheme: configs.boardDefaults.codeTheme + defaultCodeTheme: configs.boardDefaults.codeTheme, + postFilesSize: formatSize(configs.globalLimits.postFilesSize.max) } })) .pipe(gulp.dest(paths.pug.dest)); diff --git a/views/custompages/faq.pug b/views/custompages/faq.pug index 8a67df9d..c342cb66 100644 --- a/views/custompages/faq.pug +++ b/views/custompages/faq.pug @@ -19,10 +19,12 @@ block content ul.mv-0 li: a(href='#whats-an-imageboard') What is an imageboard? li: a(href='/rules.html') What are the rules? + li: a(href='#contact') How can I contact the administration? b Making posts ul.mv-0 li: a(href='#name-formatting') How do names, tripcodes and capcodes work? li: a(href='#post-styling') What kind of styling options are available when making a post? + li: a(href='#post-info') What is the file size limit? li: a(href='#moderation') How does moderation work? b Boards, users & permissions ul.mv-0 @@ -177,6 +179,14 @@ block content | If the language is "plain", highlighting is disabled for the code block. Not all languages are supported, a subset of popular languages is used. | If the language is not in the supported list, the code block will be rendered like "plain" with no highlighting. | Languages supported: #{codeLanguages.join(', ')} + .table-container.flex-center.mv-5 + .anchor#post-info + table + tr + th: a(href='#post-info') What is the file size limit? + tr + td + p Max size of form data per-post is #{postFilesSize}. Because other fields e.g. name, message, etc contribute to this, the maximum size of file uploads will be very slightly smaller than this. .table-container.flex-center.mv-5 .anchor#moderation table @@ -247,3 +257,23 @@ block content | Level 2 and 3 are usually only aplicable to users when on a board they are owner or moderator. However, level 2 or 3 can be assigned manually to create global board owners or global board moderators | who have board owner or moderation permissions on all boards, but without access to the global moderation interfaces. If assigning global boad owners (level 2), they will have access to the board settings | and the ability to reassign board owners. + .table-container.flex-center.mv-5 + .anchor#contact + table + tr + th: a(href='#contact') How can I contact the administration? + tr + td + p + | For casual inquiries, questions, comments, bugs, etc. use the meta board + a(href='/t/index.html') >>>/t/ + | and make a public post. + | If you need to make a bug report and have a github account, please + a.quote(href='https://github.com/fatchan/jschan/issues') open an issue + | . For private bug disclosure e.g. security vulnerabilities or other urgent matters email + a(href='mailto:admin@fatpeople.lol') admin@fatpeople.lol + | . + | For abuse reports email + a(href='mailto:abuse@fatpeople.lol') abuse@fatpeople.lol + | . + diff --git a/views/custompages/faq.pug.example b/views/custompages/faq.pug.example new file mode 100644 index 00000000..d4af0be8 --- /dev/null +++ b/views/custompages/faq.pug.example @@ -0,0 +1,267 @@ +extends ../layout.pug +include ../mixins/post.pug + +block head + script(src='/js/all.js') + title Frequently Asked Questions + +block content + h1.board-title FAQ + include ../includes/stickynav.pug + .table-container.flex-center.mv-5 + .anchor + table + tr + th Frequently Asked Questions + tr + td.post-message + b General + ul.mv-0 + li: a(href='#whats-an-imageboard') What is an imageboard? + li: a(href='/rules.html') What are the rules? + li: a(href='#contact') How can I contact the administration? + b Making posts + ul.mv-0 + li: a(href='#name-formatting') How do names, tripcodes and capcodes work? + li: a(href='#post-styling') What kind of styling options are available when making a post? + li: a(href='#post-info') What is the file size limit? + li: a(href='#moderation') How does moderation work? + b Boards, users & permissions + ul.mv-0 + li: a(href='#make-a-board') How do I make my own board? + li: a(href='#staff-and-permissions') How do staff, users and permissions work? + .table-container.flex-center.mv-5 + .anchor#whats-an-imageboard + table + tr + th: a(href='#whats-an-imageboard') What is an imageboard? + tr + td + p + | An imageboard is a type of discussion board where users share images and text about various topics. + p + | The primary difference between imageboards and traditional forums is that anybody can make a post without registering + | an account or providing any personal information. This lowers the barrier to entry, protects user identities and focuses on what is said, rather than who says it. + .table-container.flex-center.mv-5 + .anchor#name-formatting + table + tr + th: a(href='#name-formatting') Name formatting + tr + td.post-message + p When posting, you can format the name field to include a name, tripcode , capcode, any combination of the three including leaving the field completely blank. Instead of a blank name, "Anonymous" is used, however this depends on board-specific configuration. The optional components are explained below. + + b Format + p + | Names should be input like: + input(disabled='true' spellcheck='false' type='text' value='Name##Tripcode## Capcode') + | . Tripcode and capcode are optional components. Tripcodes and capcodes may not contain "##" and the whitespace before capcodes is significant. + p Valid examples: + ol.mv-0 + li Name + li Name##tripcode + li Name## capcode + li Name##tripcode## capcode + li ##tripcode## capcode + li ##tripcode + li ## capcode + p The capcode can also be left blank to display just your role. + p From the examples, you can see that all components can be used in combination or independently. In a post number 4 would look like: + - + const examplePost = { + "date" : new Date("2019-08-02T09:48:44.180Z"), + "name" : "Name", + "board" : "example", + "tripcode" : "!!X8NXmAS44=", + "capcode" : "##Board Owner capcode", + "message" : "Hello, world!", + "nomarkup" : "Hello, world!", + "thread" : 1, + "password" : null, + "email" : "", + "spoiler" : false, + "banmessage" : null, + "files" : [ ], + "reports" : [ ], + "globalreports" : [ ], + "quotes" : [ ], + "backlinks" : [ ], + "postId" : 123 + } + +post(examplePost) + p The name appears bold in the top left, followed by the tripcode in regular weight with a !! prefix, then the capcode in a different color, bold and with a ## prefix. The colours may vary between themes but are generally distinct from eachother + + b Name + p The name is simply what name you want to be shown alongside your post. Other users can post with the same name so there is nothing preventing impersonation. This is not related to your username (for registered users). + + b Tripcode + p A tripcode is a password of sorts, which users can provide in the tripcode component of their name. This tripcode is used in conjunction with a server-known secret to generate a unique* tripcode portion of the name. Long, unique tripcodes can be used as a form of identity. It is important that you keep tripcodes secret if you use them for some form of identity. A compromised tripcode can be used for impersonation and cannot be revoked in any way. + + b Capcode + p A capcode is a component of the name field only available to authenticated users. This includes admins, global staff, board owners and board moderators. If there is no text after the ##, the role will be displayed alone. Leaving a space and putting custom text will be prefixed by the role name. This way, the role is always shown to prevent role impersonation. + .table-container.flex-center.mv-5 + .anchor#post-styling + table + tr + th(colspan=2): a(href='#post-styling') Post styling + tr + th Input + th Output + tr + td >greentext + td + span.greentext >greentext + tr + td <pinktext + td + span.pinktext <pinktext + tr + td ==title== + td + span.title title + tr + td ''bold'' + td + span.bold bold + tr + td __underline__ + td + span.underline underline + tr + td ~~strikethrough~~ + td + span.strikethrough strikethrough + tr + td ||spoiler text|| + td + span.spoiler spoiler text + tr + td **italic** + td + span.em italic + tr + td (((detected))) + td + span.detected (((detected))) + tr + td ##2d9+3 + td + img(src='/img/dice.png' height='16' width='16') + span.dice (##2d9-3) Rolled 2 dice with 9 sides and modifier +3 = 10 + tr + td https://example.com + td: a(href='#!') https://example.com + tr + td >>123 + td: a(class="quote" href="#!") >>123 + tr + td >>>/b/ + td: a(class="quote" href="#!") >>>/b/ + tr + td >>>/b/123 + td: a(class="quote" href="#!") >>>/b/123 + tr + td `inline monospace` + td + span.mono inline monospace + tr + td + | ```language + br + | code block + br + | ``` + td + span.code code block + tr + td(colspan=2) + | The "language" of code blocks is optional. Without it, automatic language detection is used. + | If the language is "plain", highlighting is disabled for the code block. Not all languages are supported, a subset of popular languages is used. + | If the language is not in the supported list, the code block will be rendered like "plain" with no highlighting. + | Languages supported: #{codeLanguages.join(', ')} + .table-container.flex-center.mv-5 + .anchor#post-info + table + tr + th: a(href='#post-info') What is the file size limit? + tr + td + p Max size of form data per-post is #{postFilesSize}. Because other fields e.g. name, message, etc contribute to this, the maximum size of file uploads will be very slightly smaller than this. + .table-container.flex-center.mv-5 + .anchor#moderation + table + tr + th: a(href='#moderation') How does moderation work? + tr + td.post-message + b General + p + | Moderation is very simple. Moderation permissions are different between regular users, board staff (board owner or moderator) and globals (global staff or admin). + | By default, regular users can delete, spoiler or remove the files from their own posts, provided a matching post password is supplied. They can also report or global report posts. + | Board staff have near full power over posts on their board including removing posts, stickying, spoilering, etc. even for other users posts without the need for a password. They also have access to board specific management page. + | Global staff have full power over all posts on all boards, can access the board specific management page for any board and additionally have access to the global management page. + | More details on the specifics of permission levels is available + a(href='#staff-and-permissions') here + | . + b Local vs. Global reports + p + | There exists the concept of "local" and "global" reports. Reporting a post locally will show the post along with reports on the report page for that particular board, and the reports + | may be actioned upon by the board staff. Reporting a post globally will show the post along with reports on the global manage page available only to global staff and may be actioned upon by global staff. + | Global reports should be used to flag posts that violate global rules such as illegal content or spam, in contrast to local reports which are for posts that abide by global rules but break + | board-specific rules (which may be made arbitrarily by board staff). It is also possible to be banned from a board or globally for abuse of the report system. + b Batch processing of posts + p + | Each post has a checkbox in the top left to select it for moderation actions. Multiple posts may be selected to allow batch processing e.g. reporting multiple offending posts in one request. + | The same is present in moderation interfaces. Some actions for example bans (which are based on IP) may also be handled in batches. Selecting multiple posts and using the ban action will + | apply a single ban for each unique IP of the selected posts. + b Time format in moderation interfaces + p + | Some moderation interfaces, for example the ban duration when moderating posts, or the ban duration for post filtering use a shorthand for times/length. This format supports years, months, weeks, days and hours. + | An input of "3m" would mean 3 months and "1y2m3w4d5h" would mean 1 year, 2 months, 3 weeks, 4 days and 5 hours. Units of time should be in descending order, so "2w1m" is invalid. + | However you may use "6w" for example to input 6 weeks, and are not required to use "1m2w". + .table-container.flex-center.mv-5 + .anchor#make-a-board + table + tr + th: a(href='#make-a-board') How do I make my own board? + tr + td + p + a(href='/register.html') Register + | an account, then + a(href='/create.html') create a board + |. Please avoid making excessive amounts of boards, duplicate or boards similar to an existing one unless you expect that many users will migrate to the new board for whatever reason e.g. tyrannical moderation. + .table-container.flex-center.mv-5 + .anchor#staff-and-permissions + table + tr + th: a(href='#staff-and-permissions') How do staff, users and permissions work? + tr + td + p + | There are 5 levels of permissions on the site with 0 being the highest level of privilege and 4 the lowest. In this list "Regular user" refers to somebody who is either not logged in or is not owner/mod of the board. For example if a user creates their own board, they do not have the "Board owner" permissions on other boards. Each board can have one owner and multiple moderators. Ownership can be transferred. + ol(start='0') + li Admin: All permissions + li Global staff: All permissions on all boards excluding account management and news updates + li Board owner: Permissions to board-specific settings, reports, banners and bans and some post actions + li Board moderator: Permissions to manage board-specific reports, bans and some post actions + li Regular user: Permissions to report/delete/spoiler posts + | Post actions refers to reporting, deleting, stickying, etc. More details on these permissions: + ol(start='0') + li Admin: All actions + li Global staff: All below, delete files, delete-by-ip-global and global ban + li Board owner: Same as board moderator + li Board moderator: All below, move/merge, ban, delete-by-ip, sticky/sage/lock/cycle + li Regular user: Reports, and post spoiler/delete/unlink if the board has them enabled + | Administrators have the ability to assign a permission level directly to users through the global management page. Typically a user is level 4 (regular user), 1 (global staff) or 0 (administrator). + | Level 2 and 3 are usually only aplicable to users when on a board they are owner or moderator. However, level 2 or 3 can be assigned manually to create global board owners or global board moderators + | who have board owner or moderation permissions on all boards, but without access to the global moderation interfaces. If assigning global boad owners (level 2), they will have access to the board settings + | and the ability to reassign board owners. + .table-container.flex-center.mv-5 + .anchor#contact + table + tr + th: a(href='#contact') How can I contact the administration? + tr + td + p Example diff --git a/views/custompages/rules.pug b/views/custompages/rules.pug index cc3b6a8c..4bcd4149 100644 --- a/views/custompages/rules.pug +++ b/views/custompages/rules.pug @@ -1,4 +1,3 @@ - extends ../layout.pug block head @@ -11,7 +10,9 @@ block content table.table-body tr.table-row td - p Do not post, link or promote any content illegal under United States law. - p Do not spam, flood, (D)DoS, etc. which negatively impacts site performance. - p SFW marked boards must be primarily SFW and spoiler all NSFW content. - p No advertising other imageboards. Join the webring instead of shilling. + p 1. Do not post, request, link or promote any content illegal under United States law. + p 2. Do not post child models, underage, "jailbait", social media posts of kids, etc. + p 3. Do not spam, flood, (D)DoS, etc which may negatively impact site performance. + p 4. No advertising, link shorteners, referrals or affiliate links, etc. + p 5. Boards created for the sole purpose of spam or whose board owners neglect reasonable antispam settings may be locked, forfeited or deleted. + p 6. SFW marked boards must be primarily SFW and spoiler all NSFW content. diff --git a/views/custompages/rules.pug.example b/views/custompages/rules.pug.example new file mode 100644 index 00000000..50262095 --- /dev/null +++ b/views/custompages/rules.pug.example @@ -0,0 +1,13 @@ +extends ../layout.pug + +block head + script(src='/js/all.js') + title Rules + +block content + h1.board-title Rules + .table-container.flex-center.mv-10 + table.table-body + tr.table-row + td + p 1. Put rules here