-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.cfm
More file actions
187 lines (175 loc) · 7.46 KB
/
Copy pathdocs.cfm
File metadata and controls
187 lines (175 loc) · 7.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<cfscript>
request.section = "docs";
request.title = "Documentation: guides, reference and recipes";
request.desc = "Everything written about RustCFML, grouped the way the docs directory is grouped: build and run, data, concurrency, observability, extending the engine and reference.";
icons = new lib.Icons();
</cfscript>
<cfinclude template="includes/_head.cfm">
<cfinclude template="includes/_header.cfm">
<section class="page-hero">
<div class="wrap">
<cfoutput>
<h1>The documentation is in the repository</h1>
<p class="lead">
Twenty-six files live in <code class="inline">docs/</code>, versioned with the code
they describe and reviewed in the same pull requests that change the behaviour. This
page indexes the twenty-four that answer questions people actually ask. The rest are
internal engineering notes, and the whole set is one click from
<a href="#( application.repo )#/tree/main/docs" rel="noopener">the repository</a>.
</p>
</cfoutput>
</div>
</section>
<!-- ==================================================================== -->
<!-- Sixty-second start -->
<!-- ==================================================================== -->
<section class="tight">
<div class="wrap">
<div class="cta reveal">
<cfoutput>
<h2>A running site, then the docs you need</h2>
<div class="grid grid-3" style="margin-top:22px">
<div class="term">
<div class="term-bar"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span class="term-name">1 · install</span></div>
<pre class="term-body"><code>curl -LO #( application.latest )#/download/rustcfml-linux-x86_64
chmod +x rustcfml-linux-x86_64
sudo mv rustcfml-linux-x86_64 /usr/local/bin/rustcfml</code></pre>
</div>
<div class="term">
<div class="term-bar"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span class="term-name">2 · a page</span></div>
<pre class="term-body"><code><cfset name = "world">
<cfoutput>Hello, ##name##!</cfoutput></code></pre>
</div>
<div class="term">
<div class="term-bar"><span class="dot"></span><span class="dot"></span><span class="dot"></span><span class="term-name">3 · serve</span></div>
<pre class="term-body"><code>rustcfml --serve . --port 8500
open http://localhost:8500/index.cfm</code></pre>
</div>
</div>
</cfoutput>
</div>
</div>
</section>
<!-- ==================================================================== -->
<!-- The grouped index -->
<!-- ==================================================================== -->
<section>
<div class="wrap">
<cfloop array="#application.docGroups#" item="group">
<div class="doc-group reveal">
<cfoutput>
<div class="doc-group-head">
<h3>#( group.title )#</h3>
<span>#( group.blurb )#</span>
</div>
<div class="doc-list">
<cfloop array="#group.topics#" item="topic">
<a class="doc-item" href="#( application.docsBlob & topic.file )#" rel="noopener">
<b>#( topic.name )#</b>
<span>#( topic.desc )#</span>
<code>docs/#( topic.file )#</code>
</a>
</cfloop>
</div>
</cfoutput>
</div>
</cfloop>
</div>
</section>
<!-- ==================================================================== -->
<!-- Recipes -->
<!-- ==================================================================== -->
<section class="tint">
<div class="wrap">
<div class="section-head reveal">
<h2>The four things everybody looks up first</h2>
<p class="lead">Configuration is a file, not a console. Secrets come from the environment, so nothing sensitive is ever committed.</p>
</div>
<div class="grid grid-2">
<cfoutput>
<div class="card reveal">
<span class="tag">A datasource</span>
<p>Add it to <code class="inline">.cfconfig.json</code> beside your web root, or to
<code class="inline">this.datasources</code> in <code class="inline">Application.cfc</code>.</p>
<div class="term">
<div class="term-bar"><span class="term-name">.cfconfig.json</span></div>
<pre class="term-body"><code>{
"datasources": {
"app": {
"type": "PostgreSQL",
"host": "db.internal",
"port": 5432,
"database": "appdb",
"username": "{env:DB_USER}",
"password": "{env:DB_PASSWORD}"
}
}
}</code></pre>
</div>
</div>
<div class="card reveal">
<span class="tag">Clean URLs</span>
<p>Drop a rewrite file in the document root. Regex, backreferences, conditions and
<code class="inline">last="true"</code> all behave the way Tuckey documented.</p>
<div class="term">
<div class="term-bar"><span class="term-name">urlrewrite.xml</span></div>
<pre class="term-body"><code><urlrewrite>
<rule>
<from>^/([a-z][a-z0-9-]*)/?$</from>
<to last="true">/$1.cfm</to>
</rule>
</urlrewrite></code></pre>
</div>
</div>
<div class="card reveal">
<span class="tag">Sessions</span>
<p>On by default and in process. Move them to Memcached, or let nodes discover each
other, without touching a line of application code.</p>
<div class="term">
<div class="term-bar"><span class="term-name">Application.cfc</span></div>
<pre class="term-body"><code>component {
this.name = "MyApp";
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan( 0, 8, 0, 0 );
this.sessioncookie = {
secure = true
, httpOnly = true
, samesite = "Lax"
};
}</code></pre>
</div>
</div>
<div class="card reveal">
<span class="tag">Deploy it</span>
<p>Production mode plus a Unix socket behind nginx is the whole deployment story for
most applications. Docker is a small Dockerfile away.</p>
<div class="term">
<div class="term-bar"><span class="term-name">entrypoint</span></div>
<pre class="term-body"><code>FROM rustcfml:latest
COPY ./webroot /srv/webroot
EXPOSE 8080
ENTRYPOINT ["rustcfml", "--serve", "/srv/webroot",
"--production", "--socket=/run/rustcfml.sock"]</code></pre>
</div>
</div>
</cfoutput>
</div>
<cfoutput>
<div class="callout">
<span class="ico">#( icons.get( "alert" ) )#</span>
<p>
<b>Before you plan a migration, read Known Issues.</b> It lists the silent no-ops and
the places where behaviour diverges from Lucee by choice. It is the shortest document
in the repository that will save you the most time.
<a href="#( application.docsBlob )#known-issues.md" rel="noopener">docs/known-issues.md</a>
</p>
</div>
<div class="btn-row">
<a class="btn btn-primary btn-lg" href="#( application.repo )#/blob/main/README.md" rel="noopener">Read the README</a>
<a class="btn btn-secondary btn-lg" href="#( application.repo )#/tree/main/docs" rel="noopener">Browse docs/ on GitHub</a>
<a class="btn btn-ghost btn-lg" href="#( application.issues )#" rel="noopener">Ask a question</a>
</div>
</cfoutput>
</div>
</section>
<cfinclude template="includes/_footer.cfm">