Making a minimal chan - nanochan


oc/ - Original Content - Share your own art, code, and music



Onion Details



Page Clicks: 0

First Seen: 03/11/2024

Last Indexed: 10/21/2024

Domain Index Total: 313



Onion Content



/oc/ - Original Content Share your own art, code, and music [Make a Post] Making a minimal chan Nanonymous 2021-07-29 09:43:50 No. 2132 (L) [D] [U] [F] [S] [L] [A] [C] File: d906ac90f91f2e601e62b229f4540abccbc7b10980403b18c962c7ca2fd75b0b.jpg ( dl ) (218.22 KiB) I know we are already in the second best of all possible worlds. But could we be in the meager-est of all possible worlds? I'm thinking of a chan that is just >2134 File: 86ef6463aaaa705954401f0982403edc188b89dc7d0834e206a133e37855266a.jpg ( dl ) (291.61 KiB) >I know we are already in the second best of all possible worlds. Looks glorious. >What do you think? Whatever that is, I'm hyped. Expecting a /lit/ there. Nanonymous 2021-07-29 09:59:50 No. 2134 [D] >>2135 >>2133 Go to hell, larper. Nanonymous 2021-07-29 10:01:05 No. 2135 [D] >>2134 Yeah, gonna miss all the attention I get from making everyone seethe by just existing. Take 2 - the author thinks it's pretty cool now. Nanonymous 2021-07-29 17:48:07 No. 2136 [D] (defvar *chan*) (setf (symbol-function '*chan*) (let ((logfile #p"post.log")) (lambda (&key nappend) (if nappend (with-open-file (s logfile :direction :output :if-exists :append :if-does-not-exist :create) (format s "'~s~%" nappend)) (let ((s nil)) (unwind-protect (let ((s (open logfile))) (lambda () (let ((post (when s (read s nil)))) (if post (when s (progn (close s :abort t) (setf s nil))))))) (when s (close s :abort t)))))))) ;;;;eg - you can just drop this whole post into your lisp repl. It will make a file named post.log in the local directory though. (*chan* :nappend '(whatever . you)) (*chan* :nappend "want, really") (*chan* :nappend '(but pragmattically something like)) (*chan* :nappend '((topic . "a minimal chan") (timestamp . board-time) (text . "Do I have to have UTF8?"))) (let ((reader (*chan*))) (loop for post = (funcall reader) while post do (format t "~a~%" post))) 2dgg34 2021-07-30 00:37:39 No. 2137 [D] >>2138 Making a minimal chan - nanochan main mod log stats recent overboard [A] /b/ /l/ /g/ /pol/ /meta/ /a/ /v/ /oc/ /ar/ /oc/ - Original Content Share your own art, code, and music [Make a Post] [X] Name Email Subject Comment File Captcha Making a minimal chan Nanonymous 2021-07-29 09:43:50 No. 2132 [D] [U] [F] [S] [L] [A] [C] File: d906ac90f91f2e601e62b229f4540abccbc7b10980403b18c962c7ca2fd75b0b.jpg ( dl ) (218.22 KiB) I know we are already in the second best of all possible worlds. But could we be in the meager-est of all possible worlds? I'm thinking of a chan that is just <```chan.lisp (in-package :chan) (defparameter *world* '(("compu") ("woods") ("foods") ("manuf") ("dwell") ("busin"))) (defun view (&optional (board-name nil) (topic-name nil) (stream *standard-output*)) (cond ((and board-name topic-name) (format stream "~s~%" (assoc topic-name (cdr (assoc board-name *world* :test 'equal)) :test 'equal))) (board-name (format stream "~s~%" (mapcar #'car (cdr (assoc board-name *world* :test 'equal))))) (t (format stream "~s~%" (mapcar #'car *world*))))) (defun post (board-name topic-name post) (if (assoc topic-name (cdr (assoc board-name *world*)) :test 'equal) (nconc (assoc topic-name (cdr (assoc board-name *world*)) :test 'equal) (list post)) (nconc (assoc board-name *world* :test 'equal) (list (cons topic-name post)))) (values nil)) <``` And then serve this over onion by tcp (usocket) with some attack mitigations (persisting to disk is an attack mitigation, right). What do you think? Nanonymous 2021-07-29 09:48:56 No. 2133 [D] [U] [F] >>2134 File: 86ef6463aaaa705954401f0982403edc188b89dc7d0834e206a133e37855266a.jpg ( dl ) (291.61 KiB) >I know we are already in the second best of all possible worlds. Looks glorious. >What do you think? Whatever that is, I'm hyped. Expecting a /lit/ there. Nanonymous 2021-07-29 09:59:50 No. 2134 [D] >>2135 >>2133 Go to hell, larper. Nanonymous 2021-07-29 10:01:05 No. 2135 [D] >>2134 Yeah, gonna miss all the attention I get from making everyone seethe by just existing. Take 2 - the author thinks it's pretty cool now. Nanonymous 2021-07-29 17:48:07 No. 2136 [D] (defvar *chan*) (setf (symbol-function '*chan*) (let ((logfile #p"post.log")) (lambda (&key nappend) (if nappend (with-open-file (s logfile :direction :output :if-exists :append :if-does-not-exist :create) (format s "'~s~%" nappend)) (let ((s nil)) (unwind-protect (let ((s (open logfile))) (lambda () (let ((post (when s (read s nil)))) (if post (when s (progn (close s :abort t) (setf s nil))))))) (when s (close s :abort t)))))))) ;;;;eg - you can just drop this whole post into your lisp repl. It will make a file named post.log in the local directory though. (*chan* :nappend '(whatever . you)) (*chan* :nappend "want, really") (*chan* :nappend '(but pragmattically something like)) (*chan* :nappend '((topic . "a minimal chan") (timestamp . board-time) (text . "Do I have to have UTF8?"))) (let ((reader (*chan*))) (loop for post = (funcall reader) while post do (format t "~a~%" post))) [Catalog] [Overboard] [Update] [Reply] 2 files, 4 replies Nanonymous 2021-07-30 00:43:06 No. 2138 [D] >>2137 See that's what you think, but what you haven't realized is that I'm not adding web. Nanonymous 2021-08-03 04:00:31 No. 2140 [D] Well, I think that's that. I'm going to inline all of my files here. pkg_add ecl usocket of ((( https://github.com))) /usocket/usocket in your ~/common-lisp/ and its dependencies (I think split-sequence). Good luck. Usage, serving: $ ecl > (require 'asdf) > (require 'hapastan) > (hapastan:serve) Usage, using (default port 4242) $ nc localhost 4242 "You can really put anything here" Need to hit return twice for some reason. Standing bug. "Reading the chan": $ nc localhost 4242 nil Let me know if you manage to try it, or try but don't manage it. I suggest an ad hoc alist for posts that let people filter how they like. nc localhost 4242 ( (topic Hapas) ;; Both symbols. (author "Are") ;;strings are fine (comment "evolved from tigers")) ;;(Nothing gets evaluated) It seems sensible to put base64 encoded image text in a field but severely size limit them. Nanonymous 2021-08-03 04:23:59 No. 2142 [D] ** > (hapastan:serve) should be > (hapastan:main) or else (hapastan::serve) Nanonymous 2021-08-03 04:53:17 No. 2143 [D] In order to totally not replace nanochan: populate tcp hidden service files -serve has a thread pool -Override the reader macro to drop misbehaving connections -End connections better generally [Catalog] [Overboard] [Update] [Reply] 2 files, 10 replies