├── bin └── .foobar ├── ebin └── .empty ├── examples ├── ebin │ └── .empty └── include │ └── .empty ├── applications ├── yapp │ ├── doc │ │ └── .empty │ ├── ebin │ │ └── .empty │ ├── vsn.mk │ ├── priv │ │ └── docroot │ │ │ ├── END.inc │ │ │ ├── index.yaws │ │ │ ├── HEAD.inc │ │ │ ├── list.yaws │ │ │ ├── remove_post.yaws │ │ │ ├── add_post.yaws │ │ │ ├── add.yaws │ │ │ └── remove.yaws │ ├── src │ │ ├── yapp.app.src │ │ ├── Makefile │ │ ├── yapp_registry.erl │ │ ├── yapp_app.erl │ │ └── yapp_sup.erl │ ├── Makefile │ └── README ├── mail │ ├── ebin │ │ └── .empty │ ├── vsn.mk │ ├── mail │ │ ├── mail.js │ │ ├── up.gif │ │ ├── down.gif │ │ ├── spacer.gif │ │ ├── tab-hr.gif │ │ ├── tool-div.gif │ │ ├── index.yaws │ │ ├── tool-send.gif │ │ ├── view-mark.gif │ │ ├── tab-bg_active.gif │ │ ├── tool-delete.gif │ │ ├── tool-newmail.gif │ │ ├── tab-bg_inactive.gif │ │ ├── tab-left_active.gif │ │ ├── tab-left_inactive.gif │ │ ├── tab-right_active.gif │ │ ├── tab-right_inactive.gif │ │ ├── compose.yaws │ │ ├── logout.yaws │ │ ├── send.yaws │ │ ├── headers.yaws │ │ ├── showmail.yaws │ │ ├── listop.yaws │ │ ├── login.yaws │ │ ├── mail.yaws │ │ └── reply.yaws │ ├── src │ │ ├── mail_vsn.template │ │ ├── defs.hrl │ │ ├── yaws-webmail.conf │ │ ├── attachment.erl │ │ └── Makefile │ ├── Makefile │ ├── TODO │ ├── include.mk │ └── README ├── wiki │ ├── ebin │ │ └── .keepme │ ├── vsn.mk │ ├── start.sh │ ├── src │ │ ├── wiki.erl │ │ ├── wiki_format_txt.erl │ │ ├── wiki_vsn.template │ │ ├── wiki_plugin_dummy.erl │ │ ├── wiki_plugin_backlinks.erl │ │ ├── Makefile │ │ ├── wiki_plugin_menu.erl │ │ └── utils.erl │ ├── wiki │ │ ├── Examples.wob │ │ ├── ALockedPage.wob │ │ ├── AnUnlockedPage.wob │ │ ├── WikiPreferences.wob │ │ ├── FormattingWikiPages.wob │ │ ├── WikiPreferences.files │ │ │ ├── ftp.png │ │ │ ├── url.png │ │ │ ├── back.gif │ │ │ ├── edit.gif │ │ │ ├── editme.gif │ │ │ ├── home.gif │ │ │ ├── http.png │ │ │ ├── https.png │ │ │ ├── icon.gif │ │ │ ├── index.gif │ │ │ ├── kamera.gif │ │ │ ├── mailto.png │ │ │ ├── allpages.gif │ │ │ ├── forward.gif │ │ │ ├── history.gif │ │ │ ├── zombies.gif │ │ │ ├── editfiles.gif │ │ │ ├── interwiki.png │ │ │ ├── lastedited.gif │ │ │ ├── template2.html │ │ │ ├── custom.css │ │ │ ├── template_info.html │ │ │ ├── template_info2.html │ │ │ └── template.html │ │ ├── getMidSize.yaws │ │ ├── getThumb.yaws │ │ ├── allRefsToMe.yaws │ │ ├── storePage.yaws │ │ ├── allPages.yaws │ │ ├── editFiles.yaws │ │ ├── editPage.yaws │ │ ├── editTag.yaws │ │ ├── lastEdited.yaws │ │ ├── wikiZombies.yaws │ │ ├── importFiles.yaws │ │ ├── showHistory.yaws │ │ ├── showOldPage.yaws │ │ ├── showPage.yaws │ │ ├── storeFiles.yaws │ │ ├── storeTagged.yaws │ │ ├── changePassword.yaws │ │ ├── copyFiles.yaws │ │ ├── createNewPage.yaws │ │ ├── deleteFiles.yaws │ │ ├── previewPage.yaws │ │ ├── previewTagged.yaws │ │ ├── putPassword.yaws │ │ ├── slideShow.yaws │ │ ├── storeNewPage.yaws │ │ ├── thumbIndex.yaws │ │ ├── finalDeletePage.yaws │ │ ├── previewNewPage.yaws │ │ ├── changePassword2.yaws │ │ ├── sendMeThePassword.yaws │ │ ├── index.yaws │ │ ├── addFile.yaws │ │ └── searchPage.yaws │ ├── wiki.conf │ ├── scripts │ │ ├── addFile.src │ │ ├── getPassword.src │ │ ├── importFiles.src │ │ ├── Makefile │ │ └── updateWiki.src │ ├── include.mk │ ├── Makefile │ └── README └── chat │ ├── chat │ ├── chat_read.yaws │ ├── cry.png │ ├── sad.png │ ├── angel.png │ ├── burp.png │ ├── cool.png │ ├── kiss.png │ ├── smile.png │ ├── think.png │ ├── wink.png │ ├── yell.png │ ├── bigsmile.png │ ├── farted.png │ ├── index.yaws │ ├── oneeye.png │ ├── scream.png │ ├── tongue.png │ ├── moneymouth.png │ ├── crossedlips.png │ ├── embarrassed.png │ ├── chat_write.yaws │ ├── login.yaws │ └── chat.yaws │ ├── Makefile │ ├── src │ └── Makefile │ └── include.mk ├── .gitignore ├── www ├── ssi_ex1 ├── END ├── small.yaws ├── favicon.ico ├── icons │ ├── a.gif │ ├── c.gif │ ├── f.gif │ ├── p.gif │ ├── dir.gif │ ├── dvi.gif │ ├── erl.gif │ ├── hrl.gif │ ├── pdf.gif │ ├── ps.gif │ ├── tar.gif │ ├── tex.gif │ ├── up.gif │ ├── uu.gif │ ├── back.gif │ ├── binary.gif │ ├── binhex.gif │ ├── blank.gif │ ├── bomb.gif │ ├── box1.gif │ ├── box2.gif │ ├── broken.gif │ ├── burst.gif │ ├── down.gif │ ├── folder.gif │ ├── image1.gif │ ├── image2.gif │ ├── image3.gif │ ├── index.gif │ ├── layout.gif │ ├── left.gif │ ├── link.gif │ ├── movie.gif │ ├── patch.gif │ ├── php4.gif │ ├── pie0.gif │ ├── pie1.gif │ ├── pie2.gif │ ├── pie3.gif │ ├── pie4.gif │ ├── pie5.gif │ ├── pie6.gif │ ├── pie7.gif │ ├── pie8.gif │ ├── portal.gif │ ├── quill.gif │ ├── right.gif │ ├── screw1.gif │ ├── screw2.gif │ ├── script.gif │ ├── sound1.gif │ ├── sound2.gif │ ├── text.gif │ ├── world1.gif │ ├── world2.gif │ ├── yaws.gif │ ├── yawsY.gif │ ├── yaws_y.gif │ ├── ball.red.gif │ ├── forward.gif │ ├── generic.gif │ ├── hand.up.gif │ ├── mailman.jpg │ ├── small │ │ ├── ps.gif │ │ ├── uu.gif │ │ ├── back.gif │ │ ├── blank.gif │ │ ├── burst.gif │ │ ├── comp1.gif │ │ ├── comp2.gif │ │ ├── dir.gif │ │ ├── dir2.gif │ │ ├── doc.gif │ │ ├── image.gif │ │ ├── index.gif │ │ ├── key.gif │ │ ├── movie.gif │ │ ├── patch.gif │ │ ├── sound.gif │ │ ├── tar.gif │ │ ├── text.gif │ │ ├── binary.gif │ │ ├── binhex.gif │ │ ├── broken.gif │ │ ├── forward.gif │ │ ├── generic.gif │ │ ├── image2.gif │ │ ├── rainbow.gif │ │ ├── sound2.gif │ │ ├── unknown.gif │ │ ├── compressed.gif │ │ ├── continued.gif │ │ ├── generic2.gif │ │ ├── generic3.gif │ │ ├── transfer.gif │ │ └── README.txt │ ├── sphere1.gif │ ├── sphere2.gif │ ├── transfer.gif │ ├── unknown.gif │ ├── yaws_pb.gif │ ├── alert.black.gif │ ├── alert.red.gif │ ├── apache_pb.gif │ ├── ball.gray.gif │ ├── comp.blue.gif │ ├── comp.gray.gif │ ├── compressed.gif │ ├── continued.gif │ ├── folder.open.gif │ ├── folder.sec.gif │ ├── generic.red.gif │ ├── generic.sec.gif │ ├── hand.right.gif │ ├── icon.sheet.gif │ ├── uuencoded.gif │ ├── yaws_head.gif │ ├── PythonPowered.png │ ├── gnu-head-tiny.jpg │ └── mailman-large.jpg ├── spacer.gif ├── simple_ex1.yaws ├── process_tree.dia ├── process_tree.png ├── compile_layout.dia ├── compile_layout.png ├── testdir │ └── index.html ├── .xvpics │ ├── hyber.org.gif │ └── hyber_org.jpg ├── shopingcart │ ├── junk.jpg │ ├── loginpost.yaws │ ├── buy.yaws │ ├── index.yaws │ ├── logout.yaws │ ├── shopcart_form.yaws │ ├── Makefile │ └── style.css ├── redirect3.yaws ├── redirect4.yaws ├── simple_ex2.yaws ├── ssi │ ├── dynamic.1 │ ├── dynamic.3 │ └── dynamic.2 ├── redirect2.yaws ├── simple_ex3.yaws ├── simple_ex4.yaws ├── END2 ├── code │ ├── Makefile │ └── myappmod.erl ├── HEAD ├── static.html ├── haxe_sample.html ├── haxe_sample.yaws ├── code.yaws ├── api.yaws ├── motivation.yaws ├── upload0.yaws ├── session.yaws ├── ybed.erl ├── contact.yaws ├── examples.yaws ├── urandom.yaws ├── man.yaws ├── stats.yaws ├── yaws-1.55_to_1.56.patch ├── arg2.yaws ├── json_sample.html ├── session1.yaws ├── yman.yaws ├── doc.yaws ├── todo.yaws ├── json_sample.yaws ├── readpcookie.yaws ├── stats_ex.yaws ├── setcookie.yaws ├── pcookie.yaws ├── readcookie.yaws ├── contribs.yaws ├── form.yaws ├── cookies.yaws ├── stil.css ├── setpcookie.yaws ├── post.yaws ├── query.yaws └── stream.yaws ├── vsn.mk ├── ChangeLog ├── doc ├── yaws.tex └── Makefile ├── src ├── yaws_ls.erl ├── ymnesia.erl ├── yaws_rpc.erl ├── yaws_rss.erl ├── yaws_jsonrpc.erl ├── yaws_xmlrpc.erl ├── yaws.app.src ├── yaws.conf ├── yaws_ticker.erl ├── yaws_vsn.template ├── yaws_app.erl ├── yaws_generated.template ├── yaws_log_file_h.erl ├── yaws_404.erl └── yaws_debug.hrl ├── scripts ├── Subst ├── darwin │ ├── Yaws.plist │ ├── README │ └── Yaws.StartupItem ├── freebsd │ └── yaws.sh ├── make-upload ├── gentoo │ ├── yaws.ebuild │ ├── conf.d.yaws │ └── init.d.yaws ├── make-release ├── debian │ └── yaws.init.d ├── netbsd │ └── yaws.sh ├── redhat │ └── yaws.init.d └── Makefile ├── sourceforge-site ├── yaws_pb2.gif └── yaws_head3.gif ├── include ├── yaws_dav.hrl ├── erlsom.hrl └── yaws_api.hrl ├── man └── Makefile ├── ssl ├── yaws-key.pem └── yaws-cert.pem ├── c_src └── Makefile ├── Makefile ├── LICENSE └── include.mk.in /bin/.foobar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ebin/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/ebin/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/include/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /applications/yapp/doc/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.beam 2 | *.o 3 | -------------------------------------------------------------------------------- /applications/mail/ebin/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /applications/wiki/ebin/.keepme: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /applications/yapp/ebin/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /www/ssi_ex1: -------------------------------------------------------------------------------- 1 | variable a = %a% 2 | -------------------------------------------------------------------------------- /vsn.mk: -------------------------------------------------------------------------------- 1 | YAWS_VSN=1.68 2 | 3 | 4 | -------------------------------------------------------------------------------- /applications/mail/vsn.mk: -------------------------------------------------------------------------------- 1 | WIKI_VSN=0.8 2 | -------------------------------------------------------------------------------- /applications/wiki/vsn.mk: -------------------------------------------------------------------------------- 1 | WIKI_VSN=0.8 2 | -------------------------------------------------------------------------------- /applications/yapp/vsn.mk: -------------------------------------------------------------------------------- 1 | YAPP_VSN=0.2.0 2 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/ChangeLog -------------------------------------------------------------------------------- /applications/wiki/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | yaws -i -c wiki.conf 3 | -------------------------------------------------------------------------------- /www/END: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | -------------------------------------------------------------------------------- /www/small.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(_) -> {html, "XXXX"}. 3 | 4 | -------------------------------------------------------------------------------- /applications/yapp/priv/docroot/END.inc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /doc/yaws.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/doc/yaws.tex -------------------------------------------------------------------------------- /src/yaws_ls.erl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/src/yaws_ls.erl -------------------------------------------------------------------------------- /src/ymnesia.erl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/src/ymnesia.erl -------------------------------------------------------------------------------- /www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/favicon.ico -------------------------------------------------------------------------------- /www/icons/a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/a.gif -------------------------------------------------------------------------------- /www/icons/c.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/c.gif -------------------------------------------------------------------------------- /www/icons/f.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/f.gif -------------------------------------------------------------------------------- /www/icons/p.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/p.gif -------------------------------------------------------------------------------- /www/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/spacer.gif -------------------------------------------------------------------------------- /src/yaws_rpc.erl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/src/yaws_rpc.erl -------------------------------------------------------------------------------- /src/yaws_rss.erl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/src/yaws_rss.erl -------------------------------------------------------------------------------- /www/icons/dir.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/dir.gif -------------------------------------------------------------------------------- /www/icons/dvi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/dvi.gif -------------------------------------------------------------------------------- /www/icons/erl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/erl.gif -------------------------------------------------------------------------------- /www/icons/hrl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/hrl.gif -------------------------------------------------------------------------------- /www/icons/pdf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pdf.gif -------------------------------------------------------------------------------- /www/icons/ps.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/ps.gif -------------------------------------------------------------------------------- /www/icons/tar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/tar.gif -------------------------------------------------------------------------------- /www/icons/tex.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/tex.gif -------------------------------------------------------------------------------- /www/icons/up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/up.gif -------------------------------------------------------------------------------- /www/icons/uu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/uu.gif -------------------------------------------------------------------------------- /www/simple_ex1.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello world

4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /scripts/Subst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | p=$1 5 | d=$2 6 | 7 | sed -e "s;$p;$d;g" 8 | 9 | -------------------------------------------------------------------------------- /src/yaws_jsonrpc.erl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/src/yaws_jsonrpc.erl -------------------------------------------------------------------------------- /src/yaws_xmlrpc.erl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/src/yaws_xmlrpc.erl -------------------------------------------------------------------------------- /www/icons/back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/back.gif -------------------------------------------------------------------------------- /www/icons/binary.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/binary.gif -------------------------------------------------------------------------------- /www/icons/binhex.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/binhex.gif -------------------------------------------------------------------------------- /www/icons/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/blank.gif -------------------------------------------------------------------------------- /www/icons/bomb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/bomb.gif -------------------------------------------------------------------------------- /www/icons/box1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/box1.gif -------------------------------------------------------------------------------- /www/icons/box2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/box2.gif -------------------------------------------------------------------------------- /www/icons/broken.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/broken.gif -------------------------------------------------------------------------------- /www/icons/burst.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/burst.gif -------------------------------------------------------------------------------- /www/icons/down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/down.gif -------------------------------------------------------------------------------- /www/icons/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/folder.gif -------------------------------------------------------------------------------- /www/icons/image1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/image1.gif -------------------------------------------------------------------------------- /www/icons/image2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/image2.gif -------------------------------------------------------------------------------- /www/icons/image3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/image3.gif -------------------------------------------------------------------------------- /www/icons/index.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/index.gif -------------------------------------------------------------------------------- /www/icons/layout.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/layout.gif -------------------------------------------------------------------------------- /www/icons/left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/left.gif -------------------------------------------------------------------------------- /www/icons/link.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/link.gif -------------------------------------------------------------------------------- /www/icons/movie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/movie.gif -------------------------------------------------------------------------------- /www/icons/patch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/patch.gif -------------------------------------------------------------------------------- /www/icons/php4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/php4.gif -------------------------------------------------------------------------------- /www/icons/pie0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pie0.gif -------------------------------------------------------------------------------- /www/icons/pie1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pie1.gif -------------------------------------------------------------------------------- /www/icons/pie2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pie2.gif -------------------------------------------------------------------------------- /www/icons/pie3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pie3.gif -------------------------------------------------------------------------------- /www/icons/pie4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pie4.gif -------------------------------------------------------------------------------- /www/icons/pie5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pie5.gif -------------------------------------------------------------------------------- /www/icons/pie6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pie6.gif -------------------------------------------------------------------------------- /www/icons/pie7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pie7.gif -------------------------------------------------------------------------------- /www/icons/pie8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/pie8.gif -------------------------------------------------------------------------------- /www/icons/portal.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/portal.gif -------------------------------------------------------------------------------- /www/icons/quill.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/quill.gif -------------------------------------------------------------------------------- /www/icons/right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/right.gif -------------------------------------------------------------------------------- /www/icons/screw1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/screw1.gif -------------------------------------------------------------------------------- /www/icons/screw2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/screw2.gif -------------------------------------------------------------------------------- /www/icons/script.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/script.gif -------------------------------------------------------------------------------- /www/icons/sound1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/sound1.gif -------------------------------------------------------------------------------- /www/icons/sound2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/sound2.gif -------------------------------------------------------------------------------- /www/icons/text.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/text.gif -------------------------------------------------------------------------------- /www/icons/world1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/world1.gif -------------------------------------------------------------------------------- /www/icons/world2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/world2.gif -------------------------------------------------------------------------------- /www/icons/yaws.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/yaws.gif -------------------------------------------------------------------------------- /www/icons/yawsY.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/yawsY.gif -------------------------------------------------------------------------------- /www/icons/yaws_y.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/yaws_y.gif -------------------------------------------------------------------------------- /www/process_tree.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/process_tree.dia -------------------------------------------------------------------------------- /www/process_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/process_tree.png -------------------------------------------------------------------------------- /www/compile_layout.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/compile_layout.dia -------------------------------------------------------------------------------- /www/compile_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/compile_layout.png -------------------------------------------------------------------------------- /www/icons/ball.red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/ball.red.gif -------------------------------------------------------------------------------- /www/icons/forward.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/forward.gif -------------------------------------------------------------------------------- /www/icons/generic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/generic.gif -------------------------------------------------------------------------------- /www/icons/hand.up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/hand.up.gif -------------------------------------------------------------------------------- /www/icons/mailman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/mailman.jpg -------------------------------------------------------------------------------- /www/icons/small/ps.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/ps.gif -------------------------------------------------------------------------------- /www/icons/small/uu.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/uu.gif -------------------------------------------------------------------------------- /www/icons/sphere1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/sphere1.gif -------------------------------------------------------------------------------- /www/icons/sphere2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/sphere2.gif -------------------------------------------------------------------------------- /www/icons/transfer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/transfer.gif -------------------------------------------------------------------------------- /www/icons/unknown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/unknown.gif -------------------------------------------------------------------------------- /www/icons/yaws_pb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/yaws_pb.gif -------------------------------------------------------------------------------- /www/testdir/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/testdir/index.html -------------------------------------------------------------------------------- /applications/chat/chat/chat_read.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> 3 | chat:chat_read(A). 4 | 5 | -------------------------------------------------------------------------------- /www/.xvpics/hyber.org.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/.xvpics/hyber.org.gif -------------------------------------------------------------------------------- /www/.xvpics/hyber_org.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/.xvpics/hyber_org.jpg -------------------------------------------------------------------------------- /www/icons/alert.black.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/alert.black.gif -------------------------------------------------------------------------------- /www/icons/alert.red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/alert.red.gif -------------------------------------------------------------------------------- /www/icons/apache_pb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/apache_pb.gif -------------------------------------------------------------------------------- /www/icons/ball.gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/ball.gray.gif -------------------------------------------------------------------------------- /www/icons/comp.blue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/comp.blue.gif -------------------------------------------------------------------------------- /www/icons/comp.gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/comp.gray.gif -------------------------------------------------------------------------------- /www/icons/compressed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/compressed.gif -------------------------------------------------------------------------------- /www/icons/continued.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/continued.gif -------------------------------------------------------------------------------- /www/icons/folder.open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/folder.open.gif -------------------------------------------------------------------------------- /www/icons/folder.sec.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/folder.sec.gif -------------------------------------------------------------------------------- /www/icons/generic.red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/generic.red.gif -------------------------------------------------------------------------------- /www/icons/generic.sec.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/generic.sec.gif -------------------------------------------------------------------------------- /www/icons/hand.right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/hand.right.gif -------------------------------------------------------------------------------- /www/icons/icon.sheet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/icon.sheet.gif -------------------------------------------------------------------------------- /www/icons/small/back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/back.gif -------------------------------------------------------------------------------- /www/icons/small/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/blank.gif -------------------------------------------------------------------------------- /www/icons/small/burst.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/burst.gif -------------------------------------------------------------------------------- /www/icons/small/comp1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/comp1.gif -------------------------------------------------------------------------------- /www/icons/small/comp2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/comp2.gif -------------------------------------------------------------------------------- /www/icons/small/dir.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/dir.gif -------------------------------------------------------------------------------- /www/icons/small/dir2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/dir2.gif -------------------------------------------------------------------------------- /www/icons/small/doc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/doc.gif -------------------------------------------------------------------------------- /www/icons/small/image.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/image.gif -------------------------------------------------------------------------------- /www/icons/small/index.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/index.gif -------------------------------------------------------------------------------- /www/icons/small/key.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/key.gif -------------------------------------------------------------------------------- /www/icons/small/movie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/movie.gif -------------------------------------------------------------------------------- /www/icons/small/patch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/patch.gif -------------------------------------------------------------------------------- /www/icons/small/sound.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/sound.gif -------------------------------------------------------------------------------- /www/icons/small/tar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/tar.gif -------------------------------------------------------------------------------- /www/icons/small/text.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/text.gif -------------------------------------------------------------------------------- /www/icons/uuencoded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/uuencoded.gif -------------------------------------------------------------------------------- /www/icons/yaws_head.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/yaws_head.gif -------------------------------------------------------------------------------- /www/shopingcart/junk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/shopingcart/junk.jpg -------------------------------------------------------------------------------- /www/icons/PythonPowered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/PythonPowered.png -------------------------------------------------------------------------------- /www/icons/gnu-head-tiny.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/gnu-head-tiny.jpg -------------------------------------------------------------------------------- /www/icons/mailman-large.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/mailman-large.jpg -------------------------------------------------------------------------------- /www/icons/small/binary.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/binary.gif -------------------------------------------------------------------------------- /www/icons/small/binhex.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/binhex.gif -------------------------------------------------------------------------------- /www/icons/small/broken.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/broken.gif -------------------------------------------------------------------------------- /www/icons/small/forward.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/forward.gif -------------------------------------------------------------------------------- /www/icons/small/generic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/generic.gif -------------------------------------------------------------------------------- /www/icons/small/image2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/image2.gif -------------------------------------------------------------------------------- /www/icons/small/rainbow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/rainbow.gif -------------------------------------------------------------------------------- /www/icons/small/sound2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/sound2.gif -------------------------------------------------------------------------------- /www/icons/small/unknown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/unknown.gif -------------------------------------------------------------------------------- /applications/chat/chat/cry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/cry.png -------------------------------------------------------------------------------- /applications/chat/chat/sad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/sad.png -------------------------------------------------------------------------------- /applications/mail/mail/mail.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/mail.js -------------------------------------------------------------------------------- /applications/mail/mail/up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/up.gif -------------------------------------------------------------------------------- /applications/wiki/src/wiki.erl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/src/wiki.erl -------------------------------------------------------------------------------- /sourceforge-site/yaws_pb2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/sourceforge-site/yaws_pb2.gif -------------------------------------------------------------------------------- /www/icons/small/compressed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/compressed.gif -------------------------------------------------------------------------------- /www/icons/small/continued.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/continued.gif -------------------------------------------------------------------------------- /www/icons/small/generic2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/generic2.gif -------------------------------------------------------------------------------- /www/icons/small/generic3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/generic3.gif -------------------------------------------------------------------------------- /www/icons/small/transfer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/www/icons/small/transfer.gif -------------------------------------------------------------------------------- /applications/chat/chat/angel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/angel.png -------------------------------------------------------------------------------- /applications/chat/chat/burp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/burp.png -------------------------------------------------------------------------------- /applications/chat/chat/cool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/cool.png -------------------------------------------------------------------------------- /applications/chat/chat/kiss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/kiss.png -------------------------------------------------------------------------------- /applications/chat/chat/smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/smile.png -------------------------------------------------------------------------------- /applications/chat/chat/think.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/think.png -------------------------------------------------------------------------------- /applications/chat/chat/wink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/wink.png -------------------------------------------------------------------------------- /applications/chat/chat/yell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/yell.png -------------------------------------------------------------------------------- /applications/mail/mail/down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/down.gif -------------------------------------------------------------------------------- /sourceforge-site/yaws_head3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/sourceforge-site/yaws_head3.gif -------------------------------------------------------------------------------- /www/shopingcart/loginpost.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(A) -> 5 | shopcart:loginpost(A). 6 | 7 | 8 | -------------------------------------------------------------------------------- /applications/chat/chat/bigsmile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/bigsmile.png -------------------------------------------------------------------------------- /applications/chat/chat/farted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/farted.png -------------------------------------------------------------------------------- /applications/chat/chat/index.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> 3 | {redirect_local, {rel_path, "chat.yaws"}}. 4 | 5 | -------------------------------------------------------------------------------- /applications/chat/chat/oneeye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/oneeye.png -------------------------------------------------------------------------------- /applications/chat/chat/scream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/scream.png -------------------------------------------------------------------------------- /applications/chat/chat/tongue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/tongue.png -------------------------------------------------------------------------------- /applications/mail/mail/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/spacer.gif -------------------------------------------------------------------------------- /applications/mail/mail/tab-hr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tab-hr.gif -------------------------------------------------------------------------------- /applications/mail/mail/tool-div.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tool-div.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/Examples.wob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/Examples.wob -------------------------------------------------------------------------------- /applications/chat/chat/moneymouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/moneymouth.png -------------------------------------------------------------------------------- /applications/mail/mail/index.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> 3 | {redirect_local, {rel_path, "mail.yaws"}}. 4 | 5 | -------------------------------------------------------------------------------- /applications/mail/mail/tool-send.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tool-send.gif -------------------------------------------------------------------------------- /applications/mail/mail/view-mark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/view-mark.gif -------------------------------------------------------------------------------- /applications/chat/chat/crossedlips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/crossedlips.png -------------------------------------------------------------------------------- /applications/chat/chat/embarrassed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/chat/chat/embarrassed.png -------------------------------------------------------------------------------- /applications/mail/mail/tab-bg_active.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tab-bg_active.gif -------------------------------------------------------------------------------- /applications/mail/mail/tool-delete.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tool-delete.gif -------------------------------------------------------------------------------- /applications/mail/mail/tool-newmail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tool-newmail.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/ALockedPage.wob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/ALockedPage.wob -------------------------------------------------------------------------------- /applications/mail/mail/tab-bg_inactive.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tab-bg_inactive.gif -------------------------------------------------------------------------------- /applications/mail/mail/tab-left_active.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tab-left_active.gif -------------------------------------------------------------------------------- /applications/wiki/src/wiki_format_txt.erl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/src/wiki_format_txt.erl -------------------------------------------------------------------------------- /applications/wiki/wiki/AnUnlockedPage.wob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/AnUnlockedPage.wob -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.wob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.wob -------------------------------------------------------------------------------- /applications/mail/mail/tab-left_inactive.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tab-left_inactive.gif -------------------------------------------------------------------------------- /applications/mail/mail/tab-right_active.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tab-right_active.gif -------------------------------------------------------------------------------- /applications/mail/mail/tab-right_inactive.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/mail/mail/tab-right_inactive.gif -------------------------------------------------------------------------------- /www/redirect3.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | %% redirect 3 yaws 4 | 5 | out(_Arg) -> 6 | {redirect_local, "/redirect2.yaws"}. 7 | 8 | -------------------------------------------------------------------------------- /applications/wiki/wiki/FormattingWikiPages.wob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/FormattingWikiPages.wob -------------------------------------------------------------------------------- /www/redirect4.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | %% redirect4.yaws 4 | 5 | out(_Arg) -> 6 | {redirect_local, {any_path, "redirect2.yaws"}}. 7 | 8 | -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/ftp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/ftp.png -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/url.png -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/back.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/edit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/edit.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/editme.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/editme.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/home.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/home.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/http.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/http.png -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/https.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/https.png -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/icon.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/index.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/index.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/kamera.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/kamera.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/mailto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/mailto.png -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/allpages.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/allpages.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/forward.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/forward.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/history.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/history.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/zombies.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/zombies.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/getMidSize.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(Arg) -> 4 | F = getMidSize, 5 | wiki_yaws:call_with_query(wiki, F, Arg). 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /applications/wiki/wiki/getThumb.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(Arg) -> 4 | F = getThumb, 5 | wiki_yaws:call_with_query(wiki, F, Arg). 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/editfiles.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/editfiles.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/interwiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/interwiki.png -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/lastedited.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/lastedited.gif -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/template2.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mojombo/yaws/HEAD/applications/wiki/wiki/WikiPreferences.files/template2.html -------------------------------------------------------------------------------- /www/simple_ex2.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Yesssssss

5 | 6 | 7 | out(Arg) -> {html, "

Hello again

"}. 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/mail/src/mail_vsn.template: -------------------------------------------------------------------------------- 1 | -module(mail_vsn). 2 | -author('jb@bevemyr.com'). 3 | 4 | -compile(export_all). 5 | 6 | version() -> "%VSN%". 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /applications/wiki/src/wiki_vsn.template: -------------------------------------------------------------------------------- 1 | -module(wiki_vsn). 2 | -author('jb@bevemyr.com'). 3 | 4 | -compile(export_all). 5 | 6 | version() -> "%VSN%". 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /include/yaws_dav.hrl: -------------------------------------------------------------------------------- 1 | -ifndef(_YAWS_DAV). 2 | -define(_YAWS_DAV, true). 3 | 4 | -record(propfind, { 5 | prop = [], 6 | uri = "" 7 | }). 8 | 9 | 10 | 11 | -endif. 12 | -------------------------------------------------------------------------------- /www/shopingcart/buy.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case shopcart:top(A) of 5 | ok -> 6 | shopcart:buy(A); 7 | X -> 8 | X 9 | end. 10 | 11 | 12 | -------------------------------------------------------------------------------- /www/shopingcart/index.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case shopcart:top(A) of 5 | ok -> 6 | shopcart:index(A); 7 | X -> 8 | X 9 | end. 10 | 11 | 12 | -------------------------------------------------------------------------------- /www/ssi/dynamic.1: -------------------------------------------------------------------------------- 1 | 2 |

Foobar

3 | 4 | 5 | 6 | out(Arg) -> 7 | {html, "Funky Stuff"}. 8 | 9 | 10 | 11 |

Baz

12 | 13 | 14 | -------------------------------------------------------------------------------- /www/redirect2.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | %% redirect2.yaws 4 | 5 | out(_Arg) -> 6 | L="http://www.google.com/search?num=20&hl=en&lr=lang_en%7Clang_sv&q=yaws", 7 | {redirect, L}. 8 | 9 | -------------------------------------------------------------------------------- /www/shopingcart/logout.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(A) -> 5 | case shopcart:top(A) of 6 | ok -> 7 | shopcart:logout(A); 8 | X -> 9 | X 10 | end. 11 | 12 | 13 | -------------------------------------------------------------------------------- /www/simple_ex3.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Yesssssss

5 | 6 | 7 | out(Arg) -> {ehtml, [{h2, [{class, "foo"}], "Hello yet again"}]}. 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /www/shopingcart/shopcart_form.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case shopcart:top(A) of 5 | ok -> 6 | shopcart:formupdate(A); 7 | X -> 8 | X 9 | end. 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/wiki/wiki.conf: -------------------------------------------------------------------------------- 1 | logdir = logs 2 | ebin_dir = ebin 3 | include_dir = include 4 | 5 | 6 | port = 8000 7 | listen = 127.0.0.1 8 | docroot = wiki 9 | 10 | -------------------------------------------------------------------------------- /applications/chat/chat/chat_write.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> 3 | case chat:check_session(A) of 4 | Session -> 5 | chat:chat_write(A); 6 | Error -> 7 | Error 8 | end. 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/mail/mail/compose.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case mail:check_session(A) of 5 | {ok, Session} -> 6 | mail:compose(Session); 7 | Error -> 8 | Error 9 | end. 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/mail/mail/logout.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case mail:check_session(A) of 5 | {ok, Session} -> 6 | mail:logout(Session); 7 | Error -> 8 | Error 9 | end. 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/mail/mail/send.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case mail:check_session(A) of 5 | {ok, Session} -> 6 | mail:send(Session,A); 7 | Error -> 8 | Error 9 | end. 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/yapp/priv/docroot/index.yaws: -------------------------------------------------------------------------------- 1 | 2 | %% Bootstrap page to handle both "/xxx" and "/xxx/" root paths 3 | out(A) -> 4 | Redir = yapp:prepath(A) ++ "/list.yaws", 5 | {redirect, Redir }. 6 | 7 | 8 | -------------------------------------------------------------------------------- /www/simple_ex4.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

simple ex 3

5 | 6 | 7 | out(Arg) -> {html, f("Printing the arg structure :" 8 | "~n
~p~n
~n", [Arg])}. 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/yaws.app.src: -------------------------------------------------------------------------------- 1 | {application,yaws, 2 | [{description,"yaws WWW server"}, 3 | {vsn,"%VSN%"}, 4 | {modules,[%MODULES%]}, 5 | {registered, []}, 6 | {mod,{yaws_app,[]}}, 7 | {env, []}, 8 | {applications,[kernel,stdlib]}]}. 9 | -------------------------------------------------------------------------------- /applications/wiki/wiki/allRefsToMe.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(Arg) -> 5 | F = allRefsToMe, 6 | wiki_yaws:call_with_query(wiki, F, Arg). 7 | 8 | 9 | -------------------------------------------------------------------------------- /applications/wiki/wiki/storePage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(Arg) -> 5 | F = storePage, 6 | wiki_yaws:call_with_multiquery(wiki, F, Arg). 7 | 8 | 9 | -------------------------------------------------------------------------------- /applications/wiki/wiki/allPages.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = allPages, 7 | wiki_yaws:call_wiki(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /scripts/darwin/Yaws.plist: -------------------------------------------------------------------------------- 1 | { 2 | Description = "Yaws web server"; 3 | Provides = ("Yaws"); 4 | Requires = ("DirectoryServices"); 5 | Uses = ("Disks", "NFS", "Network Time"); 6 | OrderPreference = "None"; 7 | } 8 | -------------------------------------------------------------------------------- /applications/wiki/wiki/editFiles.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = editFiles, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/editPage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = editPage, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/editTag.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = editTag, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/lastEdited.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = lastEdited, 7 | wiki_yaws:call_wiki(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/wikiZombies.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = wikiZombies, 7 | wiki_yaws:call_wiki(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/importFiles.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = fixupFiles, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/showHistory.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = showHistory, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/showOldPage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = showOldPage, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/showPage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = showPage, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/wiki/wiki/storeFiles.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = storeFiles, 7 | wiki_yaws:call_with_multi(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/storeTagged.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = storeTagged, 7 | wiki_yaws:call_with_multi(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/changePassword.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = changePassword, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/copyFiles.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = copyFiles, 7 | wiki_yaws:call_with_multi(wiki, F, Arg). 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/wiki/wiki/createNewPage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = createNewPage, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/deleteFiles.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = deleteFiles, 7 | wiki_yaws:call_with_multi(wiki, F, Arg). 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/wiki/wiki/previewPage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = previewPage, 7 | wiki_yaws:call_with_multiquery(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/previewTagged.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = previewTagged, 7 | wiki_yaws:call_with_multi(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/putPassword.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = putPassword, 7 | wiki_yaws:call_with_multi(wiki, F, Arg). 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/wiki/wiki/slideShow.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = slideShow, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/wiki/wiki/storeNewPage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = storeNewPage, 7 | wiki_yaws:call_with_multi(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/thumbIndex.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = thumbIndex, 7 | wiki_yaws:call_with_query(wiki, F, Arg). 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /applications/wiki/wiki/finalDeletePage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = finalDeletePage, 7 | wiki_yaws:call_with_multi(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/previewNewPage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = previewNewPage, 7 | wiki_yaws:call_with_multiquery(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/changePassword2.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = changePassword2, 7 | wiki_yaws:call_with_multiquery(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/sendMeThePassword.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = sendMeThePassword, 7 | wiki_yaws:call_with_multi(wiki, F, Arg). 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/mail/mail/headers.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case mail:check_session(A) of 5 | {ok, Session} -> 6 | {ok, Nr} = queryvar(A, "nr"), 7 | mail:showheaders(Session, list_to_integer(Nr)); 8 | Error -> 9 | Error 10 | end. 11 | 12 | 13 | -------------------------------------------------------------------------------- /applications/wiki/wiki/index.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(Arg) -> 4 | {abs_path, P} = (Arg#arg.req)#http_request.path, 5 | Path = yaws_api:url_decode(P), 6 | Prefix = wiki_yaws:get_path_prefix(Path), 7 | {redirect_local, Prefix ++ "showPage.yaws?node=home"}. 8 | 9 | 10 | -------------------------------------------------------------------------------- /applications/yapp/src/yapp.app.src: -------------------------------------------------------------------------------- 1 | {application, yapp, 2 | [{description,"Yaws applications handler"}, 3 | {vsn,"%VSN%"}, 4 | {modules,[%MODULES%]}, 5 | {registered, [yapp_handler]}, 6 | {mod,{yapp_app,[]}}, 7 | {env, [{yapp_registry_impl, yapp_mnesia_server}]}, 8 | {applications,[yaws]}]}. 9 | -------------------------------------------------------------------------------- /applications/wiki/scripts/addFile.src: -------------------------------------------------------------------------------- 1 | #!/bin/bash -- 2 | 3 | progname=`basename $0` 4 | 5 | function usage () { 6 | cat < 8 | EOF 9 | exit 1 10 | } 11 | 12 | 13 | if test $# -ne 2 ; then 14 | usage 15 | fi 16 | 17 | erl -noinput -pa %%ebindir%% -s wiki addFile $1 $2 18 | -------------------------------------------------------------------------------- /applications/wiki/scripts/getPassword.src: -------------------------------------------------------------------------------- 1 | #!/bin/bash -- 2 | 3 | progname=`basename $0` 4 | 5 | function usage () { 6 | cat < 8 | EOF 9 | exit 1 10 | } 11 | 12 | 13 | if test $# -ne 1 ; then 14 | usage 15 | fi 16 | 17 | erl -noinput -pa %%ebindir%% -s wiki getPassword $1 18 | -------------------------------------------------------------------------------- /applications/wiki/scripts/importFiles.src: -------------------------------------------------------------------------------- 1 | #!/bin/bash -- 2 | 3 | progname=`basename $0` 4 | 5 | function usage () { 6 | cat < 8 | EOF 9 | exit 1 10 | } 11 | 12 | 13 | if test $# -ne 1 ; then 14 | usage 15 | fi 16 | 17 | erl -noinput -pa %%ebindir%% -s wiki importFiles $1 18 | -------------------------------------------------------------------------------- /applications/mail/mail/showmail.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case mail:check_session(A) of 5 | {ok, Session} -> 6 | L = yaws_api:parse_query(A), 7 | {value, {_,Nr}} = lists:keysearch("nr",1,L), 8 | mail:showmail(Session, list_to_integer(Nr)); 9 | Error -> 10 | Error 11 | end. 12 | 13 | 14 | -------------------------------------------------------------------------------- /www/icons/small/README.txt: -------------------------------------------------------------------------------- 1 | 2 | These icons are provided as an alternative to the standard Apache 3 | icon graphics. All graphics in this directory, with the exception 4 | of rainbow.gif, are 16x16 pixels in size, rather than the 20x22 5 | dimension icons which are the normal defaults for Apache and are 6 | in the parent directory of this one. 7 | -------------------------------------------------------------------------------- /applications/mail/mail/listop.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case mail:check_session(A) of 5 | {ok, Session} -> 6 | L = yaws_api:parse_post(A), 7 | Op = mail:get_val("cmd", L, ""), 8 | ToDelete = [M || {M,Op} <- L, Op=="yes"], 9 | mail:delete(Session, ToDelete); 10 | Error -> 11 | Error 12 | end. 13 | 14 | 15 | -------------------------------------------------------------------------------- /man/Makefile: -------------------------------------------------------------------------------- 1 | 2 | include ../include.mk 3 | 4 | install: 5 | install -d $(DESTDIR)/$(PREFIX)/share/man/man1 6 | install -d $(DESTDIR)/$(PREFIX)/share/man/man5 7 | cp yaws.1 $(DESTDIR)/$(PREFIX)/share/man/man1 8 | cp yaws.conf.5 $(DESTDIR)/$(PREFIX)/share/man/man5 9 | cp yaws_api.5 $(DESTDIR)/$(PREFIX)/share/man/man5 10 | 11 | all debug clean: 12 | -------------------------------------------------------------------------------- /www/END2: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 |

7 | Valid XHTML 1.0! 10 |

11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /www/code/Makefile: -------------------------------------------------------------------------------- 1 | include ../../include.mk 2 | 3 | all: myappmod.beam 4 | cp myappmod.beam ../../examples/ebin 5 | debug: 6 | 7 | install: all 8 | cp myappmod.beam $(DESTDIR)/$(VARDIR)/yaws/ebin 9 | 10 | clean: 11 | $(RM) myappmod.beam 12 | $(RM) ../../examples/ebin/myappmod.beam 13 | 14 | myappmod.beam: myappmod.erl 15 | $(ERLC) myappmod.erl 16 | -------------------------------------------------------------------------------- /www/shopingcart/Makefile: -------------------------------------------------------------------------------- 1 | include ../../include.mk 2 | 3 | all: shopcart.beam 4 | cp shopcart.beam ../../examples/ebin 5 | debug: 6 | 7 | install: all 8 | cp shopcart.beam $(DESTDIR)/$(VARDIR)/yaws/ebin 9 | 10 | clean: 11 | $(RM) shopcart.beam 12 | $(RM) ../../examples/ebin/shopcart.beam 13 | 14 | shopcart.beam: shopcart.erl 15 | $(ERLC) shopcart.erl 16 | -------------------------------------------------------------------------------- /src/yaws.conf: -------------------------------------------------------------------------------- 1 | 2 | # conf for yaws 3 | 4 | # first we have a set of globals 5 | 6 | # logdir = . 7 | # ebin_dir = . 8 | # include_dir = . 9 | # keep_alive_timeout = 15000 10 | 11 | #end then a set of servers 12 | 13 | 14 | port = 8000 15 | listen = 192.168.128.24 16 | docroot = /home/klacke/yaws/www 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/yaws_ticker.erl: -------------------------------------------------------------------------------- 1 | -module(yaws_ticker). 2 | -author('klacke@bluetail.com'). 3 | 4 | -export([ticker/3]). 5 | 6 | %% Moved here from module yaws to ease purging of yaws. 7 | %% cschultz 8 | 9 | ticker(Time, To, Msg) -> 10 | receive 11 | {'EXIT', _} -> 12 | exit(normal) 13 | after Time -> 14 | To ! Msg 15 | end, 16 | ?MODULE:ticker(Time, To, Msg). 17 | -------------------------------------------------------------------------------- /applications/chat/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS = src 2 | include ./include.mk 3 | 4 | 5 | all debug clean install: 6 | @set -e ; \ 7 | for d in $(SUBDIRS) ; do \ 8 | if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \ 9 | done 10 | 11 | 12 | touch: 13 | find . -name '*' -print | xargs touch -m 14 | find . -name '*.erl' -print | xargs touch -m 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /applications/mail/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS = src 2 | include ./include.mk 3 | 4 | 5 | all debug clean install: 6 | @set -e ; \ 7 | for d in $(SUBDIRS) ; do \ 8 | if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \ 9 | done 10 | 11 | 12 | touch: 13 | find . -name '*' -print | xargs touch -m 14 | find . -name '*.erl' -print | xargs touch -m 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /www/HEAD: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Yaws 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /applications/wiki/wiki/addFile.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | WikiRoot = filename:dirname(Arg#arg.fullpath), 7 | {abs_path, P} = (Arg#arg.req)#http_request.path, 8 | Path = yaws_api:url_decode(P), 9 | Prefix = wiki_yaws:get_path_prefix(Path), 10 | wiki:addFile(Arg, WikiRoot, Prefix). 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /www/static.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hyber 7 | 8 | 10 | 11 | 12 | HYBER LOGO 13 |

nano content

14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /applications/wiki/src/wiki_plugin_dummy.erl: -------------------------------------------------------------------------------- 1 | %%% File : wiki_plugin_dummy.erl 2 | %%% Author : Mickael Remond 3 | %%% Description : Example "dummy" wiki plugin 4 | %%% Created : 20 Oct 2003 by Mickael Remond 5 | %%% 6 | 7 | -module(wiki_plugin_dummy). 8 | 9 | -export([run/2]). 10 | 11 | run(Page, ArgList) -> 12 | "

Using Dummy Wiki Plugin.

". 13 | -------------------------------------------------------------------------------- /www/ssi/dynamic.3: -------------------------------------------------------------------------------- 1 | 2 | -record(http_request, {method, 3 | path, 4 | version}). 5 | 6 | 7 | -record(headers, { 8 | connection, 9 | accept, 10 | host, 11 | if_modified_since, 12 | if_match, 13 | if_none_match, 14 | if_range, 15 | if_unmodified_since, 16 | range, 17 | referer, 18 | user_agent, 19 | accept_ranges, 20 | cookie = [], 21 | keep_alive, 22 | content_length}). 23 | 24 | -------------------------------------------------------------------------------- /src/yaws_vsn.template: -------------------------------------------------------------------------------- 1 | %%%---------------------------------------------------------------------- 2 | %%% File : yaws_vsn.template 3 | %%% Author : Klacke 4 | %%% Purpose : 5 | %%% Created : 10 Jun 2002 by Klacke 6 | %%%---------------------------------------------------------------------- 7 | 8 | -module(yaws_vsn). 9 | -author('klacke@bluetail.com'). 10 | 11 | -compile(export_all). 12 | 13 | version() -> "%VSN%". 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /www/haxe_sample.html: -------------------------------------------------------------------------------- 1 | class Application { 2 | 3 | public static function main():Void { 4 | var URL = "http://localhost:8000/haxe_sample.yaws"; 5 | var cnx = haxe.remoting.AsyncConnection.urlConnect(URL); 6 | cnx.onError = function(err) { 7 | trace("Exception : " + Std.string(err)); 8 | }; 9 | var a = {a:"foo", b:"bar", c:[1,2,3]}; 10 | var b = "hello, Erlang!"; 11 | cnx.echo.call([a, b], display); 12 | } 13 | 14 | static function display(v) { 15 | trace(v); 16 | } 17 | } -------------------------------------------------------------------------------- /applications/wiki/wiki/searchPage.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(Arg) -> 6 | F = searchPages, 7 | if 8 | Arg#arg.clidata /= undefined -> 9 | %% io:format("post~n"), 10 | wiki_yaws:call_with_post(wiki, F, Arg); 11 | length(Arg#arg.querydata) > 0 -> 12 | %% io:format("query~n"), 13 | wiki_yaws:call_with_query(wiki, F, Arg); 14 | true -> 15 | wiki_yaws:call_wiki(wiki, F, Arg) 16 | end. 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /www/code/myappmod.erl: -------------------------------------------------------------------------------- 1 | -module(myappmod). 2 | -author('klacke@bluetail.com'). 3 | 4 | -include("../../include/yaws_api.hrl"). 5 | -compile(export_all). 6 | 7 | box(Str) -> 8 | {'div',[{class,"box"}], 9 | {pre,[],Str}}. 10 | 11 | out(A) -> 12 | {ehtml, 13 | [{p,[], 14 | box(io_lib:format("A#arg.appmoddata = ~p~n" 15 | "A#arg.appmod_prepath = ~p~n" 16 | "A#arg.querydata = ~p~n", 17 | [A#arg.appmoddata, 18 | A#arg.appmod_prepath, 19 | A#arg.querydata]))}]}. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /scripts/freebsd/yaws.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # Startup script for Yaws 4 | 5 | 6 | YAWS_BIN=%prefix%bin/yaws 7 | YAWS_ID=myserverid 8 | CONF=%etcdir%yaws.conf 9 | 10 | 11 | if [ "x${YAWS_ID}" = x ]; then 12 | idarg="" 13 | else 14 | idarg="--id ${YAWS_ID}" 15 | fi 16 | 17 | start() { 18 | $yaws ${idarg} --daemon --heart --conf ${conf} 19 | } 20 | 21 | stop() { 22 | $yaws ${idarg} --stop 23 | } 24 | 25 | reload() { 26 | $yaws ${idarg} --hup 27 | } 28 | 29 | 30 | status() { 31 | $yaws ${idarg} --status 32 | } 33 | 34 | -------------------------------------------------------------------------------- /applications/mail/src/defs.hrl: -------------------------------------------------------------------------------- 1 | % -*- Erlang -*- 2 | % File: defs.hrl (/mnt/disk2/jb/work/yaws/yaws/applications/mail/src/defs.hrl) 3 | % Author: Johan Bevemyr 4 | % Created: Wed Oct 29 23:39:30 2003 5 | % Purpose: 6 | 7 | -ifndef(DEFS_HRL). 8 | -define(DEFS_HRL, true). 9 | 10 | 11 | %% Create config file in /etc/mail/yaws-webmail.conf 12 | 13 | -record(cfg, {ttl = 1800, % 30 minuter TTL 14 | popserver = "localhost", 15 | maildomain = "foo.bar", 16 | smtpserver = "localhost", 17 | sendtimeout = 3000}). 18 | 19 | 20 | -endif. 21 | -------------------------------------------------------------------------------- /www/haxe_sample.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | A1 = A#arg{state = {new_state, "alive and kicking"}}, 5 | yaws_rpc:handler(A1, {haxe_sample, respond}). 6 | 7 | respond(State, {call, echo, Value} = _Request) -> 8 | {new_state, StateVal} = State, 9 | {array, [First, Second]} = Value, 10 | Response = 11 | {response, 12 | {struct, [ 13 | {you_sent_first, First}, 14 | {btw, "Hello haXe!"}, 15 | {also, {array, ["take", "this", 4, "array"]}}, 16 | {my_state_is, StateVal} 17 | ] 18 | }}, 19 | {true, 0, null, Response}. 20 | 21 | -------------------------------------------------------------------------------- /applications/mail/mail/login.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | L = case (A#arg.req)#http_request.method of 5 | 'GET' -> 6 | yaws_api:parse_query(A); 7 | 'POST' -> 8 | yaws_api:parse_post(A) 9 | end, 10 | User = mail:getopt("user", L, ""), 11 | Passwd = mail:getopt("password", L, ""), 12 | case mail:login(User, Passwd) of 13 | {ok, Cookie} -> 14 | [yaws_api:setcookie("mailsession", Cookie), 15 | {redirect_local, {rel_path,"mail.yaws"}}]; 16 | {error, Reason} -> 17 | mail:display_login(A, Reason) 18 | end. 19 | 20 | 21 | -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/custom.css: -------------------------------------------------------------------------------- 1 | body, td { 2 | font-family : Verdana, Arial, sans-serif ; 3 | font-size : 9pt; 4 | } 5 | /* links without underline */ 6 | a { 7 | text-decoration: none; 8 | } 9 | /* visual link effect */ 10 | a:hover { 11 | text-decoration: underline; 12 | } 13 | 14 | TEXTAREA{ 15 | width : 100%; 16 | } 17 | 18 | #menu{ 19 | background: #BFEE90; 20 | } 21 | #lockedmenu{ 22 | background: #EF0000; 23 | } 24 | #lockedmenuframe { 25 | background: #FF1010; 26 | } 27 | #menuframe { 28 | background: #90EE91; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /applications/mail/mail/mail.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case mail:check_session(A) of 5 | {ok, Session} -> 6 | L = yaws_api:parse_query(A), 7 | Refresh = 8 | case lists:keysearch("refresh",1,L) of 9 | {value, _} -> true; 10 | _ -> false 11 | end, 12 | Sort = 13 | case lists:keysearch("sort",1,L) of 14 | {value, {_,SortStr}} -> list_to_atom(SortStr); 15 | _ -> undefined 16 | end, 17 | mail:list(Session, {Refresh, Sort}); 18 | Error -> 19 | Error 20 | end. 21 | 22 | 23 | -------------------------------------------------------------------------------- /www/code.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(A) -> 5 | {Code, F} = case queryvar(A, "file") of 6 | {ok, Fname} -> 7 | File = A#arg.docroot ++ 8 | yaws_api:sanitize_file_name(Fname), 9 | case file:read_file(File) of 10 | {ok, B} -> 11 | C = {'div', 12 | [], 13 | {pre, [], B}}, 14 | {C, Fname}; 15 | _ -> 16 | {[], "Can't read " ++ Fname } 17 | end; 18 | undefined -> 19 | {[], "Bad request"} 20 | end, 21 | {ehtml, {html, [], 22 | {'div', 23 | [], 24 | [{h2, [], F}, 25 | Code]}}}. 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /scripts/make-upload: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This is make it a wee bit more convenient for 4 | # me to publish the tar balls 5 | # set -x 6 | 7 | if [ $# != 1 ]; then 8 | echo 'usage: make-upload ' 9 | exit 1 10 | fi 11 | 12 | 13 | echo "cd incoming " > /tmp/cmds.$$ 14 | echo "put $1 " >> /tmp/cmds.$$ 15 | ncftp -u anonymous -p klacke@hyber.org upload.sourceforge.net < /tmp/cmds.$$ 16 | rm /tmp/cmds.$$ 17 | 18 | 19 | 20 | echo "Now login at sourceforge at go the page" 21 | echo "http://sourceforge.net/project/admin/editpackages.php?group_id=45637" 22 | echo "and create the new package ... " 23 | 24 | -------------------------------------------------------------------------------- /src/yaws_app.erl: -------------------------------------------------------------------------------- 1 | %%%---------------------------------------------------------------------- 2 | %%% File : yaws_app.erl 3 | %%% Author : Claes Wikstrom 4 | %%% Purpose : 5 | %%% Created : 16 Jan 2002 by Claes Wikstrom 6 | %%%---------------------------------------------------------------------- 7 | 8 | -module(yaws_app). 9 | -author('klacke@hyber.org'). 10 | 11 | 12 | -behaviour(application). 13 | -export([start/2,stop/1]). 14 | 15 | %% start 16 | 17 | start(_Type, _StartArgs) -> 18 | yaws_sup:start_link(). 19 | 20 | %% stop 21 | 22 | stop(_State) -> 23 | ok. 24 | -------------------------------------------------------------------------------- /applications/yapp/src/Makefile: -------------------------------------------------------------------------------- 1 | YAWSDIRECTORY=../../.. 2 | include ../vsn.mk 3 | include $(YAWSDIRECTORY)/include.mk 4 | 5 | VSN=$(YAPP_VSN) 6 | 7 | DEBUG= 8 | 9 | EINCLUDE=../include 10 | YAWS_INCL=$(YAWSDIRECTORY)/include 11 | 12 | ERLC_FLAGS+=-W $(DEBUG) -I$(EINCLUDE) -I$(YAWS_INCL) 13 | 14 | 15 | MODULES = yapp yapp_app yapp_sup yapp_handler yapp_server yapp_registry yapp_mnesia_server yapp_event_handler 16 | EBIN = ../ebin 17 | EBIN_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(EBIN)/yapp.app 18 | 19 | all: $(EBIN_FILES) 20 | 21 | debug: 22 | $(MAKE) DEBUG=-DDEBUG 23 | clean: 24 | rm -rf $(EBIN_FILES) 25 | 26 | -------------------------------------------------------------------------------- /applications/mail/src/yaws-webmail.conf: -------------------------------------------------------------------------------- 1 | # This is the default Yaws webmail configuration file 2 | # It contains very few config items, ... 3 | 4 | 5 | 6 | # The time to live, a session is GC'ed by the server 7 | # when it has ben idle for more than this amount of seconds 8 | ttl = 1800 9 | 10 | # the popserver, either an IP or a FQDN is acceptable here 11 | popserver = localhost 12 | 13 | 14 | # same goes for the smtp server 15 | smtpserver = localhost 16 | 17 | 18 | ## maildomin must be set, 19 | maildomain = mydomain.org 20 | 21 | 22 | # The timeout in send operations, default should be fine here (ms) 23 | sendtimeout = 15000 24 | 25 | -------------------------------------------------------------------------------- /www/api.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(A) -> 5 | yaws_api:ssi(A#arg.docroot, ["/HEAD", "/TOPTAB"]). 6 | 7 | 8 | 9 |

Yaws API

10 | 11 |

12 | Here we describe the API avalable to Yaws applications. 13 | First and foremost, the entire regular erlang API is available, this 14 | include mnesia ans all other erlang applications that are part of the 15 | regular erlang system. 16 |

17 | Here we describe the functions available in the yaws_api module 18 | 19 | 20 | man page for yaws_api (5) 21 | 22 | 23 | 24 | out(A) -> yaws_api:ssi(A#arg.docroot, ["/END"]). 25 | 26 | -------------------------------------------------------------------------------- /www/ssi/dynamic.2: -------------------------------------------------------------------------------- 1 | -record(arg, { 2 | clisock, %% the socket leading to the peer client 3 | headers, %% #headers{} record 4 | req, %% #http_request{} record 5 | clidata, %% The client data (as a binary in POST requests) 6 | querydata, %% Was the URL on the form of ....?query (GET reqs) 7 | docroot, %% where is the data 8 | fullpath, %% absolute path to requested yaws file 9 | server_path, %% The normalized server path 10 | pid, %% pid of the yaws worker process 11 | opaque %% useful to pass static data 12 | 13 | }). 14 | 15 | 16 | -------------------------------------------------------------------------------- /scripts/gentoo/yaws.ebuild: -------------------------------------------------------------------------------- 1 | # $Header: /cvsroot/erlyaws/yaws/scripts/gentoo/yaws.ebuild,v 1.4 2003/05/04 23:22:34 klacke Exp $ 2 | 3 | 4 | DESCRIPTION="Yaws, a dynamic content, fast, erlang based webserver " 5 | HOMEPAGE="http://yaws.hyber.org/" 6 | SRC_URI="http://yaws.hyber.org/download/${P}.tar.gz" 7 | LICENSE="BSD" 8 | SLOT="0" 9 | KEYWORDS="x86 ppc sparc alpha arm" 10 | IUSE="ssl" 11 | 12 | DEPEND=">=dev-lang/erlang-8b 13 | ssl? ( >=dev-libs/openssl-0.9.6d )" 14 | 15 | 16 | 17 | src_compile() { 18 | ./configure --prefix=/usr || die 19 | make || die 20 | } 21 | 22 | src_install() { 23 | make DESTDIR=${D} install || die 24 | } 25 | 26 | -------------------------------------------------------------------------------- /www/motivation.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(A) -> 5 | yaws_api:ssi(A#arg.docroot, ["/HEAD", "/TOPTAB"]). 6 | 7 | 8 | 9 |

Motivation

10 | 11 |

12 | I wrote Yaws for the 13 | simple reason that I needed to build a website for the first time in my life 14 | and I didn't realize the amount of horrible ad-hockery which currently 15 | needs to be applied in order to build a website. In particular, I thought 16 | that php was designed in such a horrible 17 | way that I simply refused to use it. 18 | 19 | 20 | 21 | 22 | 23 | out(A) -> yaws_api:ssi(A#arg.docroot, ["/END"]). 24 | 25 | 26 | -------------------------------------------------------------------------------- /scripts/make-release: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #set -x 4 | 5 | . ../vsn.mk 6 | 7 | echo tagging and packing release ${YAWS_VSN} 8 | 9 | CVS_RSH=ssh 10 | Y=`echo ${YAWS_VSN} | sed 's/\./-/g'` 11 | 12 | if [ ! -f ./make-release ]; then 13 | echo "need to be in scripts dir"; exit 1; 14 | fi 15 | 16 | 17 | cd ../.. 18 | 19 | cvs tag -F yaws-${Y} 20 | 21 | rm -rf tmp 2> /dev/null 22 | mkdir tmp 23 | 24 | cvs export -d tmp -r yaws-$Y . 25 | cd tmp 26 | mv yaws yaws-${YAWS_VSN} 27 | ln -s yaws-${YAWS_VSN} yaws 28 | tar cfz yaws-${YAWS_VSN}.tar.gz yaws yaws-${YAWS_VSN} 29 | 30 | #mv yaws-${YAWS_VSN}.tar.gz .. 31 | #cd .. 32 | 33 | echo release resides in `pwd`/yaws-${YAWS_VSN}.tar.gz 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /www/upload0.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | [{ssi, "TAB.inc", "%%",[{"upload0", "choosen"}]}, 5 | {ehtml, 6 | {html, [], 7 | {'div',[{id, "entry"}], 8 | [{h1, [], "Upload a file to the webserver"}, 9 | {p, [], "The code that parses the multipart form data resides in"}, 10 | {a, [{href, "code.yaws?file=/upload.yaws"}], "upload.yaws"}, 11 | {br,[],[]}, 12 | {hr,[],[]}, 13 | {form, [{enctype, "multipart/form-data"}, 14 | {method, post}, 15 | {action, "/upload.yaws"} 16 | ], 17 | [{input, [{type, submit}, {value, "Upload"}] ,[]}, 18 | {input, [{type,file}, {width, "50"}, {name, "foo"}], []} 19 | ]}]}}}, 20 | {ssi, "END2",[],[]}]. 21 | 22 | 23 | -------------------------------------------------------------------------------- /applications/chat/chat/login.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | L = case (A#arg.req)#http_request.method of 5 | 'GET' -> 6 | yaws_api:parse_query(A); 7 | 'POST' -> 8 | yaws_api:parse_post(A) 9 | end, 10 | case {lists:keysearch("user", 1, L), 11 | lists:keysearch("password", 1, L)} of 12 | {{value, {_, User}}, {value, {_,Passwd}}} -> 13 | case chat:login(User, Passwd) of 14 | {ok, Cookie} -> 15 | [yaws_api:setcookie("sessionid", Cookie), 16 | {redirect_local, {rel_path,"chat.yaws"}}]; 17 | {error, Reason} -> 18 | chat:display_login(A, Reason) 19 | end; 20 | _ -> 21 | chat:display_login(A, "badly formated POST/GET") 22 | end. 23 | 24 | 25 | -------------------------------------------------------------------------------- /www/session.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> 3 | {ssi, "TAB.inc", "%%",[{"session", "choosen"}]}. 4 | 5 | 6 |

7 | 8 | 9 |

The session server

10 |

11 | The Yaws session server is ideal (and recommended) 12 | for maintaining cookie state 13 | in a server side application. 14 |

15 | 16 |

The code in session1.yaws 17 | shows a minimalistic way to handle sessions. 18 | To run it click here 19 |

20 | 21 |

22 | The actual session API is documented in the man page for yaws_api. 23 |

24 | 25 |
26 | 27 | 28 | 29 | out(A) -> {ssi, "END2",[],[]}. 30 | 31 | 32 | -------------------------------------------------------------------------------- /www/ybed.erl: -------------------------------------------------------------------------------- 1 | %%%------------------------------------------------------------------- 2 | %%% File : ybed.erl 3 | %%% Author : 4 | %%% Description : Small embedded yaws example 5 | %%% 6 | %%% Created : 25 Nov 2003 by 7 | %%%------------------------------------------------------------------- 8 | -module(ybed). 9 | -compile(export_all). 10 | 11 | -include("/usr/local/lib/yaws/include/yaws.hrl"). 12 | 13 | start() -> 14 | application:start(yaws), 15 | GC = yaws_config:make_default_gconf(false), 16 | SC = #sconf{port = 8888, 17 | servername = "foobar", 18 | listen = {0,0,0,0}, 19 | docroot = "/tmp"}, 20 | yaws_api:setconf(GC, [[SC]]). 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/yaws_generated.template: -------------------------------------------------------------------------------- 1 | %%%---------------------------------------------------------------------- 2 | %%% File : yaws_generated.template 3 | %%% Author : Klacke 4 | %%% Purpose : 5 | %%% Created : 10 Jun 2002 by Klacke 6 | %%%---------------------------------------------------------------------- 7 | 8 | %% generated code from some environment variables 9 | %% especially VARDIR is important since it controls 10 | %% where the --hup and friends 11 | 12 | -module(yaws_generated). 13 | -author('klacke@bluetail.com'). 14 | 15 | -compile(export_all). 16 | 17 | version() -> "%VSN%". 18 | 19 | vardir() -> "%VARDIR%". 20 | 21 | ctldir() -> "%VARDIR%/run/yaws". 22 | 23 | etcdir() -> "%ETCDIR%". 24 | 25 | -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/template_info.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | @@TITLE@@ 4 | 9 | 10 | 11 | 12 | 13 | 31 | 32 | 33 | 34 | 35 |
14 | 15 | 16 | 17 | 19 | 20 | 21 | 28 | 29 |
18 |
22 |

 
23 | 24 | 25 |

@@HEADER@@

26 | @@DATA@@ 27 |
30 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /scripts/darwin/README: -------------------------------------------------------------------------------- 1 | Yaws startup on MacOS X / Darwin 2 | 3 | Doing `make install' as root will create a `Yaws' StartupItem in 4 | /Library/StartupItems. 5 | 6 | By default, yaws startup is disabled. To enable it, edit (as root) 7 | /etc/hostconfig and add the line 8 | 9 | YAWS=-YES- 10 | 11 | Yaws startup can be disabled by changing the line to 12 | 13 | YAWS=-NO- 14 | 15 | Yaws will start automatically on reboot. You can manually test the 16 | startup without rebooting by issuing the command (as root) in a 17 | terminal window 18 | 19 | $ SystemStarter start Yaws 20 | 21 | 22 | Stop the server by issuing: 23 | 24 | $ SystemStarter stop Yaws 25 | 26 | Reload the server with the command 27 | 28 | $ SystemStarter restart Yaws 29 | 30 | -------------------------------------------------------------------------------- /applications/mail/TODO: -------------------------------------------------------------------------------- 1 | Things to do 2 | 3 | - handle attachments in received emails 4 | - optionally include old text as quoted text in reply. We 5 | need to select the text part for the quote if the email 6 | is of type multipart/alternative. We select text/html 7 | to display. 8 | - page large inboxes with 20 emails per page (sorted in 9 | reverse order with most recently received emails first) 10 | - write an attachement cache to limit the delays when 11 | fetching an attachement 12 | - code outgoing emails as quoted-printable (must limit max 13 | line length to 74 according to RFC ???) 14 | 15 | - Sort by 'From', 'Subject' and 'Nr' 16 | - Implement mail forwarding 17 | - Support imap mail backend system. 18 | - Properly decode encoded attachments. 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | 2 | include ../include.mk 3 | include ../vsn.mk 4 | 5 | IMG_EPS = $(wildcard *.eps) 6 | IMG_PDF = $(IMG_EPS:.eps=.pdf) 7 | 8 | all debug: 9 | echo "To build the docs, please use make docs before doing make install" 10 | 11 | docs: yaws.ps yaws.pdf 12 | 13 | yaws.ps: yaws.dvi 14 | -dvips -o yaws.ps yaws.dvi 15 | -cp yaws.ps ../www 16 | 17 | yaws.pdf: yaws.tex $(IMG_PDF) 18 | -pdflatex yaws.tex 19 | -cp yaws.pdf ../www 20 | 21 | yaws.dvi: yaws.tex $(IMG_EPS) 22 | -latex yaws.tex 23 | -latex yaws.tex 24 | 25 | %.pdf: %.eps 26 | -epstopdf $< 27 | 28 | clean: 29 | -rm *~ *.ps *.dvi *.log *.aux *.pdf *.toc *.beam 2> /dev/null 30 | 31 | install: 32 | -install -d $(DESTDIR)/$(PREFIX)/share/doc/yaws-$(YAWS_VSN) 33 | -cp yaws.pdf $(DESTDIR)/$(PREFIX)/share/doc/yaws-$(YAWS_VSN) 34 | 35 | -------------------------------------------------------------------------------- /scripts/darwin/Yaws.StartupItem: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## 4 | # Yaws HTTP Server 5 | ## 6 | 7 | . /etc/rc.common 8 | 9 | yaws=%prefix%/bin/yaws 10 | lockdir=/var/spool/lock 11 | yawsid=myserverid 12 | 13 | StartService () 14 | { 15 | if [ "${YAWS:=-NO-}" = "-YES-" ]; then 16 | ConsoleMessage "Starting yaws http daemon" 17 | HOME=/tmp $yaws --id ${yawsid} --daemon --heart 18 | RETVAL=$? 19 | [ $RETVAL = 0 ] 20 | fi 21 | } 22 | 23 | StopService () 24 | { 25 | ConsoleMessage "Stopping yaws http daemon" 26 | HOME=/tmp $yaws --id ${yawsid} --stop 27 | } 28 | 29 | RestartService () 30 | { 31 | if [ "${YAWS:=-NO-}" = "-YES-" ]; then 32 | ConsoleMessage "Restarting yaws http daemon" 33 | HOME=/tmp $yaws --id ${yawsid} --hup 34 | else 35 | StopService 36 | fi 37 | } 38 | 39 | RunService "$1" 40 | -------------------------------------------------------------------------------- /www/contact.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(A) -> 5 | {ssi, "TAB.inc","%%",[{"contact", "choosen"}]}. 6 | 7 | 8 | 9 |
10 | 11 |

Contact

12 | 13 |

There is a mailinglist which is used to discuss yaws. 14 | The list is called 15 | erlyaws-list 16 | and it is run by Sourceforge.

17 | 18 |

19 | The URL to the list is: https://lists.sourceforge.net/lists/listinfo/erlyaws-list

20 | 21 | 22 |

It is also possible to contact:

23 |
 
24 |     klacke @ hyber . org
25 |     Cell: +46 0702097763
26 |   
27 | 28 | 29 |
30 | 31 | 32 | out(A) -> {ssi, "END2",[],[]}. 33 | 34 | -------------------------------------------------------------------------------- /scripts/gentoo/conf.d.yaws: -------------------------------------------------------------------------------- 1 | # 2 | # Config file for yaws Gentoo start-script. 3 | # Should be stored as: /etc/conf.d/yaws 4 | # 5 | 6 | # Application name 7 | YAWS_APP=yaws 8 | 9 | # set specific ID on /etc server 10 | # change this string to your liking 11 | YAWS_ID=myserverid 12 | 13 | # Path to yaws executable 14 | YAWS_EXEC=%prefix%/bin/yaws 15 | 16 | 17 | # The Yaws config file 18 | YAWS_CONF_FILE=/etc/yaws.conf 19 | 20 | # The start options 21 | YAWS_START_OPTS="--daemon --heart --id ${YAWS_ID} --conf ${YAWS_CONF_FILE}" 22 | 23 | # The stop options 24 | YAWS_STOP_OPTS="--stop --id ${YAWS_ID}" 25 | 26 | # The reload options 27 | YAWS_RELOAD_OPTS="--hup --id ${YAWS_ID}" 28 | 29 | # The query options 30 | YAWS_QUERY_OPTS="--status --id ${YAWS_ID}" 31 | 32 | # The debug options 33 | YAWS_DEBUG_OPTS="-i --conf ${YAWS_CONF_FILE}" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /applications/yapp/Makefile: -------------------------------------------------------------------------------- 1 | YAWSDIRECTORY=../.. 2 | include vsn.mk 3 | include $(YAWSDIRECTORY)/include.mk 4 | 5 | VSN = $(YAPP_VSN) 6 | APPNAME=yapp 7 | DOC_OPTS=[{def,{vsn,"$(VSN)"}}] 8 | INSTALL=$(YAWSDIRECTORY)/install-sh 9 | 10 | 11 | all: 12 | (cd src;$(MAKE)) 13 | 14 | clean: 15 | (cd src;$(MAKE) clean) 16 | 17 | appfile: 18 | (cd src;$(MAKE) ../ebin/$(APPNAME).app) 19 | 20 | docs: 21 | $(ERL) -noshell -run edoc_run application "'$(APPNAME)'" '"."' '$(DOC_OPTS)' -s init stop 22 | 23 | cleandocs: 24 | rm -rf doc/*.html doc/edoc-info doc/stylesheet.css 25 | 26 | install: all docs 27 | $(INSTALL) -d $(DESTDIR)/$(PREFIX)/lib/$(APPNAME)/ebin 28 | $(INSTALL) -d $(DESTDIR)/$(PREFIX)/lib/$(APPNAME)/priv/docroot 29 | $(INSTALL) -d $(DESTDIR)/$(PREFIX)/lib/$(APPNAME)/doc 30 | (tar cf - ebin priv doc) | (cd $(DESTDIR)/$(PREFIX)/lib/yapp; tar xf - ) 31 | 32 | -------------------------------------------------------------------------------- /applications/wiki/scripts/Makefile: -------------------------------------------------------------------------------- 1 | # -*- Makefile -*- 2 | # File: Makefile (/usr/local/src/yaws/yaws/applications/wiki/scripts/Makefile) 3 | # Author: Johan Bevemyr 4 | # Created: Sat May 17 13:15:29 2003 5 | # Purpose: 6 | 7 | include ../include.mk 8 | 9 | SCRIPTS=importFiles getPassword updateWiki addFile 10 | 11 | all: $(SCRIPTS) 12 | 13 | addFile : addFile.src 14 | sed "s|%%ebindir%%|$(EBININSTALLDIR)|" $< > $@ 15 | chmod +x $@ 16 | 17 | importFiles : importFiles.src 18 | sed "s|%%ebindir%%|$(EBININSTALLDIR)|" $< > $@ 19 | chmod +x $@ 20 | 21 | getPassword : getPassword.src 22 | sed "s|%%ebindir%%|$(EBININSTALLDIR)|" $< > $@ 23 | chmod +x $@ 24 | 25 | updateWiki : updateWiki.src 26 | sed "s|%%wikisrcdir%%|$(shell cd ../wiki ; pwd)|" $< > $@ 27 | chmod +x $@ 28 | 29 | clean: 30 | rm importFiles getPassword updateWiki 31 | 32 | 33 | install: 34 | 35 | 36 | -------------------------------------------------------------------------------- /www/examples.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> yaws_api:ssi(A#arg.docroot, ["/HEAD", "/EXHEAD"]). 3 | 4 | 5 | 6 |

Yaws Examples

7 |

8 | Here we try to show the power of yaws by means of a series of examples. 9 | Many of the pages inside this documentation, use embedded erlang code 10 | merely as a means to include files into the HTML documentation. Yaws can 11 | be used to do much more which is shown by the examples. 12 | 13 |

14 | It can be used to generate any dynamic content, 15 | and also, combining Yaws with 16 | the Erlang DBMS Mnesia, we can easily connect persistent data to a Cookie. 17 | 18 |

19 | In all of the examples we will utilize the yaws api functions defined in the 20 | module yaws_api. The documentation for the API module is 21 | here. 22 | 23 | 24 | 25 | out(A) -> yaws_api:ssi(A#arg.docroot, ["/END"]). 26 | 27 | -------------------------------------------------------------------------------- /www/urandom.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(A) -> 5 | Self = self(), 6 | spawn(fun() -> 7 | %% Create a random number 8 | {_A1, A2, A3} = now(), 9 | random:seed(erlang:phash(node(), 100000), 10 | erlang:phash(A2, A3), 11 | A3), 12 | Sz = random:uniform(100000), 13 | 14 | %% Read random junk 15 | S="dd if=/dev/urandom count=1 bs=" ++ 16 | integer_to_list(Sz) ++ " 2>/dev/null", 17 | P = open_port({spawn, S}, [binary,stream, eof]), 18 | 19 | rec_loop(Self, P) 20 | end), 21 | 22 | {streamcontent, "application/octet-stream", <<>>}. 23 | 24 | 25 | rec_loop(YawsPid, P) -> 26 | receive 27 | {P, {data, BinData}} -> 28 | yaws_api:stream_chunk_deliver(YawsPid, BinData), 29 | rec_loop(YawsPid, P); 30 | {P, eof} -> 31 | port_close(P), 32 | yaws_api:stream_chunk_end(YawsPid), 33 | exit(normal) 34 | end. 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /applications/mail/src/attachment.erl: -------------------------------------------------------------------------------- 1 | %%%------------------------------------------------------------------- 2 | %%% File : attachment.erl 3 | %%% Author : 4 | %%% Description : 5 | %%% 6 | %%% Created : 4 Feb 2004 by 7 | %%%------------------------------------------------------------------- 8 | -module(attachment). 9 | -compile(export_all). 10 | 11 | out(A) -> 12 | case mail:check_session(A) of 13 | {ok, Session} -> 14 | case {yaws_api:queryvar(A, "nr"),yaws_api:queryvar(A,"form")} of 15 | {{ok, Nr},{ok,"text"}} -> 16 | mail:send_attachment_plain(Session, yaws:to_integer(Nr)); 17 | {{ok, Nr},_} -> 18 | mail:send_attachment(Session, yaws:to_integer(Nr)); 19 | _ -> 20 | err() 21 | end; 22 | Error -> 23 | err() 24 | end. 25 | 26 | 27 | err() -> 28 | [{status, 404}, 29 | {header, {connection, "close"}}]. 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ssl/yaws-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWwIBAAKBgQDMJHAcJXB9TzkYg/ghXNjOAp3zcgKC6XZo4991SPGYukKVU1Fv 3 | RX0YgPx3wz8Ae7ykPc0KW7O3D9Pn8liazTYEaXskNKAzOFr1gtBd7p937PKNQk++ 4 | 3/As5EfJjz+lBrwUGbSicJgldJk3Cj89htMUqGwL2Bl/yOQIsZtyLlrP1wIDAQAB 5 | AoGAYgEwTWLwAUjSaWGZ8zJm52g8Ok7Gw+CfNzYG5oCxdBgftR693sSmjOgHzNtQ 6 | WMQOyW7eDBYATmdr3VPsk8znHBSfQ19gAJjR89lJ6lt5qDMNtXMUWILn91g+RbkO 7 | gmTkhD8uc0e/3FJBwPxFJWQzFEcAR4jNFJwhNzg6CO8CK/ECQQD7sNzvMRnUi1RQ 8 | tiKgRxdjdEwNh58OUPwuJWhKdBLIpHBAJxCBHJB+1N0ufpqaEgUfJ5+gEYrBRMJh 9 | aTCIJul5AkEAz6MsmkMz6Iej5zlKrlDL5q6GU+wElXK/F1H8tN/JchoSXN8BRCJZ 10 | DLpK0mcMN4yukHKDCo0LD9NBlRQFDll/zwJASb2CrW2kVLpRhKgoMu9BMflDwv8G 11 | IcqmZ9q72HxzeGd9H76SPlGhIBe7icC8CQHYkE0qnlolXgSIMsP/3RQReQJAYHnt 12 | +INvNAUKSB6br6EFDNtcuNO6UYJufbRvmc89d5HbpGFN4k2fWMWajGarC4iHd8Bt 13 | WNKuKB09pLoXm1JEiwJAfRtIXE6sr4MQOL6aWwGElw+Yb4B1WBhBiPRRwGTX0nzN 14 | HXF3851+kgZBZjjzA3Ib2nr5PeXkZBBLE/4NJvRPRA== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /applications/wiki/src/wiki_plugin_backlinks.erl: -------------------------------------------------------------------------------- 1 | %%% File : wiki_plugin_backlinks.erl 2 | %%% Author : Mickael Remond 3 | %%% Description : This plugin can show the list of backlinks inline 4 | %%% Created : 20 Oct 2003 by Mickael Remond 5 | %%% 6 | 7 | -module(wiki_plugin_backlinks). 8 | 9 | -export([run/2]). 10 | 11 | -include("yaws.hrl"). %% Needed only if you want to manipulate 12 | %% Yaws configuration 13 | 14 | run(Page, ArgList) -> 15 | %% TODO: Fixme 16 | %% This is working if there is only one virtual server. 17 | %% A way to handle this cleanly is needed. 18 | {ok, Gconf, [[Sconf|Others]]} = yaws_api:getconf(), 19 | Root = Sconf#sconf.docroot, 20 | 21 | AllRefs = wiki_utils:getallrefs(Page, Root), 22 | 23 | lists:map(fun(F) -> 24 | [wiki_to_html:format_link(F, Root),"
"] end, 25 | AllRefs). 26 | 27 | -------------------------------------------------------------------------------- /applications/yapp/README: -------------------------------------------------------------------------------- 1 | An easy way to deploy Yaws applications (Yapps) independently of 2 | each other. 3 | 4 | To compile : 5 | make 6 | Generate edoc documents : 7 | make docs 8 | Install: 9 | make install 10 | 11 | You need to have compiled (configured) the Yaws application before 12 | making yapp. 13 | See the generated documents for more info in how to use the yapp 14 | application. 15 | The current application uses mnesia so a precondition is that a 16 | schema is generated for the node Yaws is running on. 17 | 18 | Known problems 19 | - You need a trailing "/" to your path when doing directory 20 | based access to the yapp. 21 | 22 | 23 | TODO 24 | 25 | - subscribe on mnesia events so that the yapp registry can be 26 | updated and used in a cluster of yaws nodes. 27 | 28 | - Support to create .boot and relup scripts so that Yapps can be 29 | added/upgraded/downgraded/removed on a running Yaws server. 30 | 31 | - Cluster support for the point above. 32 | 33 | -------------------------------------------------------------------------------- /www/man.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(A) -> 5 | L = case queryvar(A,"page") of 6 | {ok, Page} -> 7 | %% only allow regular chars in Page 8 | case lists:all(fun(C) -> 9 | if 10 | $a =< C, C =< $z -> 11 | true; 12 | $A =< C, C =< $Z -> 13 | true; 14 | C == $_ -> 15 | true; 16 | C == $. -> 17 | true; 18 | true -> 19 | false 20 | end 21 | end, Page) of 22 | true -> 23 | os:cmd("man " ++ Page ++ " | col -b -p -x"); 24 | false -> 25 | "illegal character detected in query arg" 26 | end; 27 | undefined -> 28 | "no man page found in query arg " 29 | end, 30 | {ehtml, 31 | {html,[], 32 | {'div',[{class,"man"}], 33 | {pre,[], L}}}}. 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /applications/yapp/priv/docroot/HEAD.inc: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | Yapp 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |

21 | 22 | 23 | 29 | 30 |
31 |

Yapp admin console

32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /applications/chat/src/Makefile: -------------------------------------------------------------------------------- 1 | include ../include.mk 2 | 3 | ifeq ($(TYPE),debug) 4 | DEBUG_FLAGS = -Ddebug 5 | else 6 | DEBUG_FLAGS = 7 | endif 8 | 9 | #include ../vsn.mk 10 | #VSN=$(YAWS_VSN) 11 | MODULES=chat 12 | 13 | HDR_FILES= 14 | 15 | EBIN_FILES=$(MODULES:%=../ebin/%.$(EMULATOR)) 16 | 17 | ERLC_FLAGS+=-W +debug_info $(DEBUG_FLAGS) -I../../../include -pa ../../chat 18 | 19 | # 20 | # Targets 21 | # 22 | 23 | all: $(EBIN_FILES) 24 | 25 | $(EBIN_FILES) : $(HDR_FILES) 26 | 27 | debug: 28 | $(MAKE) TYPE=debug 29 | 30 | clean: 31 | rm -f $(EBIN_FILES) 32 | 33 | install: all 34 | install -d $(CHATINSTALLDIR) 35 | install -d $(EBININSTALLDIR) 36 | (cd ../ebin; find . -name '*' -print | xargs tar cf - ) | (cd $(EBININSTALLDIR); tar xf - ) 37 | (cd ../chat; find . -name '*' -print | xargs tar cf - ) | (cd $(CHATINSTALLDIR); tar xf - ) 38 | 39 | 40 | 41 | tags: 42 | erl -noshell -pa ../ebin -s chat_debug mktags 43 | 44 | xref: 45 | erl -noshell -pa ../ebin -s chat_debug xref ../ebin 46 | 47 | -------------------------------------------------------------------------------- /scripts/debian/yaws.init.d: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Startup script for the Yaws Web Server 4 | # 5 | # config: /etc/yaws.conf 6 | # 7 | 8 | 9 | 10 | 11 | yaws=%prefix%/bin/yaws 12 | prog=yaws 13 | yawsid=myserverid 14 | 15 | test -x $yaws || exit 1 16 | 17 | 18 | case "$1" in 19 | start) 20 | echo -n "Starting $prog: " 21 | $yaws --id ${yawsid} --daemon --heart 22 | echo "." 23 | ;; 24 | stop) 25 | echo -n "Stopping $prog: " 26 | $yaws --id ${yawsid} --stop 27 | echo "." 28 | ;; 29 | reload) 30 | echo -n "Reloading $prog: " 31 | $yaws --id ${yawsid} --hup 32 | echo "." 33 | ;; 34 | status) 35 | $yaws --id ${yawsid} --status 36 | echo "." 37 | ;; 38 | restart) 39 | echo -n "Stopping $prog: " 40 | $yaws --id ${yawsid} --stop 41 | echo -n "Starting $prog: " 42 | $yaws --id ${yawsid} --daemon --heart 43 | echo "." 44 | ;; 45 | 46 | *) 47 | echo $"Usage: $prog {start|stop|restart|reload|status}" 48 | exit 1 49 | esac 50 | 51 | exit 0 52 | 53 | -------------------------------------------------------------------------------- /applications/yapp/priv/docroot/list.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> {ssi, "HEAD.inc","%%",[{"list", "choosen"}]}. 4 | 5 | 6 | 7 |

Yapp list

8 | 9 | 10 | 11 | format_yapp_tables([]) -> []; 12 | format_yapp_tables([{ServId,Yapps}|T]) -> 13 | [{h3,[], ["Server id : ", ServId]}, [{p,[],format_yapp_table(Yapps)}] | 14 | format_yapp_tables(T)]. 15 | 16 | format_yapp_table(Yapps) -> 17 | {table,[{border,"1"}], 18 | [{tr,[],[{th,[],"Application"},{th,[],"Url"},{th,[],"Docroot"}]} | 19 | format_yapps(Yapps)] 20 | }. 21 | 22 | format_yapps([]) -> 23 | []; 24 | format_yapps([{yapp, Urlpath, Docroot, Appname, Appmods}|T]) -> 25 | [{tr,[],[{td,[],atom_to_list(Appname)}, {td,[], Urlpath},{td,[],Docroot}]} | 26 | format_yapps(T)]. 27 | 28 | out(A) -> 29 | Header = "Cache-Control:no-store", 30 | [{header, Header}, 31 | {ehtml, format_yapp_tables(yapp:get_yapps())}]. 32 | 33 | 34 | 35 | 36 | out(A) -> {ssi,"END.inc",[],[]}. 37 | 38 | 39 | -------------------------------------------------------------------------------- /www/stats.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> 3 | yaws_api:ssi(A#arg.docroot, ["/HEAD", "/TOPTAB"]). 4 | 5 | 6 | 7 | 8 | out(A) -> 9 | {UpTime, L} = yaws_server:stats(), 10 | {Days, {Hours, Minutes, Secs}} = UpTime, 11 | H = f(" ~n

Uptime: ~w Days, ~w Hours, ~w Minutes

~n", 12 | [Days, Hours, Minutes]), 13 | 14 | T =lists:map( 15 | fun({Host,IP,Hits}) -> 16 | L1= f("

stats for ~p at ~p

~n", 17 | [Host,IP]), 18 | T = " \n" 19 | "", 20 | {L2, Total}=lists:mapfoldl( 21 | fun({Url, Hits}, Sum) -> 22 | {f("~n", 23 | [Url, Hits]), Sum + Hits} 24 | end, 0, Hits), 25 | END = f("
URL Number of hits
~s ~w
Total~w
", [Total]), 26 | [L1, T, L2, END] 27 | end, L), 28 | {html, [H, T]}. 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /www/yaws-1.55_to_1.56.patch: -------------------------------------------------------------------------------- 1 | 2 | Index: yaws_api.erl 3 | =================================================================== 4 | RCS file: /cvsroot/erlyaws/yaws/src/yaws_api.erl,v 5 | retrieving revision 1.126 6 | retrieving revision 1.128 7 | diff -u -b -r1.126 -r1.128 8 | --- yaws_api.erl 16 May 2005 21:12:03 -0000 1.126 9 | +++ yaws_api.erl 16 Jun 2005 11:36:57 -0000 1.128 10 | @@ -741,11 +741,14 @@ 11 | 12 | url_decode_q_split([$%, Hi, Lo | Tail], Ack) -> 13 | Hex = yaws:hex_to_integer([Hi, Lo]), 14 | + if Hex == 0 -> exit(badurl); 15 | + true -> ok 16 | + end, 17 | url_decode_q_split(Tail, [Hex|Ack]); 18 | url_decode_q_split([$?|T], Ack) -> 19 | %% Don't decode the query string here, that is parsed separately. 20 | {path_norm_reverse(Ack), T}; 21 | -url_decode_q_split([H|T], Ack) -> 22 | +url_decode_q_split([H|T], Ack) when H /= 0 -> 23 | url_decode_q_split(T, [H|Ack]); 24 | url_decode_q_split([], Ack) -> 25 | {path_norm_reverse(Ack), []}. 26 | 27 | -------------------------------------------------------------------------------- /www/arg2.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | out(A) -> 6 | 7 | Peer = A#arg.client_ip_port, 8 | Req = A#arg.req, 9 | H = yaws_api:reformat_header(A#arg.headers), 10 | {ehtml, 11 | [{h5,[], "The headers passed to us were:"}, 12 | {hr,[],[]}, 13 | {ol, [],lists:map(fun(S) -> {li,[], {p,[],S}} end,H)}, 14 | 15 | {h5, [], "The request"}, 16 | {ul,[], 17 | [{li,[], f("method: ~s", [Req#http_request.method])}, 18 | {li,[], f("path: ~p", [Req#http_request.path])}, 19 | {li,[], f("version: ~p", [Req#http_request.version])}]}, 20 | 21 | {hr,[],[]}, 22 | {h5, [], "Other items"}, 23 | {ul,[], 24 | [{li, [], f("Peer: ~p", [Peer])}, 25 | {li,[], f("docroot: ~s", [A#arg.docroot])}, 26 | {li,[], f("fullpath: ~s", [A#arg.fullpath])}]}, 27 | {hr,[],[]}, 28 | {h5, [], "Parsed query data"}, 29 | {pre,[], f("~p", [yaws_api:parse_query(A)])}, 30 | {hr,[],[]}, 31 | {h5,[], "Parsed POST data "}, 32 | {pre,[], f("~p", [yaws_api:parse_post(A)])}]}. 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /scripts/netbsd/yaws.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | 4 | # 5 | # PROVIDE: yaws 6 | # REQUIRE: DAEMON 7 | # 8 | # You will need to set some variables in /etc/rc.conf to start Yaws: 9 | # 10 | # yaws=YES 11 | # yaws_flags="" 12 | # yaws_id="" 13 | # 14 | 15 | if [ -f /etc/rc.subr ] 16 | then 17 | . /etc/rc.subr 18 | fi 19 | 20 | name="yaws" 21 | rcvar=$name 22 | yaws_command="%prefix%bin/${name}" 23 | required_files="%etcdir%yaws.conf" 24 | 25 | start_cmd="yaws_start" 26 | stop_cmd="yaws_stop" 27 | status_cmd="yaws_status" 28 | reload_cmd="yaws_reload" 29 | extra_commands="reload status" 30 | 31 | : ${yaws_id:=default} 32 | : ${yaws_flags:=--heart} 33 | 34 | yaws_start() { 35 | $yaws_command --id $yaws_id $yaws_flags --daemon 36 | } 37 | 38 | yaws_stop() { 39 | $yaws_command --id $yaws_id --stop 40 | } 41 | 42 | yaws_status() { 43 | $yaws_command --id $yaws_id --status 44 | } 45 | 46 | yaws_reload() { 47 | $yaws_command --id $yaws_id --hup 48 | } 49 | 50 | if [ -f /etc/rc.subr -a -f /etc/rc.conf ] 51 | then 52 | load_rc_config $name 53 | run_rc_command "$1" 54 | else 55 | yaws_start 56 | fi 57 | -------------------------------------------------------------------------------- /applications/mail/mail/reply.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | case mail:check_session(A) of 5 | {ok, Session} -> 6 | L = yaws_api:parse_post(A), 7 | Cmd = mail:get_val("cmd", L, reply), 8 | case Cmd of 9 | "reply" -> 10 | From = yaws_api:url_decode(mail:get_val("from", L, "")), 11 | Subject = yaws_api:url_decode(mail:get_val("subject", L, "")), 12 | To = yaws_api:url_decode(mail:get_val("to", L, "")), 13 | Cc = yaws_api:url_decode(mail:get_val("cc", L, "")), 14 | Bcc = yaws_api:url_decode(mail:get_val("bcc", L, "")), 15 | Quote = yaws_api:url_decode(mail:get_val("quote", L, "")), 16 | NewCc = 17 | if To == [] -> Cc; 18 | Cc == [] -> To; 19 | true -> To ++ ", " ++ Cc 20 | end, 21 | mail:compose(Session,"",From,NewCc,Bcc,"RE: "++Subject, 22 | Quote); 23 | "delete" -> 24 | Nr = mail:get_val("nr", L, ""), 25 | mail:delete(Session, [Nr]) 26 | end; 27 | Error -> 28 | Error 29 | end. 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /www/json_sample.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Testing html-json library 4 | 5 | 6 | 27 | 28 |
29 |
30 |
31 |

32 | First Argument: 33 |

34 |

35 | Second Argument: 36 |

37 |

38 | 39 |

40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /www/session1.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | -record(myopaque, {udata, 4 | times = 0, 5 | foobar}). 6 | 7 | out(A) -> 8 | H = A#arg.headers, 9 | C = H#headers.cookie, 10 | case yaws_api:find_cookie_val("baz", C) of 11 | [] -> 12 | M = #myopaque{}, 13 | Cookie = yaws_api:new_cookie_session(M), 14 | Data = {ehtml, 15 | {html,[], 16 | ["I just set yout cookie to ", Cookie, "Click ", 17 | {a, [{href,"session1.yaws"}], " here "}, 18 | "to revisit"]}}, 19 | CO = yaws_api:setcookie("baz",Cookie,"/"), 20 | [Data, CO]; 21 | Cookie -> 22 | {ok, OP} = yaws_api:cookieval_to_opaque(Cookie), 23 | OP2 = OP#myopaque{times = OP#myopaque.times + 1}, 24 | yaws_api:replace_cookie_session(Cookie, OP2), 25 | Data = {ehtml, 26 | {html,[], 27 | [ 28 | "Click ", 29 | {a, [{href,"session1.yaws"}], " here "}, 30 | "to revisit", 31 | {p, [], f("You have been here ~p times", [OP2#myopaque.times])}, 32 | {p, [], f("Your cookie is ~s", [Cookie])}]}}, 33 | Data 34 | end. 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /www/yman.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | prebox(Str) -> 5 | {'div',[{class,"man"}], 6 | {pre,[], yaws_api:htmlize(Str)}}. 7 | 8 | 9 | out(A) -> 10 | H = {ssi, "TAB.inc", [],[]}, 11 | L = case queryvar(A,"page") of 12 | {ok, Page} -> 13 | %% only allow regular chars in Page 14 | case lists:all(fun(C) -> 15 | if 16 | $a =< C, C =< $z -> 17 | true; 18 | $A =< C, C =< $Z -> 19 | true; 20 | C == $_ -> 21 | true; 22 | C == $. -> 23 | true; 24 | true -> 25 | false 26 | end 27 | end, Page) of 28 | true -> 29 | os:cmd("man " ++ Page ++ " | col -b -p -x"); 30 | false -> 31 | "illegal character detected in query arg" 32 | end; 33 | undefined -> 34 | "no man page found in query arg " 35 | end, 36 | 37 | Man = {ehtml, {'div', [{id, "entry"}], prebox(L)}}, 38 | Trail = {ssi, "END2",[],[]}, 39 | [H, Man, Trail]. 40 | 41 | 42 | -------------------------------------------------------------------------------- /www/doc.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | out(A) -> 5 | {ssi, "TAB.inc","%%",[{"doc", "choosen"}]}. 6 | 7 | 8 | 9 |
10 | 11 |

Documentation

12 | 13 | 14 |

User manual

15 | 16 |

The version of the usermanual is currently getting a bit old. 17 | There are several features of yaws which are yet not properly described 18 | in the user manual, they are all described in the Example collection or 19 | man pages though. 20 |

21 | 22 | 26 | 27 | 28 |

Man pages

29 | 30 | 45 | 46 |
47 | 48 | 49 | 50 | out(_) -> {ssi, "END2", [],[]}. 51 | 52 | 53 | -------------------------------------------------------------------------------- /www/todo.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | out(A) -> 4 | yaws_api:ssi(A#arg.docroot, ["/HEAD", "/TOPTAB"]). 5 | 6 | 7 | 8 | 9 | 10 |

TODO

11 | 12 |
    13 | 14 | 15 |
  • Test suites !!! 16 |
  • Http client code/lib 17 |
  • Load and unload configs without disturbing existing sessions. 18 |
  • respect client side Cache-Control: no-cache 19 |
  • clusters, it would be fairly straightforward 20 | to build support for webfarms into yaws. Now it works 21 | ofcource with a normal loadbalancer and mnesia across a set 22 | of nodes, but we could migrate IPs and stuff as well. 23 |
  • TRACE, PUT, OPTIONS ...... 24 |
  • more documentation in the www directory 25 |
  • redo the docs completely, docbook ?? 26 |
  • more functions in yaws_api 27 |
  • lots of examples, mnesia examples. 28 |
  • do something cool, maybe a streaming audio app 29 |
  • shell access into the daemon .... no bad idea .. ?? Maybe using 30 | distributed erlang to do that. 31 |
  • HTTP trailer support (why ??) 32 |
  • webdav, lots of work. 33 |
  • content negotiation / language support 34 |
35 | 36 | 37 | 38 | 39 | out(A) -> yaws_api:ssi(A#arg.docroot, ["/END"]). 40 | 41 | 42 | -------------------------------------------------------------------------------- /www/json_sample.yaws: -------------------------------------------------------------------------------- 1 | 2 | -compile(export_all). 3 | 4 | out(A) -> 5 | Peer = if 6 | tuple(A#arg.clisock), 7 | element(1, A#arg.clisock) == sslsocket -> 8 | ssl:peername(A#arg.clisock); 9 | true -> 10 | inet:peername(A#arg.clisock) 11 | end, 12 | 13 | {ok,{IP,_}} = Peer, 14 | A2=A#arg{state = [{ip, IP}]}, 15 | yaws_rpc:handler_session(A2, {?MODULE, counter}). 16 | 17 | 18 | 19 | counter([{ip, IP}] = _State, {call, test1, Value} = _Request, Session) -> 20 | io:format("Request = ~p~n", [_Request]), 21 | IPStr = io_lib:format("Client ip is ~p~n" , [ IP ]), 22 | OldSession = io_lib:format("Request is: ~p~nOld session value " 23 | "is ~p~n", [ _Request, Session ]), 24 | 25 | case Session of 26 | undefined -> % create new session 27 | NewSession = 0; 28 | 10 -> % reset session after reaching 10 29 | NewSession = undefined; 30 | N -> 31 | NewSession = N + 1 32 | end, 33 | 34 | NewVal = io_lib:format("New session value is ~p ~n", [ NewSession ]), 35 | Str = lists:flatten([IPStr,OldSession,NewVal]), 36 | {true, 0, NewSession, {response, Str }}. 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /applications/chat/include.mk: -------------------------------------------------------------------------------- 1 | ###-*-makefile-*- ; force emacs to enter makefile-mode 2 | 3 | 4 | # these the items can be edited 5 | 6 | INSTALLPREFIX=/var/yaws 7 | 8 | CHATINSTALLDIR=$(INSTALLPREFIX)/chat 9 | EBININSTALLDIR=$(INSTALLPREFIX)/ebin 10 | 11 | ERL=$(shell which erl) 12 | ERLC=$(shell which erlc) 13 | 14 | 15 | ## don't edit below here 16 | 17 | EMULATOR=beam 18 | ifdef debug 19 | ERLC_FLAGS+=-Ddebug 20 | endif 21 | 22 | ifdef trace 23 | ERLC_FLAGS=+trace 24 | endif 25 | 26 | ifdef export_all 27 | ERLC_FLAGS+=-Dexport_all 28 | endif 29 | 30 | 31 | INSTALL=install -c 32 | INSTALL_DATA=${INSTALL} -m 644 33 | 34 | 35 | # Hmm, don't know if you are supposed to like this better... ;-) 36 | APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }' 37 | 38 | # Targets 39 | 40 | ../ebin/%.app: %.app.src ../vsn.mk Makefile 41 | perl -e $(APPSCRIPT) "$(VSN)" $(MODULES) < $< > $@ 42 | 43 | ../ebin/%.appup: %.appup 44 | cp $< $@ 45 | 46 | ../ebin/%.$(EMULATOR): %.erl 47 | $(ERLC) -b $(EMULATOR) $(ERLC_FLAGS) -o ../ebin $< 48 | 49 | %.$(EMULATOR): %.erl 50 | $(ERLC) -b $(EMULATOR) $(ERLC_FLAGS) $< 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /applications/mail/include.mk: -------------------------------------------------------------------------------- 1 | ###-*-makefile-*- ; force emacs to enter makefile-mode 2 | 3 | 4 | # these the items can be edited 5 | 6 | INSTALLPREFIX=/var/yaws 7 | 8 | MAILINSTALLDIR=$(INSTALLPREFIX)/mail 9 | EBININSTALLDIR=$(INSTALLPREFIX)/ebin 10 | 11 | ERL=$(shell which erl) 12 | ERLC=$(shell which erlc) 13 | 14 | 15 | ## don't edit below here 16 | 17 | EMULATOR=beam 18 | ifdef debug 19 | ERLC_FLAGS+=-Ddebug 20 | endif 21 | 22 | ifdef trace 23 | ERLC_FLAGS=+trace 24 | endif 25 | 26 | ifdef export_all 27 | ERLC_FLAGS+=-Dexport_all 28 | endif 29 | 30 | 31 | INSTALL=install -c 32 | INSTALL_DATA=${INSTALL} -m 644 33 | 34 | 35 | # Hmm, don't know if you are supposed to like this better... ;-) 36 | APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }' 37 | 38 | # Targets 39 | 40 | ../ebin/%.app: %.app.src ../vsn.mk Makefile 41 | perl -e $(APPSCRIPT) "$(VSN)" $(MODULES) < $< > $@ 42 | 43 | ../ebin/%.appup: %.appup 44 | cp $< $@ 45 | 46 | ../ebin/%.$(EMULATOR): %.erl 47 | $(ERLC) -b $(EMULATOR) $(ERLC_FLAGS) -o ../ebin $< 48 | 49 | %.$(EMULATOR): %.erl 50 | $(ERLC) -b $(EMULATOR) $(ERLC_FLAGS) $< 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /applications/wiki/include.mk: -------------------------------------------------------------------------------- 1 | ###-*-makefile-*- ; force emacs to enter makefile-mode 2 | 3 | 4 | # these the items can be edited 5 | 6 | INSTALLPREFIX=/var/yaws 7 | 8 | WIKIINSTALLDIR=$(INSTALLPREFIX)/wiki 9 | EBININSTALLDIR=$(INSTALLPREFIX)/ebin 10 | 11 | ERL=$(shell which erl) 12 | ERLC=$(shell which erlc) 13 | 14 | 15 | ## don't edit below here 16 | 17 | EMULATOR=beam 18 | ifdef debug 19 | ERLC_FLAGS+=-Ddebug 20 | endif 21 | 22 | ifdef trace 23 | ERLC_FLAGS=+trace 24 | endif 25 | 26 | ifdef export_all 27 | ERLC_FLAGS+=-Dexport_all 28 | endif 29 | 30 | 31 | INSTALL=install -c 32 | INSTALL_DATA=${INSTALL} -m 644 33 | 34 | 35 | # Hmm, don't know if you are supposed to like this better... ;-) 36 | APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }' 37 | 38 | # Targets 39 | 40 | ../ebin/%.app: %.app.src ../vsn.mk Makefile 41 | perl -e $(APPSCRIPT) "$(VSN)" $(MODULES) < $< > $@ 42 | 43 | ../ebin/%.appup: %.appup 44 | cp $< $@ 45 | 46 | ../ebin/%.$(EMULATOR): %.erl 47 | $(ERLC) -b $(EMULATOR) $(ERLC_FLAGS) -o ../ebin $< 48 | 49 | %.$(EMULATOR): %.erl 50 | $(ERLC) -b $(EMULATOR) $(ERLC_FLAGS) $< 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /applications/yapp/priv/docroot/remove_post.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> {ssi, "HEAD.inc","%%",[{"remove", "choosen"}]}. 3 | 4 | 5 |

Add yapp

6 | 7 | 8 | get_value(K,P) -> 9 | case proplists:get_value(K,P) of 10 | undefined -> {"",""}; 11 | V -> 12 | [ServId,Path|_] = string:tokens(string:strip(V),","), 13 | {string:strip(ServId), string:strip(Path)} 14 | end. 15 | 16 | format(P) -> 17 | {SrvId,UrlPath} = get_value("srvidurlpath",P), 18 | format(SrvId,UrlPath). 19 | 20 | format([],_) -> error(no_srv_id); 21 | format(_,[]) -> error(no_path); 22 | format(S,P) -> 23 | case yapp_handler:remove(yapp_handler, S, P) of 24 | ok -> 25 | ["Removed Server Id: ", S,", Path: ", P]; 26 | Error -> 27 | error(Error) 28 | end. 29 | 30 | error(no_srv_id) -> "

No Server Id selected!

"; 31 | error(no_path) -> "

No path given!

"; 32 | error(E) -> ["

Error removing yapp

",E,"

"]. 33 | 34 | out(A) -> 35 | P = yaws_api:parse_post(A), 36 | Header = "Cache-Control:no-store", 37 | [{header, Header}, 38 | {html, ["

",format(P),"

", 39 | " Return to remove page"] }, 40 | {ssi,"END.inc",[],[]}]. 41 | 42 |
-------------------------------------------------------------------------------- /include/erlsom.hrl: -------------------------------------------------------------------------------- 1 | %%% ==================================================================== 2 | %%% Header file for erlsom 3 | %%% 4 | %%% Copyright (C) 2006 Willem de Jong 5 | %%% 6 | %%% This program is free software; you can redistribute it and/or modify 7 | %%% it under the terms of the GNU General Public License as published by 8 | %%% the Free Software Foundation; either version 2 of the License, or 9 | %%% (at your option) any later version. 10 | %%% 11 | %%% This program is distributed in the hope that it will be useful, but 12 | %%% WITHOUT ANY WARRANTY; without even the implied warranty of 13 | %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | %%% General Public License for more details. 15 | %%% 16 | %%% You should have received a copy of the GNU General Public License 17 | %%% along with this program; if not, write to the Free Software 18 | %%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 19 | %%% USA 20 | %%% 21 | %%% Author contact: w.a.de.jong@gmail.com 22 | %%% ==================================================================== 23 | 24 | %%% version: 0.0.2 25 | 26 | %% prefix=the prefix that will be used in the result 27 | -record(ns, {uri, prefix}). 28 | -record(qname, {uri, localPart, prefix, mappedPrefix}). 29 | -------------------------------------------------------------------------------- /applications/yapp/priv/docroot/add_post.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> {ssi, "HEAD.inc","%%",[{"add", "choosen"}]}. 3 | 4 | 5 |

Add yapp

6 | 7 | 8 | 9 | get_value(K,P) -> 10 | case proplists:get_value(K,P) of 11 | undefined -> ""; 12 | V -> string:strip(V) 13 | end. 14 | 15 | format(P) -> 16 | SrvId = get_value("srvid",P), 17 | Appmod = get_value("appmod",P), 18 | Path = get_value("path",P), 19 | format(SrvId,Appmod,Path). 20 | 21 | format([],_,_) -> error(no_srv_id); 22 | format(_,[],_) -> error(no_appmod); 23 | format(S,A,[]) -> format(S,A,"/" ++ A); 24 | format(S,A,P) -> 25 | case (catch yapp_handler:add(yapp_handler, S, P, list_to_atom(A))) of 26 | ok -> 27 | ["Added Server Id: ", S,", Appmod: ", A, ", Path: ", P]; 28 | Error -> 29 | error(Error) 30 | end. 31 | 32 | error(no_srv_id) -> "

No Server Id selected!

"; 33 | error(no_appmod) -> "

No Appmod given!

"; 34 | error(E) -> ["

Error adding yapp

", io:format("~p",[E]),"

"]. 35 | 36 | out(A) -> 37 | 38 | P = yaws_api:parse_post(A), 39 | 40 | {html, ["

",format(P),"

"] }. 41 | 42 |
43 | 44 |

Return to add page

45 | 46 | 47 | out(A) -> {ssi,"END.inc",[],[]}. 48 | 49 | -------------------------------------------------------------------------------- /applications/wiki/src/Makefile: -------------------------------------------------------------------------------- 1 | include ../include.mk 2 | 3 | ifeq ($(TYPE),debug) 4 | DEBUG_FLAGS = -Ddebug 5 | else 6 | DEBUG_FLAGS = 7 | endif 8 | 9 | include ../vsn.mk 10 | VSN=$(YAWS_VSN) 11 | MODULES=wiki \ 12 | wiki_templates \ 13 | wiki_split \ 14 | wiki_to_html \ 15 | wiki_format_txt \ 16 | wiki_utils \ 17 | wiki_diff \ 18 | wiki_yaws \ 19 | wiki_plugin_dummy \ 20 | wiki_plugin_backlinks \ 21 | wiki_plugin_menu \ 22 | utils 23 | 24 | EBIN_FILES=$(MODULES:%=../ebin/%.$(EMULATOR)) 25 | 26 | ERLC_FLAGS+=-W +debug_info $(DEBUG_FLAGS) -I../../../include -pa ../../wiki 27 | 28 | # 29 | # Targets 30 | # 31 | 32 | 33 | 34 | all: $(EBIN_FILES) 35 | 36 | wiki_vsn.erl: wiki_vsn.template 37 | . ../vsn.mk; sed "s/%VSN%/${WIKI_VSN}/" < wiki_vsn.template > wiki_vsn.erl 38 | 39 | debug: 40 | $(MAKE) TYPE=debug 41 | 42 | clean: 43 | rm -f $(EBIN_FILES) wiki_vsn.erl 44 | 45 | install: all 46 | install -d $(WIKIINSTALLDIR) 47 | install -d $(EBININSTALLDIR) 48 | (cd ../ebin; find . -name '*' -print | xargs tar cf - ) | (cd $(EBININSTALLDIR); tar xf - ) 49 | (cd ../wiki; find . -name '*' -print | xargs tar cf - ) | (cd $(WIKIINSTALLDIR); tar xf - ) 50 | 51 | 52 | 53 | tags: 54 | erl -noshell -pa ../ebin -s wiki_debug mktags 55 | 56 | xref: 57 | erl -noshell -pa ../ebin -s wiki_debug xref ../ebin 58 | 59 | -------------------------------------------------------------------------------- /applications/mail/src/Makefile: -------------------------------------------------------------------------------- 1 | include ../include.mk 2 | 3 | ifeq ($(TYPE),debug) 4 | DEBUG_FLAGS = -Ddebug 5 | else 6 | DEBUG_FLAGS = 7 | endif 8 | 9 | include ../vsn.mk 10 | VSN=$(YAWS_VSN) 11 | MODULES=mail attachment smtp mail_html 12 | 13 | EBIN_FILES=$(MODULES:%=../ebin/%.$(EMULATOR)) 14 | 15 | ERLC_FLAGS+=-W +debug_info $(DEBUG_FLAGS) -I../../../include -pa ../../mail 16 | 17 | # 18 | # Targets 19 | # 20 | 21 | all: $(EBIN_FILES) 22 | 23 | mail_vsn.erl: mail_vsn.template 24 | . ../vsn.mk; sed "s/%VSN%/${MAIL_VSN}/" < mail_vsn.template > mail_vsn.erl 25 | 26 | debug: 27 | $(MAKE) TYPE=debug 28 | 29 | clean: 30 | rm -f $(EBIN_FILES) mail_vsn.erl 31 | 32 | install: all 33 | install -d $(MAILINSTALLDIR) 34 | install -d $(EBININSTALLDIR) 35 | install -d $(DESTDIR)/etc/mail 36 | @if [ -f $(DESTDIR)/etc/mail/yaws-webmail.conf ]; \ 37 | then echo "$(DESTDIR)/etc/mail/yaws-webmail.conf already exists"; \ 38 | else \ 39 | cp yaws-webmail.conf $(DESTDIR)/etc/mail/yaws-webmail.conf; fi 40 | (cd ../ebin; find . -name '*' -print | xargs tar cf - ) | (cd $(EBININSTALLDIR); tar xf - ) 41 | (cd ../mail; find . -name '*' -print | xargs tar cf - ) | (cd $(MAILINSTALLDIR); tar xf - ) 42 | 43 | 44 | 45 | tags: 46 | erl -noshell -pa ../ebin -s mail_debug mktags 47 | 48 | xref: 49 | erl -noshell -pa ../ebin -s mail_debug xref ../ebin 50 | 51 | -------------------------------------------------------------------------------- /www/readpcookie.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Read persistent cookie

4 | 5 | 6 | 7 | to_integer(S) -> 8 | list_to_integer(string:strip(S, both)). 9 | 10 | out(A) -> 11 | H=A#arg.headers, 12 | C = H#headers.cookie, 13 | L=case yaws_api:find_cookie_val("pfoobar", C) of 14 | [] -> 15 | f("

No cookie set from the browser, need to " 16 | "visit setpcookie.yaws " 17 | "to set the cookie first

~n", []); 18 | NumStr -> 19 | Num = to_integer(NumStr), 20 | case ets:lookup(pcookies, {cookie,Num}) of 21 | [{{cookie, Num}, Data}] -> 22 | f("

Yes, I read your cookie:it is ~p~n " 23 | "Your persistent info is ~n" 24 | "

~n~p~n

~n", [NumStr, Data]); 25 | [] -> 26 | f("

You had a cookie,but the data is gone

",[]) 27 | end 28 | end, 29 | {html, L}. 30 | 31 |
32 | 33 | 34 |

35 | The code to read the cookie, is simple, we get the cookie passed to the yaws 36 | code in the #arg structure which is the argument supplied to the out/1 function. 37 | The code is:

38 | 39 | 40 | out(A) -> 41 | {ok, B} = file:read_file(A#arg.docroot ++ "/readpcookie.yaws"), 42 | {ehtml, 43 | {'div', [{class, "box"}], 44 | {pre,[], B}}}. 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /scripts/gentoo/init.d.yaws: -------------------------------------------------------------------------------- 1 | #!/sbin/runscript 2 | # 3 | # Startup script for the Yaws Web Server (for Gentoo Linux) 4 | # 5 | # config: /etc/conf.d/yaws 6 | # 7 | # description: yaws - Erlang enabled http server 8 | # 9 | # use: rc-update add yaws default 10 | # 11 | 12 | opts="start stop reload restart query debug" 13 | 14 | depend() { 15 | need net 16 | } 17 | 18 | 19 | start() { 20 | ebegin "Starting ${YAWS_APP} " 21 | start-stop-daemon --start --verbose \ 22 | --exec ${YAWS_EXEC} -- ${YAWS_START_OPTS} 23 | eend $? 24 | } 25 | 26 | 27 | stop() { 28 | ebegin "Stopping ${YAWS_APP} " 29 | start-stop-daemon --start --quiet \ 30 | --exec ${YAWS_EXEC} -- ${YAWS_STOP_OPTS} 31 | eend $? 32 | } 33 | 34 | 35 | reload() { 36 | ebegin "Reloading ${YAWS_APP} " 37 | start-stop-daemon --start --quiet --chuid ${YAWS_UID} \ 38 | --exec ${YAWS_EXEC} -- ${YAWS_RELOAD_OPTS} 39 | eend $? 40 | } 41 | 42 | query() { 43 | ebegin "Querying ${YAWS_APP} " 44 | start-stop-daemon --start --quiet --chuid ${YAWS_UID} \ 45 | --exec ${YAWS_EXEC} -- ${YAWS_QUERY_OPTS} 46 | eend $? 47 | } 48 | 49 | debug() { 50 | ebegin "Debug ${YAWS_APP} " 51 | start-stop-daemon --start --quiet --chuid ${YAWS_UID} \ 52 | --exec ${YAWS_EXEC} -- ${YAWS_DEBUG_OPTS} 53 | eend $? 54 | } 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /c_src/Makefile: -------------------------------------------------------------------------------- 1 | include ../include.mk 2 | 3 | 4 | # don't c-compile anything on win32 (yet) 5 | # I don't know how to make a linked in driver using gcc, or any 6 | # other compiler there, and have no intentions of finding out 7 | 8 | ifdef WIN32 9 | PRIV_FILES=../priv/.foo 10 | else 11 | # don't make pam if configured out with --disable-pam 12 | PRIV_FILES= ../priv/setuid_drv.$(DLL) $(EPAM) 13 | endif 14 | 15 | 16 | CFLAGS += -I"${ERLDIR}/usr/include" 17 | 18 | # and for MacOs + possibly others ... 19 | CFLAGS += -I/usr/include/pam/ $(EXTRAINCLUDE) 20 | 21 | # 22 | # Targets 23 | # 24 | 25 | all: $(PRIV_FILES) 26 | 27 | clean: 28 | -rm -f $(PRIV_FILES) setuid_drv.$(OBJ) 29 | 30 | install: $(PRIV_FILES) 31 | $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/yaws/priv 32 | $(INSTALL) $(PRIV_FILES) $(DESTDIR)$(PREFIX)/lib/yaws/priv 33 | ifndef WIN32 34 | if [ `id -u` = "0" -a -d $(DESTDIR)$(PREFIX)/lib/yaws/priv/epam ]; then \ 35 | chown root $(DESTDIR)$(PREFIX)/lib/yaws/priv/epam; \ 36 | chmod a+s $(DESTDIR)$(PREFIX)/lib/yaws/priv/epam; \ 37 | fi 38 | endif 39 | 40 | 41 | ../priv/setuid_drv.$(DLL): setuid_drv.$(OBJ) 42 | $(LD_SHARED) $(OUT) $@ setuid_drv.$(OBJ) $(DLL_LIBS) 43 | setuid_drv.$(OBJ): setuid_drv.c 44 | $(CC) -c $(FPIC) $(CFLAGS) -DDYNAMIC_DRIVER setuid_drv.c 45 | 46 | ../priv/.foo: 47 | touch ../priv/.foo 48 | 49 | epam.o: epam.c 50 | $(CC) -c $(CFLAGS) epam.c 51 | ../priv/epam: epam.o 52 | $(CC) -o $@ epam.o -lpam 53 | -------------------------------------------------------------------------------- /www/shopingcart/style.css: -------------------------------------------------------------------------------- 1 | 58 | -------------------------------------------------------------------------------- /applications/yapp/priv/docroot/add.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> {ssi, "HEAD.inc","%%",[{"add", "choosen"}]}. 3 | 4 | 5 |

Add yapp

6 |
7 |

8 | 9 | 10 | format_srvid_radio([]) -> []; 11 | format_srvid_radio([ServId|T]) -> 12 | [ "
", 13 | "", ServId | 14 | format_srvid_radio(T)]. 15 | 16 | 17 | out(A) -> 18 | Header = "Cache-Control:no-store", 19 | [{header, Header}, {html, [ "Server id: ", format_srvid_radio(yapp:get_server_ids())]}]. 20 | 21 |
22 |

23 |

Appmod :

24 |

Path (optional):

25 |

26 |
27 |

Note: An added Yapp will always be stored in the registry, 28 | but if the application is not really in the load path of the Erlang system it will not 29 | be loaded into Yaws server configuration. In such case it will not show up the when listing 30 | the applications in the Yapp console, but it will show up in the Remove list.

31 |

If the yapp handler fails to find the application, a record will be written to the error log. 32 | The application may be included in the load path later, and will be put into Yaws configuration 33 | when Yaws is hupped or next time a Yapp is added/removed.

34 | 35 | 36 | out(A) -> {ssi,"END.inc",[],[]}. 37 | 38 | -------------------------------------------------------------------------------- /www/stats_ex.yaws: -------------------------------------------------------------------------------- 1 | 2 | out(A) -> file:read_file([A#arg.docroot, "/EXHEAD"]). 3 | 4 | 5 |

Talking to the server

6 | 7 | Since we are running in the same process as the webserver itself, it is 8 | easy for us to interact with the webserver itself from a yaws script. 9 | The following is an example which produces a statistics report 10 | from the webserver. We call the server 11 | 12 | The absoluteley most simple example is a HTML file which doesn't contain 13 | any embedded erlang code at all. 14 | 15 | 16 | 17 | out(A) -> 18 | {ok, B} = file:read_file([A#arg.docroot, "/stats_ex1.yaws"]), 19 | {ok, [" \n", B, "</xmp\n>"]}. 20 | </erl> 21 | 22 | <br> 23 | Since the file has the suffix <tt>.yaws</tt>, the file will be processed 24 | by the Yaws dynamic compiler, but since no embeddded erlang code is found, 25 | the data from the file will be delivered untouched. 26 | <br> 27 | 28 | <h2> Hello world again </h2> 29 | 30 | The file <a href="simple_ex2.yaws">simple_ex2.yaws</a> contains the following 31 | HTML code. 32 | <br> 33 | <erl> 34 | out(A) -> 35 | {ok, B} = file:read_file([A#arg.docroot, "/simple_ex2.yaws"]), 36 | {ok, ["<xmp> \n", B, "</xmp\n>"]}. 37 | </erl> 38 | 39 | The file has one very simple function which just returns a tuple 40 | <tt>{ok, String} </tt> 41 | <br> 42 | The String will be substituted into the delivered HTML data instead of the 43 | Erlang code. 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | </html> 54 | -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/template_info2.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 | <html> 3 | <head> 4 | <title>@@TITLE@@</title> 5 | <style type="text/css"> 6 | <!-- 7 | @import url("WikiPreferences.files/custom.css"); 8 | --> 9 | </style> 10 | </head> 11 | <body style="background-color: rgb(102, 204, 204);"> 12 | <table cellpadding="2" cellspacing="10" border="0" 13 | style="width: 100%; text-align: left;"> 14 | <tbody> 15 | <tr> 16 | <td style="vertical-align: middle; text-align: left;"> 17 | <table colspan="2" cellpadding="2" cellspacing="2" border="0" 18 | style="text-align: left; width: 100%;"> 19 | <tbody> 20 | <tr> 21 | <td style="vertical-align: top;"> 22 | <img src="WikiPreferences.files/yaws_pb.gif" 23 | title="" alt=""></td> 24 | <td style="vertical-align: top;"></td> 25 | </tr> 26 | </tbody> 27 | </table> 28 | </td> 29 | <td style="vertical-align: top; text-align: right;"> <br> 30 | </td> 31 | </tr> 32 | <tr> 33 | <td 34 | style="vertical-align: top; background-color: rgb(204, 255, 255);"> 35 | <h4>@@HEADER@@</h4> 36 | <!-- the generated page --> 37 | @@DATA@@ </td> 38 | <!-- the right hand image --> <td 39 | style="text-align: right; vertical-align: top;"><br> 40 | </td> 41 | </tr> 42 | </tbody> 43 | </table> 44 | </body> 45 | </html> 46 | -------------------------------------------------------------------------------- /www/setcookie.yaws: -------------------------------------------------------------------------------- 1 | 2 | 3 | <erl> 4 | 5 | session(A, Visits) -> 6 | receive 7 | {From, tick} -> 8 | N = calendar:local_time(), 9 | From ! {self(), [N|Visits]}, 10 | session(A, [N|Visits]) 11 | after 60000 -> %% keep state for 60 secs only 12 | exit(normal) 13 | end. 14 | 15 | 16 | out(A) -> 17 | H = A#arg.headers, 18 | C = H#headers.cookie, 19 | case yaws_api:find_cookie_val("foobar", C) of 20 | [] -> 21 | Now = calendar:local_time(), 22 | P = spawn(fun() -> session(A, [Now]) end), 23 | yaws_api:setcookie("foobar", 24 | pid_to_list(P), "/"); 25 | PidStr -> 26 | Pid = list_to_pid(PidStr), 27 | case process_info(Pid, messages) of 28 | undefined -> 29 | Now = calendar:local_time(), 30 | P = spawn(fun() -> 31 | session(A, [Now]) 32 | end), 33 | yaws_api:setcookie("foobar", 34 | pid_to_list(P), "/"); 35 | _ -> 36 | ok 37 | end 38 | end. 39 | 40 | </erl> 41 | 42 | <html> 43 | 44 | 45 | <h2> set cookie </h2> 46 | 47 | <p>This is the page that set the cookie in the browser. 48 | <a href="readcookie.yaws">readcookie.yaws</a> will 49 | read the cookie and report persistent information as 50 | long as the browser session exists. 51 | 52 | <p> it will set the cookie 53 | <tt>foobar = &lt;x,y,z&gt;; </tt> where the 54 | x,y,z string is the textual representation of an 55 | actual erlang pid which will be responsible for 56 | this session. 57 | 58 | </html> 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = c_src src man www/shopingcart www/code doc scripts 3 | include ./include.mk 4 | 5 | 6 | all debug clean: 7 | @set -e ; \ 8 | for d in $(SUBDIRS) ; do \ 9 | if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \ 10 | done 11 | 12 | 13 | install: all 14 | set -e ; \ 15 | for d in $(SUBDIRS) ; do \ 16 | if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \ 17 | done 18 | @echo "-------------------------------" 19 | @echo 20 | @echo "** etc files went into ${ETCDIR}" 21 | @echo "** executables went into ${prefix}/bin" 22 | @echo "** library files went into ${prefix}/lib/yaws" 23 | @echo "** var files went into ${VARDIR}" 24 | @echo "** default docroot went into ${VARDIR}/yaws/www" 25 | @echo 26 | @echo "--------------------------------" 27 | 28 | 29 | docs: 30 | ( cd doc && $(MAKE) docs ) 31 | 32 | conf_clean: 33 | -rm include.mk config.cache config.status config.log 2> /dev/null 34 | 35 | local_install: all 36 | (cd scripts && $(MAKE) local_install) 37 | 38 | 39 | touch: 40 | find . -name '*' -print | xargs touch -m 41 | find . -name '*.erl' -print | xargs touch -m 42 | 43 | 44 | 45 | 46 | foo: 47 | @echo "-------------------------------" 48 | @echo 49 | @echo "** etc files will go into ${ETCDIR}" 50 | @echo "** executables will go into ${prefix}/bin" 51 | @echo "** library file will go into ${prefix}/lib/yaws" 52 | @echo "** var files will go into ${VARDIR}" 53 | @echo 54 | @echo "--------------------------------" 55 | 56 | -------------------------------------------------------------------------------- /www/pcookie.yaws: -------------------------------------------------------------------------------- 1 | <erl> 2 | out(A) -> {ssi, "TAB.inc", "%%",[{"pcookie", "choosen"}]}. 3 | </erl> 4 | 5 | 6 | <div id="entry"> 7 | 8 | <h1>Persistent Cookies</h1> 9 | <p> 10 | We saw in the first <a href="cookies.yaws">cookie</a> example, how we 11 | assigned a special erlang process to handle each session. 12 | The cookie has an expiry date, and the correct thing would be to let the 13 | handling process live as long as the cookie is valid. This is not a good option. 14 | A better option is to store cookie in a persistant storage. This can be an 15 | ets table or a dets table. If we choose an ets table, the cookies will disappear 16 | when the yaws server is restarted, whereas if we choose a dets table, 17 | the cookies will survive daemon restarts. What to choose depends on the 18 | type of cookie information we have. 19 | </p> 20 | 21 | <p> 22 | The yaws code in 23 | <a href="setpcookie.yaws">setpcookie.yaws</a> sets the cookie in the browser. 24 | </p> 25 | 26 | <p>And the yaws code in <a href="readpcookie.yaws">readpcookie.yaws</a> 27 | will read the cookie 28 | </p> 29 | 30 | <p> 31 | Let's show some code. To set the cookie we we have: 32 | </p> 33 | 34 | <erl> 35 | out(A) -> yaws_api:pre_ssi_files(A#arg.docroot, ["setpcookie.yaws"]). 36 | </erl> 37 | 38 | <p> 39 | And to read the cookie, we have the following code: 40 | </p> 41 | 42 | <erl> 43 | out(A) -> yaws_api:pre_ssi_files(A#arg.docroot, ["readpcookie.yaws"]). 44 | </erl> 45 | 46 | 47 | </div> 48 | 49 | 50 | <erl> 51 | out(A) -> {ssi, "END2",[],[]}. 52 | </erl> 53 | 54 | -------------------------------------------------------------------------------- /applications/mail/README: -------------------------------------------------------------------------------- 1 | 2 | 3 | This is a very basic WebMail application which is completely 4 | stateless, by design. I didn't want any SQL databases etc 5 | for storing the emails. 6 | 7 | The reason for building it was that I needed a local WebMail 8 | and I didn't want to install an Apache with python or PHP, 9 | and besides all those relied on some local store (mbox, MySQL 10 | etc) which I didn't want. Also, Klacke told me that he never 11 | finished the other webmail app so I started from scratch. 12 | 13 | A few important things are still missing. The most notable is the 14 | ability to handle attached files and email on multipart format... 15 | 16 | 17 | To install 18 | ---------- 19 | 20 | - Modify include.mk for your local paths 21 | 22 | Run 'make' and 'make install' 23 | 24 | 25 | 26 | - Edit/Create /etc/mail/yaws-webmail.conf 27 | 28 | (Make install will create a good template for the conf 29 | file in /etc/mail) 30 | 31 | 32 | 33 | Two things need to be edited in /etc/yaws.conf 34 | 35 | 1. yaws must find the beam code for mail.beam, 36 | By default (include.mk) that gets installed in 37 | /var/yaws/ebin 38 | 39 | This path must be added to /etc/yaws conf as in: 40 | 41 | ebin_dir = /var/yaws/ebin 42 | 43 | 44 | 45 | 2. The virtual server that is supposed to run the webmail 46 | must have an appmod called 'attachment' installed. 47 | 48 | Here is an example: 49 | 50 | <server flinta> 51 | port = 80 52 | appmods = attachment 53 | listen = 0.0.0.0 54 | docroot = /var/yaws/mail 55 | </server> 56 | 57 | 58 | 59 | 60 | /Johan Bevemyr 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2006, Claes Wikstrom, klacke@hyber.org 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | * Neither the name of "Yaws" nor the names of its contributors may be 14 | used to endorse or promote products derived from this software without 15 | specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /scripts/redhat/yaws.init.d: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Startup script for the Yaws Web Server 4 | # 5 | # config: /etc/yaws.conf 6 | # 7 | # chkconfig: 2345 65 35 8 | # description: yaws - Erlang enabled http server 9 | # use "/sbin/chkconfig --add yaws" to install 10 | 11 | # Source function library. 12 | 13 | . /etc/rc.d/init.d/functions 14 | 15 | yaws=%prefix%/bin/yaws 16 | prog=yaws 17 | yawsid=myserverid 18 | 19 | start() { 20 | echo -n $"Starting $prog: " 21 | daemon $yaws --id ${myserverid} --daemon --heart 22 | RETVAL=$? 23 | echo 24 | [ $RETVAL = 0 ] && touch /var/lock/subsys/yaws 25 | return $RETVAL 26 | } 27 | 28 | stop() { 29 | echo -n $"Stopping $prog: " 30 | str=`$yaws --id ${yawsid} --stop` 31 | if [ "$str" = "stopping" ]; then 32 | echo_success 33 | RETVAL=0 34 | else 35 | echo_failure 36 | RETVAL=1 37 | fi 38 | echo 39 | rm -f /var/lock/subsys/yaws /var/run/yaws.pid 40 | } 41 | 42 | 43 | reload() { 44 | echo -n $"Reloading $prog: " 45 | r=`$yaws --id ${yawsid} --hup` 46 | RETVAL=$? 47 | echo $r 48 | } 49 | 50 | # See how we were called. 51 | case "$1" in 52 | start) 53 | start 54 | ;; 55 | stop) 56 | stop 57 | ;; 58 | status) 59 | $yaws -S 60 | RETVAL=$? 61 | ;; 62 | restart) 63 | stop 64 | start 65 | ;; 66 | condrestart) 67 | if [ -f /tmp/yaws.ctl ] ; then 68 | stop 69 | start 70 | fi 71 | ;; 72 | reload) 73 | reload 74 | ;; 75 | help) 76 | $yaws -? 77 | ;; 78 | *) 79 | echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|help}" 80 | exit 1 81 | esac 82 | 83 | exit $RETVAL 84 | -------------------------------------------------------------------------------- /www/readcookie.yaws: -------------------------------------------------------------------------------- 1 | <html> 2 | 3 | <h2> Read cookie </h2> 4 | 5 | <erl> 6 | out(A) -> 7 | H=A#arg.headers, 8 | C = H#headers.cookie, 9 | 10 | L=case yaws_api:find_cookie_val("foobar", C) of 11 | [] -> 12 | f("<p> No cookie set from the browser, need to " 13 | "visit <a href=\"setcookie.yaws\">setcookie.yaws</a> " 14 | "to set the cookie first ~n", []); 15 | PidStr -> 16 | Pid = list_to_pid(PidStr), 17 | Pid ! {self(), tick}, 18 | receive 19 | {Pid, VisitList} -> 20 | f("<p> Yes, I read your cookie " 21 | "You have vistited this page ~w times " 22 | "they were ~n<ol> ~n~s </ol>~n " 23 | 24 | "Reloading this page will show the session state ", 25 | 26 | [length(VisitList), 27 | lists:map(fun(D) -> 28 | Ds = yaws:time_to_string(D, "GMT"), 29 | f("<li> ~s~n", [Ds]) end, 30 | VisitList) 31 | ]) 32 | after 500 -> 33 | f("<p> You had a cookie, but the pid handling your sess " 34 | "timedout ...",[]) 35 | end 36 | end, 37 | {html, L}. 38 | 39 | </erl> 40 | 41 | 42 | <p> 43 | The code to read the cookie, is simple, we get the cookie passed to the yaws 44 | code in the #arg structure which is the argument supplied to the out/1 function. 45 | 46 | <p>We use the <tt>yaws_api:find_cookie_val/2</tt> function to parse 47 | the raw cookie string passed to us from the browser. 48 | 49 | The code is: 50 | <erl> 51 | out(A) -> 52 | yaws_api:pre_ssi_files(A#arg.docroot, ["readcookie.yaws"]). 53 | </erl> 54 | 55 | 56 | 57 | 58 | </html> 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /applications/yapp/priv/docroot/remove.yaws: -------------------------------------------------------------------------------- 1 | <erl> 2 | out(A) -> {ssi, "HEAD.inc","%%",[{"remove", "choosen"}]}. 3 | </erl> 4 | 5 | 6 | <h3>Remove yapp</h3> 7 | <form action="remove_post.yaws" method="post"> 8 | <erl> 9 | 10 | format_yapp_tables([]) -> []; 11 | format_yapp_tables([ServId|T]) -> 12 | Yapps = yapp_handler:list(yapp_handler,ServId), 13 | [ format_yapp_table(ServId, Yapps) | format_yapp_tables(T)]. 14 | 15 | format_yapp_table(ServId, undefined) -> ""; 16 | format_yapp_table(ServId, Yapps) -> 17 | ["<h3> Server id : ", ServId, "</h3>", 18 | "<table border=\"1\"><tr><th>Select</th><th>Application</th><th>Url</th></tr>", 19 | format_yapps(ServId, Yapps), 20 | "<table>"]. 21 | 22 | format_yapps(ServId,[]) -> 23 | []; 24 | format_yapps(ServId, [{Urlpath, Appname}|T]) -> 25 | ["<tr><td>", 26 | "<input type=\"radio\" name=\"srvidurlpath\" value=\"", ServId,",",Urlpath, "\" />", 27 | "</td><td>", atom_to_list(Appname), "</td><td>", Urlpath, "</td></tr>" | format_yapps(ServId, T)]. 28 | 29 | out(A) -> 30 | Header = "Cache-Control:no-store", 31 | 32 | [{header,Header},{html, format_yapp_tables(yapp:get_server_ids())}]. 33 | 34 | </erl> 35 | <p> 36 | <input type="submit" value="Remove Yapp"> 37 | </p> 38 | </form> 39 | <p>The Yapps listed in this page are those stored in the Yapp registry. It excludes the applications 40 | loaded from yaws.conf with the bootstrap_yapps opaque variable. It will also include those registered 41 | applications that are not available in the Erlang load path, and therefore not shown on the "List" page.</p> 42 | 43 | <erl> 44 | out(A) -> {ssi,"END.inc",[],[]}. 45 | </erl> 46 | -------------------------------------------------------------------------------- /www/contribs.yaws: -------------------------------------------------------------------------------- 1 | <erl> 2 | out(A) -> 3 | {ssi, "TAB.inc", "%%",[{"contribs", "choosen"}]}. 4 | </erl> 5 | 6 | 7 | <div id="entry"> 8 | 9 | <h1>Contributions and Applications</h1> 10 | 11 | <p>This is a list of (some of) the currently known 12 | Yaws applications. </p> 13 | 14 | 15 | <ul> 16 | 17 | <li> <h4>The Yaws wiki </h4> 18 | 19 | <p>This application is part of the Yaws source code distribution. It is 20 | a fullblown wiki web.</p> 21 | </li> 22 | 23 | <li><h4> cvstat </h4> 24 | 25 | <p> CVS realtime statistics through Web interface at 26 | <a href="http://downloads.erlang-fr.org"> http://downloads.erlang-fr.org </a></p> 27 | </li> 28 | 29 | 30 | <li><h4> The ticket tracker </h4> 31 | <p>An error reporting system at 32 | <a href="http://btt.sourceforge.net"> http://btt.sourceforge.net/ </a></p> 33 | </li> 34 | 35 | <li><h4>Nortel SSL-VPN </h4> 36 | 37 | <p>An SSL based VPN appliance at: 38 | <a href="http://www.nortelnetworks.com/products/01/alteon/sslvpn"> 39 | http://www.nortelnetworks.com/products/01/alteon/sslvpn/ </a> 40 | </p> 41 | </li> 42 | 43 | <li><h4>Yaws webmail </h4> 44 | 45 | <p>An excellent little stateless webmail server. No db, no nothing is needed except the address 46 | of a popserver and the address of an smtp server. Part of the Yaws source code distro. Extremely 47 | easy to configure and run. 48 | </p> 49 | </li> 50 | 51 | </ul> 52 | 53 | 54 | 55 | </div> 56 | 57 | 58 | <erl> 59 | out(A) -> {ssi, "END2",[],[]}. 60 | </erl> 61 | 62 | -------------------------------------------------------------------------------- /ssl/yaws-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEbTCCA9agAwIBAgIBADANBgkqhkiG9w0BAQQFADCBqTELMAkGA1UEBhMCc2Ux 3 | FTATBgNVBAgTDEdvbmR3YW5hbGFuZDERMA8GA1UEBxMIWWF3c3Rvd24xEzARBgNV 4 | BAoTCkh5YmVyIEluYy4xGzAZBgNVBAsTEkphbml0b3JpYWwgc2VjdGlvbjESMBAG 5 | A1UEAxMJbG9jYWxob3N0MSowKAYJKoZIhvcNAQkBFhtub2JvZHlAbm93aGVyZS5n 6 | b25kd2FuYWxhbmQwHhcNMDQwMzE4MDk0NDA5WhcNMDkwOTA4MDk0NDA5WjCBqTEL 7 | MAkGA1UEBhMCc2UxFTATBgNVBAgTDEdvbmR3YW5hbGFuZDERMA8GA1UEBxMIWWF3 8 | c3Rvd24xEzARBgNVBAoTCkh5YmVyIEluYy4xGzAZBgNVBAsTEkphbml0b3JpYWwg 9 | c2VjdGlvbjESMBAGA1UEAxMJbG9jYWxob3N0MSowKAYJKoZIhvcNAQkBFhtub2Jv 10 | ZHlAbm93aGVyZS5nb25kd2FuYWxhbmQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ 11 | AoGBAMwkcBwlcH1PORiD+CFc2M4CnfNyAoLpdmjj33VI8Zi6QpVTUW9FfRiA/HfD 12 | PwB7vKQ9zQpbs7cP0+fyWJrNNgRpeyQ0oDM4WvWC0F3un3fs8o1CT77f8CzkR8mP 13 | P6UGvBQZtKJwmCV0mTcKPz2G0xSobAvYGX/I5Aixm3IuWs/XAgMBAAGjggGhMIIB 14 | nTAMBgNVHRMEBTADAQH/MBEGCWCGSAGG+EIBAQQEAwICRDAyBglghkgBhvhCAQ0E 15 | JRYjQWx0ZW9uL05vcnRlbCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYE 16 | FCgQch3M7taVtzPbNV2hEqkhSIMWMIHWBgNVHSMEgc4wgcuAFCgQch3M7taVtzPb 17 | NV2hEqkhSIMWoYGvpIGsMIGpMQswCQYDVQQGEwJzZTEVMBMGA1UECBMMR29uZHdh 18 | bmFsYW5kMREwDwYDVQQHEwhZYXdzdG93bjETMBEGA1UEChMKSHliZXIgSW5jLjEb 19 | MBkGA1UECxMSSmFuaXRvcmlhbCBzZWN0aW9uMRIwEAYDVQQDEwlsb2NhbGhvc3Qx 20 | KjAoBgkqhkiG9w0BCQEWG25vYm9keUBub3doZXJlLmdvbmR3YW5hbGFuZIIBADAm 21 | BgNVHREEHzAdgRtub2JvZHlAbm93aGVyZS5nb25kd2FuYWxhbmQwJgYDVR0SBB8w 22 | HYEbbm9ib2R5QG5vd2hlcmUuZ29uZHdhbmFsYW5kMA0GCSqGSIb3DQEBBAUAA4GB 23 | AJta5N4bDsuLdft6COg2k/+nUN6sIPSm0g6px8Zdj6+9u1ERydqmPJoFBZVDnvKt 24 | w5O91ErGuwTGTLwJwPBU7bvEhynWEJbLbEF/kNWZBHfzAq5rg9qmu87c6yhXX4C+ 25 | 5Qlk+IW7ZE5HOW3Q41Ln6WBQGS/ec85BKoro/hh9X1Bg 26 | -----END CERTIFICATE----- 27 | -------------------------------------------------------------------------------- /applications/wiki/src/wiki_plugin_menu.erl: -------------------------------------------------------------------------------- 1 | -module(wiki_plugin_menu). 2 | 3 | %%% File : wiki_plugin_menu.erl 4 | %%% Author : Mickal Remond <mickael.remond@erlang-fr.org> 5 | %%% Description : Allows the selection and display of a menu Links are 6 | %%% selected base on first word of the page name (Menu, 7 | %%% Category, ...). The other part of the title is the 8 | %%% name of the menu entry. 9 | %%% Created : 22 Oct 2003 by Mickael Remond 10 | %%% <mickael.remond@erlang-fr.org> 11 | 12 | -export([run/2]). 13 | 14 | -include("yaws.hrl"). %% Needed only if you want to manipulate 15 | %% Yaws configuration 16 | 17 | run(_Page, ArgList) -> 18 | %% TODO: Fixme 19 | %% This is working if there is only one virtual server. 20 | %% A way to handle this cleanly is needed. 21 | {ok, Gconf, [[Sconf|Others]]} = yaws_api:getconf(), 22 | Root = Sconf#sconf.docroot, 23 | 24 | Prefix = get_prefix(ArgList), 25 | 26 | %% Get all page starting with a given word 27 | Pages = wiki_utils:getpages_by_prefix(Prefix, Root), 28 | 29 | lists:map(fun(F) -> 30 | [wiki_to_html:format_menu_link(Prefix, F, Root),"<br>"] end, 31 | Pages). 32 | 33 | 34 | %% Get the category to use in the menu If not passed as parameter, use 35 | %% "Category" 36 | %% Be careful: plugin syntax is for the moment case sensitive 37 | get_prefix(ArgList) -> 38 | case lists:keysearch("prefix", 1, ArgList) of 39 | {value, {"prefix", Prefix}} -> 40 | Prefix; 41 | _Other -> 42 | "Category" 43 | end. 44 | 45 | %% TODO: is it relevant to be able to handle several category in 46 | %% the menu ? 47 | -------------------------------------------------------------------------------- /www/form.yaws: -------------------------------------------------------------------------------- 1 | 2 | <erl> 3 | 4 | out(A) -> 5 | {ssi, "TAB.inc", "%%",[{"form", "choosen"}]}. 6 | 7 | </erl> 8 | 9 | 10 | <div id="entry"> 11 | <h2>POST example </h2> 12 | 13 | <p>This is a simple example where we get to fill in 14 | a series of fields and POST the data by hitting the Submit button 15 | at the end. 16 | </p> 17 | <p> 18 | The action is set to the yaws file <tt>/post.yaws </tt> which 19 | gets POSTed data in its <tt>ARG#arg.clidata</tt> field. 20 | </p> 21 | 22 | <form method="post" 23 | action="/post.yaws"> 24 | 25 | This is a serious poll. 26 | 27 | <p>Your favourite programming language? </p> 28 | <input name="lang" type="text" size="48" /> 29 | 30 | <p>Imperative ? <input name="imperative" type="checkbox"/></p> 31 | 32 | <p>How many tabs to you indent? <input name="tabs" type="text" /></p> 33 | 34 | <p>Which OS do you use?</p> 35 | 36 | <ol> 37 | <li>Windows 95 pro ultra 38 | <input name="os1" type="checkbox" value="w95"/></li> 39 | 40 | <li>Windows XP beta cracked 41 | <input name="os2" type="checkbox" value="xpbeta" /></li> 42 | <li>Windows 43 | <input name="os3" type="checkbox" value="windows"/></li> 44 | <li>Other<input name="other" size="40" /></li> 45 | </ol> 46 | 47 | <p>Your email <input name="contact" size="42" /></p> 48 | 49 | <p>Submit this POST to get an explanation of how to process the 50 | POSTed data.</p> 51 | 52 | <p><input type="submit" /> <input type="reset" /></p> 53 | 54 | </form> 55 | 56 | </div> 57 | 58 | 59 | 60 | <erl> 61 | out(A) -> {ssi, "END2",[],[]}. 62 | </erl> 63 | 64 | -------------------------------------------------------------------------------- /src/yaws_log_file_h.erl: -------------------------------------------------------------------------------- 1 | %%%------------------------------------------------------------------- 2 | %%% File : yaws_log_file_h.erl 3 | %%% Author : <klacke@hyber.org> 4 | %%% Description : 5 | %%% 6 | %%% Created : 11 Mar 2004 by <klacke@hyber.org> 7 | %%%------------------------------------------------------------------- 8 | 9 | 10 | %% Just extending the error_logger_file_h abit, 11 | %% If they change the internals of that module, this module 12 | %% breaks, but then again, the otp crew doesn't ever appear to 13 | %% change anything that might break anything ..... 14 | 15 | -module(yaws_log_file_h). 16 | -behaviour(gen_event). 17 | 18 | -export([init/1, 19 | handle_event/2, handle_call/2, handle_info/2, 20 | terminate/2, code_change/3]). 21 | 22 | 23 | 24 | %% This one is used when we are started directly. 25 | init(File) -> 26 | init(File, []). 27 | 28 | init(File, PrevHandler) -> 29 | process_flag(trap_exit, true), 30 | case file:open(File, [write, append]) of 31 | {ok,Fd} -> 32 | {ok, {Fd, File, PrevHandler}}; 33 | Error -> 34 | Error 35 | end. 36 | 37 | handle_call(wrap, {Fd, File, Prev}) -> 38 | Old = File ++ ".old", 39 | file:delete(Old), 40 | file:close(Fd), 41 | file:rename(File, Old), 42 | {ok, Fd2} = file:open(File, [write,append]), 43 | {ok, ok, {Fd2, File, Prev}}; 44 | 45 | handle_call(X, S) -> 46 | error_logger_file_h:handle_call(X,S). 47 | 48 | 49 | handle_event(X, S) -> 50 | error_logger_file_h:handle_event(X, S). 51 | handle_info(X, S) -> 52 | error_logger_file_h:handle_info(X, S). 53 | 54 | 55 | terminate(Reason, State) -> 56 | error_logger_file_h:terminate(Reason, State). 57 | 58 | code_change(_OldVsn, State, _Extra) -> 59 | {ok, State}. 60 | -------------------------------------------------------------------------------- /applications/wiki/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS = src scripts 2 | include ./include.mk 3 | include ./vsn.mk 4 | 5 | all debug clean install: 6 | @set -e ; \ 7 | for d in $(SUBDIRS) ; do \ 8 | if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \ 9 | done 10 | 11 | 12 | release: all 13 | install -d build/wiki-$(WIKI_VSN)/ebin 14 | install -d build/wiki-$(WIKI_VSN)/src 15 | install -d build/wiki-$(WIKI_VSN)/include 16 | install -d build/wiki-$(WIKI_VSN)/logs 17 | install -d build/wiki-$(WIKI_VSN)/scripts 18 | install -d build/wiki-$(WIKI_VSN)/yaws/WikiPreferences.files 19 | install -m 0666 ebin/*.beam build/wiki-$(WIKI_VSN)/ebin 20 | install -m 0666 src/*.erl build/wiki-$(WIKI_VSN)/src 21 | install -m 0666 src/Makefile build/wiki-$(WIKI_VSN)/src 22 | install -m 0666 wiki/*.{yaws,wob} build/wiki-$(WIKI_VSN)/yaws 23 | install -m 0666 wiki/WikiPreferences.files/*.{gif,png,css} build/wiki-$(WIKI_VSN)/yaws/WikiPreferences.files 24 | install -m 0755 scripts/getPassword build/wiki-$(WIKI_VSN)/scripts 25 | install -m 0755 scripts/importFiles build/wiki-$(WIKI_VSN)/scripts 26 | install -m 0755 scripts/updateWiki build/wiki-$(WIKI_VSN)/scripts 27 | install -m 0666 scripts/*.src build/wiki-$(WIKI_VSN)/scripts 28 | install -m 0666 scripts/Makefile build/wiki-$(WIKI_VSN)/scripts 29 | install -m 0666 *.mk build/wiki-$(WIKI_VSN)/ 30 | install -m 0666 Makefile build/wiki-$(WIKI_VSN)/ 31 | install -m 0755 start.sh build/wiki-$(WIKI_VSN)/ 32 | install -m 0666 wiki.conf build/wiki-$(WIKI_VSN)/ 33 | install -m 0666 README build/wiki-$(WIKI_VSN)/ 34 | (cd build; tar zcvf wiki-$(WIKI_VSN).tar.gz wiki-$(WIKI_VSN)) 35 | 36 | touch: 37 | find . -name '*' -print | xargs touch -m 38 | find . -name '*.erl' -print | xargs touch -m 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /applications/yapp/src/yapp_registry.erl: -------------------------------------------------------------------------------- 1 | %%%------------------------------------------------------------------- 2 | %%% File : yapp_registry.erl 3 | %%% @author Mikael Karlsson <mikael@creado.com> 4 | %%% @since 1 June 2006 by Mikael Karlsson <mikael@creado.com> 5 | %%% @doc Yapp registry api. 6 | %%% <p>The default yapp registry (yapp_mnesia_server) uses mnesia, so a 7 | %%% prerequisite is that a schema is created. </p> 8 | 9 | -module(yapp_registry). 10 | 11 | 12 | %% API 13 | -export([list/1, register/3, unregister/3]). 14 | 15 | %% @spec list(YappRegistry::pid()) -> RegistryContent | exit() 16 | %% RegsitryContent = [YawsSrvContent] 17 | %% YawsSrvContent = {YawsServerId, Yapps} 18 | %% Yapps = [{URL, AppName}] | undefined 19 | %% URL= string() 20 | %% AppName = atom() 21 | %% @doc Lists all registered Yapps. 22 | list(YappRegistry) -> 23 | gen_server:call(YappRegistry,{?MODULE, list}). 24 | 25 | %% @spec register(YappRegistry::pid(), SrvId::string(), {YappUrl::string(), AppName::atom()}) -> ok | exit() 26 | %% @doc Register a Yapp. Registers in the virtual server with the opaque property 27 | %% yapp_server_id = SrvID. The YappUrl is the root path to the Yapp and the AppName is 28 | %% the Name of the application. 29 | register(YappRegistry, SrvId, {_YappUrl, _AppName} = A) -> 30 | gen_server:call(YappRegistry,{?MODULE, register, {SrvId, A}}). 31 | 32 | 33 | %% @spec unregister(YappRegistry::pid(), SrvId::string(), YappUrl::string()) -> ok | exit() 34 | %% @doc Unregister a Yapp from Yaws. Unregisters in the virtual server with yapp_server_id = SrvID. 35 | %% The YappUrlOrName is either the root path to the Yapp or the name of it. 36 | unregister(YappRegistry, SrvId, YappUrl) -> 37 | gen_server:call(YappRegistry,{?MODULE, unregister, {SrvId, YappUrl}}). 38 | -------------------------------------------------------------------------------- /applications/wiki/wiki/WikiPreferences.files/template.html: -------------------------------------------------------------------------------- 1 | <html> 2 | <head> 3 | <title> @@NODE@@ </title> 4 | <style type="text/css"> 5 | <!-- 6 | @import url("WikiPreferences.files/custom.css"); 7 | --> 8 | </style> 9 | </head> 10 | <body> 11 | <table width='100%' border=0> 12 | <tr> 13 | <td> 14 | <table width='100%' border=0> 15 | <tr> 16 | <!-- the menu --> 17 | <td id="@@MENUID@@" valign='top' width='90%'> 18 | <table width="100%"><tr><td id="menu"> 19 | <a href="@@HOME@@"><img border=0 src='WikiPreferences.files/home.gif' alt='Home' title='Go to initial page'></a>&nbsp;&nbsp; 20 | <a href="@@HISTORY@@"><img border=0 src='WikiPreferences.files/history.gif' alt='History' title='History of page evolution'></a>&nbsp;&nbsp; 21 | <a href="@@ALL@@"><img border=0 src='WikiPreferences.files/allpages.gif' alt='All Pages' title='Lists all pages on this site'></a>&nbsp;&nbsp; 22 | <a href="@@LAST@@"><img border=0 src='WikiPreferences.files/lastedited.gif' alt='Last Edited' title='Site editing history'></a>&nbsp;&nbsp; 23 | <a href="@@ZOMBIES@@"><img border=0 src='WikiPreferences.files/zombies.gif' alt='Zombies' title='Unreachable pages'></a>&nbsp;&nbsp; 24 | <a href="@@EDITPAGE@@"><img border=0 src='WikiPreferences.files/editme.gif' alt='Edit Me' title='Edit this page'></a>&nbsp;&nbsp; 25 | <a href="@@EDITFILES@@"><img border=0 src='WikiPreferences.files/editfiles.gif' alt='Edit Files' title='Edit attached files'></a>&nbsp;&nbsp; 26 | </td></tr></table> 27 | </td> 28 | </tr> 29 | <tr> 30 | <td> 31 | <p>&nbsp;<br> 32 | 33 | <!-- the generated page --> 34 | <h1><a href='@@ALLREFS@@'>@@NODE@@</a></h1> 35 | @@DATA@@ 36 | <hr><p>Last Modified: @@MODIFIED@@ 37 | </td> 38 | </tr> 39 | </table> 40 | </td> 41 | 42 | <!-- the right hand image --> 43 | <td width=10 align='right' valign='top'></td> 44 | </tr> 45 | </table> 46 | </body> 47 | </html> 48 | -------------------------------------------------------------------------------- /applications/wiki/scripts/updateWiki.src: -------------------------------------------------------------------------------- 1 | #!/bin/bash -- 2 | # -*- Shell-script -*- 3 | # File: updateWiki.sh 4 | # Author: Johan Bevemyr 5 | # Created: Fri May 16 22:06:00 2003 6 | # Purpose: Update existing Wiki installations 7 | 8 | progname=`basename $0` 9 | 10 | function usage () { 11 | cat <<EOF 12 | usage: $progname [directories] 13 | EOF 14 | exit 1 15 | } 16 | 17 | wikisrc=%%wikisrcdir%% 18 | suffix="."`date -I` 19 | 20 | updategifs= 21 | while [ x$updategifs = x ]; do 22 | echo 23 | echo -n "Do you want to replace the gifs in WikiPreferences.files?"\ 24 | "(yes or no) [no] " 25 | read reply leftover 26 | case $reply in 27 | y* | Y*) 28 | updategifs=1 29 | ;; 30 | n* | N*) 31 | updategifs=0 32 | ;; 33 | esac 34 | if [ x$reply = x ] ; then 35 | updategifs=0 36 | fi 37 | done 38 | 39 | function updateDir () { 40 | if test -d $udir ; then 41 | echo "updating $udir" 42 | install -b -S $suffix $wikisrc/*.yaws $udir 43 | install -b -S $suffix $wikisrc/*.wob $udir 44 | if test '!' -d $udir/WikiPreferences.files ; then 45 | mkdir $udir/WikiPreferences.files 46 | fi 47 | install -b -S $suffix $wikisrc/WikiPreferences.files/*.css \ 48 | $udir/WikiPreferences.files 49 | install -b -S $suffix $wikisrc/WikiPreferences.files/*.html \ 50 | $udir/WikiPreferences.files 51 | if [ $updategifs = 1 ]; then 52 | install -b -S $suffix $wikisrc/WikiPreferences.files/*.gif \ 53 | $udir/WikiPreferences.files 54 | install -b -S $suffix $wikisrc/WikiPreferences.files/*.png \ 55 | $udir/WikiPreferences.files 56 | fi 57 | else 58 | echo "$progname: $udir is not a directory" 59 | usage 60 | fi 61 | } 62 | 63 | if test $# -lt 1 ; then 64 | usage 65 | fi 66 | 67 | while test $# -gt 0 ; do 68 | udir=$1 69 | shift 1 70 | updateDir 71 | done 72 | 73 | -------------------------------------------------------------------------------- /src/yaws_404.erl: -------------------------------------------------------------------------------- 1 | %%%---------------------------------------------------------------------- 2 | %%% File : yaws_404.erl 3 | %%% Author : Claes Wikstrom <klacke@hyber.org> 4 | %%% Purpose : 5 | %%% Created : 4 Nov 2002 by Claes Wikstrom <klacke@hyber.org> 6 | %%%---------------------------------------------------------------------- 7 | 8 | -module(yaws_404). 9 | -author('klacke@hyber.org'). 10 | 11 | 12 | -include("../include/yaws.hrl"). 13 | -include("../include/yaws_api.hrl"). 14 | 15 | -export([out404/3, 16 | out404/1, 17 | crashmsg/3]). 18 | 19 | 20 | %% The default error 404 error delivery module 21 | %% This function can be used to generate 22 | %% a special page on 404's (it doesn't even have to be a 404) 23 | 24 | 25 | 26 | 27 | out404(Arg) -> 28 | out404(Arg, get(gc), get(sc)). 29 | out404(Arg, GC, SC) -> 30 | Req = Arg#arg.req, 31 | {abs_path, Path} = Req#http_request.path, 32 | B = not_found_body(Path, GC, SC), 33 | [{status, 404}, 34 | {header, {content_type, "text/html"}}, 35 | {header, {connection, "close"}}, 36 | {html, B}]. 37 | 38 | 39 | 40 | not_found_body(Path, _GC, SC) -> 41 | L = ["<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">" 42 | "<HTML><HEAD>" 43 | "<TITLE>404 Not Found</TITLE>" 44 | "</HEAD><BODY>" 45 | "<H1>Not Found</H1>" 46 | "The requested URL ", 47 | yaws_api:htmlize(Path), 48 | " was not found on this server.<P>" 49 | "<HR>", 50 | yaws:address(), 51 | " </BODY></HTML>" 52 | ], 53 | list_to_binary(L). 54 | 55 | 56 | 57 | 58 | %% possibility to customize crash messages, 59 | 60 | % while developing 61 | %% it's extremely convenient to get the crash messages in the browser, 62 | %% however not in production :-) 63 | 64 | crashmsg(_Arg, _SC, L) -> 65 | {ehtml, 66 | [{h2, [], "Internal error, yaws code crashed"}, 67 | {br}, 68 | {hr}, 69 | {pre, [], L}, 70 | {hr}]}. 71 | -------------------------------------------------------------------------------- /www/cookies.yaws: -------------------------------------------------------------------------------- 1 | <erl> 2 | out(A) -> 3 | {ssi, "TAB.inc", "%%",[{"cookies", "choosen"}]}. 4 | </erl> 5 | 6 | <div id="entry"> 7 | 8 | 9 | 10 | <h1>Yaws and Cookies</h1> 11 | <p> 12 | Cookies are the means in HTTP to assign data to a session. A HTTP session 13 | typically consists of many (and sometimes concurrent) TCP connections from the 14 | client to the web server. The first time a client arrives to our webserver, we 15 | issue the HTTP header <tt>Set-Cookie: var=someval</tt>. The browser will then in 16 | subsequent connections to the same server pass this cookie "var=someval" in its 17 | client side <tt>Cookie: var=someval</tt> header. We can thereby assign state to a 18 | session, either through data actualy encoded into the cookie value itself, or by 19 | associating server side session data to the cookie.</p> 20 | <p> 21 | 22 | Let's do an example where we set a simple cookie, and create a specific erlang process 23 | which is then responsible for that session. 24 | The cookie value will be a string encoding of the pid handling the session. 25 | </p> 26 | <p> 27 | The yaws code in 28 | <a href="setcookie.yaws">setcookie.yaws</a> sets the cookie in the browser.</p> 29 | 30 | <p>And the yaws code in <a href="readcookie.yaws">readcookie.yaws</a> 31 | will read the cookie 32 | and report some uninteresting session data. 33 | </p> 34 | 35 | <p> 36 | A correct definition of cookies can be found at Netscapes 37 | <a href="http://www.netscape.com/newsref/std/cookie_spec.html">cookie spec</a></p> 38 | 39 | 40 | <p>The code to set the cookie looks like:</p> 41 | 42 | <erl> 43 | out(A) -> 44 | {ok, B} = file:read_file(A#arg.docroot ++ "/setcookie.yaws"), 45 | {ehtml, 46 | {'div', [{class, "box"}], 47 | {pre,[], B}}}. 48 | 49 | </erl> 50 | 51 | 52 | 53 | 54 | </div> 55 | 56 | 57 | <erl> 58 | out(A) -> {ssi, "END2",[],[]}. 59 | </erl> 60 | 61 | -------------------------------------------------------------------------------- /www/stil.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | html {margin: 0; padding: 0;} 4 | 5 | body {font: 12px Verdana, Arial, Helvetica, sans-serif; 6 | margin: 0; padding: 0; 7 | background: rgb(95%,95%,95%); color: black;} 8 | 9 | h1 {font-size: 200%; text-transform: lowercase; letter-spacing: 3px; 10 | margin: 0.66em 0 0.33em 3%; padding: 0;} 11 | 12 | h3 {font-size: 133%; margin: 0; padding: 0; 13 | border-bottom: 1px solid black;} 14 | 15 | h4 {font-size: 100%; margin: 0; padding: 0.33em 0 0; 16 | border-bottom: 1px solid rgb(50%,50%,35%); 17 | color: rgb(50%,50%,35%);} 18 | 19 | 20 | h5 {font-size: 100%; margin: 0; padding: 0.33em 0 0; 21 | color: rgb(50%,50%,35%);} 22 | 23 | p {line-height: 1.66; margin: 0.5em 0 1em 3em;} 24 | 25 | 26 | div.logo {margin: 3em;} 27 | 28 | 29 | div#entry {margin: 0 33% 1em 7%; padding: 0;} 30 | 31 | div#sidebar {position: absolute; top: 4em; right: 0; width: 20%; font-size: 11px;} 32 | 33 | div#sidebar a {display: block; padding: 8px 0 2px 10px; margin: 0; 34 | border-left: 1px solid rgb(50%,50%,35%);} 35 | 36 | div#sidebar a:hover {background: rgb(221,221,221);} 37 | 38 | div.links { 39 | background: green; 40 | } 41 | 42 | div.box { border: solid; border-width: thin; width: 96%; 43 | background: rgb(211, 211, 211) } 44 | 45 | div.news { border: solid; border-width: thin; width: 96%; 46 | border-bottom: 3px solid black; 47 | margin: 18px 5px 2px 10px; 48 | background: rgb(211, 211, 211) } 49 | 50 | div.box pre {margin: 0.66em 0 0.33em 1%; padding: 0;} 51 | 52 | div.man { border: solid; border-width: thin; width: 100%; 53 | font-size: 90%; 54 | margin : 4; 55 | background: rgb(211,211,211) } 56 | 57 | 58 | div.choosen {border: solid; border-width: thin; 59 | background: rgb(231, 231, 231) } 60 | 61 | div.none { } 62 | 63 | 64 | 65 | I { font-size : 12px; 66 | font-family: Times, Verdana, Arial, Helvetica, sans-serif;} 67 | 68 | 69 | -------------------------------------------------------------------------------- /include.mk.in: -------------------------------------------------------------------------------- 1 | ###-*-makefile-*- ; force emacs to enter makefile-mode 2 | 3 | 4 | PREFIX = @prefix@ 5 | prefix = ${PREFIX} 6 | ETCDIR = @sysconfdir@ 7 | VARDIR = @localstatedir@ 8 | 9 | ifeq ($(DESTDIR),) 10 | DESTDIR=/ 11 | endif 12 | 13 | ## DESTDIR is handled separately in the individual Makefiles 14 | 15 | ERL=@ERL@ 16 | WERL=@WERL@ 17 | ERLC=@ERLC@ 18 | EMULATOR=beam 19 | DEFAULT_CHARSET=@DEFAULT_CHARSET@ 20 | EPAM = @EPAM@ 21 | EXTRAINCLUDE = @EXTRAINCLUDE@ 22 | ERLBINDIR = @ERLBINDIR@ 23 | 24 | 25 | ifdef debug 26 | ERLC_FLAGS+=-Ddebug 27 | endif 28 | 29 | ifdef trace 30 | ERLC_FLAGS=+trace 31 | endif 32 | 33 | ifdef export_all 34 | ERLC_FLAGS+=-Dexport_all 35 | endif 36 | 37 | ifdef debug_info 38 | ERLC_FLAGS+=+debug_info 39 | endif 40 | 41 | CC=@CC@ 42 | CFLAGS=@CFLAGS@ 43 | LINKER=@LINKER@ 44 | LDFLAGS=@LDFLAGS@ 45 | WIN32=@WIN32@ 46 | BSDI=@BSDI@ 47 | EXE=@EXE@ 48 | DLL=@DLL@ 49 | OBJ=@OBJ@ 50 | OUT=@OUT@ 51 | FPIC=@FPIC@ 52 | LIBS=@LIBS@ 53 | 54 | 55 | 56 | ERLDIR=@ERLDIR@ 57 | 58 | LD_SHARED=@LD_SHARED@ 59 | 60 | INSTALL=@INSTALL@ 61 | INSTALL_DATA=@INSTALL_DATA@ 62 | 63 | 64 | 65 | EMULATOR=beam 66 | ifdef debug 67 | ERLC_FLAGS+=-Ddebug 68 | endif 69 | 70 | ifdef trace 71 | ERLC_FLAGS=+trace 72 | endif 73 | 74 | ifdef export_all 75 | ERLC_FLAGS+=-Dexport_all 76 | endif 77 | 78 | 79 | # Hmm, don't know if you are supposed to like this better... ;-) 80 | APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }' 81 | 82 | # Targets 83 | 84 | ../ebin/%.app: %.app.src ../vsn.mk Makefile 85 | perl -e $(APPSCRIPT) "$(VSN)" $(MODULES) < $< > $@ 86 | 87 | ../ebin/%.appup: %.appup 88 | cp $< $@ 89 | 90 | ../ebin/%.$(EMULATOR): %.erl 91 | "$(ERLC)" $(ERLC_FLAGS) -o ../ebin $< 92 | 93 | %.$(EMULATOR): %.erl 94 | "$(ERLC)" $(ERLC_FLAGS) $< 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /www/setpcookie.yaws: -------------------------------------------------------------------------------- 1 | 2 | <erl> 3 | -export([pserv/0]). 4 | 5 | ensure_pcookie_server() -> 6 | case whereis(pcookie_server) of 7 | undefined -> 8 | proc_lib:start(?MODULE, pserv,[]); 9 | _ -> 10 | ok 11 | end. 12 | 13 | pserv() -> 14 | catch begin 15 | register(pcookie_server, self()), 16 | T = ets:new(pcookies, [set, public, 17 | named_table]), 18 | ets:insert(T, {counter, 0}) 19 | end, 20 | proc_lib:init_ack(ok), 21 | pserv_loop(). 22 | 23 | pserv_loop() -> 24 | receive 25 | X -> 26 | pserv_loop() 27 | end. 28 | 29 | setcookie(A) -> 30 | Num = ets:update_counter(pcookies, counter, 1), 31 | Data = {(A#arg.headers)#headers.user_agent, 32 | calendar:local_time(), 33 | inet:peername(A#arg.clisock)}, 34 | ets:insert(pcookies, {{cookie, Num}, Data}), 35 | yaws_api:setcookie("pfoobar",integer_to_list(Num), "/"). 36 | 37 | 38 | 39 | out(A) -> 40 | ensure_pcookie_server(), 41 | H = A#arg.headers, 42 | C = H#headers.cookie, 43 | case C of 44 | [Cookie|_] -> 45 | case string:tokens(Cookie, [$=]) of 46 | ["pfoobar", NumStr] -> 47 | Num = list_to_integer(NumStr), 48 | %% cookie allready set 49 | case ets:lookup(pcookies, {c, Num}) of 50 | [{cookie, Data}] -> 51 | ok; %% cookie already set 52 | [] -> 53 | setcookie(A) 54 | end; 55 | _ -> 56 | setcookie(A) 57 | end; 58 | _ -> 59 | setcookie(A) 60 | end. 61 | </erl> 62 | 63 | 64 | <erl> 65 | 66 | 67 | out(A) -> {ssi, "TAB.inc", [],[]}. 68 | </erl> 69 | 70 | <div id="entry"> 71 | 72 | 73 | 74 | 75 | 76 | <h2> Set persistent cookie </h2> 77 | 78 | <p>This is the page that set a persistent cookie in 79 | the browser. 80 | <a href="readpcookie.yaws">readpcookie.yaws</a> will 81 | read the cookie and report persistent information. 82 | 83 | 84 | 85 | </div> 86 | 87 | 88 | <erl> 89 | out(A) -> {ssi, "END2",[],[]}. 90 | </erl> 91 | 92 | -------------------------------------------------------------------------------- /applications/yapp/src/yapp_app.erl: -------------------------------------------------------------------------------- 1 | %%%------------------------------------------------------------------- 2 | %%% File : yapp_app.erl 3 | %%% Author : Mikael Karlsson <mikael@creado.com> 4 | %%% Description : 5 | %%% 6 | %%% Created : 1 Jun 2006 by Mikael Karlsson <mikael@creado.com> 7 | %%%------------------------------------------------------------------- 8 | -module(yapp_app). 9 | 10 | -behaviour(application). 11 | 12 | %% Application callbacks 13 | -export([start/2, stop/1]). 14 | 15 | %%==================================================================== 16 | %% Application callbacks 17 | %%==================================================================== 18 | %%-------------------------------------------------------------------- 19 | %% Function: start(Type, StartArgs) -> {ok, Pid} | 20 | %% {ok, Pid, State} | 21 | %% {error, Reason} 22 | %% Description: This function is called whenever an application 23 | %% is started using application:start/1,2, and should start the processes 24 | %% of the application. If the application is structured according to the 25 | %% OTP design principles as a supervision tree, this means starting the 26 | %% top supervisor of the tree. 27 | %%-------------------------------------------------------------------- 28 | start(_Type, StartArgs) -> 29 | case yapp_sup:start_link(StartArgs) of 30 | {ok, Pid} -> 31 | {ok, Pid}; 32 | Error -> 33 | Error 34 | end. 35 | 36 | %%-------------------------------------------------------------------- 37 | %% Function: stop(State) -> void() 38 | %% Description: This function is called whenever an application 39 | %% has stopped. It is intended to be the opposite of Module:start/2 and 40 | %% should do any necessary cleaning up. The return value is ignored. 41 | %%-------------------------------------------------------------------- 42 | stop(_State) -> 43 | ok. 44 | 45 | %%==================================================================== 46 | %% Internal functions 47 | %%==================================================================== 48 | -------------------------------------------------------------------------------- /scripts/Makefile: -------------------------------------------------------------------------------- 1 | include ../include.mk 2 | 3 | 4 | all debug: ../bin/yaws yaws.conf 5 | 6 | ../bin/yaws: yaws.template 7 | cat yaws.template | \ 8 | ./Subst %yawsdir% `pwd`/.. | \ 9 | ./Subst %vardir% $(VARDIR) | \ 10 | ./Subst %run_erl% "$(ERLBINDIR)/run_erl" | \ 11 | ./Subst %to_erl% "$(ERLBINDIR)/to_erl" | \ 12 | ./Subst %erl% "$(ERL)" | \ 13 | ./Subst %werl% "$(WERL)" > ../bin/yaws 14 | chmod +x ../bin/yaws 15 | 16 | 17 | local_install: ../bin/yaws 18 | @install -d $$HOME/yaws_logs 19 | @if [ -f $$HOME/yaws.conf ]; \ 20 | then target=$$HOME/yaws.conf.template; \ 21 | else \ 22 | target=$$HOME/yaws.conf; \ 23 | fi; \ 24 | echo "--- Installing local config file at $${target} "; \ 25 | cat yaws.conf.template | \ 26 | ./Subst %yawsdir% `pwd`/.. | \ 27 | ./Subst %logdir% $$HOME/yaws_logs | \ 28 | ./Subst %host% `hostname` | \ 29 | ./Subst %port% 8000 | \ 30 | ./Subst %docroot% `pwd`/../www | \ 31 | ./Subst %certdir% `pwd`/../ssl | \ 32 | ./Subst %sslport% 4443 > $${target}; \ 33 | install -d $$HOME/bin; \ 34 | cp ../bin/yaws $$HOME/bin/yaws; \ 35 | echo "--- Installed $$HOME/bin/yaws" 36 | 37 | yaws.conf: 38 | @echo PREFIX is $(PREFIX) 39 | cat yaws.conf.template | \ 40 | ./Subst %yawsdir% $(PREFIX)/lib/yaws | \ 41 | ./Subst %logdir% $(VARDIR)/log/yaws | \ 42 | ./Subst %host% `hostname` | \ 43 | ./Subst %port% 80 | \ 44 | ./Subst %docroot% $(VARDIR)/yaws/www | \ 45 | ./Subst %certdir% $(ETCDIR) | \ 46 | ./Subst %sslport% 443 > yaws.conf 47 | 48 | clean: 49 | rm -f ../bin/yaws 50 | 51 | install: .install 52 | 53 | .install: 54 | -rm -rf /tmp/yaws 2> /dev/null 55 | sh ./Install $(PREFIX) $(DESTDIR) "$(ERL)" \ 56 | "$(WERL)" $(ETCDIR)/ $(VARDIR)/ $(ERLBINDIR)/ 57 | @cp ../ssl/yaws-cert.pem $(DESTDIR)/$(ETCDIR) 58 | @cp ../ssl/yaws-key.pem $(DESTDIR)/$(ETCDIR) 59 | @if [ -f $(DESTDIR)/$(ETCDIR)/yaws.conf ]; \ 60 | then echo "Keeping old config file "; \ 61 | cp yaws.conf $(DESTDIR)/$(ETCDIR)/yaws.conf.template; \ 62 | else \ 63 | echo "Installing $(DESTDIR)/$(ETCDIR)/yaws.conf"; \ 64 | mkdir -p $(DESTDIR)/$(ETCDIR); \ 65 | cp yaws.conf $(DESTDIR)/$(ETCDIR)/yaws.conf; \ 66 | fi 67 | -------------------------------------------------------------------------------- /www/post.yaws: -------------------------------------------------------------------------------- 1 | <erl> 2 | 3 | 4 | box(Str) -> 5 | {'div',[{class,"box"}], 6 | {pre,[], yaws_api:htmlize(Str)}}. 7 | 8 | fpostvar(A, Key) -> 9 | case postvar(A,"lang") of 10 | undefined -> "None"; 11 | {ok, Val} -> 12 | Val 13 | end. 14 | 15 | 16 | out(A) -> 17 | [{ssi, "TAB.inc", [],[]}, 18 | {ehtml, 19 | {'div',[{id, "entry"}], [{h2, [],"post.yaws"}, 20 | {p,[],[ "This is the ", {tt, [], "post.yaws"}, " file ", 21 | "This yaws file gets invoked with POSTed client data. " 22 | "This is the data that is submitted from the forms page ", 23 | {a, [{href, "form.yaws"}], " form.yaws "}]}, 24 | 25 | {p, [], ["POST data is naturally organized as a ", 26 | {tt, [], "{Key, Value} "}, " list. A call to " 27 | "the function ", {tt, [], "yaws_api:parse_post(A) "}, 28 | " will parse the POSTed data. and return a key/value list "]}, 29 | box(" 30 | out(A) -> 31 | {ehtml, 32 | {pre, [], 33 | io_lib:format('~p', [yaws_api:parse_post(A)])}}. 34 | "), 35 | 36 | {p, [], "Produces the following output"}, 37 | 38 | box(io_lib:format('~p', [yaws_api:parse_post(A)])), 39 | {p, [], ["The natural way to extract the \"Variables\" from " 40 | " the posted data is to use the function (defined in yaws_api.erl) " 41 | " called ", {tt,[], "postvar(Arg,Key) "}]}, 42 | {p, [], "Thus the following erlang code: "}, 43 | box(" 44 | out(A) -> 45 | {ehtml, 46 | {p,[], [\"The favourite programming language is \", 47 | case postvar(A,\"lang\") of 48 | undefined -> \"None\"; 49 | {ok, Val} -> Val 50 | end]}}. 51 | "), 52 | 53 | {p,[], "Produces the following output:"}, 54 | {hr,[],[]}, 55 | {'div',[{class,"box"}], 56 | {p,[], ["The favourite programming language is ", 57 | case postvar(A,"lang") of 58 | undefined -> "None"; 59 | {ok, Val} -> Val 60 | end]}} 61 | ]}}, 62 | {ssi, "END",[],[]}]. 63 | 64 | 65 | </erl> 66 | 67 | -------------------------------------------------------------------------------- /applications/chat/chat/chat.yaws: -------------------------------------------------------------------------------- 1 | <html> 2 | <erl> 3 | out(A) -> 4 | case chat:check_session(A) of 5 | {ok, Session} -> 6 | chat:dynamic_headers(); 7 | Error -> 8 | Error++[break] 9 | end. 10 | </erl> 11 | 12 | <script> 13 | 14 | function handleEnter(event) { 15 | if (event == null) 16 | event = window.event; 17 | 18 | var keyCode = event.keyCode ? event.keyCode : event.which ? 19 | event.which : event.charCode; 20 | 21 | if (keyCode == 13) { 22 | sendmsg(); 23 | return false; 24 | } 25 | } 26 | 27 | function addSmiley(ref) { 28 | var text = document.getElementById("msg"); 29 | 30 | text.value = text.value+"<img src='"+ref+"'>"; 31 | 32 | text.focus(); 33 | 34 | return false; 35 | } 36 | 37 | function addText(ref) { 38 | var text = document.getElementById("msg"); 39 | 40 | text.value = text.value+ref; 41 | 42 | text.focus(); 43 | 44 | return false; 45 | } 46 | 47 | </script> 48 | 49 | <style> 50 | 51 | body { 52 | font: 10px/15px Verdana, Lucida, Arial, sans-serif; 53 | } 54 | 55 | h1 { 56 | font: 15px/20px Verdana, Lucida, Arial, sans-serif; 57 | font-weight: bold; 58 | } 59 | 60 | #msgs { 61 | border:1px solid #ccc; 62 | height: 25em; 63 | width: 500px; 64 | background-color: #f5f5ff; 65 | overflow: auto; 66 | float: left; 67 | padding: 2px; 68 | } 69 | 70 | #members { 71 | border:1px solid #ccc; 72 | height: 25em; 73 | width: 100px; 74 | background-color: #f5f5ff; 75 | overflow: auto; 76 | margin: 2px; 77 | padding: 2px; 78 | } 79 | 80 | #msg { 81 | width: 614px; 82 | clear: both; 83 | } 84 | 85 | </style> 86 | 87 | <script src="chat.js"></script> 88 | 89 | <body onload="setTimeout('reader_init0()', 0);" onunload="stop_all()"> 90 | 91 | 92 | <H1> Welcome to the chat room </h1> 93 | 94 | <div id="msgs"></div> 95 | <div id="members"></div> 96 | 97 | <textarea id="msg" rows="3" value="" 98 | onKeyPress="return handleEnter(event)"> 99 | </textarea> 100 | <br> 101 | 102 | <script> 103 | document.write(smilies_toolbar()); 104 | </script> 105 | 106 | </html> 107 | -------------------------------------------------------------------------------- /www/query.yaws: -------------------------------------------------------------------------------- 1 | <erl> 2 | 3 | out(A) -> 4 | {ssi, "TAB.inc", "%%",[{"query", "choosen"}]}. 5 | 6 | 7 | </erl> 8 | 9 | <div id="entry"> 10 | 11 | <h2>The query part of the url</h2> 12 | 13 | <p> 14 | A url can have an optional query part. This part is passed in 15 | the A#arg.querydata which is passed as an argument to the 16 | out/1 function. 17 | </p> 18 | 19 | <p>We show how to work with the query part of the url through 20 | an example, if we have a URL on the form of 21 | <a href="man.yaws?page=cat">http://yaws.hyber.org/man.yaws?page=cat</a> 22 | a key/value pair is passed to the page. 23 | In the above example, we have key=page and its value "cat". 24 | The code in the page man.yaws, will read these key/value pairs 25 | in the A#arg.querydata and display the man page.</p> 26 | 27 | <p> 28 | Assuming a predifined CSS class called box, defined as:</p> 29 | 30 | <div class="box"> 31 | <pre> 32 | div.box { border: solid; border-width: thin; width: 90%; 33 | background: rgb(211, 211, 211) } 34 | </pre> 35 | </div> 36 | 37 | <p> 38 | The following code:</p> 39 | 40 | <erl> 41 | 42 | out(A) -> 43 | {ehtml,ssi("man.yaws")}. 44 | 45 | ssi(File) -> 46 | {'div',[{class,"box"}], 47 | {pre,[], {ssi, File, [],[]}}}. 48 | 49 | 50 | </erl> 51 | 52 | 53 | <p> will display a man page if invoked with a proper key/value 54 | pair in the query part of the URL.</p> 55 | 56 | <p> This fairly convenient way of getting at the query (or POST) 57 | is equivalent of the code:</p> 58 | 59 | <div class="box"> 60 | <pre> 61 | P = yaws_api:parse_query_data(A), 62 | L = case lists:keysearch(page, 1, P) of 63 | {value, {page, Page}} -> 64 | ..... 65 | </pre> 66 | </div> 67 | 68 | <p>The querypart of the URL is part as field in the Arg structure. 69 | The function <tt>parse_query/1</tt> parses the raw data into 70 | a key/value list. </p> 71 | 72 | 73 | <p>The <tt>queryvar(ARG,Key)</tt> function returns the value of the 74 | variable if it is found in the query part of the request. If the variable is not found 75 | or if the variable is unset, the <tt>queryvar(ARG,Key)</tt> function returns <tt>undefined</tt>. 76 | </p> 77 | 78 | 79 | </div> 80 | 81 | 82 | <erl> 83 | out(A) -> {ssi, "END2",[],[]}. 84 | </erl> 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/yaws_debug.hrl: -------------------------------------------------------------------------------- 1 | %%%---------------------------------------------------------------------- 2 | %%% File : yaws_debug.hrl 3 | %%% Author : Claes Wikstrom <klacke@hyber.org> 4 | %%% Purpose : 5 | %%% Created : 7 Feb 2002 by Claes Wikstrom <klacke@hyber.org> 6 | %%%---------------------------------------------------------------------- 7 | 8 | -author('klacke@hyber.org'). 9 | 10 | 11 | 12 | -define(F(Format,Args), 13 | lists:flatten(io_lib:format(Format,Args))). 14 | 15 | -define(f(L), lists:flatten(L)). 16 | 17 | -define(W(A), ?F("~w", [A])). 18 | 19 | -define(format_record(Rec, Name), 20 | yaws_debug:format_record(Rec, Name, record_info(fields, Name))). 21 | 22 | 23 | 24 | -define(Trace(What, Fmt, Args), if Trace == false -> 25 | ok; 26 | _ -> 27 | yaws_debug:dtrace(What,Fmt,Args) 28 | end). 29 | 30 | 31 | 32 | -ifdef(debug). 33 | 34 | 35 | %% Possible Ops are, equal | neq | integer | list | {list, length, equal} 36 | %% | greater | min | max | interval | {in, X , List} 37 | 38 | 39 | 40 | 41 | -define(Dassert(X,Op,Y,Msg), 42 | yaws_debug:assert(Op,X,Y,{assert,?FILE,?LINE,Msg})). 43 | 44 | 45 | -define(Dalert(X,Op,Y,Msg), 46 | yaws_debug:assert(Op,X,Y,{alert,?FILE,?LINE,Msg})). 47 | 48 | -define(Deval(Expr),Expr). 49 | 50 | -define(Debug(F, A), 51 | yaws_debug:assert([],0,0,{{debug,"DEBUG"}, ?FILE,?LINE,F, A})). 52 | 53 | 54 | %% ease of use, just do ?Dvar(Variable) 55 | -define(Dvar(Var), ?Debug("Var = ~p~n", [Var])). 56 | 57 | -define(TC(L), yaws_debug:typecheck(L, ?FILE, ?LINE)). 58 | 59 | 60 | -define(Derror(Fmt,Args), 61 | yaws_debug:assert([],0,0,{{debug,"ERROR"}, ?FILE,?LINE,Fmt,Args})). 62 | 63 | 64 | -define(Dformat(Fmt,Args), 65 | yaws_debug:assert([],0,0,{format, ?FILE,?LINE,Fmt,Args})). 66 | 67 | 68 | -define(Dfunassert(Fun, Msg), 69 | yaws_debug:assert('fun', Fun, 0, {assert,?FILE,?LINE,Msg})). 70 | 71 | -else. %% not debug_mode 72 | 73 | -define(DLOG(F, A), ?LOG(F, A)). 74 | -define(Dassert(X,Op,Y,Msg),debug_disabled). 75 | -define(Dalert(X,Op,Y,Msg),debug_disabled). 76 | -define(Deval(Expr),debug_disabled). 77 | -define(Debug(F, A),debug_disabled). 78 | -define(Dvar(Var), debug_disabled). 79 | -define(Dformat(Fmt,Args),debug_disabled). 80 | -define(Dfunassert(Fun, Msg), debug_disabled). 81 | -define(Derror(Fmt,Args),debug_disabled). 82 | -define(TC(L), debug_disabled). 83 | 84 | -endif. %% debug defined 85 | 86 | -------------------------------------------------------------------------------- /applications/wiki/src/utils.erl: -------------------------------------------------------------------------------- 1 | -module(utils). 2 | 3 | %%% File : utils.erl 4 | %%% Author : Mickael Remond <mickael.remond@erlang-fr.org> 5 | %%% Description : Various general purpose helper functions 6 | %%% Created : 22 Oct 2003 by Mickael Remond 7 | %%% <mickael.remond@erlang-fr.org> 8 | 9 | -export([time_to_string/1]). 10 | -export([fold_files/3, fold_files/5]). 11 | 12 | %% Time (as return by calendar:local_time() to string conversion. 13 | time_to_string( {{Y,Mo,D},{H,Mi,S}} ) -> 14 | String = io_lib:format( "~4.4w-~2.2.0w-~2.2.0w ~2.2.0w:~2.2.0w:~2.2.0w", 15 | [Y,Mo,D,H,Mi,S] ), 16 | lists:flatten(String). 17 | 18 | 19 | %% Fold_files is a rewrite by Chris Pressey of the broken 20 | %% implementation in Erlang R9C 21 | 22 | %% @spec fold_files(dir(), fun(), term()) -> term() 23 | %% @doc Folds the function Fun(F, IsDir, Acc) -> {Recurse, Acc1} over 24 | %% all files F in Dir that match the regular expression RegExp. 25 | %% If Recurse is true all sub-directories of F are processed. 26 | %% (This function is a modified version of that from filelib.erl) 27 | 28 | fold_files(Dir, Fun, Acc) -> 29 | case file:list_dir(Dir) of 30 | {ok, Files} -> 31 | fold_files0(Files, Dir, Fun, Acc); 32 | {error, _} -> 33 | Acc 34 | end. 35 | 36 | fold_files0([File | Tail], Dir, Fun, Acc) -> 37 | FullName = filename:join([Dir, File]), 38 | IsDir = filelib:is_dir(FullName), 39 | {Recurse, NewAcc} = Fun(FullName, IsDir, Acc), 40 | fold_files0(FullName, Tail, Dir, Fun, IsDir, Recurse, NewAcc); 41 | fold_files0([], Dir, Fun, Acc) -> 42 | Acc. 43 | 44 | fold_files0(FullName, Tail, Dir, Fun, true, true, Acc) -> 45 | NewAcc = fold_files(FullName, Fun, Acc), 46 | fold_files0(Tail, Dir, Fun, NewAcc); 47 | fold_files0(FullName, Tail, Dir, Fun, _, _, Acc) -> 48 | fold_files0(Tail, Dir, Fun, Acc). 49 | 50 | %% @spec fold_files(dir(), regexp(), bool(), fun(), term()) -> term() 51 | %% Wrapper for the original fold_files/5 behaviour. 52 | 53 | fold_files(Dir, RegExp, Recursive, Fun, InitialAcc) -> 54 | {ok, CompiledRegExp} = regexp:parse(RegExp), 55 | Wrapper = fun 56 | (FullName, false, Acc) -> 57 | NewAcc = case regexp:match(FullName, CompiledRegExp) of 58 | {match, _, _} -> 59 | Fun(FullName, Acc); 60 | _ -> 61 | Acc 62 | end, 63 | {Recursive, NewAcc}; 64 | (_, true, Acc) -> 65 | {Recursive, Acc} 66 | end, 67 | fold_files(Dir, Wrapper, InitialAcc). 68 | -------------------------------------------------------------------------------- /include/yaws_api.hrl: -------------------------------------------------------------------------------- 1 | %%%---------------------------------------------------------------------- 2 | %%% File : yaws_api.hrl 3 | %%% Author : Claes Wikstrom <klacke@hyber.org> 4 | %%% Purpose : 5 | %%% Created : 24 Jan 2002 by Claes Wikstrom <klacke@hyber.org> 6 | %%%---------------------------------------------------------------------- 7 | 8 | -author('klacke@hyber.org'). 9 | 10 | 11 | -record(arg, { 12 | clisock, %% the socket leading to the peer client 13 | client_ip_port, %% {ClientIp, ClientPort} tuple 14 | headers, %% headers 15 | req, %% request 16 | clidata, %% The client data (as a binary in POST requests) 17 | server_path, %% The normalized server path 18 | querydata, %% Was the URL on the form of ...?query (GET reqs) 19 | appmoddata, %% the remainder of the path leading up to the query 20 | docroot, %% where's the data 21 | fullpath, %% full deep path to yaws file 22 | cont, %% Continuation for chunked multipart uploads 23 | state, %% State for use by users of the out/1 callback 24 | pid, %% pid of the yaws worker process 25 | opaque, %% useful to pass static data 26 | appmod_prepath, %% path in front of: <appmod><appmoddata> 27 | pathinfo %% Set to 'd/e' when calling c.yaws for the request 28 | %% http://some.host/a/b/c.yaws/d/e 29 | }). 30 | 31 | 32 | -record(http_request, {method, 33 | path, 34 | version}). 35 | 36 | -record(http_response, {version, 37 | status, 38 | phrase}). 39 | 40 | -record(headers, { 41 | connection, 42 | accept, 43 | host, 44 | if_modified_since, 45 | if_match, 46 | if_none_match, 47 | if_range, 48 | if_unmodified_since, 49 | range, 50 | referer, 51 | user_agent, 52 | accept_ranges, 53 | cookie = [], 54 | keep_alive, 55 | location, 56 | content_length, 57 | content_type, 58 | content_encoding, 59 | authorization, 60 | transfer_encoding, 61 | other = [] %% misc other headers 62 | }). 63 | 64 | 65 | 66 | 67 | -record(url, 68 | {scheme, 69 | host, 70 | port, %% undefined means not set 71 | path = [], 72 | querypart = []}). 73 | 74 | 75 | -record(setcookie,{ 76 | key, 77 | value, 78 | quoted, 79 | comment, 80 | comment_url, 81 | discard, 82 | domain, 83 | max_age, 84 | expires, 85 | path, 86 | port, 87 | secure, 88 | version}). 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /www/stream.yaws: -------------------------------------------------------------------------------- 1 | 2 | <erl> 3 | 4 | 5 | box(Str) -> 6 | {'div',[{class,"box"}], 7 | {pre,[],yaws_api:htmlize(Str)}}. 8 | 9 | tbox(T) -> 10 | box(lists:flatten(io_lib:format("~p",[T]))). 11 | 12 | 13 | ssi(File) -> 14 | {'div',[{class,"box"}], 15 | {pre,[], 16 | {ssi, File,[],[]}}}. 17 | 18 | 19 | out(A) -> 20 | [{ssi, "TAB.inc", "%%",[{"stream", "choosen"}]}, 21 | {ehtml, 22 | {'div',[{id, "entry"}], 23 | [{h1, [], "Streaming data to the client"}, 24 | 25 | {p, [], 26 | "Sometimes we want to stream data to the client. Maybe we don't know or cannot compute the size of the data. Regardless of what, we do not want to keep all data in memory until it's shipped to the client. We want to use chunked encodings, and simply send data in chunks to the client. This is performed in steps. First the out/1 return value:"}, 27 | 28 | box(" {streamcontent, MimeType, FirstChunk}"), 29 | 30 | {p,[], ["Is returned from the out/1 function" 31 | " This make the erlang process processing that particular page go into a receive loop, waiting for more data. Somehow, another process in the erlang system, must then deliver data to the waiting/receiving erlang processs. There are two asyncronous API functions that can be used to deliver that data."]}, 32 | 33 | box("yaws_api:stream_chunk_deliver(YawsPid, Data)"), 34 | {p, [], "and"}, 35 | box("yaws_api:stream_chunk_end(YawsPid)"), 36 | 37 | {p, [], "The YawsPid argument is the process identifier of the original yaws process processing the page, i.e. self(), in the .yaws file."}, 38 | 39 | {p, [],"Maybe this gets clear with a programing example, let's use a process reading a random number of bytes from /dev/urandom as the source of the data"}, 40 | 41 | ssi("urandom.yaws"), 42 | 43 | {p, [], 44 | ["The above slightly bizzare code can be executed ", 45 | {a, [{href, "urandom.yaws"}], "Here"}, 46 | " The code creates a process which reads a random amount of bytes from /dev/urandom and sends them to the client, piece by piece. "]}, 47 | 48 | {p,[], "There is also a version of the API code which delivers the data in a blocking fashion. Whenever the producer of the stream is faster than the consumer, that is the WWW client, we must use a syncronous version of the code. The api function is called:"}, 49 | 50 | box("yaws_api:stream_chunk_deliver_blocking(YawsPid, Data)") 51 | 52 | 53 | ]}}, 54 | {ssi, "END2",[],[]} 55 | ]. 56 | 57 | 58 | </erl> 59 | 60 | 61 | </html> 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /applications/yapp/src/yapp_sup.erl: -------------------------------------------------------------------------------- 1 | %%%------------------------------------------------------------------- 2 | %%% File : yapp_sup.erl 3 | %%% Author : Mikael Karlsson <mikael@creado.com> 4 | %%% Description : 5 | %%% 6 | %%% Created : 1 Jun 2006 by Mikael Karlsson <mikael@creado.com> 7 | %%%------------------------------------------------------------------- 8 | -module(yapp_sup). 9 | 10 | -behaviour(supervisor). 11 | 12 | %% API 13 | -export([start_link/1]). 14 | 15 | %% Supervisor callbacks 16 | -export([init/1]). 17 | 18 | -define(SERVER, ?MODULE). 19 | 20 | %%==================================================================== 21 | %% API functions 22 | %%==================================================================== 23 | %%-------------------------------------------------------------------- 24 | %% Function: start_link() -> {ok,Pid} | ignore | {error,Error} 25 | %% Description: Starts the supervisor 26 | %%-------------------------------------------------------------------- 27 | start_link(_) -> 28 | supervisor:start_link({local, ?SERVER}, ?MODULE, []). 29 | 30 | %%==================================================================== 31 | %% Supervisor callbacks 32 | %%==================================================================== 33 | %%-------------------------------------------------------------------- 34 | %% Func: init(Args) -> {ok, {SupFlags, [ChildSpec]}} | 35 | %% ignore | 36 | %% {error, Reason} 37 | %% Description: Whenever a supervisor is started using 38 | %% supervisor:start_link/[2,3], this function is called by the new process 39 | %% to find out about restart strategy, maximum restart frequency and child 40 | %% specifications. 41 | %%-------------------------------------------------------------------- 42 | init([]) -> 43 | AllEnv = application:get_all_env(), 44 | YappRegistryModule = proplists:get_value(yapp_registry_impl, AllEnv, yapp_mnesia_server), 45 | YappRegName = YappRegistryModule, 46 | YappRegistry = {yapp_registry_worker,{YappRegistryModule, start_link,[YappRegName]}, 47 | permanent,2000,worker,[YappRegistryModule, yapp_registry]}, 48 | YappHandler = {yapp_handler_worker,{yapp_server, start_link, [yapp_handler, YappRegName]}, 49 | permanent,2000,worker,[yapp_handler, yapp_server]}, 50 | yapp_event_handler:add_handler(yaws_event_manager, yapp_handler), 51 | {ok,{{one_for_all,0,5}, [YappRegistry, YappHandler]}}. 52 | 53 | %%==================================================================== 54 | %% Internal functions 55 | %%==================================================================== 56 | -------------------------------------------------------------------------------- /applications/wiki/README: -------------------------------------------------------------------------------- 1 | This Wiki was originally based on Joe Armstrongs wiki implementation. 2 | It has been ported to yaws and hacked quite a bit in general by Johan 3 | Bevemyr. 4 | 5 | To Install 6 | ---------- 7 | 8 | Edit include.mk (change the WIKIINSTALLDIR and EBININSTALLDIR) then 9 | 10 | make 11 | make install 12 | 13 | 14 | Edit your /etc/yaws.conf and include /var/yaws/ebin in the 15 | ebin path ($EBININSTALLDIR), for example 16 | 17 | ebin_dir = /var/yaws/ebin 18 | 19 | It is possible to have several Wiki instances on the same server. 20 | Just install the wiki/* files in the directory where you want a 21 | Wiki instance. This is easily done by running the updateWiki script 22 | and give a new directory as argument. 23 | 24 | To edit the wiki preferences go to the wiki page WikiPreferences 25 | (for example by clicking on the "All Pages" or "Zombies" icon) 26 | and replace the gifs with our own favorites. 27 | 28 | The password to the WikiPreferences page is ForgetMe. 29 | 30 | Getting started 31 | --------------- 32 | WIKIINSTALLDIR is where the wiki is located. It must be part of your 33 | docroot. After installation, browse to the wiki directory. You will be 34 | asked to create a 'home' page, which will be the first wiki page. To find out 35 | about the special wiki formatting rules, go to WikiFormattingRules (e.g. 36 | from "All Pages"). To create a new page, just create a link to it by clicking 37 | EditMe on the home page (use the ~ character: "my new page ~TestPage"), and 38 | save the home page. The new link will show up as: "my new page TestPage???". 39 | The question marks means that the node TestPage doens't exist. Click on the 40 | question marks to create the the page. 41 | 42 | 43 | Look and feel 44 | ------------- 45 | 46 | The layout of the Wiki pages is to a large extent controlled by 47 | two templates in WikiPreferences.files called template.html 48 | and template_info.html. There is an alternative look and feel 49 | bundled, just copy template2.html to template.html and 50 | template_info2.html to template_info.html. 51 | 52 | To maintain 53 | ----------- 54 | 55 | There are a number of useful scripts in the script directory. 56 | 57 | updateWiki - takes a number of wiki directories and updates 58 | the .yaws files etc 59 | 60 | getPassword - takes a path to a wob file as argument. Will print 61 | the password associated with that node. 62 | 63 | importFiles - takes a path to a wob file as argument. Will add 64 | any files in the corresponding .files directory 65 | to the page. Useful when you want to import many 66 | files without going through the WEB GUI. Just 67 | copy the files to the .files directory and run 68 | the importFiles command. 69 | 70 | --------------------------------------------------------------------------------